ERC-7683 in Production
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:
Validating an intent
Processing an intent by creating a deposit on the SpokePool contract (either
depositV3()
orunsafeDeposit()
)
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 here.
As specified in the standard, 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!
Production Contracts
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 here.
Currently, AcrossOriginSettler contract is deployed on the following chains:
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
As you may have read in the standard, 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 our crosschain intent generator website and do the following steps:
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.
Executing Crosschain Intent
With the fillDeadline
, orderDataType
and orderData
ready, it's now time that we head over to basescan.org and execute the crosschain intent where we bridge 10 USDC from Base to Arbitrum:
Head over to the USDC contract on Basescan and call the approve function with the following details:
AcrossOriginSettler Contract address on Base (0x4afb570AC68BfFc26Bb02FdA3D801728B0f93C9E) as the spender.
1000000000 as the value (i.e. maximum allowance amount)
Click on Write and sign the transaction.
Now, head over to the AcrossOriginSettler contract on basescan and click on Contract and then Write Contract section and click on Connect to Web3 to connect your wallet:
After connecting your wallet, expand the open function and input the details we had obtained from our script in the previous section:
Now, simply click on Write and sign the transaction on your wallet. Finally check arbiscan.io. You will notice 10 USDC in your wallet on Arbitrum. This ensures that your crosschain intent was executed successfully.
Congratulations! You are now an adopter of ERC-7683 and we thank you for your support.
In case you need any help, please feel free to contact us here.
Last updated