Mainnet Deployment Guide
Last updated
Last updated
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.
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:
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.
Submits a Merge Request to THORNode to whitelist { checksum, deployer } on mainnet
Ensure your contract checksum matches the registry and ties to the final audit report.
Ensure that your deployer address matches the team multisig address from step 6.
Hans will do a final code review and guide through the Merge Request (one MR every Base Layer upgrade).
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.
2/3 of Node Operators must upgrade to the new THORChain version to allow you to deploy the contracts.
Submit MsgStoreCore with the correct checksum to store your contract. Example:
thornode tx wasm store ./artifacts/my_contract.wasm --from deployer-account
Use MsgInstantiateContract to deploy your contract instance on mainnet.
thornode tx wasm instantiate 100 '{"some_init": "msg"} --from deployer-account