The LendingPool contract's liquidation mechanism contains a critical logical error that completely inverts the intended behavior of the protocol's safety system. The initiateLiquidation
function's conditional check is backward, causing the function to revert precisely when it should execute and proceed when it should revert.
This fundamentally breaks the protocol's core safety mechanism. Per the documentation, RAAC is designed to "deeply integrate real estate within on-chain finance rails for seamless accessibility, composability, stability and capital efficiency." The liquidation system is essential to maintaining this stability - without it, the entire lending system becomes unsafe as bad debt cannot be cleared.
Looking at the protocol documentation:
Borrower: NFT Owner that collateralizes their NFT and borrows CRVUSD against them.
Collector: Contracts that receive swap taxes and similar revenue (FeeCollector).
These roles depend on a functioning liquidation system to maintain protocol solvency. The current implementation makes this impossible.
The issue lies in the liquidation check condition in LendingPool.sol:
The condition if (healthFactor >= healthFactorLiquidationThreshold)
means:
When health factor is GOOD (>= threshold) -> function reverts
When health factor is BAD (< threshold) -> function continues
However, the revert message is "HealthFactorTooLow", which is exactly backward
I've created a test demonstrating this:
This means:
Underwater positions cannot be liquidated
Bad debt accumulates in the system
Protocol becomes increasingly insolvent
No way to recover collateral from defaulted positions
Manual Review
Hardhat
The condition should be reversed to match the intended logic:
This aligns with the protocol's documentation and intended safety mechanisms, allowing liquidations to occur when positions become undercollateralized.
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.