MAPO Developer Docs
LearnDevelopRunWhitePaperBRC-201
繁體中文
繁體中文
  • 概述
  • 學習
    • 關於 MAP 協議
      • 背景
      • 介紹 MAP 協議
      • MAP 協議的發展歷程
    • 與其他跨鏈模型進行比較
      • MAP 協議與Cosmos& Pokadot
      • MAP vs. 其他無中繼鏈的跨鏈解決方案
    • 技術機制
      • MAP協議'的技術機制
      • 三層結構
      • MAP協議層
      • MAP中繼鏈
        • 概念
        • 與所有鏈的同構性
        • 驗證& 維護網絡
      • MAPO服務(MOS)層
      • MAPO應用層
      • ZK 支持下的輕節點
    • 燃氣費收費模式
    • DAO
    • MAP協議的構建
      • 開發者
      • 驗證者
      • 維護者
      • 信使
      • 流動資金提供者
      • 終端用戶
    • Tokenomics
    • 購買$MAP
  • 開發
    • MAP Relay Chain
      • 入門
        • 構建
        • 製作私有鏈
        • 如何投票
        • 如何取出質押
        • 集成到交易所
        • EVM 兼容鏈接入MAP 中繼鏈
      • 共識
        • 概述
        • Proof-of-Stake
        • 驗證器
          • 驗證器
          • 鎖定的MAP
        • 選舉
        • 獎勵
        • 聚合印章
      • 合約
        • 預編譯合約
        • 創世紀合約
          • ABI
            • AccountsABI
            • ElectionABI
            • EpochRewardsABI
            • LockedGoldABI
            • ValidatorsABI
          • Deploy
      • Marker
        • Genesis
        • 驗證器
        • Vote
        • ContractOwner
        • Common
    • 輕型客戶端
      • 基於輕型客戶端的驗證
      • MAPO輕型客戶端
        • EVM鏈
        • Near
      • 輕客戶端
        • 客戶端管理器
        • BNB 鏈
        • NEAR 協議
        • Polygon(Matic)
        • Ethereum 2.0
        • 維護者
    • MOS 全鏈服務
      • MOS消息指南
        • How It Works
      • MOS 指南
        • 運行原理
        • 如何使用
          • 在Evm鏈的方法
          • 在NEAR協議上
        • 中繼鏈合約
        • EVM鏈合約
        • NEAR 協議合約
      • 信使
      • API
    • OmniChain實例
      • Omni App
      • OmniDictionary
    • API & SDK
      • Butter SDK
      • Atlas JSON RPC
      • Atlas Consensus API
      • MAP掃描API
    • 最新接鏈進展以及對應地址
  • 運行
    • 如何成爲一個新的驗證者
    • 如何成爲一個新的驗證者[進階版]
    • 取出或撤回
Powered by GitBook
On this page
  • Contract Address
  • contract interface
  • User Interface
  • transferOutToken
  • transferOutNative
  • depositToken
  • depositNative
  • 取出
  • 信使界面
  • transferIn
  • 數據結構

Was this helpful?

  1. 開發
  2. MOS 全鏈服務
  3. MOS 指南

中繼鏈合約

Previous在NEAR協議上NextEVM鏈合約

Last updated 1 year 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

參數

參數
類型
備註

_token

address

轉移代幣的代幣地

_to

bytes

轉出代幣的目的鏈接收地址

_amount

uint256

要轉移的代幣數量

_toChain

uint256

轉出的目標鏈id

transferOutNative

跨鏈轉出原生代幣

功能

function transferOutNative(bytes memory _to, uint256 _toChain) external

參數

參數
類型
備註

_to

bytes

待轉token的目的鏈接收地址

_toChain

uint256

轉出的目標鏈id

depositToken

存款代幣在鏈上

功能

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

參數

參數
類型
備註

_token

address

可以從中轉移代幣的地址

_to

address

待存入代幣的目的鏈接收地址

_amount

uint

要存入的代幣數量

depositNative

存款原生代幣在鏈上

功能

功能 depositNative(address _to) external

參數

參數
類型
備註

_to

address

待轉出代幣的目的鏈接收地址

取出

取出質押代幣及收入

功能

功能 withdraw(address _vaultToken, uint256 _vaultAmount) external

參數

參數
類型
備註

_vaultToken

address

valut 代幣地址

_vaultAmount

uint256

代幣取出數量

信使界面

transferIn

執行跨鏈傳輸

功能

功能 transferIn(uint256 _chainId, bytes memory _receiptProof) external

參數

參數
類型
備註

_chainId

uint256

起源鏈 id

_receiptProof

bytes

起源鏈轉出證明

### depositIn

執行跨鏈傳輸

功能

功能 depositIn(uint256 _chainId, bytes memory _receiptProof) external

參數

參數
類型
備註

_chainId

uint256

起源鏈 id

_receiptProof

bytes

起源鏈轉出證明

數據結構

ReceiptProof包括證明和收據證明。


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