ICMBridgeFactory manages Avalanche ICTT bridge routes and exposes a single bridge entrypoint for ERC20 transfers between Avalanche chains.
Source: evm/src/ICMBridgeFactory.sol
Route model
Routes are keyed by:BridgeRoute
| Field | Type | Description |
|---|---|---|
tokenTransferrer | address | Local ERC20TokenHome or ERC20TokenRemote. |
destTransferrer | address | Paired transferrer on the destination chain. |
requiredGasLimit | uint256 | Gas limit used by the ICM relayer. |
active | bool | Whether the route is enabled. |
External functions
| Function | Access | Description |
|---|---|---|
pause() | owner | Pauses bridge operations. |
unpause() | owner | Resumes bridge operations. |
registerRoute(address,bytes32,address,address,uint256) | owner | Adds a token and destination route. |
updateRoute(address,bytes32,address,address,uint256) | owner | Updates an active route. |
deregisterRoute(address,bytes32) | owner | Removes a route. |
bridge(address,uint256,bytes32,address,address,uint256) | public | Pulls tokens and dispatches an ICTT transfer. |
getRoute(address,bytes32) | view | Returns route config. |
isRouteActive(address,bytes32) | view | Returns whether the route is active. |
Fee handling
| Fee mode | Inputs |
|---|---|
| No fee | primaryFeeToken = address(0), primaryRelayerFee = 0 |
| Fee in bridge token | primaryFeeToken = token, primaryRelayerFee > 0 |
| Fee in separate token | primaryFeeToken = feeToken, primaryRelayerFee > 0 |
bridge() calls, the caller must approve the bridge token and any separate fee token. For AvalancheEscrowVault.claimHop, the vault only supports no fee or fee in the bridge token because it only holds the escrowed token.
Events
| Event | Description |
|---|---|
RouteRegistered(address,bytes32,address,address,uint256) | Route added. |
RouteUpdated(address,bytes32,address,address,uint256) | Route changed. |
RouteDeregistered(address,bytes32) | Route removed. |
BridgeSent(address,bytes32,address,address,uint256,uint256) | Bridge transfer dispatched. |
Errors
| Error | Meaning |
|---|---|
ICMBridgeFactory__ZeroAddress | Required address is zero. |
ICMBridgeFactory__ZeroAmount | Bridge amount is zero. |
ICMBridgeFactory__RouteNotFound | Route is missing or inactive. |
ICMBridgeFactory__RouteAlreadyRegistered | Active route already exists. |
ICMBridgeFactory__ZeroGasLimit | Gas limit is zero. |
ICMBridgeFactory__InvalidBlockchainId | Destination blockchain ID is zero. |
ICMBridgeFactory__InvalidFeeParameters | Nonzero fee was supplied with zero fee token. |