ERC-7683 in Production
Last updated
Last updated
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.
The AcrossOriginSettler contract is an extremely important part of this setup. It implements the IOriginSettler ERC-7683 interface. Its core features include:
Validating an intent
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:
fillDeadline: timestamp indicating when the crosschain intent expires if not completed.
orderDataType: an EIP-712 typehash that specifies the format/structure of the orderData.
orderData: The encoded parameters (tokens, amounts, chains, recipient, etc.) that define the desired outcome.
Let's dive in!
Currently, AcrossOriginSettler contract is deployed on the following chains:
Base
Arbitrum
Now, let's walk through crosschain intent execution and learn how using the AcrossOriginSettler contract, we can bridge USDC from Base to Arbitrum.
Input wallet address. Funds will be sent from origin chain and received on destination on the same wallet.
Input amount in USDC.
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:
Great! Now our intent is ready. In the next step, we will discuss how to use the AcrossOriginSettler contract and execute our crosschain intent.
1000000000 as the value (i.e. maximum allowance amount)
Click on Write and sign the transaction.
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 .