MAPO Developer Docs
  • MAPO Developer Docs
  • Base
    • MAPO Introduction
    • MAPO token
    • Omnichain DAPP
    • Differences Between Omnichain Applications and Single or Multi-Chain Applications
    • Differences Between Third-Party Trusted Cross-Chain and Peer-to-Peer Cross-Chain Solutions
    • BTC layer2
      • brc-201
    • Oracle
      • Supra: Decentralized Oracle on MAP Protocol
    • Account
    • Transactions
    • block
    • MPT tree
    • RLP
    • Gas fee
    • Cross Chain Message
    • light client
      • MAPO light client
    • MOS
      • MOS interface and functions
      • deploy MOS
      • Messenger
    • map-relay-chain(atlas)
      • atlas architecture
        • atlas architecture
        • atlas genesis
          • genesis config
          • genesis contract
            • ABI
              • Accounts
              • Election
              • EpochRewards
              • LockedGold
              • Validators
            • address
            • deploy
        • precompile-contract
        • protocol
          • Proof of Stake
          • consensus
          • election
          • rewards
          • governance
      • deploy atlas
        • run atlas
        • run atlas(archive)
        • run atlas(bootnodes)
        • run atlas(validator)
        • run atlas(RPC)
      • Marker tool
        • Genesis
        • Validator
        • Vote
        • Common
      • make private network(atlas)
      • public service
        • public network
      • example
        • how-to-vote
        • how-to-withdraw
        • how-to-become-a-new-validator
        • how-to-become-a-new-validator(advanced)
    • Compass(maintainer,messenger)
      • Compass - arch and model
      • Compass - config
      • Compass - deploy
      • Compass secondary development - define your own routing service based on compass
  • MAPO Stack
    • stack
      • Connected Chains and Corresponding Addresses
    • Compatible-EVM
      • Smart Contracts Language
      • Smart Contracts Anatomy
      • Smart Contracts Libraries
      • Smart Contracts Compile
      • Smart Contracts Testing
      • Smart Contracts Deploy
      • Smart Contracts Composability
      • Smart Contracts Security
      • Formal-Verification
      • Frameworks
      • dev-network
    • MAPO Implement Cross-chain Interoperability
      • integration of MAP with EVM-Compatible Chains
        • light client verify
        • light client update state
        • MOS
      • integration of MAP with TON Network
      • integration of MAP with Non-EVM-Compatible Chains
        • light client verify
        • light client update state
        • MOS
    • How to develop cross-chain applications
    • light client address
    • SDK/API
      • MOS interface
      • Light client interface
      • Atlas RPC
        • json-rpc
          • atlas json rpc
          • atlas consensus rpc
        • javaScript sdk
        • go-sdk
      • Backend API
        • SCAN API
  • Zero-Knowledge Proof
    • zk proof
Powered by GitBook
On this page
  • Find the right repository
  • Deploy contracts
  • Deploy MosRelay contract
  • MOS on EVM chains
  • Upgrade MOS or MosRelay contracts
  1. Base
  2. MOS

deploy MOS

Find the right repository

git clone https://github.com/mapprotocol/mapo-service-contracts.git

cd /mapo-service-contracts/evm/

npm install

Configure the .env file

* PRIVATE_KEY - deploy address private key
* INFURA_KEY - infura key to use prcs
* MOS_SALT - salt for deploying mos
* FEE_SALT - salt for deploying feeService
* DEPLOY_FACTORY - Mapo's deployment factory contract address 0x6258e4d2950757A749a4d4683A7342261ce12471 (supports most common evm chains like bsc polygon eth mainnet testnets)

Deploy contracts

Deploy MosRelay contract

The following steps help deploy the MOS relay contract on the Map mainnet or Makalu testnet

  1. Deploy mosRelay

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

  • lightNodeManager addressis the light client manager address deployed on MAP mainnet or MAP Makalu.

  1. Deploy FeeService contract

npx hardhat feeFactoryDeploy --network <network>
  1. MosRelay sets FeeService

npx hardhat setFeeService  --address <feeService address> --network <network>
  1. MosRelay registers other mos addresses

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 contract on other EVM chains

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

npx hardhat feeFactoryDeploy --network <network>
  1. Set MosRelay in deploying mos contract

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

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

Upgrade MOS or MosRelay contracts

When upgrading the mos contract with the following command.

Please execute the following command on EVM compatible chains

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

Please execute the following command on the Map Relay chain mainnet or Makalu testnet

npx hardhat deploy --tags MapoServiceRelayV3Up --network <network>
PreviousMOS interface and functionsNextMessenger

Last updated 11 months ago