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
  • Requirements to be compatible with anyCall interfaces:
  • anyCall Interfaces
  • AnyCallExecutor
  1. Developer Guide
  2. anyCall V7

How to integrate anyCall V7?

PreviousanyCall V7NextAPI/Explorer

Last updated 2 years ago

  • Mainnet AnyCall Contracts:

Available Chains: Ethereum, Optimism, BNB Chain, Fantom, Polygon, Arbitrum, Avalanche.

Contract Address: 0x8efd012977DD5C97E959b9e48c04eE5fcd604374

  • Testnet AnyCall Contracts:

Goerli (5): 0x965f84D915a9eFa2dD81b653e3AE736555d945f4

BNB Testnet (97): 0xcBd52F7E99eeFd9cD281Ea84f3D903906BB677EC

Fantom Testnet (4002): 0xfCea2c562844A7D385a7CB7d5a79cfEE0B673D99

Avalanche Fuji Testnet (43113): 0x461d52769884ca6235b685ef2040f47d30c94eb5

  • Source code:

You can also lookup your tx with our explorer and api.

Requirements to be compatible with anyCall interfaces:

  1. Sender Contract: Your sender contract needs to call the method anyCall on the official anyCall contract.

  2. Receiver Contract: A method named anyExecute needs to exist on your _to contract address. This is needed because anyExec (Our deployed anyCall Contract) will call anyExecute on your receiver contract.

  3. Your contract needs to be payable to allow refund of excess fees.

anyCall Interfaces

anyCall (Called by Dapps)

function anyCall( address _to, bytes calldata _data, uint256 _toChainID, uint256 _flags, bytes calldata )

The destination chain would call anyExecute function on the _to address with _data passed in the function. And you can customize what you do with such _data.

Parameters

Param
Type
Description

_to

address

The target contract to interact with on _toChainID

_data

bytes

The calldata supplied for the interaction with _to

anyExecute will be run with this _data on the receiver contract you deployed.

_toChainID

uint256

The target chain id to interact with

_flags

uint256

How dapps are paying gas fee of tx execution:

0: Gas fee paid on source chain. Fallback not allowed.

2: Gas fee paid on destination chain. Fallback not allowed.

4: Gas fee paid on source chain. Allow fallback

6: Gas fee paid on destination chain. Allow fallback

anyExecute (This exact format needs to be implemented in your dapp, what would be called on the destination chain)

function anyExecute(bytes calldata data) external override onlyExecutor returns (bool success, bytes memory result)

Parameters

Param
Type
Description

data

bytes

The calldata supplied for the interaction with subsequent contracts

Returned Values

success

bool

The address to call on _fromChainID if the cross chain interaction fails

result

bytes

The originating chain id

AnyCallExecutor

As stated above, AnyCallExecutor will make the final execution to your destination contract as a sandbox.

The address of this executor contract is stored in the main anycall contract. It can be accessed with an interface function like below.

interface CallProxy{
 
    function executor() external view returns (address executor);
}

The executor should then be saved in your contract constructor

constructor(){
        anycallExecutor=CallProxy(anycallcontract).executor();
    }

https://github.com/anyswap/multichain-smart-contracts/tree/main/contracts/anycall/v7
API/Explorer