Allowing clawback
after campaign has been created
#332
Closed
smol-ninja
started this conversation in
General
Replies: 2 comments 7 replies
-
Conversation with RustyRabbit. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Initial comments from the call with @razgraf and @andreivladbrg :
Implementation
function claim(....) {
if (preClawbackStartTime == 0) {
preClawbackStartTime = block.timestamp;
}
// --- snip ---
}
function clawback(....) {
if (!hasExpired() || block.timestamp > preClawbackStartTime + 7 days) {
revert Errors.SablierV2MerkleLockup_CampaignNotExpired(...);
}
// --- snip ---
}
Cons
Pros
tl;dr if user accidentally funds an incorrect amount or submits an invalid Merkle root, it provides them with a window to get the funds out of the contract. We can brainstorm more on this today and finalize the solution tomorrow. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Comments from RustyRabbit (Cantina)
aggregateAmount
andrecipientCount
are not validated during the execution ofcreateMerkle
functions, they cannot be trusted in the emitted events.An example scenario
expiration
andaggregateAmount
.initialAdmin
, the Sablier UI will show both campaigns to the legitimate user.aggregateAmount
. Since theexpiration
is very high, he wouldn’t even be able toclawback
extra funds.Comment from @razgraf :
Alternate solution proposed by @smol-ninja:
clawback
can be called by the admin. it's not elegant but gives admin some time to adjust the deposit amount in case he has been tricked into depositing more.Beta Was this translation helpful? Give feedback.
All reactions