Skip to content

feat: DAO governance system — supply cap, mutable decimals, and Pausable for XCAD - #6

Draft
jgphilpott with Copilot wants to merge 1 commit into
masterfrom
copilot/upgrade-xcad-token-functionality
Draft

feat: DAO governance system — supply cap, mutable decimals, and Pausable for XCAD#6
jgphilpott with Copilot wants to merge 1 commit into
masterfrom
copilot/upgrade-xcad-token-functionality

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Adds a full on-chain DAO governance layer to the XCAD ecosystem. BITGOV holders propose and vote on parameter changes; passed proposals execute through a timelock before taking effect. XCAD's owner is now the timelock, so no single account can mint or change parameters unilaterally.

BITGOV — ERC20Votes

  • Added ERC20Votes + EIP712 to enable on-chain voting checkpoints
  • _update override resolves ERC20Capped × ERC20Votes conflict
  • Holders must call delegate(self) once to activate voting weight

XCAD — DAO-controlled parameters

  • supplyCap (uint256, 0 = uncapped) enforced in mint(); adjustable via setSupplyCap()
  • Mutable decimals via setDecimals(uint8) — cosmetic only, does not rescale stored balances
  • Pausable circuit-breaker (pause() / unpause()) blocks all _update calls (transfers, mints, burns)
  • All setters are onlyOwner (timelock in production)
  • Constructor gains a 4th initialSupplyCap arg (0 for uncapped)

New governance contracts

Contract Role
XCADTimelockController Owns XCAD; imposes mandatory delay before executing approved actions
XCADGovernor OZ Governor stack: GovernorSettings + GovernorCountingSimple + GovernorVotes + GovernorVotesQuorumFraction + GovernorTimelockControl

Example proposal to raise the supply cap:

// Encode the call
bytes memory calldata_ = abi.encodeCall(XCAD.setSupplyCap, (2_000_000 * 10**6));

// Full lifecycle
governor.propose([xcadAddr], [0], [calldata_], "Raise cap to 2M");
// ... voting delay ...
governor.castVote(proposalId, 1 /* For */);
// ... voting period ...
governor.queue([xcadAddr], [0], [calldata_], descriptionHash);
// ... timelock delay ...
governor.execute([xcadAddr], [0], [calldata_], descriptionHash);

Ignition module

ignition/modules/governance/XCADGovernor.ts deploys all four contracts in dependency order and configures PROPOSER_ROLE, CANCELLER_ROLE, and EXECUTOR_ROLE on the timelock. After deployment, the deployer should renounce DEFAULT_ADMIN_ROLE to make governance fully self-sovereign.

Optimizer

Enabled Solidity optimizer (runs: 200) in hardhat.config.tsXCADGovernor exceeds the 24 576-byte EVM limit without it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants