# asdRouter

[`asdRouter`](https://github.com/Plex-Engineer/ASD-V2/blob/main/contracts/asd/asdRouter.sol) enables asD tokens to be minted from other chains with USDC deposits. Its only public method, `lzCompose`, is called by the LayerZero executor when minting is initiated by a user on another network.

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

## Minting

To mint asD tokens from another network, a user should first obtain a whitelisted USDC OFT on the origin network (by wrapping or swapping). Then call the [LayerZero `send` method](https://docs.layerzero.network/v2/developers/evm/oft/composing#sending-token) on the OFT passing the following struct (encoded as bytes) in the [`composeMsg` parameter](/technical-reference/application-specific-dollar/asdrouter.md#minting):

```solidity
struct OftComposeMessage {
    uint32 _dstLzEid; // destination endpoint id
    address _dstReceiver; // receiver on destination
    address _dstAsdAddress; // asD address on destination
    address _cantoAsdAddress; // asD on Canto (where to mint asD from)
    uint256 _minAmountASD; // minimum amount (slippage for swap)
    address _cantoRefundAddress; // canto refund address
    uint256 _feeForSend; // fee for bridge to destination chain
}
```

## Methods

### `lzCompose`

The `lzCompose(...)` method is called by the LayerZero executor when minting is initiated on another network. The calldata for this method is determined by the `composeMsg` parameter sent on the origin chain when USDC is sent, as described above.

This method:

1. Wraps bridged USDC as asdUSDC
2. Swaps asdUSDC for NOTE on Ambient
3. Mints the specified asD token on Canto
4. Sends the asD token to the destination chain and address


---

# 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://docs.canto.io/technical-reference/application-specific-dollar/asdrouter.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.
