Skip to main content
This guide covers deploying the Router system, registering adapters, and configuring the infrastructure for production use.

Router Deployment

The Router contract is the central hub for all routing operations. It requires three critical addresses during deployment.

Constructor Parameters

From Router.sol:102:
Parameters:
atomicFillSigner
address
required
The address authorized to sign atomic fill batch operations. This address controls all user asset movements through fills and must be carefully secured.
  • Security: Use a hardware wallet or multi-sig for production
  • Pausing: Set to address(0) to pause all fill operations
  • Immutable: Cannot be changed after deployment (only via setAtomicFillSigner)
adder
address
required
The address granted ADAPTER_ADDER_ROLE for registering new protocol adapters.
  • Permissions: Can install adapters, perform hotfixes, and pause the router
  • Use case: Governance or operations address
  • Role value: bytes32(uint256(0x1001)) (from RouterManager.sol:36)
remover
address
required
The address granted ADAPTER_REMOVER_ROLE for disabling problematic adapters.
  • Permissions: Can retire adapters that are compromised or deprecated
  • Use case: Emergency operations or governance address
  • Role value: bytes32(uint256(0x1002)) (from RouterManager.sol:40)

Deployment Example

1

Prepare deployment parameters

Set up your addresses:
2

Deploy Router

Deploy the Router contract:
3

Verify deployment

Check the deployment:

Storage Layout

The Router uses a custom storage layout for deterministic state management: From Router.sol:62:
This ensures:
  • Predictable storage slots across deployments
  • Compatibility with proxy patterns
  • Consistent cross-chain deployments

Adapter Deployment

Custom adapters require specific parameters and proper registration with the Router.

Adapter Constructor Parameters

Most adapters follow this pattern (from AdapterBase.sol:82-89):

Example: SameChainAdapter

From SameChainAdapter.sol:137-146:
1

Deploy dependencies

Deploy required contracts:
2

Deploy adapter

Deploy the adapter:
3

Verify adapter

Check adapter configuration:

Adapter Registration

Once deployed, adapters must be registered with the Router to enable routing.

Installing Fill Adapters

Use installFillAdapter to register adapters for fill operations. From RouterManager.sol:106-117:
protocolVersion
bytes2
required
The semantic version (major.minor) for the adapter. Format: 0xMMmm where MM is major, mm is minor.
  • Example: 0x0100 = version 1.0
  • Example: 0x0001 = version 0.1
  • Must match adapter’s major version (from RouterManager.sol:108)
selector
bytes4
required
The function selector that the adapter implements.
  • Must be supported by the adapter’s supportsInterface
  • Used for routing calls to this adapter
  • Can register multiple selectors per adapter
adapter
address
required
The deployed adapter contract address.
  • Must implement IAdapter interface
  • Must support the provided selector via ERC165
  • Must have valid ARBITER address
Example:

Installing Claim Adapters

Use installClaimAdapter for claim operations: From RouterManager.sol:176-186:

Verification

Verify adapter installation:

Adapter Upgrades

The Router supports safe adapter upgrades through semantic versioning.

Hotfix Adapters

For patch-only updates (from RouterManager.sol:132-142):
1

Deploy new adapter

Deploy the updated adapter with incremented patch version:
2

Apply hotfix

Use hotfixFillAdapter for patch updates:
This validates:
  • An adapter is already installed (from RouterManager.sol:138)
  • New version is only a patch upgrade (from RouterManager.sol:141)

Force Hotfix

For breaking changes (use with caution):
Warning from RouterManager.sol:156: Bypasses semantic versioning validation and can introduce breaking changes.

Installing New Versions

Install a new major/minor version alongside the old one:

Removing Adapters

Retire compromised or deprecated adapters: From RouterManager.sol:268-282:

Token Approvals

Set token approvals for adapters that need to interact with protocols: From RouterManager.sol:387-393:
This:
  1. Reads the adapter’s settlementLayerSpender() (from IAdapter.sol:8)
  2. Approves that spender to spend the Router’s tokens
  3. Enables the adapter to interact with external protocols

Pausing the Router

Pause all fill operations in an emergency: From RouterManager.sol:79-82:
This sets the atomic fill signer to address(0), preventing all fill operations while allowing claims to continue.

Unpausing

Restore operations by setting a new signer:

Role Management

Manage access control roles using OpenZeppelin’s AccessControl:

Granting Roles

Revoking Roles

Checking Roles

Production Deployment Checklist

1

Security setup

  • Use hardware wallet or multi-sig for atomic signer
  • Use governance contract for ADD_ROLE
  • Use operations multi-sig for RM_ROLE
  • Verify all addresses on testnet first
2

Deploy contracts

  • Deploy Router with production addresses
  • Deploy all required arbiters
  • Deploy all adapters
  • Verify all contracts on block explorer
3

Register adapters

  • Install all fill adapters
  • Install all claim adapters
  • Set required token approvals
  • Verify registrations
4

Testing

  • Test fills on testnet
  • Test claims on testnet
  • Test batch operations
  • Test pause/unpause
  • Run gas benchmarks
5

Monitoring

  • Set up event monitoring
  • Configure alerting for errors
  • Monitor gas costs
  • Track adapter performance

Deployment Scripts

Example deployment script:
Run with:

Next Steps

Solver Integration

Learn how to integrate as a solver

Building Adapters

Build custom adapters for new protocols