Mainnet Deployment Guide
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 registry 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:
Registry check: The registry will verify that the deployer is allowed to instantiate a specific contract version, using the contract’s computed checksum.
MsgStoreCore: If the checksum matches the registry entry, the deployer will be granted permission to store the contract on-chain.
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
Create a thor address as a multisig, if you haven't already
Submit a Merge Request on THORNode that whitelists the thor address in wasm_permissions_mainnet.go to instantiate your contract(s)
Reach out to the Rujira Core team (e.g. in a group chat on Telegram or Discord) to make a proposal to store contract code via the Rujira Deployment Multisig using DAO DAO. The Rujira Core team will do a final review before storing contract code generating checksum
Instantiate contract from the thor address provided in step (2)
Wrap up the deployment process by providing the Rujira Core team with the release information to be added to Releases & Contracts
Last updated