Skip to content
Business logic Audit finding Intermediate

Non-functional wrapper in BorrowLiquidation

The Synthetix wrapper contract on the OP Chain is an empty wrapper that does not support the mint() interface, so the liquidationType2 function reverts when it tries to wrap WETH to sETH. This means liquidation type 2 cannot work on OP Chain, and if liquidation type 1 is unavailable, liquidations may fail entirely.

0x37 Follow

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2024-11-autonomint-judging/issues/438

Found by

0x37

Summary

The synthetix's wrapper in OP Chain is empty. It cannot help us to wrap WETH to sETH.

Root Cause

In borrowLiquidation.sol:348, we will wrap WETH to sETH via synthetix's wrapper.

The problem is that I find out that the synthetix's wrapper in OP Chain is different with Ethereum's wrapper. The synthetix's wrapper in OP Chainis one empty wrapper chain(https://optimistic.etherscan.io/address/0xc3Ee42caBD773A608fa9Ec951982c94BD6F33d59) after checking from (https://developer.synthetix.io/addresses/).

So in OP chain, the empty wrapper does not support mint() interface. So this liquidation will be reverted.

Solidity
    function liquidationType2(
        address user,
        uint64 index,
        uint64 currentEthPrice
    ) internal {
        ...
        wrapper.mint(amount);
}

Internal pre-conditions

N/A

External pre-conditions

N/A

Attack Path

N/A

Impact

The liquidation type 2 cannot work in OP chain. Considering that liquidation type 1 cannot work in some cases, e.g. there is not enough cds owners who opt in the liquidation, it's important to make sure that the liquidation type 2 can always work well.

PoC

N/A

Mitigation

synthetix support to exchange WETH to sUSD directly.

The original report as published on Sherlock, by 0x37. Images and videos are our own copies; raw HTML is shown as text. View it on Sherlock.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the code assumes the Synthetix wrapper on OP Chain behaves like the one on Ethereum, but the OP Chain wrapper is an empty contract without the mint() function.

Impact

Liquidation type 2 cannot work on OP Chain, and since liquidation type 1 may not always be available, liquidations could fail.

What the attacker needed

Liquidation type 2 triggered on OP Chain

The fix

The report suggests using Synthetix's direct exchange from WETH to sUSD instead of relying on the wrapper.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

A smart contract called a wrapper is supposed to convert one token into another, but on this particular network the wrapper is empty and has no code to do the conversion. When the liquidation code calls a function on it, the call fails and the whole liquidation stops. This matters because if the other liquidation method is not available, the protocol cannot liquidate a risky position.

What is Business logic?

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.

More by 0x37

View all

79 more disclosed reports, best first.

More from Autonomint Colored Dollar V1

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.