GovernorCompatibilityBravoMock.sol 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.19;
  3. import {IGovernor, Governor} from "../../governance/Governor.sol";
  4. import {GovernorCompatibilityBravo} from "../../governance/compatibility/GovernorCompatibilityBravo.sol";
  5. import {IGovernorTimelock, GovernorTimelockCompound} from "../../governance/extensions/GovernorTimelockCompound.sol";
  6. import {GovernorSettings} from "../../governance/extensions/GovernorSettings.sol";
  7. import {GovernorVotes} from "../../governance/extensions/GovernorVotes.sol";
  8. import {IERC165} from "../../interfaces/IERC165.sol";
  9. abstract contract GovernorCompatibilityBravoMock is
  10. GovernorCompatibilityBravo,
  11. GovernorSettings,
  12. GovernorTimelockCompound,
  13. GovernorVotes
  14. {
  15. function quorum(uint256) public pure override returns (uint256) {
  16. return 0;
  17. }
  18. function supportsInterface(
  19. bytes4 interfaceId
  20. ) public view override(IERC165, Governor, GovernorTimelockCompound) returns (bool) {
  21. return super.supportsInterface(interfaceId);
  22. }
  23. function state(
  24. uint256 proposalId
  25. ) public view override(IGovernor, Governor, GovernorTimelockCompound) returns (ProposalState) {
  26. return super.state(proposalId);
  27. }
  28. function proposalEta(
  29. uint256 proposalId
  30. ) public view override(IGovernorTimelock, GovernorTimelockCompound) returns (uint256) {
  31. return super.proposalEta(proposalId);
  32. }
  33. function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
  34. return super.proposalThreshold();
  35. }
  36. function propose(
  37. address[] memory targets,
  38. uint256[] memory values,
  39. bytes[] memory calldatas,
  40. string memory description
  41. ) public override(IGovernor, Governor, GovernorCompatibilityBravo) returns (uint256) {
  42. return super.propose(targets, values, calldatas, description);
  43. }
  44. function queue(
  45. address[] memory targets,
  46. uint256[] memory values,
  47. bytes[] memory calldatas,
  48. bytes32 salt
  49. ) public override(IGovernorTimelock, GovernorTimelockCompound) returns (uint256) {
  50. return super.queue(targets, values, calldatas, salt);
  51. }
  52. function execute(
  53. address[] memory targets,
  54. uint256[] memory values,
  55. bytes[] memory calldatas,
  56. bytes32 salt
  57. ) public payable override(IGovernor, Governor) returns (uint256) {
  58. return super.execute(targets, values, calldatas, salt);
  59. }
  60. function cancel(
  61. address[] memory targets,
  62. uint256[] memory values,
  63. bytes[] memory calldatas,
  64. bytes32 descriptionHash
  65. ) public override(Governor, GovernorCompatibilityBravo, IGovernor) returns (uint256) {
  66. return super.cancel(targets, values, calldatas, descriptionHash);
  67. }
  68. function _execute(
  69. uint256 proposalId,
  70. address[] memory targets,
  71. uint256[] memory values,
  72. bytes[] memory calldatas,
  73. bytes32 descriptionHash
  74. ) internal override(Governor, GovernorTimelockCompound) {
  75. super._execute(proposalId, targets, values, calldatas, descriptionHash);
  76. }
  77. function _cancel(
  78. address[] memory targets,
  79. uint256[] memory values,
  80. bytes[] memory calldatas,
  81. bytes32 salt
  82. ) internal override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
  83. return super._cancel(targets, values, calldatas, salt);
  84. }
  85. function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
  86. return super._executor();
  87. }
  88. }