/
Active7DaysFundingCycleBallot.sol
43 lines (37 loc) 路 1.33 KB
/
Active7DaysFundingCycleBallot.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: MIT
pragma solidity 0.8.6;
import "./interfaces/ITerminalV1.sol";
import "./interfaces/IFundingCycleBallot.sol";
/**
@notice Manages votes towards approving funding cycle reconfigurations.
*/
contract Active7DaysFundingCycleBallot is IFundingCycleBallot {
// --- public stored properties --- //
/// @notice The number of seconds that must pass for a funding cycle reconfiguration to become active.
uint256 public constant reconfigurationDelay = 604800; // 7 days
// --- external views --- //
/**
@notice The time that this ballot is active for.
@dev A ballot should not be considered final until the duration has passed.
@return The durection in seconds.
*/
function duration() external pure override returns (uint256) {
return reconfigurationDelay;
}
/**
@notice The approval state of a particular funding cycle.
@param _configured The configuration of the funding cycle to check the state of.
@return The state of the provided ballot.
*/
function state(uint256, uint256 _configured)
external
view
override
returns (BallotState)
{
return
block.timestamp > _configured + reconfigurationDelay
? BallotState.Approved
: BallotState.Active;
}
}