The execution delay of veRAACToken::enableEmergencyWithdraw() is longer than expected.
The enableEmergencyWithdraw() function is designed to enable emergency withdrawals. However, it applies the withEmergencyDelay(EMERGENCY_WITHDRAW_ACTION) modifier, which first verifies whether EMERGENCY_DELAY has elapsed and then updates emergencyWithdrawDelay. This results in an additional calculation of EMERGENCY_DELAY, causing the total delay to be EMERGENCY_DELAY * 2, which is inconsistent with the intended functionality as described in the documentation.
In contrast, the executeEmergencyUnlock() function only enforces a single EMERGENCY_DELAY, aligning with expected behavior:
The enableEmergencyWithdraw() function applies a delay of EMERGENCY_DELAY * 2, which deviates from the expected behavior and could lead to unexpected delays in emergency withdrawal execution.
Manual Review
Modify the implementation of enableEmergencyWithdraw() to ensure that the delay is correctly set to EMERGENCY_DELAY instead of EMERGENCY_DELAY * 2.
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.