The emergencyWithdraw function in the veRAAC token contract fails to properly update the Boost state and voting power state when executed. This leads to incorrect protocol boost calculations and governance voting power
The emergencyWithdraw function is designed to allow users to withdraw their funds in emergency situations. However, the current implementation lacks crucial state updates:
When a user performs an emergency withdrawal, the contract should:
Update the Boost state to reflect the reduced staked amount
Adjust the user's voting power accordingly
The absence of these updates means that the system continues to calculate governance weights and boosts based on outdated information, leading to inaccurate voting power distribution and reward calculations.
This vulnerability causes incorrect voting power allocations in governance decisions, incorrect boost calculations for reward distributions. Some users will face unfair second order effects because of this.
Manual review
Add Boost state update logic in emergencyWithdraw:
boostState.updateBoost(msg.sender);
Also, implement voting power adjustment:
votingPower.adjustVotingPower(msg.sender);
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.