The mintRewards
function in the RAACMinter
contract relies on an internal accounting variable excessTokens
to determine whether to mint additional tokens before transferring rewards. In scenarios where excessTokens
exceeds the reward amount, no minting occurs, potentially causing the subsequent token transfer to revert if the contract’s balance is insufficient.
Issue: The tick()
function mints tokens directly to the StabilityPool but increases excessTokens
as if held by RAACMinter.
Result: excessTokens
becomes an invalid indicator of RAACMinter's actual balance.
Initial State:
RAACMinter Balance: 0 RAAC
excessTokens
: 0 RAAC
Call tick()
:
amountToMint
= 100 RAAC
excessTokens
becomes 100
100 RAAC minted directly to StabilityPool
Current State:
RAACMinter Balance: 0 RAAC
StabilityPool Balance: 100 RAAC
excessTokens
: 100 RAAC
Call mintRewards(50)
:
toMint
= 0 (since 100 >= 50)
excessTokens
reduced to 50
Attempt to transfer 50 RAAC from RAACMinter (balance = 0)
Legitimate reward transfers may revert unexpectedly, disrupting the reward distribution process.
All reward distributions fail when tick()
has been called previously
Manual Review
Hardhat Test:
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.