GovernorTimelockAccessMock.sol 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.24;
  3. import {Governor} from "../../governance/Governor.sol";
  4. import {GovernorTimelockAccess} from "../../governance/extensions/GovernorTimelockAccess.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 GovernorTimelockAccessMock is
  9. GovernorSettings,
  10. GovernorTimelockAccess,
  11. GovernorVotesQuorumFraction,
  12. GovernorCountingSimple
  13. {
  14. function nonGovernanceFunction() external {}
  15. function quorum(uint256 blockNumber) public view override(Governor, GovernorVotesQuorumFraction) returns (uint256) {
  16. return super.quorum(blockNumber);
  17. }
  18. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  19. return super.proposalThreshold();
  20. }
  21. function proposalNeedsQueuing(
  22. uint256 proposalId
  23. ) public view virtual override(Governor, GovernorTimelockAccess) returns (bool) {
  24. return super.proposalNeedsQueuing(proposalId);
  25. }
  26. function propose(
  27. address[] memory targets,
  28. uint256[] memory values,
  29. bytes[] memory calldatas,
  30. string memory description
  31. ) public override(Governor, GovernorTimelockAccess) returns (uint256) {
  32. return super.propose(targets, values, calldatas, description);
  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, GovernorTimelockAccess) 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, GovernorTimelockAccess) {
  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, GovernorTimelockAccess) returns (uint256) {
  58. return super._cancel(targets, values, calldatas, descriptionHash);
  59. }
  60. }