ποΈ 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
andgetUsersByRole
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, andCANCELLER_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:
- Admin (0): The highest authority for managing core functionalities, including setting public capabilities, role assignments, and contract upgrades.
- Bitcorn Minter (1): Authorized to mint BTCN tokens.
- Bitcorn Minter with mintTo (2): Additional authority to mint BTCN to any address.
- Bitcorn Burner (3): Permitted to burn BTCN tokens.
- Pauser (5): Can pause operations in designated contracts.
- Unpauser (6): Enables the resumption of paused contract functions.
- 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 ID | Role Description | Actors |
---|---|---|
0 | Admin | Security Timelock |
1 | Bitcorn Minter | Corn Silo, Corn Private Silo |
2 | Bitcorn Minter with mintTo | No specific actor assigned |
3 | Bitcorn Burner | Corn Silo, Corn Private Silo |
5 | Pauser | Corn Deployer, Corn Security Multisig, Corn TechOps Multisig |
6 | Unpauser | Corn Security Multisig, Corn TechOps Multisig |
7 | Silo addApprovedToken | Corn 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:
Role | Role Admin | Member |
---|---|---|
TIMELOCK_ADMIN_ROLE | TIMELOCK_ADMIN_ROLE | Security Timelock |
PROPOSER_ROLE | TIMELOCK_ADMIN_ROLE | Corn TechOps Multisig, Corn Security Multisig |
CANCELLER_ROLE | TIMELOCK_ADMIN_ROLE | Corn Security Multisig |
EXECUTOR_ROLE | TIMELOCK_ADMIN_ROLE | Corn Security Multisig |
L2 Governance Architecture Overviewβ
Under construction
Corn Rollup Governance Architecture Overviewβ
Under construction