# When transferring tokens native on SKALE to Ethereum with TokenManagerERC20.exitToMainERC20(), the tokens on the schain will be frozen on TokenManagerERC20, but they will not receive tokens on Ethereum

TokenManagerERC20.exitToMainERC20 lacks a mainnet guard for schain-native tokens, so bridging burns user tokens while DepositBoxERC20 reverts on the message type, freezing funds.

- Payout: Audit contest
- Severity: medium
- Program: SKALE
- Found by: WatchPug
- Disclosed: 2022-11-11
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-02-skale-findings/issues/58
- Library page: https://bugbountylibrary.com/r/c4%3A2022-02-skale%3AM-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** TokenManagerERC20.exitToMainERC20 / DepositBoxERC20 bridge
**Root cause:** _exit() does not require chainHash != MAINNET_HASH for schain-native tokens; it burns the tokens and emits TRANSFER_ERC20_AND_TOKEN_INFO/TOTAL_SUPPLY messages, but DepositBoxERC20 only decodes TRANSFER_ERC20 and reverts.
**Steps:**
1. User holds schain-native ERC20 and approves TokenManagerERC20.
2. Call `exitToMainERC20(contractOnMainnet, amount)` with mainnet as target.
3. _exit() finds no clone, sets isMainChainToken=true, calls _receiveERC20, transfers tokens to contract and burns them, posts TRANSFER_ERC20_AND_TOKEN_INFO or TRANSFER_ERC20_AND_TOTAL_SUPPLY message.
4. DepositBoxERC20.postMessage calls decodeTransferErc20Message, which requires MessageType.TRANSFER_ERC20 and reverts.
5. Tokens burned/frozen on schain; nothing delivered on Ethereum.
**How found:** Code review of exitToMainERC20/_exit path noting missing mainnet guard, then cross-checking message type encoding against DepositBoxERC20's decoder which only accepts TRANSFER_ERC20.
**Exploitation:** Any user bridging a schain-native token to mainnet loses the burned amount; no attacker profit, funds permanently stuck.
**Insight:** When auditing bridge contracts, verify that every message type a source-chain sender can emit is decodable by the destination receiver; asymmetric encode/decode paths cause silent fund freezes.
