How To Use

Build and Deploy

Build and deploy on EVM chains

Build and deploy on Near Protocol

Register chain

Register EVM Chain

  1. Set relay contract on EVM Chains

    npx hardhat mosSetRelay --relay <Relay address> --chain <map chainId> --network <network>
  2. register in relay contract

    npx hardhat relayRegisterChain --address <MOS address> --chain <chain id> --network <network>

Register Near

npx hardhat relayRegisterChain --address <MOS address> --chain <near chain id> --type 2 --network <network>

NOTE: Near Protocol testnet chain id 5566818579631833089, mainnet chain id 5566818579631833088

Register token

  1. Deploy vault token on relay chain Every token has a vault token. The vault token will distribute to the users that provide cross-chain liquidity. The mos relay contract is manager of all vault tokens.

  2. Register token on relay chain

  3. Set fee ratio on relay chain

Add Cross-chain Token

  1. Relay Chain Bind the token mapping relationship between the two chains that requires cross-chain

  2. Relay Chain sets the token cross-chain fee ratio

  3. Altchain sets token mintable

    NOTE: If set the token mintable, the token must grant the minter role to mos contract.

  4. Altchain sets bridge token

Token cross-chain transfer and deposit

  1. token transfer

  2. token depsit

    Note that the --token parameter is optional, if not set, it means to transfer out Native Token. Similarly --address is also an optional parameter. If it is not filled in, it will be the default caller's address.

  3. transfer native token to other chain:

  4. transfer native token to sender's address:

List token mapped chain

  1. relay chain

  2. altchains

Last updated

Was this helpful?