Submitted by leastwood
As NOTE continues to be staked in the sNOTE contract, it is important that Notionals governance is able to correctly handle on-chain voting by calculating the relative power sNOTE has in terms of its equivalent NOTE amount.
getVotingPower is a useful function in tracking the relative voting power a staker has, however, it does not utilise any checkpointing mechanism to ensure the users voting power is a snapshot of a specific block number. As a result, it would be possible to manipulate a users voting power by casting a vote on-chain and then have them transfer their sNOTE to another account to then vote again.
https://github.com/code-423n4/2022-01-notional/blob/main/contracts/sNOTE.sol#L271-L293
Consider implementing a getPriorVotingPower function which takes in a blockNumber argument and returns the correct balance at that specific block.
jeffywu (Notional) confirmed
pauliax (judge) commented:
