MAPO Developer Docs
LearnDevelopRunWhitePaperBRC-201
English
English
  • Overview
  • Learn
    • About MAP Protocol
      • Background
      • Introduction of MAP Protocol
      • History of MAP Protocol
    • Comparison with other cross-chain models
      • MAP Protocol vs Cosmos & Polkadot
      • MAP vs other cross-chain solutions without relay chain
    • Technical Mechanism
      • MAP Protocol's Technical Mechanism
      • Three-layer Architecture
      • MAP Protocol Layer
        • Concept
        • Isomorphism with All Chains
        • Verification & Maintenance Network
      • MAP Omnichain Service (MOS) Layer
      • MAPO Application Layer
      • Peer-to-Peer Cross-chain Technology with ZK-enabled Light Clients
      • Interact with Bitcoin
    • Gas Fee Model
    • DAO
    • Construction of MAP Protocol
      • Developers
      • Validators
      • Maintainers
      • Messengers
      • Liquidity providers
      • End users
    • Tokenomics
    • Purchase $MAP
  • Develop
    • MAP Relay Chain
      • Getting Started
        • Build
        • Make Private Chain
        • How To Vote
        • How To Withdraw
        • Integrate an Exchange
        • Integrate MAP Relay Chain with EVM-Compatible Chains
      • Consensus
        • Overview
        • Proof-of-Stake
        • Validator
          • Validator
          • Locked MAP
        • Election
        • Rewards
        • Aggregated Seal
      • Contracts
        • Precompiled Contracts
        • Genesis Contracts
          • ABI
            • AccountsABI
            • ElectionABI
            • EpochRewardsABI
            • LockedGoldABI
            • ValidatorsABI
          • Deploy
      • Marker
        • Genesis
        • Validator
        • Vote
        • ContractOwner
        • Common
      • Account-Abstraction
    • Light Client
      • Verification based on Light Client
      • MAPO Light Client
        • EVM Chains
        • Near
      • Light Clients
        • Client Manager
        • BNB Smart Chain
        • Near Protocol
        • Polygon(Matic)
        • Ethereum 2.0
        • Klaytn
        • Conflux)
      • Maintainer
    • MAP Omnichain Service (MOS)
      • MOS Message Guides
        • How It Works
        • How To Use
        • EVM Chains Contract
      • MCS Guides
        • How It Works
        • How To Use
          • How To On Evm Chains
          • How To On Near Protocol
        • Relay Chain Contract
        • EVM Chains Contract
        • Near Protocol Contract
      • Messenger
      • API
    • OmniChain Examples
      • OmniApp
      • OmniDictionary
    • API & SDK
      • Butter SDK
      • Atlas JSON RPC
      • Atlas Consensus API
      • MAP Scan API
    • Connected Chains and Corresponding Addresses
  • Run
    • How To Become A New Validator
    • How To Become A New Validator[advanced]
    • Withdraw
Powered by GitBook
On this page
  • Contract Address
  • contract interface
  • User Interface
  • transferOutToken
  • transferOutNative
  • depositToken
  • depositNative
  • withdraw
  • Messenger Interface
  • transferIn
  • depositIn
  • Data structure

Was this helpful?

  1. Develop
  2. MAP Omnichain Service (MOS)
  3. MCS Guides

Relay Chain Contract

PreviousHow To On Near ProtocolNextEVM Chains Contract

Last updated 2 years ago

Was this helpful?

Contract Address

contract interface

interface RelayChainContract {
    
	function transferOutToken(address _token, bytes memory _to, uint256 _amount, uint256 _toChain) external;
    
    function transferOutNative(bytes memory _to, uint _toChain) external;
    
    function depositToken(address _token, address _to, uint _amount) external;
    
    function depositNative(address _to) external;
    
    function transferIn(uint256 _chainId, bytes memory _receiptProof) external;

    function withdraw(address _vaultToken, uint256 _vaultAmount) external;

}

User Interface

transferOutToken

Cross-chain transfer of tokens

function

function transferOutToken(address _token, bytes memory _to, uint256 _amount, uint256 _toChain) external

parameters

parameter
type
comment

_token

address

Token address to transfer tokens from

_to

bytes

The destination chain receiving address of the token to be transferred out

_amount

uint256

Amount of tokens to be transferred

_toChain

uint256

Target chain id to transfer out

transferOutNative

Cross-chain transfer out of the native token

function

function transferOutNative(bytes memory _to, uint256 _toChain) external

parameters

parameter
type
comment

_to

bytes

The destination chain receiving address of the token to be transferred out

_toChain

uint256

Target chain id to transfer out

depositToken

The deposit tokens are in the chain

function

function depositToken(address _token, address _to, uint _amount) external

parameters

parameter
type
comment

_token

address

Token address to transfer tokens from

_to

address

The destination chain receiving address of the token to be deposited out

_amount

uint

Amount of tokens to be deposited

depositNative

The deposit native tokens are in the chain

function

function depositNative(address _to) external

parameters

parameter
type
comment

_to

address

The destination chain receiving address of the token to be transferred out

withdraw

Withdraw staked tokens and earnings

function

function withdraw(address _vaultToken, uint256 _vaultAmount) external

parameters

parameter
type
comment

_vaultToken

address

valut token address

_vaultAmount

uint256

Amount of tokens withdraw

Messenger Interface

transferIn

Perform cross-chain transfer

function

function transferIn(uint256 _chainId, bytes memory _receiptProof) external

parameters

parameter
type
comment

_chainId

uint256

source chain id

_receiptProof

bytes

source chain transfer proof

depositIn

Perform cross-chain deposit

function

function depositIn(uint256 _chainId, bytes memory _receiptProof) external

parameters

parameter
type
comment

_chainId

uint256

source chain id

_receiptProof

bytes

source chain depsoit proof

Data structure

ReceiptProof includes the proof and the receipt to prove.


struct receiptProof {

    // the block header where the receipt exists
    blockHeader header;
    // This is the structure that contains the transaction log
    TxReceipt txReceipt;
    // the index of the receipt in the block
    bytes keyIndex;
    // the proof to prove the existance of the above receipt
    bytes[] proof;

}
Here to get MAPO mainnet and testnet MCS contract address.
MOSRelay