GovernorCompatibilityBravoMock.sol 3.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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/GovernorVotesComp.sol";
  7. abstract contract GovernorCompatibilityBravoMock is
  8. GovernorCompatibilityBravo,
  9. GovernorSettings,
  10. GovernorTimelockCompound,
  11. GovernorVotesComp
  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(uint256 proposalId) public override(Governor, GovernorCompatibilityBravo, IGovernor) {
  59. super.cancel(proposalId);
  60. }
  61. function _execute(
  62. uint256 proposalId,
  63. address[] memory targets,
  64. uint256[] memory values,
  65. bytes[] memory calldatas,
  66. bytes32 descriptionHash
  67. ) internal override(Governor, GovernorTimelockCompound) {
  68. super._execute(proposalId, targets, values, calldatas, descriptionHash);
  69. }
  70. function _cancel(
  71. address[] memory targets,
  72. uint256[] memory values,
  73. bytes[] memory calldatas,
  74. bytes32 salt
  75. ) internal override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
  76. return super._cancel(targets, values, calldatas, salt);
  77. }
  78. function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
  79. return super._executor();
  80. }
  81. }