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. MCS Guides
  4. How To Use

How To On Evm Chains

PreviousHow To UseNextHow To On Near Protocol

Last updated 2 years ago

Was this helpful?

Build

git clone https://github.com/mapprotocol/map-contracts.git
cd map-contracts/mcs/evmv2/
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 Fee Center and Token Register

npx hardhat deploy --tags TokenRegister --network <network>
  1. Deploy MOS Relay

npx hardhat relayDeploy --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. Init MOS Relay

npx hardhat relayInit  --tokenmanager <token register address> --network <network>
  1. sets fee distribution

npx hardhat managerSetDistributeRate --type <0 to the token vault, 1 to specified receiver> --address <fee receiver address> --rate <rate 0-1000000, uni 0.000001> --network <network>

MOS on EVM Chains

  1. Deploy

npx hardhat mosDeploy --wrapped <native wrapped address> --lightnode <lightnode address> --network <network>
  1. Set MOS Relay Address The following command on the EVM compatible chain

npx hardhat mosSetRelay --relay <Relay address> --chain <map chainId> --network <network>
  1. Register The following command applies to the cross-chain contract configuration of Map mainnet and Makalu testnet

npx hardhat relayRegisterChain --address <MAPOmnichainService address> --chain <chain id> --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 MAPOmnichainServiceV2Up --network <network>

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

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