# Voting Period

The voting period defines the duration for which a governance proposal remains open for voting, measured in Ethereum blocks. During this period, eligible token holders can cast their votes to either support or reject the proposal. Once the voting period ends, the results determine whether the proposal advances to execution or is dismissed.

#### Function Implementation in `CHNGovernance`

In the `CHNGovernance` contract, the `votingPeriod()` function establishes the length of time a proposal remains open for voting.

#### Function Signature

```
function votingPeriod() public view returns (uint)
```

`RETURN`: The function returns an unsigned integer (uint) representing the number of Ethereum blocks during which voting is active for a given proposal.

#### Example Solidity Implementation

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

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

#### Web3.js Implementation (v1.2.6)

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

```javascript
const blocks = await gov.methods.votingPeriod().call();
```

#### Technical Considerations

* The `votingPeriod()` function is a view function, meaning it does not modify blockchain state and can be executed without incurring gas costs.
* The duration of the voting period impacts governance participation, allowing stakeholders ample time to review proposals and cast votes.
* This parameter may be adjusted through governance proposals, ensuring adaptability as governance activity and network participation evolve.
* The retrieved value should be used by governance dashboards, off-chain governance tracking tools, and front-end governance interfaces to display accurate voting timelines.


---

# 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-period.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.
