DOCUMENTATION

Governance Contracts

The smart contracts behind Onyx Chain governance — Governor, Timelock, Snapshot Registry, stXCN, and the Grant Treasury — with addresses and roles.

Documentation

Onyx Chain governance is implemented by a small set of purpose-built smart contracts deployed on Onyx Mainnet (chain ID 327). Each contract has one job, and no single party — including the team — can bypass the chain of checks they enforce together.

Architecture

  1. 01Staker / Voter (Onyx App or direct call)
  2. 02Governor OnyxGovernorV2
  3. 03Timelock OnyxTimelockV2
  4. 04Grant Treasury and other governed contracts
  5. 05stXCN StakedXCNDirect
  6. 06Snapshot Registry StXCNSnapshotRegistryV2
  7. 07Snapshot publisher
  8. 08Independent challenger
  9. 09Guardian

The flow of authority is one-directional: stakers' balances feed snapshots, snapshots authorize proposals and votes in the Governor, the Governor commands the Timelock, and only the Timelock touches governed contracts.

Contract addresses (Onyx Mainnet, chain ID 327)

ContractAddress
Governor (OnyxGovernorV2)0xd6fA6779224deD996D8a7d04ba51Dc4769b08280
Timelock (OnyxTimelockV2)0xFC6a91f52dF6e3a8E0bB547de4265D71BD3feCA4
Snapshot Registry (StXCNSnapshotRegistryV2)0xB14461828f3b55edf1B82020724dF7560117dB88
stXCN (StakedXCNDirect)0xA553a603e2f84fEa6c1fc225E0945FE176C72F74
Grant Treasury0xB592E16d6A7EF093Aa77843E1cB7BB287584f17a
Wrapped XCN (WXCN, Treasury grant asset)0x1a0Da75ADf091a69E7285e596bB27218D77E17a9

The contracts

Governor

The Governor (OnyxGovernorV2) is the heart of the system — it is where proposals are created, voted on, and driven through their lifecycle. It is built on the industry-standard OpenZeppelin Governor framework, extended with proof-based eligibility:

  • Proof-bound proposing. proposeWithProof requires the proposer to attach a Merkle proof of their snapshot weight; the Governor checks it against the latest finalized eligibility snapshot in the Registry and enforces the proposal threshold (currently 100,000,000 staked XCN).
  • Proof-bound voting. The only accepted vote path carries the voter's weight and Merkle proof; the Governor verifies every vote against the proposal's finalized snapshot root. A vote without a valid proof counts as zero.
  • For-only quorum. Quorum (currently 200,000,000) is satisfied by For votes alone; passage additionally requires For > Against.
  • Fixed timing. Voting delay (1 day) and voting period (2 days) are compiled into the contract — they cannot be quietly changed by an operator. The threshold and quorum rates can be adjusted only within hard-coded bounds, and only by governance itself.

Onyx Chain Timelock

The Timelock (OnyxTimelockV2) is the executor and the safety buffer. When a proposal succeeds, the Governor queues its actions here, where they must wait a mandatory 2 days before execution:

  • The Timelock — not the Governor, not any admin — is the owner of governed contracts. A governed contract only changes when the Timelock executes an approved proposal.
  • The Governor is the only address allowed to queue operations (proposer role).
  • The guardian holds a cancel right on the Timelock, so a malicious proposal that slipped through a vote can still be stopped during the 2-day delay — but the guardian can never create or fast-track anything.

stXCN Snapshot Registry

The Snapshot Registry (StXCNSnapshotRegistryV2) is the on-chain home of voting-power snapshots. It stores each published Merkle root with its full metadata (snapshot block, eligible supply, policy version) and enforces the root lifecycle:

  • Post → challenge (1 day) → finalize. Only roots that survive the challenge window become usable for governance.
  • Strict role separation. The publisher, challenger, and guardian are required to be distinct parties — the contract itself rejects a configuration where one address holds two of these roles.
  • Fail-closed verification. The Governor's proof checks revert on an unfinalized root, a wrong-purpose root, a mismatched policy, or a paused registry. There is no fallback path that skips verification.

stXCN (StakedXCNDirect)

stXCN is the liquid staking token you receive for staking XCN — and the sole source of voting power on Onyx Chain. It is a rebasing token: your balance grows as staking rewards accrue, and governance snapshots measure that grown balance. stXCN itself is documented in Staking and stXCN.

Grant Treasury

The Grant Treasury is the first contract governed end-to-end by Onyx Chain governance. It holds WXCN and exposes exactly one privileged function — paying out a grant to a recipient — callable only by its owner, the Timelock. In other words:

The only way funds leave the Grant Treasury is a full OIP: proposal → vote → quorum → 2-day timelock → execution.

This makes community grant funding a pure governance decision, with every step publicly visible and verifiable on the explorer.

Operational roles

RoleWhat it can doWhat it cannot do
PublisherPost new snapshot roots to the RegistryFinalize its own root early, vote, or execute anything
ChallengerDispute an incorrect root during the 1-day windowPost roots or interfere with correct ones
GuardianVeto a bad root; cancel a malicious proposal during the timelock delayCreate, fast-track, or execute proposals; move funds
Governor (contract)Queue approved proposals into the TimelockExecute anything without the 2-day delay
Timelock (contract)Execute approved proposals after the delayAct without an approved, queued proposal