The RAACMinter is responsible for managing the minting and distribution of RAAC tokens based on a dynamic emissions schedule. These tokens are minted to be distributed for rewards. To calculate the emission rate, the minting strategy adjusts based on the system utilization rate.
However, due to incorrect precision handling when calculating the utilization rate, it will result in a overly large value, hence affecting the emIssion schedule of RAAC Token.
Assume this scenario whereby tick()function is called:
Assume the first if statement executes, calling updateEmissionRate()
In updateEmissionRate(), assume the if statement does not execute. calculateNewEmissionRate()is executed
Now in calculateNewEmissionRate(), getUtilizationRate()is called
To get totalBorrowed, getNormalizedDebt()is called, which will return the reserve.usageIndex. This value is in 27 decimals, as seen at constructor whereby reserve.usageIndex = uint128(WadRayMath.RAY). Assume totalBorrowed = 1.1e27
to get totalDeposits, getTotalDeposits()is called, which will return rToken.balanceOf(address(this)). This will be in 18 decimals. Assume totalDeposits = 100_000e18
UtilizationRate = (1.1e27 * 100) / 100_000e18 = 1.1e6
Now back to calculateEmissionRate():
Assume current emissionRate = 100 * 1e18
adjustment = ( 100e18 * 5) / 100
utilizationTarget = 70, hence the if statement will execute as utilizationRate > utilizationTarget
increasedRate = 100e18 + (( 100e18 * 5) / 100) = 105e18
since increasedRate > 100e18, maxRate = increasedRate
since maxRate < 2000e18, maxRate = 105e18
As seen in 6(iii), the if statement checks if (UtilizationRate > UtilizationTarget) will always execute, due to the low value of it being 70. Even if updater role updates the UtilizationTarget via setUtilizationTarget(), the maximum it can be set to is 100, which is the MAX_UTILIZATION_TARGET.
Additionally, as long as rToken.balanceOf(address(this)) !=0, it is 100% certainty that the logic of getUtilizationRate() will result in utilizationRate > utilizationTarget, as usage index is in 27 decimals, and R Token is in 18 decimals.
Emission rate can never be decreased, as the else statement (utilizationRate < utilizationTarget) will never execute unless rToken.balanceOf(address(this))= 0. The emission rate will either stay the same or increase, and can never be decreased. The utilizationTarget is rendered useless, and even if system is heavily utilized, RAAC emission rate will not be reduce. This can lead to oversupply of RAAC tokens.
Manual
Ensure the utilizationTarget is handled correctly to match precision of utilizationRate.
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.