DOCUMENTATION

Deploying Contracts

Deploy and verify Solidity contracts on Onyx Mainnet.

Documentation

Use ordinary Solidity tooling with Chain ID 327. Estimate gas and read the current gas price instead of pinning values copied from another network.

javascript

import "dotenv/config";
import { JsonRpcProvider, Wallet, ContractFactory } from "ethers";
import artifact from "./artifacts/Example.json" with { type: "json" };

const provider = new JsonRpcProvider("https://rpc.onyx.org", 327);
const signer = new Wallet(process.env.DEPLOYER_PRIVATE_KEY, provider);
const factory = new ContractFactory(artifact.abi, artifact.bytecode, signer);
const contract = await factory.deploy();
await contract.waitForDeployment();
console.log(await contract.getAddress());

Keep private keys out of source code and shell history. After deployment, confirm eth_getCode is non-empty and verify the source through Onyx Scan.

Onyx follows EVM execution semantics but is not required to expose every Ethereum client-specific debug or tracing extension. Test the exact RPC methods your deployment and verification pipeline needs before Mainnet use.