GovernorTimelockControlMock.sol 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {IGovernor, Governor} from "../../governance/Governor.sol";
  4. import {GovernorTimelockControl} from "../../governance/extensions/GovernorTimelockControl.sol";
  5. import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
  6. import {GovernorCountingSimple} from "../../governance/extensions/GovernorCountingSimple.sol";
  7. import {GovernorVotesQuorumFraction} from "../../governance/extensions/GovernorVotesQuorumFraction.sol";
  8. abstract contract GovernorTimelockControlMock is
  9. GovernorSettings,
  10. GovernorTimelockControl,
  11. GovernorVotesQuorumFraction,
  12. GovernorCountingSimple
  13. {
  14. function quorum(uint256 blockNumber) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {
  15. return super.quorum(blockNumber);
  16. }
  17. function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
  18. return super.state(proposalId);
  19. }
  20. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  21. return super.proposalThreshold();
  22. }
  23. function proposalNeedsQueuing(
  24. uint256 proposalId
  25. ) public view virtual override(Governor, GovernorTimelockControl) returns (bool) {
  26. return super.proposalNeedsQueuing(proposalId);
  27. }
  28. function _queueOperations(
  29. uint256 proposalId,
  30. address[] memory targets,
  31. uint256[] memory values,
  32. bytes[] memory calldatas,
  33. bytes32 descriptionHash
  34. ) internal override(Governor, GovernorTimelockControl) returns (uint48) {
  35. return super._queueOperations(proposalId, targets, values, calldatas, descriptionHash);
  36. }
  37. function _executeOperations(
  38. uint256 proposalId,
  39. address[] memory targets,
  40. uint256[] memory values,
  41. bytes[] memory calldatas,
  42. bytes32 descriptionHash
  43. ) internal override(Governor, GovernorTimelockControl) {
  44. super._executeOperations(proposalId, targets, values, calldatas, descriptionHash);
  45. }
  46. function _cancel(
  47. address[] memory targets,
  48. uint256[] memory values,
  49. bytes[] memory calldatas,
  50. bytes32 descriptionHash
  51. ) internal override(Governor, GovernorTimelockControl) returns (uint256) {
  52. return super._cancel(targets, values, calldatas, descriptionHash);
  53. }
  54. function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
  55. return super._executor();
  56. }
  57. function nonGovernanceFunction() external {}
  58. }