> For the complete documentation index, see [llms.txt](https://snowconedao.gitbook.io/snowconedao/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://snowconedao.gitbook.io/snowconedao/build/treasury-extensions/ballot.md).

# Ballot

**Specifications**

A contract can be transformed into a funding cycle ballot by adhering to ISnowconeFundingCycleBallot:

```javascript
interface ISnowconeFundingCycleBallot {
  function duration() external view returns (uint256);

  function stateOf(
    uint256 _projectId,
    uint256 _configuration,
    uint256 _start
  ) external view returns (SnowconeBallotState);
}
```

Two functions must be implemented: `duration(...)` and `stateOf(...)`. The result of `duration(...)` is the number of seconds the ballot lasts for from the moment the reconfiguration is proposed. During this time, the protocol automatically interprets the ballot's state as SnowconeBallotState.Active. The result of `stateOf(...)` returns the SnowconeBallotState. If a configuration is approved and the duration has expired, the SnowconeFundingCycleStore will use it as the project's current funding cycle when it becomes active. Otherwise, it will make a copy of the latest approved cycle to use.

When extending the pay functionality with a delegate, the protocol will pass a projectId, a configuration, and a start to the `stateOf(...)` function. `configuration` is the identifier of the funding cycle being evaluated, and also the unix timestamp in seconds of when the reconfiguration was proposed. `start` is the unix timestamp the reconfiguration is scheduled to start at if that reconfiguration is approved.

Once the `duration(...)` has expired, the returned value of `stateOf(...)` should no longer change.

**Attaching**

New ballot contracts should be deployed independently. Once deployed, its address can be configured into a project's funding cycle. The ballot will take effect while that funding cycle is active, and will be used for evaluating subsequent reconfigurations.
