GovernorTimelockControlMock.sol 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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 _queueOperations(
  24. uint256 proposalId,
  25. address[] memory targets,
  26. uint256[] memory values,
  27. bytes[] memory calldatas,
  28. bytes32 descriptionHash
  29. ) internal override(Governor, GovernorTimelockControl) returns (uint48) {
  30. return super._queueOperations(proposalId, targets, values, calldatas, descriptionHash);
  31. }
  32. function _executeOperations(
  33. uint256 proposalId,
  34. address[] memory targets,
  35. uint256[] memory values,
  36. bytes[] memory calldatas,
  37. bytes32 descriptionHash
  38. ) internal override(Governor, GovernorTimelockControl) {
  39. super._executeOperations(proposalId, targets, values, calldatas, descriptionHash);
  40. }
  41. function _cancel(
  42. address[] memory targets,
  43. uint256[] memory values,
  44. bytes[] memory calldatas,
  45. bytes32 descriptionHash
  46. ) internal override(Governor, GovernorTimelockControl) returns (uint256) {
  47. return super._cancel(targets, values, calldatas, descriptionHash);
  48. }
  49. function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
  50. return super._executor();
  51. }
  52. function nonGovernanceFunction() external {}
  53. }