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.
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:
SablierV2OpenEndedCorecontains all core logic and can be put in theabstractsfolderSablierV2OpenEndedcontains 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.
* 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 |
|
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:
cancelMultiplecreateMultiplecreateAndDepositMultiplewithdrawMultipleNotes:
createAndDepositMultiplebecause they are already checked in the function called (createMultiple&depositMultiple).createAndDepositMultiplecan be optimized to not calldepositMultiplebecause this function checks if all the streams arecanceled, i am not sure if we modify this would be worth the complexityAlso, the tests for
createMultipleandcreateMultipleAndDepositMultipleare going to be added later.