GovernorTimelockCompoundMock.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 {GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.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 GovernorTimelockCompoundMock is
  9. GovernorSettings,
  10. GovernorTimelockCompound,
  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(
  18. uint256 proposalId
  19. ) public view override(Governor, GovernorTimelockCompound) returns (ProposalState) {
  20. return super.state(proposalId);
  21. }
  22. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  23. return super.proposalThreshold();
  24. }
  25. function proposalNeedsQueuing(
  26. uint256 proposalId
  27. ) public view virtual override(Governor, GovernorTimelockCompound) returns (bool) {
  28. return super.proposalNeedsQueuing(proposalId);
  29. }
  30. function _queueOperations(
  31. uint256 proposalId,
  32. address[] memory targets,
  33. uint256[] memory values,
  34. bytes[] memory calldatas,
  35. bytes32 descriptionHash
  36. ) internal override(Governor, GovernorTimelockCompound) returns (uint48) {
  37. return super._queueOperations(proposalId, targets, values, calldatas, descriptionHash);
  38. }
  39. function _executeOperations(
  40. uint256 proposalId,
  41. address[] memory targets,
  42. uint256[] memory values,
  43. bytes[] memory calldatas,
  44. bytes32 descriptionHash
  45. ) internal override(Governor, GovernorTimelockCompound) {
  46. super._executeOperations(proposalId, targets, values, calldatas, descriptionHash);
  47. }
  48. function _cancel(
  49. address[] memory targets,
  50. uint256[] memory values,
  51. bytes[] memory calldatas,
  52. bytes32 descriptionHash
  53. ) internal override(Governor, GovernorTimelockCompound) returns (uint256) {
  54. return super._cancel(targets, values, calldatas, descriptionHash);
  55. }
  56. function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
  57. return super._executor();
  58. }
  59. }