Overview
Trails doesn’t just move tokens cross-chain—it can execute arbitrary smart contract functions on the destination chain as part of the same transaction flow. This enables powerful use cases like cross-chain NFT mints, DeFi deposits, and protocol interactions.How It Works
When you includetoCalldata in your Trails transaction, the protocol:
- Routes funds from the user’s selected source chain/token
- Bridges and swaps as needed to the destination chain/token
- Executes your calldata on the destination contract with the funds attached
Example: Cross-Chain NFT Mint
A user on Arbitrum wants to mint an NFT on Base that costs 0.01 ETH. They only have USDC:- User confirms a single transaction on Arbitrum
- Trails swaps USDC → ETH and bridges to Base
- On Base, Trails calls
mint()on the NFT contract with 0.01 ETH attached - User receives their NFT
Example: Cross-Chain DeFi Deposit
Deposit into an Aave lending pool on Arbitrum using tokens from any chain:Supported Calldata Patterns
Static Calldata
When the function parameters are known in advance:- NFT mints with fixed recipient
- Staking with fixed parameters
- Any function where amount isn’t a parameter
Dynamic Calldata
When the amount needs to be determined at execution time, useTRAILS_ROUTER_PLACEHOLDER_AMOUNT:
- ERC-4626 vault deposits
- Lending protocol supplies
- Any function with an
amountparameter that should match bridged funds
Key Benefits
- Single Transaction: Users confirm once, regardless of complexity
- Any Token → Any Function: Pay with USDC, execute with ETH
- Atomic Execution: Calldata executes only if funds arrive successfully
- No Contract Changes: Works with existing smart contracts
Use Cases
| Use Case | Example |
|---|---|
| NFT Minting | Mint on any chain with any token |
| DeFi Deposits | Supply to lending protocols cross-chain |
| Staking | Stake tokens on any chain |
| Gaming | Purchase in-game items across chains |
| DAO Interactions | Vote or participate with any token |
See Also
- Pay Mode - Configuration for payment with calldata
- Fund Mode - Configuration for deposits with calldata
- How It Works - Detailed protocol architecture