Incorrect subtraction of newPower and balanceOf will sometimes revert due to an underflow.
Invoking increase allows a user to deposit more RAACToken to increase their voting power. The flow involves calculating their current decayed power and add the new one. At the end, additional veRAAC tokens are minted.
The subtraction of newPower - balanceOf(msg.sender) will cause underflow reverts as there is no guarantee that newPower > balanceOf since sometimes the decayed power + the increase will still be lower than the initial power. Here is a practical example:
User locks 100 tokens for max duration (4 years) and is minted 100 veRAAC
2 years pass and user invokes increase to deposit 50 more tokens
calculateAndUpdatePower calculates the new power against the 150 locked tokens
initialPower = 150 * 2 years / 4 years = 75
This value is passed back to the increase function and logged as newPower
_mint attempts to subtract 75 - 100 and ends up reverting
User is unable to perform a simple action of increasing their lock and depositing more money in the protocol.
Broken functionality, unexpected behaviour
Perform a burn on the entire balanceOf(msg.sender) and then mint newPower
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.