Notes
- L1 to L2 deposits via RootChainManager. L2 to L1 withdrawals require burning tokens on Polygon, then calling
exit()on L1 with the burn proof - Approval target for ERC-20: approve tokens to the ERC20Predicate (
0x40ec5B...), NOT the RootChainManager depositDatafor ERC-20 isabi.encode(amount)— the amount encoded as a 32-byte uint256- ETH deposits are received as WETH on Polygon (Polygon’s native token is MATIC)
- L1 to L2 deposits finalize after the next Polygon checkpoint (~30-60 minutes)
- L2 to L1 withdrawals require checkpoint inclusion +
exit()call on Ethereum (~3 hours for checkpoint) - Supports ERC-20, ERC-721, and ERC-1155 via different predicate contracts
- Canonical bridge, secured by the Polygon PoS validator set
Its names in a program
On Ethereum,PolygonBridge is a namespace: its contracts need no import.
Deployments
ABI
PolygonRootChainManagerABI
import PolygonRootChainManagerABI from "./protocols/polygon-bridge/PolygonRootChainManagerABI.json"; Speaks for: rootChainManager.
depositEtherFor(address user) payabledepositFor(address user, address rootToken, bytes depositData)exit(bytes inputData)
Next steps
- Protocols: the other protocols, by what they do.
- Protocols and tokens: calling a contract by its namespace, or through its ABI.
- Glossary: the words these pages use, in plain terms.
