GovernorCompatibilityBravoMock.sol 3.3 KB

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