Checkpoint not written in veRAACToken.emergencyWithdraw()
veRAACToken contract uses checkpoints to track the historical voting power every user has had. Whenever a user gets their voting power updated, a Checkpoint is added with current block number to reflect how the voting power has changed over time.
However, `emergencyWithdraw()` function does not write the mentioned checkpoint for caller, meaning that the votingPower after a user calls this functions will be 0 (as all their veRAACTokens are burnt) while the absence of a new Checkpoint indicates that user has still voting power.
Checkpoint is not written when it should, failing to correctly track the voting power of the caller address until they create a new Lock, which would be the expected behaviour of the contract and of the Checkpoints structure. This can potentially lead to rewards being allocated incorrectly if another contract uses the _checkpointState
state variable as a source of truth to allocate rewards.
Manual testing
Write a new Checkpoint for caller when emergencyWithdraw() is called:
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.