RootChainManager Contract on Ethereum: Deposits and Exits
RootChainManager is the Ethereum proxy contract you call to deposit supported assets to Polygon PoS or claim them after a withdrawal. It stores the Ethereum and Polygon token mappings, routes each asset to a predicate that holds the deposited funds, and verifies exit proofs against checkpoints.
- depositFor(user, rootToken, depositData) deposits a mapped ERC20 token.
- depositEtherFor(user) deposits ETH sent with the call as value.
- exit(bytes) verifies a Polygon burn proof and triggers release on Ethereum.
Those calls are the Ethereum side of the Polygon bridge, which moves supported assets between Ethereum and Polygon PoS. The background at polygonbridge.co places this contract entry point within the full transfer between the networks.
How Does a Deposit Work?
RootChainManager handles an ERC20 deposit by finding the token’s registered predicate, calling it to lock the tokens, and sending deposit data through StateSender to ChildChainManager on Polygon. Think of the manager as a parcel counter: it directs each asset to the right holding contract. ERC20PredicateProxy holds deposited ERC20 tokens; EtherPredicate receives deposited ETH. ChildChainManager processes the arriving state sync on Polygon.
Say you want to deposit 1,000,000 base units of an ERC20 token. Approve ERC20PredicateProxy to spend that amount, then call depositFor with your recipient address, the Ethereum token address, and depositData equal to abi.encode(uint256(1_000_000)). The third argument has type bytes. ABI encoding produces a 32-byte representation of the amount, which you enter as hex bytes when using Etherscan’s write interface.
Entering the decimal number 1000000 directly as depositData supplies the wrong type; supplying improperly encoded bytes can make the amount fail to decode or be read incorrectly. The RootChainManager source shows that the manager passes depositData to the predicate and forwards the same bytes in the state sync. Its ETH path instead encodes msg.value itself, so depositEtherFor takes a recipient and ETH value rather than an ERC20 address or depositData.
How Does an Exit Work?
RootChainManager’s exit(bytes) accepts an encoded proof after tokens have been burned on Polygon and the transaction’s block has been checkpointed on Ethereum. It verifies the receipt proof and checkpoint membership, rejects an exit already processed, then calls the token’s predicate to release the funds. A burn transaction hash alone is not the required proof payload. Polygon’s bridge flow explanation covers the lock-and-mint deposit and burn-and-unlock withdrawal that these calls implement.
Use depositFor with an ABI-encoded amount for ERC20, depositEtherFor with ETH value for native ETH, and exit with a checkpoint-backed burn proof to claim on Ethereum. RootChainManager chooses the predicate and verifies the claim; the predicate holds and releases the asset.