Across is now live on BNB Smart Chain!
Bridge Now!
Across Documentation
V3 Developer Docs
V3 Developer Docs
  • 👋Introduction
    • Welcome to Across
    • What is Across?
    • Technical FAQ
    • Migration Guides
      • Migration from V2 to V3
      • Migration to CCTP
        • Migration Guide for Relayers
        • Migration Guide for API Users
      • Migration Guide for Non-EVM and Prefills
        • Breaking Changes for Indexers
        • Breaking Changes for API Users
        • Breaking Changes for Relayers
        • Testnet Environment for Migration
      • BNB Smart Chain Migration Guide
  • 🔗Use Cases
    • Instant Bridging in your Application
      • Bridge Integration Guide
      • Multichain Bridge UI Guide
      • Single Chain Bridge UI Guide
    • Embedded Crosschain Actions
      • Crosschain Actions Integration Guide
        • Using the Generic Multicaller Handler Contract
        • Using a Custom Handler Contract
      • Crosschain Actions UI Guide
    • Settle Crosschain Intents
    • ERC-7683 in Production
  • 🧠Concepts
    • What are Crosschain Intents?
    • Intents Architecture in Across
    • Intent Lifecycle in Across
    • Canonical Asset Maximalism
  • 🛠️Reference
    • API Reference
    • App SDK Reference
    • Contracts
      • Aleph Zero
      • Arbitrum
      • Base
      • Blast
      • Ethereum
      • Linea
      • Ink
      • Lisk
      • Mode
      • Optimism
      • Polygon
      • Redstone
      • Scroll
      • Soneium
      • Unichain
      • World Chain
      • zkSync
      • Zora
    • Selected Contract Functions
    • Supported Chains
    • Fees in the System
    • Actors in the System
    • Security Model and Verification
      • Disputing Root Bundles
      • Validating Root Bundles
    • Tracking Events
  • 🔁Relayers
    • Running a Relayer
    • Relayer Nomination
  • 📚Resources
    • Release Notes
    • Developer Support
    • Bug Bounty
    • Audits
Powered by GitBook
LogoLogo

Products

  • Across Bridge
  • Across+
  • Across Settlement

Socials

  • Discord
  • Twitter
  • Medium
  • Forum

Resources

  • Blog
  • Across Brand Assets
  • Github

Routes

  • Bridge to Unichain
  • Bridge to Arbitrum
  • Bridge to Optimism
  • Bridge to Linea
  • Bridge to Polygon
  • Bridge to Base
  • Bridge to World Chain
  • Bridge to zkSync
On this page
  • Getting Started
  • Production Contracts
  • Intents in Action
  • Generating Crosschain Intent
  • Executing Crosschain Intent
  1. Use Cases

ERC-7683 in Production

PreviousSettle Crosschain IntentsNextWhat are Crosschain Intents?

Last updated 2 months ago

Getting Started

ERC-7683 reimagines how users interact with crosschain applications.

Instead of users having to understand and specify complex execution paths, they simply declare their desired outcome. This intent-based approach shifts the complexity of crosschain execution from users to specialized actors called relayers, who compete to find the most efficient path to fulfill the user's desired outcome.

AcrossOriginSettler Contract and Its Impact

The AcrossOriginSettler contract is an extremely important part of this setup. It implements the IOriginSettler ERC-7683 interface. Its core features include:

  1. Validating an intent

  2. Processing an intent by creating a deposit on the SpokePool contract (either depositV3() or unsafeDeposit())

This contract demonstrates how intents can be modular. This allows different protocols to build their own implementations while maintaining compatibility with the core ERC-7683 standard.

Users no longer need to understand the intricacies of different L2s or bridges, they simply express what they want to achieve and the protocol does it in a cheap and fast way.

Each SpokePool contract on destination chains (i.e. Base and Arbitrum) implements the IDestinationSettler interface to allow for seamless crosschain activity. You can learn more about these contracts .

As specified in the , we will be focusing on fillDeadline, orderDataType and orderData to build the intent:

  1. fillDeadline: timestamp indicating when the crosschain intent expires if not completed.

  2. orderDataType: an EIP-712 typehash that specifies the format/structure of the orderData.

  3. orderData: The encoded parameters (tokens, amounts, chains, recipient, etc.) that define the desired outcome.

Let's dive in!


Production Contracts

Currently, AcrossOriginSettler contract is deployed on the following chains:

Chain
Contract Address

Base

Arbitrum


Intents in Action

Now, let's walk through crosschain intent execution and learn how using the AcrossOriginSettler contract, we can bridge USDC from Base to Arbitrum.

