The closeLiquidation()
function's documentation indicates it should allow users to repay their debt, but the implementation does the opposite by reverting when debt exists. This creates a significant discrepancy between the documented behavior and actual code execution.
The closeLiquidation() function contains a direct contradiction between its documentation and implementation. The @notice comment states the function "Allows a user to repay their debt and close the liquidation within the grace period". However, the actual implementation reverts with DebtNotZero() if the user has any debt above the DUST_THRESHOLD. This means users attempting to follow the documented behavior will experience transaction reverts.
This mismatch creates a confusing user experience where transactions fail despite following the documented function purpose. Users who attempt to close their liquidation while still having debt will face failed transactions and wasted gas fees. The function effectively prevents the very action it claims to enable in its documentation.
Manual Review
There are two possible approaches to resolve this inconsistency:
Update the documentation to accurately reflect the current implementation:
Modify the implementation to match the documented behavior:
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.