Submitted by Jeiwan, also found by Aymen0909, Trust, 0xDjango, Chom, Lambda, and Ruhum
https://github.com/code-423n4/2022-10-paladin/blob/d6d0c0e57ad80f15e9691086c9c7270d4ccfe0e6/contracts/WardenPledge.sol#L387
https://github.com/code-423n4/2022-10-paladin/blob/d6d0c0e57ad80f15e9691086c9c7270d4ccfe0e6/contracts/WardenPledge.sol#L432
Total reward amount in extendPledge and increasePledgeRewardPerVote can be calculated incorrectly due to cached pledgeParams.votesDifference, which can lead to two outcomes:
When a pledge is created, the creator chooses the targetthe total amount of votes they want to reach with the pledge. Based on a target, the number of missing votes is calculated, which is then used to calculated the total reward amount (WardenPledge.sol#L325-L327):
When extending a pledge or increasing a pledge reward per vote, current veToken balance of the pledges receiver (votingEscrow.balanceOf(receiver)) can be different from the one it had when the pledge was created (e.g. the receiver managed to lock more CRV or some of locked tokens have expired). However pledgeParams.votesDifference is not recalculated (WardenPledge.sol#L387, WardenPledge.sol#L432):
This can lead to two consequences:
Consider updating votesDifference when extending a pledge or increasing a pledge reward per vote.
Kogaroshi (Paladin) confirmed and commented:
