Overview

The Gateway contract is deployed on every supported chain. It serves as the entry point for all intents and the trust anchor for the protocol.
The Gateway is intentionally non-upgradeable to maintain long-term trust and predictability. Once deployed, the contract logic cannot be changed.

Responsibilities

FunctionDescription
Intent ValidationValidates chain, asset, expiry, and minimum output parameters
Event EmissionEmits canonical OrderCreated events that solvers monitor
Fee ApplicationApplies token-specific fees to each transaction
Token WhitelistingOnly allows approved tokens to be bridged
Finality TrackingMarks orders as executed to prevent replay
Replay ProtectionEnsures each order ID can only be executed once

Contract Interface

bridgeToken

Create a new bridge intent:
function bridgeToken(
    address token,          // Token being bridged
    uint256 amount,         // Amount in smallest unit
    uint256 destChainId,    // Destination chain (Gasyard ID)
    address destRecipient,  // Recipient address
    uint256 minOutput,      // Minimum amount to receive
    uint256 expiry,         // Unix timestamp expiry
    bytes calldata metadata // Optional arbitrary data
) external;

bridgeNative

Bridge native token (ETH, BNB, etc.):
function bridgeNative(
    uint256 destChainId,
    address destRecipient,
    uint256 minOutput,
    uint256 expiry,
    bytes calldata metadata
) external payable;

executeOrder

Execute an intent (solver only):
function executeOrder(
    bytes32 orderId,
    address recipient,
    uint256 amount
) external;

Events

OrderCreated

Emitted when a new intent is submitted:
event OrderCreated(
    bytes32 indexed orderId,    // Unique order identifier
    address indexed sender,      // User who created the intent
    address token,               // Input token address
    uint256 amount,              // Input amount
    uint256 destChainId,         // Destination chain ID
    address destRecipient,       // Recipient on destination
    uint256 minOutput,           // Minimum output required
    uint256 expiry,              // Expiration timestamp
    bytes metadata               // Attached metadata
);

OrderExecuted

Emitted when a solver fulfills an intent:
event OrderExecuted(
    bytes32 indexed orderId,    // Order that was executed
    address indexed solver,      // Solver who executed
    uint256 outputAmount         // Amount delivered to user
);

Token-Specific Fees

Fees are configured independently per token:
TokenDefault Fee
USDC0.25%
USDT0.25%
ETH0.50%
OtherConfigurable
Partner integrations can include additional builder fees. Contact the team for custom fee arrangements.

Security Features

Role-Based Access

Only authorized addresses can execute specific functions

Non-Upgradeable

Contract logic is immutable after deployment

Token Whitelist

Only pre-approved tokens can be bridged

Replay Protection

Each order ID can only be executed once

Design Philosophy

The Gateway is intentionally minimal:
  • No routing logic — Keeps the contract simple and auditable
  • No upgradability — Trust is established at deployment
  • No external calls — Reduces attack surface
  • Deterministic behavior — Same inputs always produce same outputs
Next: Learn about Routers — how swaps are integrated.