Propose
Proposes changes to Onyx through onchain proposals.
The propose function allows eligible stakeholders to create governance proposals that can introduce changes to Onyx. Proposals may include modifications to the staking interest rate model, risk parameters within the protocol, or other governance-directed alterations to protocol parameters.
Once a proposal is submitted, it enters the voting phase, where token holders can vote for or against the proposed changes. If the proposal meets the required quorum and is approved, it is queued and executed via the Onyx Timelock contract after the predefined waiting period.
Proposal Submission Requirements
The proposer must hold more XCN than the current proposal threshold (
proposalThreshold()
) as of the immediately preceding block.The proposer cannot create a new proposal if they already have an active or pending proposal.
Due to Timelock restrictions, a proposal cannot contain duplicate actions within the same block.
Identical actions across different proposals must be queued in separate blocks to avoid execution conflicts.
Function Implementation in CHNGovernance
CHNGovernance
Function Signature:
Parameters
targets
: An ordered array of target addresses for function calls that will be executed upon proposal approval.values
: An ordered array of values (i.e., msg.value) to be passed to the respective function calls. This array must match the length of all other array parameters.signatures
: An ordered array containing function signatures that will be executed as part of the proposal.calldatas
: An ordered array of encoded data passed to each function call during execution.description
: A human-readable description outlining the proposal and the intended protocol changes.RETURN
: The function returns a proposalId, which uniquely identifies the newly created governance proposal.
Example Solidity Implementation
To submit a proposal using Solidity, the propose()
function can be called from an instance of the CHNGovernance
contract:
Web3.js Implementation (v1.2.6)
For interacting with the CHNGovernance
contract using Web3.js, the following example demonstrates how to submit a proposal:
Technical Considerations
The propose function is state-modifying and will incur gas costs.
The proposal threshold may be subject to governance modifications, dynamically altering the eligibility criteria.
The proposal queueing mechanism ensures execution order integrity and prevents conflicting transactions.
The retrieved proposal ID is essential for tracking governance actions and monitoring proposal progress.
Security best practices should be followed to ensure valid function calls and prevent unintended contract interactions.
By enforcing structured proposal submission requirements and leveraging the Onyx Timelock, the Onyx governance system ensures that protocol changes are implemented in a transparent, decentralized, and secure manner.
Last updated