Replies: 5 comments 1 reply
-
@andreivladbrg when you finish the gas estimations, could you post them here as a Markdown table? Thanks. |
Beta Was this translation helpful? Give feedback.
-
I just thought about this: keeping the contracts separate would also imply a greater cost for auditing the protocol. At this point I'm very confident that merging the contracts would be good. Though it would still be good @andreivladbrg to run the gas calculations, just so we know in hindsight the difference in gas costs. |
Beta Was this translation helpful? Give feedback.
-
Gas cost
I was expecting there to be a significant difference between the Gas report generated from this commit: 40f561e |
Beta Was this translation helpful? Give feedback.
-
I'm all for merging the two. My views:
|
Beta Was this translation helpful? Give feedback.
-
Locking this discussion since we ended up implementing this. |
Beta Was this translation helpful? Give feedback.
-
Description
It's becoming increasingly more difficult to maintain the
SablierV2Linear
andSablierV2Cliff
contracts. They have a lot of overlapping behavior, but because Solidity doesn't have something equivalent to Rust traits, we have to maintain and test the two contracts separately. Each depends upon a slightly differentStream
struct.Really the only argument against this merge is the gas efficiency of not having to deal with the cliff time. But is it so significant to warrant the maintenance cost?
We should do some back-of-the-napkin calculations to get an idea about the magnitude at play here. If it's a few hundred gas (say), it would totally be worth it from a development POV to merge the two contracts.
Pros
Cons
create
costs ~11k more,withdraw
costs ~2k more)Conclusion
All in all, I think that merging the two contracts would be worth it. The slightly higher gas cost should be fine. The gas cost is also influenced by the underlying ERC-20 token used for streaming, so whatever small optimization we do here might not matter as much as we'd think it does.
Beta Was this translation helpful? Give feedback.
All reactions