Replies: 3 comments 3 replies
-
just to confirm you also mean to remove the airdrops/src/abstracts/SablierMerkleBase.sol Line 155 in 2d1ba19 otherwise, there would be security issues. my opinion is to not make it public, as one admin may want to leave the funds more time in the pool contract. |
Beta Was this translation helpful? Give feedback.
-
We will still need a So, we can't completely make it permissionless. Current implementationfunction clawback(address to, uint128 amount) external override onlyAdmin {
// Check: current timestamp is over the grace period and the campaign has not expired.
if (_hasGracePeriodPassed() && !hasExpired()) {
revert Errors.SablierMerkleBase_ClawbackNotAllowed({
blockTimestamp: block.timestamp,
expiration: EXPIRATION,
firstClaimTime: _firstClaimTime
});
}
TOKEN.safeTransfer(to, amount);
emit Clawback(campaignAdmin, to, amount);
} Proposed implementedfunction clawback(uint128 amount) external override {
// Check: current timestamp is over the grace period and the campaign has not expired.
if (_hasGracePeriodPassed() && !hasExpired()) {
revert Errors.SablierMerkleBase_ClawbackNotAllowed({
blockTimestamp: block.timestamp,
expiration: EXPIRATION,
firstClaimTime: _firstClaimTime
});
}
// Check: only the campaign admin can clawback funds during the grace period.
if (!_hasGracePeriodPassed() && msg.sender != campaignAdmin) {
revert Errors.SablierMerkleBase_CallerNotAdmin(msg.sender);
}
TOKEN.safeTransfer(campaignAdmin, amount);
emit Clawback(campaignAdmin, amount);
} I think the second function is lengthier, and more gas consuming as well. |
Beta Was this translation helpful? Give feedback.
-
Great point @smol-ninja, I forgot about the grace period. Closing, this is not worth it. |
Beta Was this translation helpful? Give feedback.
-
Any reason for not making the
clawback
function permisionless (callable by anyone) after expiry?cc @sablier-labs/solidity
Beta Was this translation helpful? Give feedback.
All reactions