# Mainnet Deployment Guide

Once your contract has been thoroughly tested and audited as per [Review and Audit Guide](/developers/review-and-audit-guide.md), 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](https://gitlab.com/thorchain/rujira/-/blob/main/RELEASES.md) 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. Create a thor address as a [multisig](/developers/setting-up-a-thorchain-multisig.md), if you haven't already
2. Submit a Merge Request on [THORNode](https://gitlab.com/thorchain/thornode/-/tree/develop) that whitelists the thor address in [wasm\_permissions\_mainnet.go](https://gitlab.com/thorchain/thornode/-/blob/develop/common/wasmpermissions/wasm_permissions_mainnet.go) to **instantiate** your contract(s)
3. 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](https://daodao.zone/dao/thor1pnad3hhgktqde00jl6wvyuuspatle000wl9pehgqxmehl7974e4szc4zpn/proposals) using DAO DAO. The Rujira Core team will do a final review before storing contract code generating checksum
4. Instantiate contract from the thor address provided in step (2)
5. Wrap up the deployment process by providing the Rujira Core team with the release information to be added to [Releases & Contracts](/resources/releases-and-contracts.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.rujira.network/developers/mainnet-deployment-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
