diff --git a/MyGovernor.sol b/MyGovernor.sol new file mode 100644 index 0000000000000000000000000000000000000000..9afdf7607b0b560a9fe144244ac99b03a0b3c18a --- /dev/null +++ b/MyGovernor.sol @@ -0,0 +1,34 @@ +// SPDX-License-Identifier: MIT +pragma solidity ^0.8.7; + +import "@openzeppelin/contracts/governance/Governor.sol"; +import "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol"; +import "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol"; +import "@openzeppelin/contracts/governance/extensions/GovernorVotesQuorumFraction.sol"; + +contract MyGovernor is Governor, GovernorCountingSimple, GovernorVotes, GovernorVotesQuorumFraction { + constructor(IVotes _token) + Governor("MyGovernor") + GovernorVotes(_token) + GovernorVotesQuorumFraction(1) + {} + + function votingDelay() public pure override returns (uint256) { + return 0; // 0 block + } + + function votingPeriod() public pure override returns (uint256) { + return 1; // 1 blocks + } + + // The following functions are overrides required by Solidity. + + function quorum(uint256 blockNumber) + public + view + override(IGovernor, GovernorVotesQuorumFraction) + returns (uint256) + { + return super.quorum(blockNumber); + } +}