-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add batch functions #49
Conversation
feat: add cancelMultiple functions
test: rename function to expectRevertCanceled
test: add user eve and use for the malicious third party tests
test: set the block.timestamp to May 1 2024
refactor: use specific amount names instead of a generic one
test: say "given" for balance zero tests
test: createMultiple function
409cd67
to
0d0576a
Compare
85ac77e
to
6cca0e6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we separate functions that are related to multiple calls from the core functions? It would make it easier to review and read the contract. An example:
SablierV2OpenEndedCore
contains all core logic and can be put in theabstracts
folderSablierV2OpenEnded
contains functions related o multiple. This will be a child contract ofSablierV2OpenEndedCore
.
Do we need to prefix error names with I am fine with prefixing because its same in Lockup contracts. But there, it made sense because it has more than one contracts. Here, I would prefer them without prefix.SablierV2OpenEnded
? Since they are emitted by OpenEnded contracts, it this necessary?
Also there are some changes related to refactor for which I have opened a separate PR.
test/integration/create-and-deposit-multiple/createAndDepositMultiple.t.sol
Outdated
Show resolved
Hide resolved
test/integration/create-and-deposit-multiple/createAndDepositMultiple.tree
Outdated
Show resolved
Hide resolved
test/integration/create-and-deposit-multiple/createAndDepositMultiple.tree
Show resolved
Hide resolved
* perf: optimize modifiers * refactor: rename streamDebt to streamDebtOf * fix: add override * style: solhint-disable no-console * chore: use return variable in streamDebtOf * test: update streamDebt files --------- Co-authored-by: andreivladbrg <andreivladbrg@gmail.com>
interesting proposal Shub, i don't have an opinion yet on this, could you please a separate discussion for this? also, i won't name the contract with "core" but with smth like:
answered in the separate discussion #51 |
@smol-ninja i addressed your feedback, please lmk if i missed something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed it once more and left some suggestions below.
Also what do you think about using "arrays length" instead of "arrays count" throughout the code?
test/integration/create-and-deposit-multiple/createAndDepositMultiple.tree
Outdated
Show resolved
Hide resolved
test/integration/create-and-deposit-multiple/createAndDepositMultiple.t.sol
Outdated
Show resolved
Hide resolved
can we merge this now @smol-ninja ? it has been opened for a while |
@andreivladbrg yes you can go ahead and merge it. |
Closes https://github.com/sablier-labs/v2-open-ended/issues/10 and #31
About
Implements the following batch functions:
cancelMultiple
createMultiple
createAndDepositMultiple
withdrawMultiple
Notes:
createAndDepositMultiple
because they are already checked in the function called (createMultiple
&depositMultiple
).createAndDepositMultiple
can be optimized to not calldepositMultiple
because this function checks if all the streams arecanceled
, i am not sure if we modify this would be worth the complexityAlso, the tests for
createMultiple
andcreateMultipleAndDepositMultiple
are going to be added later.