When RToken are mistakenly transferred into the LendingPool contract, they become permanently locked. The contract’s rescue function explicitly prevents retrieval of these tokens, resulting in an irreversible loss of the token.
Root Cause: The rescueToken function in the LendingPool contract prevents the rescue of tokens whose address matches reserve.reserveRTokenAddress (i.e. the RToken). As a result, any RTokens accidentally sent to the contract cannot be withdrawn.
If a user mistakenly sends RTokens directly to the LendingPool contract address (instead of interacting via the designated deposit functions), the tokens become trapped since the rescue function will revert any attempt to recover them.
Paste into LendingPool.test.js and run with npx hardhat test test/unit/core/pools/LendingPool/LendingPool.test.js --show-stack-traces:
Permanent loss of the user's RToken. Destabilize the debt calculation that RToken is based on.
Manual review, Hardhat
Modify the rescue function to allow recovery of accidentally sent RTokens, perhaps by requiring additional authentication or confirmation steps to prevent misuse, while still protecting against unauthorized recovery.
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.