The emergencyWithdraw function imposes a 6-day delay instead of the intended 3-day delay due to the combined effects of scheduling and enabling the action.
The emergency withdrawal process consists of three steps:
First the owner calls scheduleEmergencyAction, which sets the _emergencyTimelock timestamp for the given action. which can be seen from below code:
Second The owner then calls enableEmergencyWithdraw, which checks if 3 days have passed (withEmergencyDelay modifier) before setting the emergencyWithdrawDelay to another 3-day delay.
If we look the modifier code, we can see that the timestamp that we set in _emergencyTimelock mapping is checked over here.
Third The owner can only call emergencyWithdraw after emergencyWithdrawDelay has elapsed.
Instead of enforcing a 3-day delay, the contract imposes a 6-day delay (3 days to enable + 3 days to withdraw).
The user must wait 6 days instead of the intended 3 days for an emergency withdrawal.
Manual Review
Modify the logic so that the emergency withdrawal delay is correctly enforced as 3 days instead of 6 days.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.