Skip to content
Business logic Audit finding Intermediate

Improper ETH Refund Handling in GatewaySend.onRevert()

The GatewaySend contract's onRevert() function uses an ERC20 transfer helper to refund native ETH, which fails because ETH is not an ERC20 token. As a result, ETH from failed cross-chain transactions remains trapped in the contract, preventing users from recovering their funds.

0xEkko Follow with 0xc0ffEE, 0xlucky and 18 others

Originally disclosed on Sherlock

Source: https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex-judging/issues/905

Found by

0xEkko, 0xc0ffEE, 0xlucky, Abhan1041, AnomX, AshishLac, ChaosSR, Goran, IvanFitro, Kirkeelee, Ob, PratRed, SafetyBytes, X0sauce, benjamin_0923, hunt1, radevweb3, roadToWatsonN101, rsam_eth, shushu, tyuuu

Summary

The GatewaySend contract’s onRevert() function mishandles native ETH refunds for failed cross-chain transactions by using TransferHelper.safeTransfer(), which is designed exclusively for ERC20 tokens. When the function attempts to refund ETH, it tries to call an ERC20 transfer() method on this non-existent contract address, causing the transaction to fail. As a result, ETH remains trapped in the contract, preventing users from recovering their funds.

Root Cause

https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex/blob/main/omni-chain-contracts/contracts/GatewaySend.sol#L394C6-L396C76

Internal Pre-conditions

N/A

External Pre-conditions

N/A

Attack Path

A user attempts to bridge 3 ETH from Ethereum to polygon Chain via depositAndCall(). The transaction fails on the destination chain, and the ZetaChain Gateway returns the ETH to GatewaySend. The onRevert() function tries to refund the ETH using TransferHelper.safeTransfer(ETH_ADDRESS, user, 3 ETH), which fails because ETH_ADDRESS is not an ERC20 contract. The ETH remains stuck in the contract, leaving the user unable to recover their funds.

Impact

Fund Lockup: ETH from failed transactions becomes trapped, causing permanent loss for users.

User Experience Degradation: Inability to recover funds undermines trust in the bridging system.

PoC

No response

Mitigation

native transfer should be handle in onRevert()

Discussion

sherlock-admin2

The protocol team fixed this issue in the following PRs/commits: https://github.com/Skyewwww/omni-chain-contracts/pull/26

The original report as published on Sherlock, by 0xEkko. 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 onRevert() function uses TransferHelper.safeTransfer() for native ETH, which is designed for ERC20 tokens and cannot handle ETH transfers.

Impact

ETH from failed transactions becomes permanently trapped in the contract, causing loss for users and undermining trust in the bridging system.

What the attacker needed

User bridges ETH via depositAndCall(); Transaction fails on destination chain

The fix

The protocol team fixed this issue by handling native transfers in onRevert().

How it was found

  1. A user calls depositAndCall() to bridge 3 ETH from Ethereum to Polygon.
  2. The transaction fails on the destination chain.
  3. The ZetaChain Gateway returns the ETH to GatewaySend.
  4. The onRevert() function attempts to refund the ETH using TransferHelper.safeTransfer(ETH_ADDRESS, user, 3 ETH).
  5. The transfer fails because ETH_ADDRESS is not an ERC20 contract.
  6. The ETH remains stuck in the contract.

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.

When a cross-chain transaction fails, the contract tries to give the user their ETH back. But it uses a method meant only for tokens like USDC, not for ETH itself. So the refund fails and the ETH gets stuck in the contract forever.

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 0xEkko

View all

10 more disclosed reports, best first.

More from DODO Cross-Chain DEX

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.