Queing a proposal for execution on the onchain cool-down period.
The queue function is responsible for moving a successful proposal into the Onyx Timelock queue. Once a proposal has been approved by the governance process, it must be queued before it can be executed. Only proposals that have met the required voting threshold and have been successfully passed can be queued.
Function Implementation in CHNGovernance
In the CHNGovernance contract, the queue() function ensures that only validated proposals are added to the Timelock queue, preventing unauthorized executions.
Function Signature
function queue(uint proposalId) public
Parameters
proposalId: The unique identifier of the governance proposal that has been successfully approved and is eligible to be queued.
RETURN: The function does not return a value. If the proposal is invalid or not yet approved, it will revert with an error.
Example Solidity Implementation
To queue a proposal using Solidity, the queue()function can be called from an instance of the CHNGovernance contract:
CHNGovernance gov = CHNGovernance(0x123...); // Contract address of CHNGovernance
gov.queue(proposalId);
Web3.js Implementation (v1.2.6)
For interacting with the CHNGovernance contract using Web3.js, the following example demonstrates how to queue a proposal: