Voting Delay

The amount of time that lapses before voting can commence for users to accrue vote weight.

The voting delay represents the number of Ethereum blocks that must elapse before voting can begin on a newly created proposal. This delay is added to the current block number at the time of proposal creation and serves as a buffer period, allowing stakeholders to become aware of the proposal before voting starts.

Function Implementation in CHNGovernance

In the CHNGovernance contract, the votingDelay() function is implemented to enforce this rule, ensuring that there is a defined waiting period before a proposal is open for voting.

Function Signature

function votingDelay() public view returns (uint)

RETURN: The function returns an unsigned integer (uint) representing the number of Ethereum blocks that must pass before voting on a proposal can commence.

Example Solidity Implementation

To retrieve the voting delay in a Solidity environment, the votingDelay() function can be called using an instance of the CHNGovernance contract.

CHNGovernance gov = CHNGovernance(0x123...); // Contract address of CHNGovernance
uint blocks = gov.votingDelay();

Web3.js Implementation (v1.2.6)

For interacting with the CHNGovernance contract using Web3.js, the following example demonstrates how to retrieve the voting delay:

const blocks = await gov.methods.votingDelay().call();

Technical Considerations

  • The votingDelay() function is a view function, meaning it does not modify blockchain state and can be executed without incurring gas costs.

  • The voting delay period is intended to give token holders time to review and analyze proposals before casting their votes, increasing informed participation in governance.

  • This parameter may be adjusted through governance proposals, allowing the community to dynamically modify the delay based on governance needs and activity levels.

  • The retrieved value should be used by governance dashboards, off-chain governance tracking tools, and front-end governance interfaces to ensure accurate voting timelines are displayed.

Last updated