GovernorPreventLateQuorumMock.sol 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 override returns (uint256) {
  30. return _quorum;
  31. }
  32. function proposalDeadline(
  33. uint256 proposalId
  34. ) public view override(Governor, GovernorPreventLateQuorum) returns (uint256) {
  35. return super.proposalDeadline(proposalId);
  36. }
  37. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  38. return super.proposalThreshold();
  39. }
  40. function _castVote(
  41. uint256 proposalId,
  42. address account,
  43. uint8 support,
  44. string memory reason,
  45. bytes memory params
  46. ) internal override(Governor, GovernorPreventLateQuorum) returns (uint256) {
  47. return super._castVote(proposalId, account, support, reason, params);
  48. }
  49. }