GovernorTimelockControlMock.sol 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.19;
  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 supportsInterface(
  15. bytes4 interfaceId
  16. ) public view override(Governor, GovernorTimelockControl) returns (bool) {
  17. return super.supportsInterface(interfaceId);
  18. }
  19. function quorum(
  20. uint256 blockNumber
  21. ) public view override(IGovernor, GovernorVotesQuorumFraction) returns (uint256) {
  22. return super.quorum(blockNumber);
  23. }
  24. function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
  25. return super.state(proposalId);
  26. }
  27. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  28. return super.proposalThreshold();
  29. }
  30. function _execute(
  31. uint256 proposalId,
  32. address[] memory targets,
  33. uint256[] memory values,
  34. bytes[] memory calldatas,
  35. bytes32 descriptionHash
  36. ) internal override(Governor, GovernorTimelockControl) {
  37. super._execute(proposalId, targets, values, calldatas, descriptionHash);
  38. }
  39. function _cancel(
  40. address[] memory targets,
  41. uint256[] memory values,
  42. bytes[] memory calldatas,
  43. bytes32 descriptionHash
  44. ) internal override(Governor, GovernorTimelockControl) returns (uint256 proposalId) {
  45. return super._cancel(targets, values, calldatas, descriptionHash);
  46. }
  47. function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
  48. return super._executor();
  49. }
  50. function nonGovernanceFunction() external {}
  51. }