The StabilityPool is unable to handle NFTs, resulting in all liquidated RAACNFT collateral to be stuck in the contract unless and upgrade is done.
Users deposit their RAACNFTs into the LendingPool as collateral to borrow against them. If the value of their collateral falls below a certain threshold, then the StabilityPool can liquidate these positions by paying the outstanding debt and receiving the RAACNFT collateral in return.
This happens in StabilityPool#liquidateBorrower via LendingPool#finalizeLiquidation:
Looking at finalizeLiquidation(), we can see that it iterates over the borrowers posited collateral and transfers them to the StabilityPool using ERC721#transferFrom:
Once the collateral has been transferred to the stability pool, there's no way to move them out of there again for further handling.
Given that other users deposit into the StabilityPool so that liquidations can happen in the first place, they should probably be rewarded for the risk, and likely, the collateral owned by the stability pool should be used for that.
Currently, this is not possible unless the StabilityPool is upgraded.
Unless there's an upgrade done later one, RAACNFTs will be stuck in StabilityPool forever and the protocol looses the opportunity to distribute the value to liquidity providers of the stability pool. Meaning, in case of liquidations, all liquidity provider funds are at risk.
Manual review.
There's a couple of things that should be done here:
Similar to how LendingPool inherits ERC721Holder, StabilityPool should also inherit ERC721Holder, to ensure it signals other contracts that it can handle NFTs.
In addition to 1) LendingPool should then also make use of ERC721#safeTransferFrom in favor of transferFrom to ensure it checks whether the receiving contract can actually handle ERC721 tokens.
Here's what this could look like:
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.