In previous code, as long as 90 days has passed from lastBurnTimestamp, anyone can call lockAndBurn to burn the funds, however, the 90 days here may include the time which the protocol is paused, making the real time for user to appeal and receive slashed funds less than 90 days.
In the mitigation, lockAndBurn can only be called by BURNER_ROLE:
function lockAndBurn() external onlyRole(BURNER_ROLE) whenNotPaused {
In this case, the protcol can monitor the paused time in certain currentSlashRound, and once 90 days has passed from lastBurnTimestamp, the monitor can wait that paused time then call lockAndBurn, which means any users got slashed in that currentSlashRound or before that currentSlashRound will have enough time (90 days) to appeal.
Lines of code
Vulnerability details
In previous code, as long as 90 days has passed from
lastBurnTimestamp
, anyone can calllockAndBurn
to burn the funds, however, the 90 days here may include the time which the protocol is paused, making the real time for user to appeal and receive slashed funds less than 90 days.In the mitigation,
lockAndBurn
can only be called byBURNER_ROLE
:https://github.com/gitcoinco/id-staking-v2/blob/7c19717aeab91a0166fc1ca50f443ee2ce7483f0/contracts/IdentityStaking.sol#L620
In this case, the protcol can monitor the paused time in certain
currentSlashRound
, and once 90 days has passed fromlastBurnTimestamp
, the monitor can wait that paused time then calllockAndBurn
, which means any users got slashed in thatcurrentSlashRound
or before thatcurrentSlashRound
will have enough time (90 days) to appeal.