The finalizeLiquidation
function in the LendingPool
contract loops through and transfers all NFTs deposited by a user to the StabilityPool
contract. However, since there is no restriction on the number of NFTs a user can deposit, if a user deposits a large number of NFTs, the function will revert out of gas. This results in the NFTs being stuck in the LendingPool
contract with no alternative transfer method, leaving the debt uncovered.
After using depositNFT, Users can borrow RTokens
using their NFT as collateral. If the value of the deposited NFTs drops, liquidation can be initiated using initiateLiquidation
, followed by finalizeLiquidation
after a grace period.
However, in the finalizeLiquidation
function, all NFTs deposited by the user are iterated over and transferred:
If a user has deposited over 500 NFTs, the function will revert out-of-gas.
Add this test to LendingPool.test.js
:
NFTs locked in LendingPool contract
Unrecoverable debt
Manual review.
Limit NFT deposits per user
Instead of handling NFT transfers in the LendingPool, delegate them to a separate contract
LightChaser L-36 and M-02 covers it.
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.