GovernorPreventLateQuorumMock.sol 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {Governor} from "../../governance/Governor.sol";
  4. import {GovernorPreventLateQuorum} from "../../governance/extensions/GovernorPreventLateQuorum.sol";
  5. import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
  6. import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
  7. import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol";
  8. abstract contract GovernorPreventLateQuorumMock is
  9. GovernorSettings,
  10. GovernorVotes,
  11. GovernorCountingSimple,
  12. GovernorPreventLateQuorum
  13. {
  14. uint256 private _quorum;
  15. constructor(uint256 quorum_) {
  16. _quorum = quorum_;
  17. }
  18. function quorum(uint256) public view override returns (uint256) {
  19. return _quorum;
  20. }
  21. function proposalDeadline(
  22. uint256 proposalId
  23. ) public view override(Governor, GovernorPreventLateQuorum) returns (uint256) {
  24. return super.proposalDeadline(proposalId);
  25. }
  26. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  27. return super.proposalThreshold();
  28. }
  29. function _castVote(
  30. uint256 proposalId,
  31. address account,
  32. uint8 support,
  33. string memory reason,
  34. bytes memory params
  35. ) internal override(Governor, GovernorPreventLateQuorum) returns (uint256) {
  36. return super._castVote(proposalId, account, support, reason, params);
  37. }
  38. }