# How to develop under Anyswap ERC20 standards

## Compaitibility requirements:

In order to be compaitible with our router, your token needs to have the following functions:

1. Mint function

```
function mint(address to, uint256 amount) external onlyAuth returns (bool) {
        _mint(to, amount);
        return true;
    }
```

2\. Burn Function

```
function burn(address from, uint256 amount) external onlyAuth returns (bool) {
        require(from != address(0), "AnyswapV3ERC20: address(0x0)");
        _burn(from, amount);
        return true;
    }
```

3\. underlying variable. For our frontend to recognize your token. This should be set as address (0) if your token natively supports our system.&#x20;

```
address public immutable underlying;
```

## Development Methods

### If your token is completely new/new on certain chains:

Forking our template is the easiest way to develop with our standards. The template is linked below and it includes backward compatibility with our older system as well. Simply fork the contract and set the underlying as address(0)

{% embed url="<https://github.com/anyswap/chaindata/blob/main/AnyswapV6ERC20.sol>" %}

{% hint style="info" %}
In most cases, our team can deploy the standard contracts on any chains for you. This guide is specifically for projects who want to implement custom methods or properties in their cross-chain tokens.
{% endhint %}

Here is another guide if you wish to use create2, however this is limited to Ethereum, Fantom, Binance Smart Chain, xDAI, and Polygon.

{% embed url="<https://github.com/anyswap/chaindata/blob/main/deploy.md>" %}

## Commonly asked questions:

### **1. Which router address should I give minting right to?**

Our team will provide the most up-to-date router address for you to give minting right to. This information will be more available through apis in the future.&#x20;

### **2. Who do I set as owner for the token?**

You can simply set your project admin as owner.

### **3. There are a lot of functions in** AnyswapV6ERC20. Which ones can I safely remove?

For router to work, the most important things we need are **minting right and burning right**. Please ensure our routers can mint and burn tokens. Other functions can be safely removed, they're there to be backward compatible with the bridge V2 system.

We also need underlying as a variable for our frontend to work.

### **4. What do I set as vault, underlying?**

Vault is the same as the owner for the token, you can simply set it as your own address.\
\
Underlying is used when your token employs a wrapper or liquidity model, if your token is supporting our system natively. Simply set underlying as address(0)


---

# 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.multichain.org/developer-guide/how-to-develop-under-anyswap-erc20-standards.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.
