Replace createWithDurations
with createWithTimestamps
in Airstreams
#997
Replies: 0 comments 15 replies
This comment has been hidden.
This comment has been hidden.
-
Thanks for opening this; I am in favor of this proposal. Question: This change would be only for linear, right? For tranched, we can’t use |
Beta Was this translation helpful? Give feedback.
-
Initial UnderstandingThanks Shub for this. It's an interesting proposal, but I have reservations. Am I correct that this would entail a change in the Core contracts, too? This is what you meant here, right:
If yes, that's not good. Disallowing end times in the past served as a way to prevent user errors: https://github.com/cantinasec/review-sablier/issues/7 Further Criticism
Suggestions
|
Beta Was this translation helpful? Give feedback.
-
Linked issues |
Beta Was this translation helpful? Give feedback.
-
Offers
claim
andwithdraw
in a single tx.Context
Relying on
createWithDurations
inMerkleLockup
has the following limitations:It can only be used to create a campaign where streams begin vesting only when claimed. But what if we can also achieve the same functionality using
createWithTimestamps
?Proposal
Replace
createWithDurations
withcreateWithTimestamps
. This would require replacingstreamDurations
with a bespoke timestamp variable but with a slight modification:When a user claims, calculate
cliffTime
andendTime
as follows to create ranged airstreams:I will explain below why it looks different than LockupLinear.Timestamp.
One-time airdrops
This can be achieved by setting the end time in the past. But since Lockup requires end time to be in the future, we will have to change that and allow end time to be in the past as long as the following inequality holds:
startTime < cliffTime < endTime
.Note
Even though, one-time airdrop can be unlocked with this approach, I am not against having a bespoke contract for it (see discussion sablier-labs/v2-periphery#370). Its a similar argument as to why we chose to release Lockup Tranched even though the same curve can also be achieved by Lockup Dynamic - gas efficiency.
Legacy Airstreams
To create the same airstreams that we allow today, we will allow
startTime
to be 0. When its 0, Lockup Linear'sstartTime
will default toblock.timestamp
, makingcliffTime
andendTime
:This would create airstreams that begin vesting when the user claims and end at different dates, similar to the current behaviour.
cc @sablier-labs/engineers.
Footnotes
Legacy airstreams are the current airstreams supported by Merkle Lockup. They have start time set as claim time and end time at a fixed duration. ↩
Beta Was this translation helpful? Give feedback.
All reactions