# Voting Delay

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:

```javascript
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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.onyx.org/governance/voting-delay.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
