123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- // SPDX-License-Identifier: MIT
- // OpenZeppelin Contracts (last updated v4.9.0) (governance/compatibility/IGovernorCompatibilityBravo.sol)
- pragma solidity ^0.8.19;
- import "../IGovernor.sol";
- /**
- * @dev Interface extension that adds missing functions to the {Governor} core to provide `GovernorBravo` compatibility.
- *
- * _Available since v4.3._
- */
- abstract contract IGovernorCompatibilityBravo is IGovernor {
- /**
- * @dev Mismatch between the parameters length for a proposal call.
- */
- error GovernorInvalidSignaturesLength(uint256 signatures, uint256 calldatas);
- /**
- * @dev Proposal structure from Compound Governor Bravo. Not actually used by the compatibility layer, as
- * {{proposal}} returns a very different structure.
- */
- struct Proposal {
- uint256 id;
- address proposer;
- uint256 eta;
- address[] targets;
- uint256[] values;
- string[] signatures;
- bytes[] calldatas;
- uint256 startBlock;
- uint256 endBlock;
- uint256 forVotes;
- uint256 againstVotes;
- uint256 abstainVotes;
- bool canceled;
- bool executed;
- mapping(address => Receipt) receipts;
- }
- /**
- * @dev Receipt structure from Compound Governor Bravo
- */
- struct Receipt {
- bool hasVoted;
- uint8 support;
- uint96 votes;
- }
- /**
- * @dev Part of the Governor Bravo's interface.
- */
- function quorumVotes() public view virtual returns (uint256);
- /**
- * @dev Part of the Governor Bravo's interface: _"The official record of all proposals ever proposed"_.
- */
- function proposals(
- uint256
- )
- public
- view
- virtual
- returns (
- uint256 id,
- address proposer,
- uint256 eta,
- uint256 startBlock,
- uint256 endBlock,
- uint256 forVotes,
- uint256 againstVotes,
- uint256 abstainVotes,
- bool canceled,
- bool executed
- );
- /**
- * @dev Part of the Governor Bravo's interface: _"Function used to propose a new proposal"_.
- */
- function propose(
- address[] memory targets,
- uint256[] memory values,
- string[] memory signatures,
- bytes[] memory calldatas,
- string memory description
- ) public virtual returns (uint256);
- /**
- * @dev Part of the Governor Bravo's interface: _"Queues a proposal of state succeeded"_.
- */
- function queue(uint256 proposalId) public virtual;
- /**
- * @dev Part of the Governor Bravo's interface: _"Executes a queued proposal if eta has passed"_.
- */
- function execute(uint256 proposalId) public payable virtual;
- /**
- * @dev Cancels a proposal only if the sender is the proposer or the proposer delegates' voting power dropped below the proposal threshold.
- */
- function cancel(uint256 proposalId) public virtual;
- /**
- * @dev Part of the Governor Bravo's interface: _"Gets actions of a proposal"_.
- */
- function getActions(
- uint256 proposalId
- )
- public
- view
- virtual
- returns (
- address[] memory targets,
- uint256[] memory values,
- string[] memory signatures,
- bytes[] memory calldatas
- );
- /**
- * @dev Part of the Governor Bravo's interface: _"Gets the receipt for a voter on a given proposal"_.
- */
- function getReceipt(uint256 proposalId, address voter) public view virtual returns (Receipt memory);
- }
|