Update docs
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorCountingSimple.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorCountingSimple.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -86,7 +86,8 @@ abstract contract GovernorCountingSimple is Governor {
|
||||
uint256 proposalId,
|
||||
address account,
|
||||
uint8 support,
|
||||
uint256 weight
|
||||
uint256 weight,
|
||||
bytes memory // params
|
||||
) internal virtual override {
|
||||
ProposalVote storage proposalvote = _proposalVotes[proposalId];
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorPreventLateQuorum.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorPreventLateQuorum.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -57,9 +57,10 @@ abstract contract GovernorPreventLateQuorum is Governor {
|
||||
uint256 proposalId,
|
||||
address account,
|
||||
uint8 support,
|
||||
string memory reason
|
||||
string memory reason,
|
||||
bytes memory params
|
||||
) internal virtual override returns (uint256) {
|
||||
uint256 result = super._castVote(proposalId, account, support, reason);
|
||||
uint256 result = super._castVote(proposalId, account, support, reason, params);
|
||||
|
||||
Timers.BlockNumber storage extendedDeadline = _extendedDeadlines[proposalId];
|
||||
|
||||
|
||||
@ -1,65 +1,12 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorTimelockCompound.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorTimelockCompound.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./IGovernorTimelock.sol";
|
||||
import "../Governor.sol";
|
||||
import "../../utils/math/SafeCast.sol";
|
||||
|
||||
/**
|
||||
* https://github.com/compound-finance/compound-protocol/blob/master/contracts/Timelock.sol[Compound's timelock] interface
|
||||
*/
|
||||
interface ICompoundTimelock {
|
||||
receive() external payable;
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function GRACE_PERIOD() external view returns (uint256);
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function MINIMUM_DELAY() external view returns (uint256);
|
||||
|
||||
// solhint-disable-next-line func-name-mixedcase
|
||||
function MAXIMUM_DELAY() external view returns (uint256);
|
||||
|
||||
function admin() external view returns (address);
|
||||
|
||||
function pendingAdmin() external view returns (address);
|
||||
|
||||
function delay() external view returns (uint256);
|
||||
|
||||
function queuedTransactions(bytes32) external view returns (bool);
|
||||
|
||||
function setDelay(uint256) external;
|
||||
|
||||
function acceptAdmin() external;
|
||||
|
||||
function setPendingAdmin(address) external;
|
||||
|
||||
function queueTransaction(
|
||||
address target,
|
||||
uint256 value,
|
||||
string memory signature,
|
||||
bytes memory data,
|
||||
uint256 eta
|
||||
) external returns (bytes32);
|
||||
|
||||
function cancelTransaction(
|
||||
address target,
|
||||
uint256 value,
|
||||
string memory signature,
|
||||
bytes memory data,
|
||||
uint256 eta
|
||||
) external;
|
||||
|
||||
function executeTransaction(
|
||||
address target,
|
||||
uint256 value,
|
||||
string memory signature,
|
||||
bytes memory data,
|
||||
uint256 eta
|
||||
) external payable returns (bytes memory);
|
||||
}
|
||||
import "../../vendor/compound/ICompoundTimelock.sol";
|
||||
|
||||
/**
|
||||
* @dev Extension of {Governor} that binds the execution process to a Compound Timelock. This adds a delay, enforced by
|
||||
@ -105,7 +52,7 @@ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Overriden version of the {Governor-state} function with added support for the `Queued` and `Expired` status.
|
||||
* @dev Overridden version of the {Governor-state} function with added support for the `Queued` and `Expired` status.
|
||||
*/
|
||||
function state(uint256 proposalId) public view virtual override(IGovernor, Governor) returns (ProposalState) {
|
||||
ProposalState status = super.state(proposalId);
|
||||
@ -167,7 +114,7 @@ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Overriden execute function that run the already queued proposal through the timelock.
|
||||
* @dev Overridden execute function that run the already queued proposal through the timelock.
|
||||
*/
|
||||
function _execute(
|
||||
uint256 proposalId,
|
||||
@ -185,7 +132,7 @@ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Overriden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already
|
||||
* @dev Overridden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already
|
||||
* been queued.
|
||||
*/
|
||||
function _cancel(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorTimelockControl.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorTimelockControl.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -47,7 +47,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Overriden version of the {Governor-state} function with added support for the `Queued` status.
|
||||
* @dev Overridden version of the {Governor-state} function with added support for the `Queued` status.
|
||||
*/
|
||||
function state(uint256 proposalId) public view virtual override(IGovernor, Governor) returns (ProposalState) {
|
||||
ProposalState status = super.state(proposalId);
|
||||
@ -107,7 +107,7 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Overriden execute function that run the already queued proposal through the timelock.
|
||||
* @dev Overridden execute function that run the already queued proposal through the timelock.
|
||||
*/
|
||||
function _execute(
|
||||
uint256, /* proposalId */
|
||||
@ -120,9 +120,12 @@ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Overriden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already
|
||||
* @dev Overridden version of the {Governor-_cancel} function to cancel the timelocked proposal if it as already
|
||||
* been queued.
|
||||
*/
|
||||
// This function can reenter through the external call to the timelock, but we assume the timelock is trusted and
|
||||
// well behaved (according to TimelockController) and this will not happen.
|
||||
// slither-disable-next-line reentrancy-no-eth
|
||||
function _cancel(
|
||||
address[] memory targets,
|
||||
uint256[] memory values,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.5.0) (governance/extensions/GovernorVotes.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorVotes.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -19,9 +19,13 @@ abstract contract GovernorVotes is Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the voting weight from the token's built in snapshot mechanism (see {IGovernor-getVotes}).
|
||||
* Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).
|
||||
*/
|
||||
function getVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) {
|
||||
function _getVotes(
|
||||
address account,
|
||||
uint256 blockNumber,
|
||||
bytes memory /*params*/
|
||||
) internal view virtual override returns (uint256) {
|
||||
return token.getPastVotes(account, blockNumber);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts v4.4.1 (governance/extensions/GovernorVotesComp.sol)
|
||||
// OpenZeppelin Contracts (last updated v4.6.0) (governance/extensions/GovernorVotesComp.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
@ -19,9 +19,13 @@ abstract contract GovernorVotesComp is Governor {
|
||||
}
|
||||
|
||||
/**
|
||||
* Read the voting weight from the token's built in snapshot mechanism (see {IGovernor-getVotes}).
|
||||
* Read the voting weight from the token's built in snapshot mechanism (see {Governor-_getVotes}).
|
||||
*/
|
||||
function getVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) {
|
||||
function _getVotes(
|
||||
address account,
|
||||
uint256 blockNumber,
|
||||
bytes memory /*params*/
|
||||
) internal view virtual override returns (uint256) {
|
||||
return token.getPriorVotes(account, blockNumber);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user