Overview
ThePolygon_Adapter enables the HubPool to bridge tokens and send messages from Ethereum L1 to Polygon PoS (formerly Matic Network) using Polygon’s native bridge infrastructure.
Key Features
- FxPortal Messaging: Sends arbitrary messages via
FxStateSender - Dual Token Bridges:
- PoS Bridge (RootChainManager) for most ERC20 tokens
- Plasma Bridge (DepositManager) for MATIC token
- Multiple Bridge Support: CCTP for USDC, LayerZero OFT for omnichain tokens
- ETH Handling: Unwraps WETH to native ETH before bridging
Contract Reference
Location:contracts/chain-adapters/Polygon_Adapter.sol
Constructor
_rootChainManager- RootChainManager contract for PoS bridge token deposits_fxStateSender- FxStateSender contract for sending arbitrary messages_depositManager- DepositManager contract for Plasma bridge (MATIC deposits)_erc20Predicate- ERC20Predicate contract to approve for PoS bridge_l1Matic- MATIC token address on L1_l1Weth- WETH token address on L1_l1Usdc- USDC token address for CCTP bridging_cctpTokenMessenger- Circle CCTP TokenMessenger contract_adapterStore- Storage contract for OFT bridging support_oftDstEid- LayerZero endpoint ID for Polygon (30109)_oftFeeCap- Maximum fee cap for OFT bridging (e.g., 1 ether)
Immutable Variables
Core Functions
relayMessage()
Sends arbitrary messages from L1 to Polygon via the FxPortal system.FxStateSenderemits aStateSyncedevent on L1- Polygon validators include this state sync in a checkpoint
FxChildcontract on Polygon receives and processes the message- Message is forwarded to the
targetcontract (usually Polygon SpokePool)
relayTokens()
Bridges tokens from L1 to Polygon using the appropriate bridge.Bridge Selection Logic
FxPortal System
Overview
FxPortal is Polygon’s arbitrary message passing system between L1 and L2. L1 Component:FxStateSender
L2 Component: FxChild
FxStateSender Interface
0xfe5e5D361b2ad62c541bAb87C45a0B9B018389a2
Message Flow
- L1:
FxStateSender.sendMessageToChild(receiver, data)emitsStateSyncedevent - Validators: Include state sync in next checkpoint (~20-30 min)
- L2:
FxChildcontract receives and validates state sync - L2:
FxChildforwards message toreceiver.processMessageFromRoot(data)
Polygon SpokePool Integration
RootChainManager (PoS Bridge)
Overview
The PoS (Proof of Stake) bridge is Polygon’s main token bridge for ERC20 tokens. Mainnet Address:0xA0c68C638235ee32657e8f720a23ceC1bFc77C77
Interface
Token Approval
Tokens must be approved to the ERC20Predicate contract, not RootChainManager:0x40ec5B33f54e0E8A33A975908C5BA1c14e5BbbDf
How PoS Bridge Works
- L1: User locks tokens in Predicate contract
- L1: RootChainManager emits deposit event
- Validators: Include deposit in checkpoint
- L2: ChildChainManager mints equivalent L2 tokens to recipient
DepositManager (Plasma Bridge)
Overview
The Plasma bridge is used exclusively for MATIC token deposits. It’s the legacy bridge system that predates the PoS bridge. Mainnet Address:0x401F6c983eA34274ec46f84D70b31C151321188b
Interface
Why Separate Bridge for MATIC?
MATIC uses the Plasma bridge instead of PoS bridge for historical reasons and because it’s the native gas token on Polygon.0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0
CCTP Integration
For USDC, the adapter uses Circle’s Cross-Chain Transfer Protocol (CCTP) for native USDC bridging:- Native USDC on both chains (no wrapped tokens)
- Faster finality than native bridges
- Lower fees
LayerZero OFT Support
The adapter supports omnichain fungible tokens (OFT) via LayerZero:AdapterStore contract, managed by HubPool admin
Examples
Send Admin Message to Polygon SpokePool
Bridge WETH to Polygon
Bridge USDC via CCTP
Bridge MATIC Token
Bridge Standard ERC20
Gas Considerations
No L2 Gas Payment Required
Unlike Arbitrum or OP Stack adapters, Polygon adapter doesn’t require pre-funding ETH for L2 gas:- Message relay: State syncs are processed by validators automatically
- Token deposits: Bridge contracts handle L2 execution
L1 Gas Costs
Typical L1 gas costs for Polygon operations:| Operation | Estimated Gas |
|---|---|
| relayMessage (FxStateSender) | ~50,000 |
| relayTokens (PoS bridge) | ~100,000 |
| relayTokens (Plasma/MATIC) | ~80,000 |
| relayTokens (CCTP) | ~100,000 |
Finality and Timing
| Bridge Type | Finality Time | Mechanism |
|---|---|---|
| FxPortal (messages) | 20-30 minutes | Checkpoint submission |
| PoS Bridge (tokens) | 20-30 minutes | Checkpoint submission |
| Plasma Bridge (MATIC) | 20-30 minutes | Checkpoint submission |
| CCTP (USDC) | 10-20 minutes | Circle attestation |
| LayerZero OFT | 1-5 minutes | Oracle + relayer |
Security Considerations
Checkpoint Validators
Polygon’s security relies on a set of validators who submit checkpoints to Ethereum. The bridge is secured by:- 2/3+ validator consensus on checkpoints
- 7-day fraud proof challenge period for withdrawals (L2 → L1)
- Multi-sig control over validator set
Token Predicate Approval
Always approve the ERC20Predicate contract, not RootChainManager:Message Authentication
Polygon SpokePool validates messages using:Related Contracts
Polygon_SpokePool.sol- Receives messages via FxChild and validates admin senderAdapterStore.sol- Stores OFT messenger mappings for LayerZero bridgingCircleCCTPAdapter.sol- Library for CCTP integrationOFTTransportAdapterWithStore.sol- Library for LayerZero OFT integration