HaiGovernor

Git Source

Inherits: Governor, GovernorSettings, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction, GovernorPreventLateQuorum, GovernorTimelockControl

This contract implements OpenZeppelin's Governor contract overriding the clock to use block.timestamp

Functions

constructor

constructor(
  IVotes _token,
  string memory _governorName,
  IHaiGovernor.HaiGovernorParams memory _params
)
  Governor(_governorName)
  GovernorSettings(_params.votingDelay, _params.votingPeriod, _params.proposalThreshold)
  GovernorVotes(_token)
  GovernorVotesQuorumFraction(_params.quorumNumeratorValue)
  GovernorPreventLateQuorum(_params.quorumVoteExtension)
  GovernorTimelockControl(
    new TimelockController(_params.timelockMinDelay, new address[](0), new address[](0), address(this))
  );

clock

Set the clock to block timestamp, as opposed to the default block number

function clock() public view override(Governor, GovernorVotes) returns (uint48 _timestamp);

CLOCK_MODE

function CLOCK_MODE() public view virtual override(Governor, GovernorVotes) returns (string memory _mode);

_cancel

The following functions are overrides required by Solidity

function _cancel(
  address[] memory _targets,
  uint256[] memory _values,
  bytes[] memory _calldatas,
  bytes32 _descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint256 _proposalId);

_executeOperations

function _executeOperations(
  uint256 _proposalId,
  address[] memory _targets,
  uint256[] memory _values,
  bytes[] memory _calldatas,
  bytes32 _descriptionHash
) internal override(Governor, GovernorTimelockControl);

_executor

function _executor() internal view override(Governor, GovernorTimelockControl) returns (address _addy);

_queueOperations

function _queueOperations(
  uint256 _proposalId,
  address[] memory _targets,
  uint256[] memory _values,
  bytes[] memory _calldatas,
  bytes32 _descriptionHash
) internal override(Governor, GovernorTimelockControl) returns (uint48 _scheduledTime);

proposalNeedsQueuing

function proposalNeedsQueuing(uint256 _proposalId)
  public
  view
  override(Governor, GovernorTimelockControl)
  returns (bool _needsQueuing);

proposalThreshold

function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256 _threshold);

state

function state(uint256 _proposalId)
  public
  view
  override(Governor, GovernorTimelockControl)
  returns (ProposalState _state);

_castVote

function _castVote(
  uint256 _proposalId,
  address _account,
  uint8 _support,
  string memory _reason,
  bytes memory _params
) internal override(Governor, GovernorPreventLateQuorum) returns (uint256 _voteId);

proposalDeadline

function proposalDeadline(uint256 _proposalId)
  public
  view
  override(Governor, GovernorPreventLateQuorum)
  returns (uint256 _deadline);