GovernorCompatibilityBravoMock.sol 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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 _execute(
  59. uint256 proposalId,
  60. address[] memory targets,
  61. uint256[] memory values,
  62. bytes[] memory calldatas,
  63. bytes32 descriptionHash
  64. ) internal override(Governor, GovernorTimelockCompound) {
  65. super._execute(proposalId, targets, values, calldatas, descriptionHash);
  66. }
  67. function _cancel(
  68. address[] memory targets,
  69. uint256[] memory values,
  70. bytes[] memory calldatas,
  71. bytes32 salt
  72. ) internal override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
  73. return super._cancel(targets, values, calldatas, salt);
  74. }
  75. function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
  76. return super._executor();
  77. }
  78. }