GovernorPreventLateQuorumMock.sol 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../governance/extensions/GovernorPreventLateQuorum.sol";
  4. import "../governance/extensions/GovernorSettings.sol";
  5. import "../governance/extensions/GovernorCountingSimple.sol";
  6. import "../governance/extensions/GovernorVotes.sol";
  7. contract GovernorPreventLateQuorumMock is
  8. GovernorSettings,
  9. GovernorVotes,
  10. GovernorCountingSimple,
  11. GovernorPreventLateQuorum
  12. {
  13. uint256 private _quorum;
  14. constructor(
  15. string memory name_,
  16. IVotes token_,
  17. uint256 votingDelay_,
  18. uint256 votingPeriod_,
  19. uint256 quorum_,
  20. uint64 voteExtension_
  21. )
  22. Governor(name_)
  23. GovernorSettings(votingDelay_, votingPeriod_, 0)
  24. GovernorVotes(token_)
  25. GovernorPreventLateQuorum(voteExtension_)
  26. {
  27. _quorum = quorum_;
  28. }
  29. function quorum(uint256) public view virtual override returns (uint256) {
  30. return _quorum;
  31. }
  32. function proposalDeadline(uint256 proposalId)
  33. public
  34. view
  35. virtual
  36. override(Governor, GovernorPreventLateQuorum)
  37. returns (uint256)
  38. {
  39. return super.proposalDeadline(proposalId);
  40. }
  41. function proposalThreshold() public view virtual override(Governor, GovernorSettings) returns (uint256) {
  42. return super.proposalThreshold();
  43. }
  44. function _castVote(
  45. uint256 proposalId,
  46. address account,
  47. uint8 support,
  48. string memory reason
  49. ) internal virtual override(Governor, GovernorPreventLateQuorum) returns (uint256) {
  50. return super._castVote(proposalId, account, support, reason);
  51. }
  52. }