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
  • Build
  • Test
  • Deploy
  • MOS Relay
  • MOS on EVM Chains
  • Upgrade

Was this helpful?

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

How To Use

PreviousHow It WorksNextEVM Chains Contract

Last updated 1 year ago

Was this helpful?

Build

git clone https://github.com/mapprotocol/mapo-service-contracts.git
cd /mapo-service-contracts/evm/
npm install

Test

npx hardhat test

Deploy

MOS Relay

The following steps help to deploy MOS relay contracts on Map mainnet or Makalu testnet

  1. Deploy MOS Relay

npx hardhat relayFactoryDeploy --wrapped <wrapped token> --lightnode <lightNodeManager address> --network <network>
  • wrapped token is wrapped MAP token address on MAP mainnet or MAP Makalu.

  • lightNodeManager address is the light client mananger address deployed on MAP mainnet or MAP Makalu. See for more information.

  1. Deploy FeeService

npx hardhat feeFactoryDeploy --network <network>
  1. MOS Relay set FeeService

npx hardhat setFeeService  --address <feeService address> --network <network>
  1. MOS Relay register chain

npx hardhat relayRegisterChain --address <mos contract address> --chain <mos chain id> --type <optional default evm value is 1> --network <network>

MOS on EVM Chains

  1. Deploy MOS

npx hardhat mosFactoryDeploy --wrapped <native wrapped address> --lightnode <lightnode address> --network <network>
  1. Deploy FeeService

npx hardhat feeFactoryDeploy --network <network>
  1. Set MOS Relay Address The following command on the EVM compatible chain

npx hardhat mosFactoryDeploy --relay <Relay address> --chain <map chainId> --network <network>
  1. MOS set FeeService

npx hardhat setFeeService  --address <feeService address> --network <network>

Upgrade

When upgrade the mos contract through the following commands.

Please execute the following command on the EVM compatible chain

npx hardhat deploy --tags MapoServiceV3Up --network <network>

Please execute the following command on relay chain mainnet or Makalu testnet

npx hardhat deploy --tags MapoServiceRelayV3Up --network <network>
here