In the veRAACToken
contract, the emergencyWithdraw
function does not update checkpoints, unlike the withdraw
function. This inconsistency can lead to potential issues in the contract's state management, particularly affecting voting power calculations and historical data tracking.
The emergencyWithdraw
function allows users to withdraw their locked tokens in case of an emergency, bypassing the usual lock expiration period. However, unlike the withdraw
function, it does not update the checkpoints after deleting the user's lock and voting points. This omission can result in outdated or incorrect voting power calculations, as the checkpoint system is designed to track changes in voting power over time.
emergencyWithdraw
Function:
withdraw
Function:
The lack of checkpoint updates in the emergencyWithdraw
function can lead to:
Inaccurate Voting Power Calculations:** The checkpoint system is used to track voting power over time. Without updating the checkpoints, the contract may incorrectly calculate a user's voting power in this block: getPastVotes
.
Manual Review
To address this issue, consider updating the checkpoints in the emergencyWithdraw
function, similar to how it is done in the withdraw
function. Here is the recommended change:
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.