# GatewayTransferNative does not collect platform fee when native asset is bridged

GatewayTransferNative's fee handler uses ERC20 safeTransfer on the native ETH sentinel address, so bridging native assets silently collects zero platform fees.

- Payout: Audit contest
- Severity: medium
- Program: Dodo Cross Chain Dex
- Found by: 0xc0ffEE
- Disclosed: 2025-05-29
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2025-05-dodo-cross-chain-dex-judging/issues/700
- Library page: https://bugbountylibrary.com/r/sherlock%3A2025-05-dodo-cross-chain-dex%3AM-6
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity vuln:business-logic vuln:fee-bypass

**Target:** GatewayTransferNative.withdrawToNativeChain / _handleFeeTransfer
**Root cause:** _handleFeeTransfer always uses TransferHelper.safeTransfer (ERC20 transfer selector) even when zrc20 is the native _ETH_ADDRESS_ sentinel; the low-level call to a codeless address returns success without moving funds.
**Steps:**
1. Call `withdrawToNativeChain(_ETH_ADDRESS_, amount, message)` with msg.value covering the bridge amount.
2. Function skips transferFrom because zrc20 == _ETH_ADDRESS_.
3. `_handleFeeTransfer` computes `platformFeesForTx = amount * feePercent / 1000`.
4. `TransferHelper.safeTransfer(_ETH_ADDRESS_, EddyTreasurySafe, fee)` issues `call(0xa9059cbb...)` to 0xEeee...EEeE; no code, returns success.
5. Bridge proceeds; treasury receives 0 fees.
**How found:** Code reading of withdrawToNativeChain: noticed the zrc20 != _ETH_ADDRESS_ guard skips transferFrom for native, then traced _handleFeeTransfer which unconditionally uses ERC20 safeTransfer on the sentinel address.
**Exploitation:** Any user bridging native asset via withdrawToNativeChain pays no platform fee; protocol silently loses revenue on every native-asset bridge.
**Insight:** When a contract uses a sentinel address (e.g. 0xEeee...EEeE) to represent native asset, audit every downstream helper that assumes ERC20 semantics; low-level calls to codeless addresses return success, so fee/transfer logic silently no-ops.

