LogoLogo
  • Introduction
  • Understanding Rujira History
    • Rujira & Kujira
    • Rujira & THORChain
    • Rujira & Levana
  • Understanding RUJI Token
  • HOW IT WORKS
    • Understanding the App Layer
    • Understanding Secured Assets
    • Understanding App Layer Security
    • Frequently Asked Questions
  • Developers
    • Getting Started
      • API & RPC Endpoints
      • Licenses
    • Development Process
    • Local Deployment Guide
    • Stagenet Deployment Guide
    • Review and Audit Guide
    • Setting Up a THORChain Multisig
    • Mainnet Deployment Guide
  • Products
    • RUJI Trade
    • RUJI Pools
      • Base Layer Arbitrage Strategy
    • RUJI Perps
      • Position size versus locked collateral
    • RUJI Lending
    • RUJI Liquidations
    • RUJI Launchpad
    • RUJI Options
    • RUJI Collections (Gojira)
  • Strategies
  • Resources
    • Branding
    • Audits
    • Discord (for Devs)
Powered by GitBook
On this page
  • Registry and Permissions
  • Deployment Steps
Export as PDF
  1. Developers

Mainnet Deployment Guide

PreviousSetting Up a THORChain MultisigNextRUJI Trade

Last updated 12 days ago

Once your contract has been thoroughly tested and audited as per Review and Audit Guide, it’s time to deploy it to THORChain mainnet to be live officially on Rujira. This process involves additional security checks and permissions to ensure the integrity of the contract on the network.

Registry and Permissions

For mainnet, Rujira maintains an on-chain that maps each contract’s checksum to its deployer. This registry will grant permissions for instantiation based on the contract’s checksum rather than its code ID. The process will involve:

  1. Registry check: The registry will verify that the deployer is allowed to instantiate a specific contract version, using the contract’s computed checksum.

  2. MsgStoreCore: If the checksum matches the registry entry, the deployer will be granted permission to store the contract on-chain.

  3. MsgInstantiateContract: Once the contract is stored, the deployer can instantiate it with the appropriate parameters.

By tying instantiation permissions to the contract checksum, THORChain node operators and hence the Rujira App Layer ensure that only approved contract versions can be deployed on mainnet, improving security and reliability.

Deployment Steps

  1. Submits a Merge Request to THORNode to whitelist { checksum, deployer } on mainnet

    1. Ensure your contract checksum matches the registry and ties to the final audit report.

    2. Ensure that your deployer address matches the team multisig address from step 6.

    3. Hans will do a final code review and guide through the Merge Request (one MR every Base Layer upgrade).

  2. The Merge Request will be reviewed and must be approved by 2 authorized reviewers from 9R and ThorSec before included in the next THORChain version upgrade.

  3. 2/3 of Node Operators must upgrade to the new THORChain version to allow you to deploy the contracts.

  4. Submit MsgStoreCore with the correct checksum to store your contract. Example:

thornode tx wasm store ./artifacts/my_contract.wasm --from deployer-account

  1. Use MsgInstantiateContract to deploy your contract instance on mainnet.

thornode tx wasm instantiate 100 '{"some_init": "msg"} --from deployer-account

registry