Generating Crosschain Intent

  1. Input wallet address. Funds will be sent from origin chain and received on destination on the same wallet.

  2. Input amount in USDC.

  3. Click on the generate intent button.

Here is a video guiding you through the flow:

Alternatively, you can also use the following javascript snippet to generate crosschain intents:

import { encodeAbiParameters } from 'viem'

// Function to pad the depositor address
function padAddress(address) {
    return '0x000000000000000000000000' + address.slice(2);
}

async function generateIntent(depositorAddress, amount) {
    // Default depositor if none provided
    const depositor = depositorAddress;
    const paddedDepositor = padAddress(depositor);

    // Calculate fillDeadline (current time + 30 minutes)
    const currentTimestamp = Math.floor(Date.now() / 1000);
    const fillDeadline = currentTimestamp + (30 * 60);

    // OrderDataType (constant)
    const orderDataType = "0x9df4b782e7bbc178b3b93bfe8aafb909e84e39484d7f3c59f400f1b4691f85e2";

    // Define the ABI
    const viemParams = [
        {
            type: 'tuple',
            components: [
                { type: 'address', name: 'inputToken' },
                { type: 'uint256', name: 'inputAmount' },
                { type: 'address', name: 'outputToken' },
                { type: 'uint256', name: 'outputAmount' },
                { type: 'uint256', name: 'destinationChainId' },
                { type: 'bytes32', name: 'recipient' },
                { type: 'address', name: 'exclusiveRelayer' },
                { type: 'uint256', name: 'depositNonce' },
                { type: 'uint32', name: 'exclusivityPeriod' },
                { type: 'bytes', name: 'message' }
            ]
        }
    ];


    const orderData = encodeAbiParameters(
        viemParams,
        [{
            inputToken: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
            inputAmount: amount*(10**6),
            outputToken: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
            outputAmount: 9980000,
            destinationChainId: 42161,
            recipient: paddedDepositor,
            exclusiveRelayer: "0x0000000000000000000000000000000000000000",
            depositNonce: 0,
            exclusivityPeriod: 0,
            message: "0x"
        }]
    );

    return {
        fillDeadline,
        orderDataType,
        orderData
    };
}

// Example usage
generateIntent("<input-wallet-address>", 10)
    .then(result => {
        console.log('\nReady to use in contract:');
        console.log('fillDeadline:', result.fillDeadline);
        console.log('orderDataType:', result.orderDataType);
        console.log('orderData:', result.orderData);
    })
    .catch(console.error);

Great! Now our intent is ready. In the next step, we will discuss how to use the AcrossOriginSettler contract and execute our crosschain intent.

Executing Crosschain Intent

    1. 1000000000 as the value (i.e. maximum allowance amount)

    2. Click on Write and sign the transaction.

  1. After connecting your wallet, expand the open function and input the details we had obtained from our script in the previous section:

Congratulations! You are now an adopter of ERC-7683 and we thank you for your support.

AcrossOriginSettler contract processes an external order type and translates it into an AcrossV3Deposit that it sends to the SpokePool Contract. This allows crosschain intents to work seamlessly throughout multiple chains. You can learn more about the Across protocol .

As you may have read in the , it is important that we perform the ABI encoding of our request and ensure that all information is correctly passed onto the AcrossOriginSettler contract.

To do this, simply head over to and do the following steps:

: Please ensure that you note the fillDeadline, orderDataType and orderData as these will be used in the next steps.

With the fillDeadline, orderDataType and orderData ready, it's now time that we head over to and execute the crosschain intent where we bridge 10 USDC from Base to Arbitrum:

Head over to the and call the approve function with the following details:

AcrossOriginSettler Contract address on Base () as the spender.

: Please ensure that you connect your wallet by clicking on the "Connect to Web3" button before interacting with the contract.

Now, head over to the and click on Contract and then Write Contract section and click on Connect to Web3 to connect your wallet:

Now, simply click on Write and sign the transaction on your wallet. Finally check . You will notice 10 USDC in your wallet on Arbitrum. This ensures that your crosschain intent was executed successfully.

In case you need any help, please feel free to contact us .

🔗
💡
💡
here
standard
here
standard
our crosschain intent generator website
basescan.org
USDC contract on Basescan
0x4afb570AC68BfFc26Bb02FdA3D801728B0f93C9E
AcrossOriginSettler contract on basescan
arbiscan.io
here
0x4afb570AC68BfFc26Bb02FdA3D801728B0f93C9E
0xB0B07055F214Ce59ccB968663d3435B9f3294998