Multichain
  • Getting Started
    • Introduction
      • Supported Chains
      • Supported Tokens
    • How it works
      • Cross-Chain Bridge
      • Cross-Chain Router
    • Governance Token
      • VeMulti
      • How to Convert ANY to MULTI
    • Security
      • Security model
      • Bug bounty (Immunefi)
      • Bug bounty (alternative)
    • How to Use
      • Fees
    • Road Map
    • FAQ
    • Careers
      • Front-end developer
      • Back-end developer
      • Test Engineer
      • Test Development Engineer
      • Security Engineer (Code Auditing)
      • Blockchain Development Engineer
      • Senior Content Editor
      • Event Manager
  • Listing and Integration
    • Token Listing
      • ERC20 Cross-chain Options
      • Difference between V2&V3
    • Chain Integration
      • EVM Networks Integration
      • Non-EVM Networks Integration
    • FAQ
  • Developer Guide
    • How to Integrate Front-end Router
    • Bridge API (Token list/Tx Status)
    • Scan API (Tx Status/Account History)
    • Token Router Testnet
    • anyCall V7
      • How to integrate anyCall V7?
      • API/Explorer
      • Quickstart (Cross-chain text example)
      • Estimate Fee/Pay Fees on destination chain
    • anyCall V6
      • How to integrate anyCall V6?
      • anyFallback
      • anyCall V6 Testnet Environments
      • Fees Paid on Source Chain
      • Context (Verify msg.sender)
    • $USDC CCTP X anyCall
      • Contract Addresses and example
    • anyCall NFT Bridge
    • Permissionless Token bridging
    • How to develop under Anyswap ERC20 standards
    • Bridge funds and anyCall (Router V7)
      • Mainnet
      • Testnet (Quick Start Example)
    • How to Integrate Front-end Bridges
Powered by GitBook
On this page
  • Compaitibility requirements:
  • Development Methods
  • If your token is completely new/new on certain chains:
  • Commonly asked questions:
  • 1. Which router address should I give minting right to?
  • 2. Who do I set as owner for the token?
  • 3. There are a lot of functions in AnyswapV6ERC20. Which ones can I safely remove?
  • 4. What do I set as vault, underlying?
  1. Developer Guide

How to develop under Anyswap ERC20 standards

This article would help you develop and deploy your own tokens compatible with our bridge

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.

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)

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.

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

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.

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)

PreviousPermissionless Token bridgingNextBridge funds and anyCall (Router V7)

Last updated 2 years ago

chaindata/AnyswapV6ERC20.sol at main · anyswap/chaindataGitHub
chaindata/deploy.md at main · anyswap/chaindataGitHub
Logo
Logo