GovernorStorageMock.sol 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.20;
  3. import {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 proposalNeedsQueuing(
  26. uint256 proposalId
  27. ) public view virtual override(Governor, GovernorTimelockControl) returns (bool) {
  28. return super.proposalNeedsQueuing(proposalId);
  29. }
  30. function _propose(
  31. address[] memory targets,
  32. uint256[] memory values,
  33. bytes[] memory calldatas,
  34. string memory description,
  35. address proposer
  36. ) internal virtual override(Governor, GovernorStorage) returns (uint256) {
  37. return super._propose(targets, values, calldatas, description, proposer);
  38. }
  39. function _queueOperations(
  40. uint256 proposalId,
  41. address[] memory targets,
  42. uint256[] memory values,
  43. bytes[] memory calldatas,
  44. bytes32 descriptionHash
  45. ) internal override(Governor, GovernorTimelockControl) returns (uint48) {
  46. return super._queueOperations(proposalId, targets, values, calldatas, descriptionHash);
  47. }
  48. function _executeOperations(
  49. uint256 proposalId,
  50. address[] memory targets,
  51. uint256[] memory values,
  52. bytes[] memory calldatas,
  53. bytes32 descriptionHash
  54. ) internal override(Governor, GovernorTimelockControl) {
  55. super._executeOperations(proposalId, targets, values, calldatas, descriptionHash);
  56. }
  57. function _cancel(
  58. address[] memory targets,
  59. uint256[] memory values,
  60. bytes[] memory calldatas,
  61. bytes32 descriptionHash
  62. ) internal override(Governor, GovernorTimelockControl) returns (uint256) {
  63. return super._cancel(targets, values, calldatas, descriptionHash);
  64. }
  65. function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
  66. return super._executor();
  67. }
  68. }