The mint function contains an unused variable, balanceIncrease, which is calculated but never used in the final balance update. This oversight can lead to under-minting of tokens, particularly when interest accrual based on the liquidity index is expected.
balanceIncrease Is Not AppliedThe function correctly calculates balanceIncrease but never uses it when minting tokens.
The minting function _mint(onBehalfOf, amountToMint.toUint128()); ignores balanceIncrease, meaning:
Users receive only the newly minted amount (amountToMint).
They do not receive the balance increase due to interest accrual from the liquidity index change.
Under-Minting Tokens: Users do not receive the full adjusted balance after an index update.
Incorrect Interest Accrual: The protocol does not properly reflect changes in the liquidity index, leading to discrepancies in token balances.
Potential Loss of Funds: If this function is part of a lending or staking system, users lose out on accrued yield due to incorrect balance calculations.
Manual Review
Adjust scaledBalance Before Minting
Mint the Correct Total Amount
The balanceIncrease is the interest that has already accrued on the user's existing scaledBalance since their last interaction. It's not something you mint as new tokens in the _mint function.
The balanceIncrease is the interest that has already accrued on the user's existing scaledBalance since their last interaction. It's not something you mint as new tokens in the _mint function.
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.