Closed PaulRBerg closed 7 months ago
Can you give details on how we plan to implement this contract? Would SablierV2Timelock
inherit SablierV2Lockup
? How would the struct that is stored would look like?
Thinking to something like this:
struct Stream {
// slot 0
address sender;
uint40 startTime;
uint40 cliffTime;
bool isCancelable;
bool wasCanceled;
// slot 1
IERC20 asset;
uint40 endTime;
bool isDepleted;
bool isStream;
bool isTransferable;
// slot 2 and 3
Lockup.Amounts amounts;
// slot [3..n]
UnlockDetails[] unlockDetails;
}
struct UnlockDetails {
uint40 milestones;
uint128 amount;
}
@andreivladbrg the design of the contract is up to you because I don't have much time on my hands nowadays.
But no, Timelock
would not inherit Lockup
, because Timelock
won't be a streaming contract. Please refer to the business strategy discussions mentioned in the OP.
Another timelock user:
https://twitter.com/ashleighschap/status/1712946120584781961
Created this LockupDynamic stream:
As discussed with @andreivladbrg on the call, it is not worth it to over-optimize the protocol for this particular use case.
We can consider this optimized contract later if we suddenly get a large influx of timelock users.
Context
We keep getting requests for timelocks - e.g. see this recent tag on Twitter:
https://twitter.com/Arr00c/status/1712559004814381308
This mention has resulted in two LockupDynamic streams with one segment and a duration of 1 second:
This is how the release curve looks like:
Task
The context above is sufficient proof that there's a need for timelocks in web3. We should build a bespoke contract focused on this use case.
Building this feature entails a soft pivot from "streaming-only" to "token distribution", but that's ok. See the related discussions here and here.