Skip to main content

πŸ›οΈ Governance

L1 Governance Architecture Overview​

Corn employs a layered governance system using two core contracts: the Governor for role management and the TimelockControllerEnumerable for secure action scheduling. The Governor contract operates on the Solmate RolesAuthority framework, enhancing flexibility and readability, while the Timelock contract enforces a timelock on critical actions, ensuring that all governance decisions are secure and accountable.

Governor Contract​

The Governor contract builds on the Solmate RolesAuthority model, providing a robust structure for managing permissions and roles across multiple contracts.

  • Role Management: Each role is assigned a unique roleId, and roles can be customized with human-readable names. Roles include functions such as minting, burning, pausing, and unpausing.
  • Permission Assignment: Permissions are dynamically assigned to addresses by roles, simplifying permissions for various contracts and functions.
  • Role-Based Access: The Governor maintains mappings that assign users to specific roles, which are then referenced in authorization checks across contracts.
  • Burnable Permissions: Permissions can be permanently removed to enforce immutability where required.
  • Convenience Reader Functions: Functions like getRolesForUser and getUsersByRole support off-chain querying for easy monitoring of permissions and user roles.

Smart Contract Reference: Governor Implementation

TimelockControllerEnumerable Contract​

The TimelockControllerEnumerable contract builds upon the OpenZeppelin TimelockController with AccessControlEnumerable extensions. This contract enforces a delay for governance actions to add security to critical functions.

  • Delay Mechanism: Any action assigned to a timelocked function is scheduled and then delayed by a minimum duration. This allows the community to review and, if necessary, object before execution.
  • Roles for Scheduling and Execution: It defines distinct roles: PROPOSER_ROLE for scheduling, EXECUTOR_ROLE for execution, and CANCELLER_ROLE for canceling operations.
  • Batch Execution: Actions can be executed in batches, allowing multiple operations within a single transaction for efficiency.
  • Self-Governance: The Timelock is self-administered, meaning adjustments to the minimum delay and other critical settings must go through the timelock process.

Smart Contract Reference: Timelock Implementation

Role-Based Permission System​

Corn’s governance model is organized into seven distinct roles, managed centrally by the Governor contract:

  1. Admin (0): The highest authority for managing core functionalities, including setting public capabilities, role assignments, and contract upgrades.
  2. Bitcorn Minter (1): Authorized to mint BTCN tokens.
  3. Bitcorn Minter with mintTo (2): Additional authority to mint BTCN to any address.
  4. Bitcorn Burner (3): Permitted to burn BTCN tokens.
  5. Pauser (5): Can pause operations in designated contracts.
  6. Unpauser (6): Enables the resumption of paused contract functions.
  7. Silo addApprovedToken (7): Authorizes new tokens for Corn Silo operations, essential for managing asset flexibility.

Here’s a table showing the actors assigned to each role in Corn’s governance system within the Ethereum Mainnet:

Role IDRole DescriptionActors
0AdminSecurity Timelock
1Bitcorn MinterCorn Silo, Corn Private Silo
2Bitcorn Minter with mintToNo specific actor assigned
3Bitcorn BurnerCorn Silo, Corn Private Silo
5PauserCorn Deployer, Corn Security Multisig, Corn TechOps Multisig
6UnpauserCorn Security Multisig, Corn TechOps Multisig
7Silo addApprovedTokenCorn Security Multisig, Corn TechOps Multisig

Security Timelock Configuration​

The Security Timelock ensures controlled access to key functions with a delay of 2 days, allowing sufficient time for oversight. Below is the configuration detailing roles, administrators, and addresses assigned:

RoleRole AdminMember
TIMELOCK_ADMIN_ROLETIMELOCK_ADMIN_ROLESecurity Timelock
PROPOSER_ROLETIMELOCK_ADMIN_ROLECorn TechOps Multisig, Corn Security Multisig
CANCELLER_ROLETIMELOCK_ADMIN_ROLECorn Security Multisig
EXECUTOR_ROLETIMELOCK_ADMIN_ROLECorn Security Multisig

L2 Governance Architecture Overview​

Under construction

Corn Rollup Governance Architecture Overview​

Under construction

Corn Badger