# ERC-7683 in Production

## Getting Started

To learn how crosschain intents work in production, lets start by forming a mental model on how users need to input their intents. All the complexities of blockchains, solver networks and any trust assumptions are abstracted away making the UX extremely fast and streamlined.

&#x20;Think of it as an order ticket with the following fields:&#x20;

1. **originChain:** Chain where you currently hold tokens.
2. **originToken:** Token which you currently hold and want to bridge over to the destination chain.
3. **originAmount:** Amount of the token that you want to bridge over to the destination chain.
4. **destinationChain:** Chain on which you want to finally bridge over the tokens.
5. **destinationToken:** Token which you want to exchange your current token for on the destination chain.
6. **minReceived:** Minimum amount of the destination token that you want to receive after gas deductions and any other costs.&#x20;
7. **fillInstructions:** Any additional messages you want to send along with the transfer.

There are a few more details here, but let's focus on just these to keep things simple and understand the power and impact of crosschain intents.

<figure><img src="/files/exu0NXN76tfPwngHbOoW" alt="ERC-7683 ORDER TICKET. "><figcaption></figcaption></figure>

***

## 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](https://docs.across.to/).

Currently, **AcrossOriginSettler** contract is deployed on the following chains:

<table><thead><tr><th width="220">Chain</th><th>Contract Address</th></tr></thead><tbody><tr><td>Base</td><td><a href="https://basescan.org/address/0x4afb570AC68BfFc26Bb02FdA3D801728B0f93C9E">0x4afb570AC68BfFc26Bb02FdA3D801728B0f93C9E</a></td></tr><tr><td>Arbitrum</td><td><a href="https://arbiscan.io/address/0xb0b07055f214ce59ccb968663d3435b9f3294998">0xB0B07055F214Ce59ccB968663d3435B9f3294998</a></td></tr></tbody></table>

***

## Intents in Action

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

### Pre-requisites

1. A wallet with 10 USDC on Base.
2. An IDE.

### Setup

As you may have read in the [spec](https://www.erc7683.org/spec#specification), it is important that we perform the ABI encoding of our request and ensure that all information is correctly passed on to **AcrossOriginSettler** contract.&#x20;

To do that, please use the following shell script:

````sh
```shellscript
depositor="${1:-<input-your-public-key>}"

padded_depositor="0x000000000000000000000000${depositor:2}"


echo -n "fillDeadline: "

current_timestamp=$(date +%s)
seconds_to_add=$((30 * 60))
new_timestamp=$((current_timestamp + seconds_to_add))
echo $new_timestamp

echo -n "orderDataType: "
echo "0x9df4b782e7bbc178b3b93bfe8aafb909e84e39484d7f3c59f400f1b4691f85e2"

#echo -n "orderData: "
#cast abi-encode "AcrossOrderData(address,uint256,address,uint256,uint256,bytes32,address,uint256,uint32,bytes)" \
#    0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 `# inputToken` \
#    10000000                                   `# inputAmount` \
#    0xaf88d065e77c8cC2239327C5EDb3A432268e5831 `# outputToken` \
#    9970000                                    `# outputAmount` \
#    42161                                      `# destinationChainId` \
#    0x00000000000000000000000recipient `# recipient (padded)` \
#    0x0000000000000000000000000000000000000000 `# exclusiveRelayer` \
#    0                                          `# depositNonce` \
#    0                                          `# exclusivityPeriod` \
#    0x                                       `# message`


echo -n "orderData: "
cast abi-encode "AcrossOrderData((address,uint256,address,uint256,uint256,bytes32,address,uint256,uint32,bytes))" "(0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913,10000000,0xaf88d065e77c8cC2239327C5EDb3A432268e5831,9980000,42161,${padded_depositor},0x0000000000000000000000000000000000000000,0,0,0x)"

```
````

:bulb:: You can open this in an IDE of choice and ensure that you input your public key as the depositor. You can name the file whatever you want, for this demo we will call it "demo.sh".

Now, run the shell script by executing the following command on your terminal:

```bash
bash demo.sh
```

Here is what the output should look like:

{% code overflow="wrap" %}

```bash
fillDeadline: 1739798544
orderDataType: 0x9df4b782e7bbc178b3b93bfe8aafb909e84e39484d7f3c59f400f1b4691f85e2
orderData: 0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda029130000000000000000000000000000000000000000000000000000000000989680000000000000000000000000af88d065e77c8cc2239327c5edb3a432268e58310000000000000000000000000000000000000000000000000000000000984860000000000000000000000000000000000000000000000000000000000000a4b1000000000000000000000000f277cca2b56684fce5cb75e0a0ee18233fe7e50100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001400000000000000000000000000000000000000000000000000000000000000000
```

{% endcode %}

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

### Executing Crosschain Intent

With the `fillDeadline`, `orderDataType` and `orderData` ready, it's now time that we head over to [Basescan.org](https://basescan.org/tx/0xcb6227f82b133e18850cf0cc0ed0edb7b1b597ee90a22f533eb3ceae218d1697) and execute the crosschain intent where we bridge 10 USDC from Base to Arbitrum:

1. Start by going to the contract on Basescan and heading to the **Contract** and then **Write Contract** section and click on **Connect to Web3** to connect your walle&#x74;**:**

   <figure><img src="/files/bwAOaNT1I68lFoE1OlH3" alt=""><figcaption></figcaption></figure>
2. After connecting your wallet, expand the **open** function and input the details we had obtained from our script in the previous section:&#x20;

   <figure><img src="/files/jYgwpqtSeG9Eg1TWyySl" alt=""><figcaption></figcaption></figure>

Now, simply click on **Write** and sign the transaction on your wallet.\
\
Finally check [Arbiscan.io](https://arbiscan.io/). You will notice 10 USDC in your wallet on Arbitrum. This ensures that your crosschain intent was executed successfully.&#x20;

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

Incase you need any help, please feel free to reach out to contact us [here](https://t.me/bobbayb).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.erc7683.org/erc-7683-in-production.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
