Replies: 4 comments 1 reply
-
personally, i have no strong opinion on either of these two options; both are good IMO. however, i think having the function name first and then the word "batch" would be better because it makes alphabetical ordering easier.
interesting proposal. uint256 myId = 123;
uint128 myAmount = 1e18;
address myTo = address(0xBEEF);
lockup.withdraw(myId, myAmount, myTo);
// vs
uint256[] memory myId = new uint256()[1];
myId[0] = 123;
uint128[] memory myAmount = new uint128()[1];
myAmount[0] = 1e18;
address[] memory myTo = new address()[1];
myTo[0] = address(0xBEEF);
lockup.withdraw(myId, myAmount, myTo); |
Beta Was this translation helpful? Give feedback.
-
I like it for cancel and renounce. But for withdraw, I agree with Andrei, it would make it look ugly to withdraw from a single stream. But what if we use an array of tuple(streamID, amount, to) instead of three lists? Another idea is that instead of changing To summarize, I propose the following:
Wouldn't the gas be same for 1 stream? Thoughts? |
Beta Was this translation helpful? Give feedback.
-
no, having arrays as input params is more expensive than single params (i don't know for how much, might be small diff tho). also, because the function implements a loop (whether one iteration is made or not)
hmm, i have mixed feelings about this, as we would have inconsistencies between function names: 1. the
IMO, we could remove all "multiple" functions, because as far as i can see in flow, |
Beta Was this translation helpful? Give feedback.
-
Great feedback from both of you! Good point that we can delete the Interesting proposal from @smol-ninja, but I'm not convinced that the UX costs are worth the refactor. A function with an array is uglier than a function with a single parameter, and I speculate that in the majority of cases, single params are what integrators use, e.g. in EarnM's OTC box contract, this is true. It would also be inconsistent to have an array in So let's just keep the system as is and consider jettisoning the Closing this discussion for now. |
Beta Was this translation helpful? Give feedback.
-
Idea: what if renamed
cancelMultiple
tobatchCancel
, andwithdrawMultiple
tobatchWithdraw
? That would be more in line with the "batch" terminology.Or, what if we refactored the cancel and the withdraw functions to take arrays as inputs? 🤔
@sablier-labs/solidity
Beta Was this translation helpful? Give feedback.
All reactions