Platform: Code4rena
Start Date: 23/05/2022
Pot Size: $75,000 USDC
Total HM: 23
Participants: 75
Period: 7 days
Judge: GalloDaSballo
Total Solo HM: 13
Id: 130
League: ETH
Rank: 14/75
Findings: 1
Award: $873.88
🌟 Selected for report: 0
🚀 Solo Findings: 0
🌟 Selected for report: hyh
Also found by: codexploder
https://github.com/code-423n4/2022-05-velodrome/blob/main/contracts/contracts/Gauge.sol#L558
Before changing any balance _updateRewardForAllTokens should always be called, otherwise rewards will be messed. This is done correctly in withdraw function but is missing in withdrawToken function
User calls withdrawToken function
The balances are directly updated and _updateRewardForAllTokens is never called
This means rewards will be calculated next with incorrect balances
The withdrawToken function should be revised to have update reward call in starting before impacting any balance
function withdrawToken(uint amount, uint tokenId) public lock { _updateRewardForAllTokens(); ... }
#0 - pooltypes
2022-06-13T17:49:38Z
Duplicate of #50
#1 - GalloDaSballo
2022-06-29T20:21:11Z
Dup of #50