GovernorStorageMock.sol 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. import {GovernorStorage} from "../../governance/extensions/GovernorStorage.sol";
  9. abstract contract GovernorStorageMock is
  10. GovernorSettings,
  11. GovernorTimelockControl,
  12. GovernorVotesQuorumFraction,
  13. GovernorCountingSimple,
  14. GovernorStorage
  15. {
  16. function quorum(uint256 blockNumber) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {
  17. return super.quorum(blockNumber);
  18. }
  19. function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) 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 _propose(
  26. address[] memory targets,
  27. uint256[] memory values,
  28. bytes[] memory calldatas,
  29. string memory description,
  30. address proposer
  31. ) internal virtual override(Governor, GovernorStorage) returns (uint256) {
  32. return super._propose(targets, values, calldatas, description, proposer);
  33. }
  34. function _queueOperations(
  35. uint256 proposalId,
  36. address[] memory targets,
  37. uint256[] memory values,
  38. bytes[] memory calldatas,
  39. bytes32 descriptionHash
  40. ) internal override(Governor, GovernorTimelockControl) returns (uint48) {
  41. return super._queueOperations(proposalId, targets, values, calldatas, descriptionHash);
  42. }
  43. function _executeOperations(
  44. uint256 proposalId,
  45. address[] memory targets,
  46. uint256[] memory values,
  47. bytes[] memory calldatas,
  48. bytes32 descriptionHash
  49. ) internal override(Governor, GovernorTimelockControl) {
  50. super._executeOperations(proposalId, targets, values, calldatas, descriptionHash);
  51. }
  52. function _cancel(
  53. address[] memory targets,
  54. uint256[] memory values,
  55. bytes[] memory calldatas,
  56. bytes32 descriptionHash
  57. ) internal override(Governor, GovernorTimelockControl) returns (uint256) {
  58. return super._cancel(targets, values, calldatas, descriptionHash);
  59. }
  60. function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
  61. return super._executor();
  62. }
  63. }