contracts/core/pools/LendingPool/LendingPool.sol
The event emitted within the deposit function of the Lendingpool contract may contain incorrect data potentially misleading offchain systems that rely on the emitted event’s data.
When the LendingPool.deposit function is called, the amount of underlying asset to be deposited in the pool is passed in as an argument to the function, next, the deposit function in the reserve library is executed, passing in the amount as part of the arguments, this then calls the mint function of the rToken contract to mint deposit shares to the user.
Here’s where the issue originates from, tracing back from the rToken contract, after the execution of RToken.mint, it returns 4 values :
A tuple containing:
* - isFirstMint (bool): True if this is the first mint for the recipient, false otherwise
* - amountToMint (uint256): The amount of scaled tokens minted
* - total supply (uint256): The new total supply after minting
* - amountScaled (uint256): The amount of underlying tokens minted
However, the amountToMint value is incorrect, during the execution of the _mint function the amount passed in is scaled by the liquidity index and the resulting amount is minted to the user
Therefore, when the execution is traced back to the initial entry point, LendingPool.deposit, it will be discovered that the value emitted as the minted rTokens amount is actually the amount of the underlying asset supplied thereby incorrect
These potentially incorrect event data may mislead systems that rely on the emitted values from the contract
Manual Review
Update the returned values from the Rtoken mint function to reflect the correct data
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.