Users can immediatly withdraw via emergencyWithdraw() and skip the lock.end duration years after the last emergencyWithdraw.
There is no function that sets the emergencyWithdrawDelay to 0.
This means that in order to keep the emergencyWithdraw() function closed, the owner must keep creating emergencyActions in order for this if statement to return true:
Users can immediatly withdraw using the emergencyWithdraw() function.
Owner must keep scheduling new emergencyActions in order to satisfy the if statement provided above(vulnerability details).
There is no way to set the emergencyWithdrawDelay to 0 to completely stop the emergency withdraw.
How to run the test:
Add the provided test inside test/unit/core/tokens/veRAACToken.test.js
Run the test with: npx hardhat test --grep "should not allow users to instantly withdraw via emergencyWithdraw"
Manual and hardhat tests
Ways to mitigate:
Adding a emergency window duration is probably not bad idea.
Creating a function where only the owner can set the emergencyWithdrawDelay to 0 whenever he wants.
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.