yearn / veYFI

Voting YFI
75 stars 38 forks source link

fix: add replay to getPriorVotes #200

Closed pandadefi closed 2 years ago

pandadefi commented 2 years ago

Description

The getPriorVotes function in VotingYFI calculates a user's bias based on the last recorded point's slope. It does not call replay_slope_changes, which would apply slope changes (kinks) that happened since the last user checkpoint.

As a result, getPriorVotes will incorrectly return a voting power that is too high if the user has a kink that is in-between the last user checkpoint and the block height on which getPriorVotes is called. Fixes # (issue)

Checklist