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