diff --git a/.changeset/loud-shrimps-play.md b/.changeset/loud-shrimps-play.md new file mode 100644 index 000000000..3de2da080 --- /dev/null +++ b/.changeset/loud-shrimps-play.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': minor +--- + +`TimelockController`: Add a state getter that returns an `OperationState` enum. diff --git a/.changeset/popular-deers-raise.md b/.changeset/popular-deers-raise.md new file mode 100644 index 000000000..ec1fb7466 --- /dev/null +++ b/.changeset/popular-deers-raise.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': major +--- + +`Governor`: Add support for casting votes with ERC-1271 signatures by using a `bytes memory signature` instead of `r`, `s` and `v` arguments in the `castVoteBySig` and `castVoteWithReasonAndParamsBySig` functions. diff --git a/.changeset/sixty-numbers-reply.md b/.changeset/sixty-numbers-reply.md new file mode 100644 index 000000000..4e6faa837 --- /dev/null +++ b/.changeset/sixty-numbers-reply.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': major +--- + +`Governor`: Add `voter` and `nonce` parameters in signed ballots, to avoid forging signatures for random addresses, prevent signature replay, and allow invalidating signatures. Add `voter` as a new parameter in the `castVoteBySig` and `castVoteWithReasonAndParamsBySig` functions. diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 8465fefbd..ec30e81e7 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -64,8 +64,6 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * The format of the revert reason is given by the following regular expression: * * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/ - * - * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role); @@ -91,8 +89,6 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * Overriding this function changes the behavior of the {onlyRole} modifier. * * Format of the revert message is described in {_checkRole}. - * - * _Available since v4.6._ */ function _checkRole(bytes32 role) internal view virtual { _checkRole(role, _msgSender()); diff --git a/contracts/access/AccessControlDefaultAdminRules.sol b/contracts/access/AccessControlDefaultAdminRules.sol index ebc40a5bf..4572a328d 100644 --- a/contracts/access/AccessControlDefaultAdminRules.sol +++ b/contracts/access/AccessControlDefaultAdminRules.sol @@ -35,8 +35,6 @@ import {IERC5313} from "../interfaces/IERC5313.sol"; * ) {} * } * ``` - * - * _Available since v4.9._ */ abstract contract AccessControlDefaultAdminRules is IAccessControlDefaultAdminRules, IERC5313, AccessControl { // pending admin pair read/written together frequently diff --git a/contracts/access/IAccessControl.sol b/contracts/access/IAccessControl.sol index 9abc2b735..38facbfb1 100644 --- a/contracts/access/IAccessControl.sol +++ b/contracts/access/IAccessControl.sol @@ -24,8 +24,6 @@ interface IAccessControl { * * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite * {RoleAdminChanged} not being emitted signaling this. - * - * _Available since v3.1._ */ event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole); diff --git a/contracts/access/IAccessControlDefaultAdminRules.sol b/contracts/access/IAccessControlDefaultAdminRules.sol index 5e61f965d..a1afb3d22 100644 --- a/contracts/access/IAccessControlDefaultAdminRules.sol +++ b/contracts/access/IAccessControlDefaultAdminRules.sol @@ -7,8 +7,6 @@ import {IAccessControl} from "./IAccessControl.sol"; /** * @dev External interface of AccessControlDefaultAdminRules declared to support ERC165 detection. - * - * _Available since v4.9._ */ interface IAccessControlDefaultAdminRules is IAccessControl { /** diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index d0ace4f03..94f29e95f 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -5,13 +5,14 @@ pragma solidity ^0.8.19; import {IERC721Receiver} from "../token/ERC721/IERC721Receiver.sol"; import {IERC1155Receiver} from "../token/ERC1155/IERC1155Receiver.sol"; -import {ECDSA} from "../utils/cryptography/ECDSA.sol"; import {EIP712} from "../utils/cryptography/EIP712.sol"; +import {SignatureChecker} from "../utils/cryptography/SignatureChecker.sol"; import {IERC165, ERC165} from "../utils/introspection/ERC165.sol"; import {SafeCast} from "../utils/math/SafeCast.sol"; import {DoubleEndedQueue} from "../utils/structs/DoubleEndedQueue.sol"; import {Address} from "../utils/Address.sol"; import {Context} from "../utils/Context.sol"; +import {Nonces} from "../utils/Nonces.sol"; import {IGovernor, IERC6372} from "./IGovernor.sol"; /** @@ -22,15 +23,16 @@ import {IGovernor, IERC6372} from "./IGovernor.sol"; * - A counting module must implement {quorum}, {_quorumReached}, {_voteSucceeded} and {_countVote} * - A voting module must implement {_getVotes} * - Additionally, {votingPeriod} must also be implemented - * - * _Available since v4.3._ */ -abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receiver, IERC1155Receiver { +abstract contract Governor is Context, ERC165, EIP712, Nonces, IGovernor, IERC721Receiver, IERC1155Receiver { using DoubleEndedQueue for DoubleEndedQueue.Bytes32Deque; - bytes32 public constant BALLOT_TYPEHASH = keccak256("Ballot(uint256 proposalId,uint8 support)"); + bytes32 public constant BALLOT_TYPEHASH = + keccak256("Ballot(uint256 proposalId,uint8 support,address voter,uint256 nonce)"); bytes32 public constant EXTENDED_BALLOT_TYPEHASH = - keccak256("ExtendedBallot(uint256 proposalId,uint8 support,string reason,bytes params)"); + keccak256( + "ExtendedBallot(uint256 proposalId,uint8 support,address voter,uint256 nonce,string reason,bytes params)" + ); // solhint-disable var-name-mixedcase struct ProposalCore { @@ -45,7 +47,6 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive bytes32 private constant _ALL_PROPOSAL_STATES_BITMAP = bytes32((2 ** (uint8(type(ProposalState).max) + 1)) - 1); string private _name; - /// @custom:oz-retyped-from mapping(uint256 => Governor.ProposalCore) mapping(uint256 => ProposalCore) private _proposals; // This queue keeps track of the governor operating on itself. Calls to functions protected by the @@ -514,16 +515,19 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive function castVoteBySig( uint256 proposalId, uint8 support, - uint8 v, - bytes32 r, - bytes32 s + address voter, + bytes memory signature ) public virtual override returns (uint256) { - address voter = ECDSA.recover( - _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support))), - v, - r, - s + bool valid = SignatureChecker.isValidSignatureNow( + voter, + _hashTypedDataV4(keccak256(abi.encode(BALLOT_TYPEHASH, proposalId, support, voter, _useNonce(voter)))), + signature ); + + if (!valid) { + revert GovernorInvalidSignature(voter); + } + return _castVote(proposalId, voter, support, ""); } @@ -533,29 +537,33 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive function castVoteWithReasonAndParamsBySig( uint256 proposalId, uint8 support, + address voter, string calldata reason, bytes memory params, - uint8 v, - bytes32 r, - bytes32 s + bytes memory signature ) public virtual override returns (uint256) { - address voter = ECDSA.recover( + bool valid = SignatureChecker.isValidSignatureNow( + voter, _hashTypedDataV4( keccak256( abi.encode( EXTENDED_BALLOT_TYPEHASH, proposalId, support, + voter, + _useNonce(voter), keccak256(bytes(reason)), keccak256(params) ) ) ), - v, - r, - s + signature ); + if (!valid) { + revert GovernorInvalidSignature(voter); + } + return _castVote(proposalId, voter, support, reason, params); } diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index 2eeedd313..b954ed205 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -8,8 +8,6 @@ import {IERC6372} from "../interfaces/IERC6372.sol"; /** * @dev Interface of the {Governor} core. - * - * _Available since v4.3._ */ abstract contract IGovernor is IERC165, IERC6372 { enum ProposalState { @@ -80,6 +78,12 @@ abstract contract IGovernor is IERC165, IERC6372 { */ error GovernorInvalidVoteType(); + /** + * @dev The provided signature is not valid for the expected `voter`. + * If the `voter` is a contract, the signature is not valid using {IERC1271-isValidSignature}. + */ + error GovernorInvalidSignature(address voter); + /** * @dev Emitted when a proposal is created. */ @@ -348,30 +352,29 @@ abstract contract IGovernor is IERC165, IERC6372 { ) public virtual returns (uint256 balance); /** - * @dev Cast a vote using the user's cryptographic signature. + * @dev Cast a vote using the voter's signature, including ERC-1271 signature support. * * Emits a {VoteCast} event. */ function castVoteBySig( uint256 proposalId, uint8 support, - uint8 v, - bytes32 r, - bytes32 s + address voter, + bytes memory signature ) public virtual returns (uint256 balance); /** - * @dev Cast a vote with a reason and additional encoded parameters using the user's cryptographic signature. + * @dev Cast a vote with a reason and additional encoded parameters using the voter's signature, + * including ERC-1271 signature support. * * Emits a {VoteCast} or {VoteCastWithParams} event depending on the length of params. */ function castVoteWithReasonAndParamsBySig( uint256 proposalId, uint8 support, + address voter, string calldata reason, bytes memory params, - uint8 v, - bytes32 r, - bytes32 s + bytes memory signature ) public virtual returns (uint256 balance); } diff --git a/contracts/governance/README.adoc b/contracts/governance/README.adoc index 00edfe23d..35f324b7e 100644 --- a/contracts/governance/README.adoc +++ b/contracts/governance/README.adoc @@ -92,8 +92,9 @@ In a governance system, the {TimelockController} contract is in charge of introd * *Operation:* A transaction (or a set of transactions) that is the subject of the timelock. It has to be scheduled by a proposer and executed by an executor. The timelock enforces a minimum delay between the proposition and the execution (see xref:access-control.adoc#operation_lifecycle[operation lifecycle]). If the operation contains multiple transactions (batch mode), they are executed atomically. Operations are identified by the hash of their content. * *Operation status:* ** *Unset:* An operation that is not part of the timelock mechanism. -** *Pending:* An operation that has been scheduled, before the timer expires. +** *Waiting:* An operation that has been scheduled, before the timer expires. ** *Ready:* An operation that has been scheduled, after the timer expires. +** *Pending:* An operation that is either waiting or ready. ** *Done:* An operation that has been executed. * *Predecessor*: An (optional) dependency between operations. An operation can depend on another operation (its predecessor), forcing the execution order of these two operations. * *Role*: diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index 56a25fe30..2cf954d12 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -21,8 +21,6 @@ import {Address} from "../utils/Address.sol"; * is in charge of proposing (resp executing) operations. A common use case is * to position this {TimelockController} as the owner of a smart contract, with * a multisig or a DAO as the sole proposer. - * - * _Available since v3.3._ */ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { bytes32 public constant PROPOSER_ROLE = keccak256("PROPOSER_ROLE"); @@ -35,7 +33,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { enum OperationState { Unset, - Pending, + Waiting, Ready, Done } @@ -52,8 +50,12 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { /** * @dev The current state of an operation is not as required. + * The `expectedStates` is a bitmap with the bits enabled for each OperationState enum position + * counting from right to left. + * + * See {_encodeStateBitmap}. */ - error TimelockUnexpectedOperationState(bytes32 operationId, OperationState expected); + error TimelockUnexpectedOperationState(bytes32 operationId, bytes32 expectedStates); /** * @dev The predecessor to an operation not yet done. @@ -166,30 +168,30 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { * @dev Returns whether an id correspond to a registered operation. This * includes both Pending, Ready and Done operations. */ - function isOperation(bytes32 id) public view virtual returns (bool) { - return getTimestamp(id) > 0; + function isOperation(bytes32 id) public view returns (bool) { + return getOperationState(id) != OperationState.Unset; } /** * @dev Returns whether an operation is pending or not. Note that a "pending" operation may also be "ready". */ - function isOperationPending(bytes32 id) public view virtual returns (bool) { - return getTimestamp(id) > _DONE_TIMESTAMP; + function isOperationPending(bytes32 id) public view returns (bool) { + OperationState state = getOperationState(id); + return state == OperationState.Waiting || state == OperationState.Ready; } /** * @dev Returns whether an operation is ready for execution. Note that a "ready" operation is also "pending". */ - function isOperationReady(bytes32 id) public view virtual returns (bool) { - uint256 timestamp = getTimestamp(id); - return timestamp > _DONE_TIMESTAMP && timestamp <= block.timestamp; + function isOperationReady(bytes32 id) public view returns (bool) { + return getOperationState(id) == OperationState.Ready; } /** * @dev Returns whether an operation is done or not. */ - function isOperationDone(bytes32 id) public view virtual returns (bool) { - return getTimestamp(id) == _DONE_TIMESTAMP; + function isOperationDone(bytes32 id) public view returns (bool) { + return getOperationState(id) == OperationState.Done; } /** @@ -200,6 +202,22 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { return _timestamps[id]; } + /** + * @dev Returns operation state. + */ + function getOperationState(bytes32 id) public view virtual returns (OperationState) { + uint256 timestamp = getTimestamp(id); + if (timestamp == 0) { + return OperationState.Unset; + } else if (timestamp == _DONE_TIMESTAMP) { + return OperationState.Done; + } else if (timestamp > block.timestamp) { + return OperationState.Waiting; + } else { + return OperationState.Ready; + } + } + /** * @dev Returns the minimum delay for an operation to become valid. * @@ -298,7 +316,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { */ function _schedule(bytes32 id, uint256 delay) private { if (isOperation(id)) { - revert TimelockUnexpectedOperationState(id, OperationState.Unset); + revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Unset)); } uint256 minDelay = getMinDelay(); if (delay < minDelay) { @@ -316,7 +334,10 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { */ function cancel(bytes32 id) public virtual onlyRole(CANCELLER_ROLE) { if (!isOperationPending(id)) { - revert TimelockUnexpectedOperationState(id, OperationState.Pending); + revert TimelockUnexpectedOperationState( + id, + _encodeStateBitmap(OperationState.Waiting) | _encodeStateBitmap(OperationState.Ready) + ); } delete _timestamps[id]; @@ -399,7 +420,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { */ function _beforeCall(bytes32 id, bytes32 predecessor) private view { if (!isOperationReady(id)) { - revert TimelockUnexpectedOperationState(id, OperationState.Ready); + revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready)); } if (predecessor != bytes32(0) && !isOperationDone(predecessor)) { revert TimelockUnexecutedPredecessor(predecessor); @@ -411,7 +432,7 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { */ function _afterCall(bytes32 id) private { if (!isOperationReady(id)) { - revert TimelockUnexpectedOperationState(id, OperationState.Ready); + revert TimelockUnexpectedOperationState(id, _encodeStateBitmap(OperationState.Ready)); } _timestamps[id] = _DONE_TIMESTAMP; } @@ -434,4 +455,19 @@ contract TimelockController is AccessControl, ERC721Holder, ERC1155Holder { emit MinDelayChange(_minDelay, newDelay); _minDelay = newDelay; } + + /** + * @dev Encodes a `OperationState` into a `bytes32` representation where each bit enabled corresponds to + * the underlying position in the `OperationState` enum. For example: + * + * 0x000...1000 + * ^^^^^^----- ... + * ^---- Done + * ^--- Ready + * ^-- Waiting + * ^- Unset + */ + function _encodeStateBitmap(OperationState operationState) internal pure returns (bytes32) { + return bytes32(1 << uint8(operationState)); + } } diff --git a/contracts/governance/compatibility/GovernorCompatibilityBravo.sol b/contracts/governance/compatibility/GovernorCompatibilityBravo.sol index 445f71be0..40284c578 100644 --- a/contracts/governance/compatibility/GovernorCompatibilityBravo.sol +++ b/contracts/governance/compatibility/GovernorCompatibilityBravo.sol @@ -15,8 +15,6 @@ import {IGovernorCompatibilityBravo} from "./IGovernorCompatibilityBravo.sol"; * through inheritance. It does not include token bindings, nor does it include any variable upgrade patterns. * * NOTE: When using this module, you may need to enable the Solidity optimizer to avoid hitting the contract size limit. - * - * _Available since v4.3._ */ abstract contract GovernorCompatibilityBravo is IGovernorTimelock, IGovernorCompatibilityBravo, Governor { enum VoteType { diff --git a/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol b/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol index 4bd593077..5476edf4f 100644 --- a/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol +++ b/contracts/governance/compatibility/IGovernorCompatibilityBravo.sol @@ -7,8 +7,6 @@ import {IGovernor} from "../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 { /** diff --git a/contracts/governance/extensions/GovernorCountingSimple.sol b/contracts/governance/extensions/GovernorCountingSimple.sol index 8934995de..6496c3acc 100644 --- a/contracts/governance/extensions/GovernorCountingSimple.sol +++ b/contracts/governance/extensions/GovernorCountingSimple.sol @@ -7,8 +7,6 @@ import {Governor} from "../Governor.sol"; /** * @dev Extension of {Governor} for simple, 3 options, vote counting. - * - * _Available since v4.3._ */ abstract contract GovernorCountingSimple is Governor { /** diff --git a/contracts/governance/extensions/GovernorPreventLateQuorum.sol b/contracts/governance/extensions/GovernorPreventLateQuorum.sol index 3e034acad..89c02fce6 100644 --- a/contracts/governance/extensions/GovernorPreventLateQuorum.sol +++ b/contracts/governance/extensions/GovernorPreventLateQuorum.sol @@ -14,13 +14,10 @@ import {Math} from "../../utils/math/Math.sol"; * If a vote causes quorum to be reached, the proposal's voting period may be extended so that it does not end before at * least a specified time has passed (the "vote extension" parameter). This parameter can be set through a governance * proposal. - * - * _Available since v4.5._ */ abstract contract GovernorPreventLateQuorum is Governor { uint48 private _voteExtension; - /// @custom:oz-retyped-from mapping(uint256 => Timers.BlockNumber) mapping(uint256 => uint48) private _extendedDeadlines; /// @dev Emitted when a proposal deadline is pushed back due to reaching quorum late in its voting period. diff --git a/contracts/governance/extensions/GovernorSettings.sol b/contracts/governance/extensions/GovernorSettings.sol index 5d98fbf34..834555654 100644 --- a/contracts/governance/extensions/GovernorSettings.sol +++ b/contracts/governance/extensions/GovernorSettings.sol @@ -7,8 +7,6 @@ import {Governor} from "../Governor.sol"; /** * @dev Extension of {Governor} for settings updatable through governance. - * - * _Available since v4.4._ */ abstract contract GovernorSettings is Governor { // amount of token diff --git a/contracts/governance/extensions/GovernorTimelockCompound.sol b/contracts/governance/extensions/GovernorTimelockCompound.sol index cd61d1ff8..4b609723d 100644 --- a/contracts/governance/extensions/GovernorTimelockCompound.sol +++ b/contracts/governance/extensions/GovernorTimelockCompound.sol @@ -19,13 +19,10 @@ import {Address} from "../../utils/Address.sol"; * Using this model means the proposal will be operated by the {TimelockController} and not by the {Governor}. Thus, * the assets and permissions must be attached to the {TimelockController}. Any asset sent to the {Governor} will be * inaccessible. - * - * _Available since v4.3._ */ abstract contract GovernorTimelockCompound is IGovernorTimelock, Governor { ICompoundTimelock private _timelock; - /// @custom:oz-retyped-from mapping(uint256 => GovernorTimelockCompound.ProposalTimelock) mapping(uint256 => uint256) private _proposalTimelocks; /** diff --git a/contracts/governance/extensions/GovernorTimelockControl.sol b/contracts/governance/extensions/GovernorTimelockControl.sol index fefe31555..111569408 100644 --- a/contracts/governance/extensions/GovernorTimelockControl.sol +++ b/contracts/governance/extensions/GovernorTimelockControl.sol @@ -21,8 +21,6 @@ import {IERC165} from "../../interfaces/IERC165.sol"; * grants them powers that they must be trusted or known not to use: 1) {onlyGovernance} functions like {relay} are * available to them through the timelock, and 2) approved governance proposals can be blocked by them, effectively * executing a Denial of Service attack. This risk will be mitigated in a future release. - * - * _Available since v4.3._ */ abstract contract GovernorTimelockControl is IGovernorTimelock, Governor { TimelockController private _timelock; diff --git a/contracts/governance/extensions/GovernorVotes.sol b/contracts/governance/extensions/GovernorVotes.sol index bb14d7fde..eea43290e 100644 --- a/contracts/governance/extensions/GovernorVotes.sol +++ b/contracts/governance/extensions/GovernorVotes.sol @@ -10,8 +10,6 @@ import {SafeCast} from "../../utils/math/SafeCast.sol"; /** * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes} token. - * - * _Available since v4.3._ */ abstract contract GovernorVotes is Governor { IERC5805 public immutable token; diff --git a/contracts/governance/extensions/GovernorVotesQuorumFraction.sol b/contracts/governance/extensions/GovernorVotesQuorumFraction.sol index bb1c7d2ea..7782130fa 100644 --- a/contracts/governance/extensions/GovernorVotesQuorumFraction.sol +++ b/contracts/governance/extensions/GovernorVotesQuorumFraction.sol @@ -10,13 +10,10 @@ import {Checkpoints} from "../../utils/structs/Checkpoints.sol"; /** * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token and a quorum expressed as a * fraction of the total supply. - * - * _Available since v4.3._ */ abstract contract GovernorVotesQuorumFraction is GovernorVotes { using Checkpoints for Checkpoints.Trace224; - /// @custom:oz-retyped-from Checkpoints.History Checkpoints.Trace224 private _quorumNumeratorHistory; event QuorumNumeratorUpdated(uint256 oldQuorumNumerator, uint256 newQuorumNumerator); diff --git a/contracts/governance/extensions/IGovernorTimelock.sol b/contracts/governance/extensions/IGovernorTimelock.sol index 00254853a..7d9c3c554 100644 --- a/contracts/governance/extensions/IGovernorTimelock.sol +++ b/contracts/governance/extensions/IGovernorTimelock.sol @@ -7,8 +7,6 @@ import {IGovernor} from "../IGovernor.sol"; /** * @dev Extension of the {IGovernor} for timelock supporting modules. - * - * _Available since v4.3._ */ abstract contract IGovernorTimelock is IGovernor { /** diff --git a/contracts/governance/utils/IVotes.sol b/contracts/governance/utils/IVotes.sol index ee17721ff..c664d1255 100644 --- a/contracts/governance/utils/IVotes.sol +++ b/contracts/governance/utils/IVotes.sol @@ -4,8 +4,6 @@ pragma solidity ^0.8.19; /** * @dev Common interface for {ERC20Votes}, {ERC721Votes}, and other {Votes}-enabled contracts. - * - * _Available since v4.5._ */ interface IVotes { /** diff --git a/contracts/governance/utils/Votes.sol b/contracts/governance/utils/Votes.sol index c0ff69e62..1c0bb3289 100644 --- a/contracts/governance/utils/Votes.sol +++ b/contracts/governance/utils/Votes.sol @@ -27,8 +27,6 @@ import {ECDSA} from "../../utils/cryptography/ECDSA.sol"; * When using this module the derived contract must implement {_getVotingUnits} (for example, make it return * {ERC721-balanceOf}), and can use {_transferVotingUnits} to track a change in the distribution of those units (in the * previous example, it would be included in {ERC721-_beforeTokenTransfer}). - * - * _Available since v4.5._ */ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { using Checkpoints for Checkpoints.Trace224; @@ -38,10 +36,8 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { mapping(address => address) private _delegation; - /// @custom:oz-retyped-from mapping(address => Checkpoints.History) mapping(address => Checkpoints.Trace224) private _delegateCheckpoints; - /// @custom:oz-retyped-from Checkpoints.History Checkpoints.Trace224 private _totalCheckpoints; /** diff --git a/contracts/interfaces/IERC1271.sol b/contracts/interfaces/IERC1271.sol index e7fca3079..1523f988e 100644 --- a/contracts/interfaces/IERC1271.sol +++ b/contracts/interfaces/IERC1271.sol @@ -6,8 +6,6 @@ pragma solidity ^0.8.19; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. - * - * _Available since v4.1._ */ interface IERC1271 { /** diff --git a/contracts/interfaces/IERC1967.sol b/contracts/interfaces/IERC1967.sol index 190d86b2c..a57f767f1 100644 --- a/contracts/interfaces/IERC1967.sol +++ b/contracts/interfaces/IERC1967.sol @@ -5,8 +5,6 @@ pragma solidity ^0.8.19; /** * @dev ERC-1967: Proxy Storage Slots. This interface contains the events defined in the ERC. - * - * _Available since v4.8.3._ */ interface IERC1967 { /** diff --git a/contracts/interfaces/IERC2309.sol b/contracts/interfaces/IERC2309.sol index 9d8886994..cd967e41b 100644 --- a/contracts/interfaces/IERC2309.sol +++ b/contracts/interfaces/IERC2309.sol @@ -5,8 +5,6 @@ pragma solidity ^0.8.19; /** * @dev ERC-2309: ERC-721 Consecutive Transfer Extension. - * - * _Available since v4.8._ */ interface IERC2309 { /** diff --git a/contracts/interfaces/IERC2981.sol b/contracts/interfaces/IERC2981.sol index ba0f98c99..18cfa7135 100644 --- a/contracts/interfaces/IERC2981.sol +++ b/contracts/interfaces/IERC2981.sol @@ -10,8 +10,6 @@ import {IERC165} from "../utils/introspection/IERC165.sol"; * * A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal * support for royalty payments across all NFT marketplaces and ecosystem participants. - * - * _Available since v4.5._ */ interface IERC2981 is IERC165 { /** diff --git a/contracts/interfaces/IERC3156FlashBorrower.sol b/contracts/interfaces/IERC3156FlashBorrower.sol index 3f216194b..5c0b88de4 100644 --- a/contracts/interfaces/IERC3156FlashBorrower.sol +++ b/contracts/interfaces/IERC3156FlashBorrower.sol @@ -6,8 +6,6 @@ pragma solidity ^0.8.19; /** * @dev Interface of the ERC3156 FlashBorrower, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. - * - * _Available since v4.1._ */ interface IERC3156FlashBorrower { /** diff --git a/contracts/interfaces/IERC3156FlashLender.sol b/contracts/interfaces/IERC3156FlashLender.sol index e5dd9c523..b52428a06 100644 --- a/contracts/interfaces/IERC3156FlashLender.sol +++ b/contracts/interfaces/IERC3156FlashLender.sol @@ -8,8 +8,6 @@ import {IERC3156FlashBorrower} from "./IERC3156FlashBorrower.sol"; /** * @dev Interface of the ERC3156 FlashLender, as defined in * https://eips.ethereum.org/EIPS/eip-3156[ERC-3156]. - * - * _Available since v4.1._ */ interface IERC3156FlashLender { /** diff --git a/contracts/interfaces/IERC4626.sol b/contracts/interfaces/IERC4626.sol index 27735f6b9..8854b0022 100644 --- a/contracts/interfaces/IERC4626.sol +++ b/contracts/interfaces/IERC4626.sol @@ -9,8 +9,6 @@ import {IERC20Metadata} from "../token/ERC20/extensions/IERC20Metadata.sol"; /** * @dev Interface of the ERC4626 "Tokenized Vault Standard", as defined in * https://eips.ethereum.org/EIPS/eip-4626[ERC-4626]. - * - * _Available since v4.7._ */ interface IERC4626 is IERC20, IERC20Metadata { event Deposit(address indexed sender, address indexed owner, uint256 assets, uint256 shares); diff --git a/contracts/interfaces/IERC5313.sol b/contracts/interfaces/IERC5313.sol index 1d17080a1..1150c322c 100644 --- a/contracts/interfaces/IERC5313.sol +++ b/contracts/interfaces/IERC5313.sol @@ -7,8 +7,6 @@ pragma solidity ^0.8.19; * @dev Interface for the Light Contract Ownership Standard. * * A standardized minimal interface required to identify an account that controls a contract - * - * _Available since v4.9._ */ interface IERC5313 { /** diff --git a/contracts/proxy/Clones.sol b/contracts/proxy/Clones.sol index d859d5645..fea1db13a 100644 --- a/contracts/proxy/Clones.sol +++ b/contracts/proxy/Clones.sol @@ -13,8 +13,6 @@ pragma solidity ^0.8.19; * The library includes functions to deploy a proxy using either `create` (traditional deployment) or `create2` * (salted deterministic deployment). It also includes functions to predict the addresses of clones deployed using the * deterministic method. - * - * _Available since v3.4._ */ library Clones { /** diff --git a/contracts/proxy/ERC1967/ERC1967Utils.sol b/contracts/proxy/ERC1967/ERC1967Utils.sol index 843fa6584..f7caaa684 100644 --- a/contracts/proxy/ERC1967/ERC1967Utils.sol +++ b/contracts/proxy/ERC1967/ERC1967Utils.sol @@ -10,8 +10,6 @@ import {StorageSlot} from "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides getters and event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. - * - * _Available since v4.1._ */ library ERC1967Utils { // We re-declare ERC-1967 events here because they can't be used directly from IERC1967. diff --git a/contracts/proxy/beacon/BeaconProxy.sol b/contracts/proxy/beacon/BeaconProxy.sol index 57883b692..94e697ca4 100644 --- a/contracts/proxy/beacon/BeaconProxy.sol +++ b/contracts/proxy/beacon/BeaconProxy.sol @@ -12,8 +12,6 @@ import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol"; * * The beacon address is stored in storage slot `uint256(keccak256('eip1967.proxy.beacon')) - 1`, so that it doesn't * conflict with the storage layout of the implementation behind the proxy. - * - * _Available since v3.4._ */ contract BeaconProxy is Proxy { /** diff --git a/contracts/proxy/utils/Initializable.sol b/contracts/proxy/utils/Initializable.sol index 86e99531b..a2e3569c4 100644 --- a/contracts/proxy/utils/Initializable.sol +++ b/contracts/proxy/utils/Initializable.sol @@ -58,7 +58,6 @@ import {Address} from "../../utils/Address.sol"; abstract contract Initializable { /** * @dev Indicates that the contract has been initialized. - * @custom:oz-retyped-from bool */ uint8 private _initialized; diff --git a/contracts/proxy/utils/UUPSUpgradeable.sol b/contracts/proxy/utils/UUPSUpgradeable.sol index 7d1515bbb..f4045aa6f 100644 --- a/contracts/proxy/utils/UUPSUpgradeable.sol +++ b/contracts/proxy/utils/UUPSUpgradeable.sol @@ -15,8 +15,6 @@ import {ERC1967Utils} from "../ERC1967/ERC1967Utils.sol"; * `UUPSUpgradeable` with a custom implementation of upgrades. * * The {_authorizeUpgrade} function must be overridden to include access restriction to the upgrade mechanism. - * - * _Available since v4.1._ */ abstract contract UUPSUpgradeable is IERC1822Proxiable { /// @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index a9028f323..7b1c9cfff 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -15,8 +15,6 @@ import {IERC1155Errors} from "../../interfaces/draft-IERC6093.sol"; * @dev Implementation of the basic standard multi-token. * See https://eips.ethereum.org/EIPS/eip-1155 * Originally based on code by Enjin: https://github.com/enjin/erc-1155 - * - * _Available since v3.1._ */ abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors { using Arrays for uint256[]; diff --git a/contracts/token/ERC1155/IERC1155.sol b/contracts/token/ERC1155/IERC1155.sol index 1b0b0ae9d..19b626c9a 100644 --- a/contracts/token/ERC1155/IERC1155.sol +++ b/contracts/token/ERC1155/IERC1155.sol @@ -8,8 +8,6 @@ import {IERC165} from "../../utils/introspection/IERC165.sol"; /** * @dev Required interface of an ERC1155 compliant contract, as defined in the * https://eips.ethereum.org/EIPS/eip-1155[EIP]. - * - * _Available since v3.1._ */ interface IERC1155 is IERC165 { /** diff --git a/contracts/token/ERC1155/IERC1155Receiver.sol b/contracts/token/ERC1155/IERC1155Receiver.sol index 04ef783f1..ce3265246 100644 --- a/contracts/token/ERC1155/IERC1155Receiver.sol +++ b/contracts/token/ERC1155/IERC1155Receiver.sol @@ -6,7 +6,8 @@ pragma solidity ^0.8.19; import {IERC165} from "../../utils/introspection/IERC165.sol"; /** - * @dev _Available since v3.1._ + * @dev Interface that must be implemented by smart contracts in order to receive + * ERC-1155 token transfers. */ interface IERC1155Receiver is IERC165 { /** diff --git a/contracts/token/ERC1155/extensions/ERC1155Burnable.sol b/contracts/token/ERC1155/extensions/ERC1155Burnable.sol index 5ebfcf6c4..3696d1bbe 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Burnable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Burnable.sol @@ -8,8 +8,6 @@ import {ERC1155} from "../ERC1155.sol"; /** * @dev Extension of {ERC1155} that allows token holders to destroy both their * own tokens and those that they have been approved to use. - * - * _Available since v3.1._ */ abstract contract ERC1155Burnable is ERC1155 { function burn(address account, uint256 id, uint256 value) public virtual { diff --git a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol index 960cd3b6e..a51f21599 100644 --- a/contracts/token/ERC1155/extensions/ERC1155Pausable.sol +++ b/contracts/token/ERC1155/extensions/ERC1155Pausable.sol @@ -18,8 +18,6 @@ import {Pausable} from "../../../security/Pausable.sol"; * {Pausable-_pause} and {Pausable-_unpause} internal functions, with appropriate * access control, e.g. using {AccessControl} or {Ownable}. Not doing so will * make the contract pause mechanism of the contract unreachable, and thus unusable. - * - * _Available since v3.1._ */ abstract contract ERC1155Pausable is ERC1155, Pausable { /** diff --git a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol index 303b452b8..2e502fd35 100644 --- a/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol +++ b/contracts/token/ERC1155/extensions/ERC1155URIStorage.sol @@ -9,8 +9,6 @@ import {ERC1155} from "../ERC1155.sol"; /** * @dev ERC1155 token with storage based token URI management. * Inspired by the ERC721URIStorage extension - * - * _Available since v4.6._ */ abstract contract ERC1155URIStorage is ERC1155 { using Strings for uint256; diff --git a/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol b/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol index 88462ef87..d0391d371 100644 --- a/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol +++ b/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol @@ -8,8 +8,6 @@ import {IERC1155} from "../IERC1155.sol"; /** * @dev Interface of the optional ERC1155MetadataExtension interface, as defined * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP]. - * - * _Available since v3.1._ */ interface IERC1155MetadataURI is IERC1155 { /** diff --git a/contracts/token/ERC1155/utils/ERC1155Holder.sol b/contracts/token/ERC1155/utils/ERC1155Holder.sol index 87c42b02f..e288f8692 100644 --- a/contracts/token/ERC1155/utils/ERC1155Holder.sol +++ b/contracts/token/ERC1155/utils/ERC1155Holder.sol @@ -6,12 +6,10 @@ pragma solidity ^0.8.19; import {ERC1155Receiver} from "./ERC1155Receiver.sol"; /** - * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. + * @dev Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. - * - * @dev _Available since v3.1._ */ abstract contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( diff --git a/contracts/token/ERC1155/utils/ERC1155Receiver.sol b/contracts/token/ERC1155/utils/ERC1155Receiver.sol index cf948ced7..02f922cf8 100644 --- a/contracts/token/ERC1155/utils/ERC1155Receiver.sol +++ b/contracts/token/ERC1155/utils/ERC1155Receiver.sol @@ -7,7 +7,9 @@ import {IERC1155Receiver} from "../IERC1155Receiver.sol"; import {IERC165, ERC165} from "../../../utils/introspection/ERC165.sol"; /** - * @dev _Available since v3.1._ + * @dev Basic contract implementing the ERC-165 interface for {IERC1155Receiver}. + * + * NOTE: This contract does not suffice to receive tokens. See {ERC1155Holder}. */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** diff --git a/contracts/token/ERC20/extensions/ERC20FlashMint.sol b/contracts/token/ERC20/extensions/ERC20FlashMint.sol index 0583af5df..5d3e11f76 100644 --- a/contracts/token/ERC20/extensions/ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/ERC20FlashMint.sol @@ -17,8 +17,6 @@ import {ERC20} from "../ERC20.sol"; * NOTE: When this extension is used along with the {ERC20Capped} or {ERC20Votes} extensions, * {maxFlashLoan} will not correctly reflect the maximum that can be flash minted. We recommend * overriding {maxFlashLoan} so that it correctly reflects the supply cap. - * - * _Available since v4.1._ */ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { bytes32 private constant _RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan"); diff --git a/contracts/token/ERC20/extensions/ERC20Permit.sol b/contracts/token/ERC20/extensions/ERC20Permit.sol index 8778f4baf..c83c7dae7 100644 --- a/contracts/token/ERC20/extensions/ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/ERC20Permit.sol @@ -16,8 +16,6 @@ import {Nonces} from "../../../utils/Nonces.sol"; * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't * need to send a transaction, and thus is not required to hold Ether at all. - * - * _Available since v3.4._ */ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces { // solhint-disable-next-line var-name-mixedcase diff --git a/contracts/token/ERC20/extensions/ERC20Votes.sol b/contracts/token/ERC20/extensions/ERC20Votes.sol index c27115eaa..e0d675b2a 100644 --- a/contracts/token/ERC20/extensions/ERC20Votes.sol +++ b/contracts/token/ERC20/extensions/ERC20Votes.sol @@ -20,8 +20,6 @@ import {Checkpoints} from "../../../utils/structs/Checkpoints.sol"; * * By default, token balance does not account for voting power. This makes transfers cheaper. The downside is that it * requires users to delegate to themselves in order to activate checkpoints and have their voting power tracked. - * - * _Available since v4.2._ */ abstract contract ERC20Votes is ERC20, Votes { /** diff --git a/contracts/token/ERC20/extensions/ERC20Wrapper.sol b/contracts/token/ERC20/extensions/ERC20Wrapper.sol index c9e33d00a..fb5f314d7 100644 --- a/contracts/token/ERC20/extensions/ERC20Wrapper.sol +++ b/contracts/token/ERC20/extensions/ERC20Wrapper.sol @@ -12,8 +12,6 @@ import {SafeERC20} from "../utils/SafeERC20.sol"; * Users can deposit and withdraw "underlying tokens" and receive a matching number of "wrapped tokens". This is useful * in conjunction with other modules. For example, combining this wrapping mechanism with {ERC20Votes} will allow the * wrapping of an existing "basic" ERC20 into a governance token. - * - * _Available since v4.2._ */ abstract contract ERC20Wrapper is ERC20 { IERC20 private immutable _underlying; diff --git a/contracts/token/ERC20/extensions/ERC4626.sol b/contracts/token/ERC20/extensions/ERC4626.sol index cb5e03da8..11f1cd593 100644 --- a/contracts/token/ERC20/extensions/ERC4626.sol +++ b/contracts/token/ERC20/extensions/ERC4626.sol @@ -44,8 +44,6 @@ import {Math} from "../../../utils/math/Math.sol"; * * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide]. * ==== - * - * _Available since v4.7._ */ abstract contract ERC4626 is ERC20, IERC4626 { using Math for uint256; diff --git a/contracts/token/ERC20/extensions/IERC20Metadata.sol b/contracts/token/ERC20/extensions/IERC20Metadata.sol index bdfe81145..d79bbaa39 100644 --- a/contracts/token/ERC20/extensions/IERC20Metadata.sol +++ b/contracts/token/ERC20/extensions/IERC20Metadata.sol @@ -7,8 +7,6 @@ import {IERC20} from "../IERC20.sol"; /** * @dev Interface for the optional metadata functions from the ERC20 standard. - * - * _Available since v4.1._ */ interface IERC20Metadata is IERC20 { /** diff --git a/contracts/token/ERC721/extensions/ERC721Consecutive.sol b/contracts/token/ERC721/extensions/ERC721Consecutive.sol index de8d1b629..729475390 100644 --- a/contracts/token/ERC721/extensions/ERC721Consecutive.sol +++ b/contracts/token/ERC721/extensions/ERC721Consecutive.sol @@ -26,8 +26,6 @@ import {Checkpoints} from "../../../utils/structs/Checkpoints.sol"; * IMPORTANT: When overriding {_afterTokenTransfer}, be careful about call ordering. {ownerOf} may return invalid * values during the {_afterTokenTransfer} execution if the super call is not called first. To be safe, execute the * super call before your custom logic. - * - * _Available since v4.8._ */ abstract contract ERC721Consecutive is IERC2309, ERC721 { using BitMaps for BitMaps.BitMap; diff --git a/contracts/token/ERC721/extensions/ERC721Royalty.sol b/contracts/token/ERC721/extensions/ERC721Royalty.sol index 107fc6709..becea403b 100644 --- a/contracts/token/ERC721/extensions/ERC721Royalty.sol +++ b/contracts/token/ERC721/extensions/ERC721Royalty.sol @@ -17,8 +17,6 @@ import {ERC165} from "../../../utils/introspection/ERC165.sol"; * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. - * - * _Available since v4.5._ */ abstract contract ERC721Royalty is ERC2981, ERC721 { /** diff --git a/contracts/token/ERC721/extensions/ERC721Votes.sol b/contracts/token/ERC721/extensions/ERC721Votes.sol index ed958c7a6..9e93ff711 100644 --- a/contracts/token/ERC721/extensions/ERC721Votes.sol +++ b/contracts/token/ERC721/extensions/ERC721Votes.sol @@ -13,8 +13,6 @@ import {Votes} from "../../../governance/utils/Votes.sol"; * Tokens do not count as votes until they are delegated, because votes must be tracked which incurs an additional cost * on every transfer. Token holders can either delegate to a trusted representative who will decide how to make use of * the votes in governance decisions, or they can delegate to themselves to be their own representative. - * - * _Available since v4.5._ */ abstract contract ERC721Votes is ERC721, Votes { /** diff --git a/contracts/token/ERC721/extensions/ERC721Wrapper.sol b/contracts/token/ERC721/extensions/ERC721Wrapper.sol index 426461337..395508b71 100644 --- a/contracts/token/ERC721/extensions/ERC721Wrapper.sol +++ b/contracts/token/ERC721/extensions/ERC721Wrapper.sol @@ -12,8 +12,6 @@ import {IERC721Receiver} from "../IERC721Receiver.sol"; * Users can deposit and withdraw an "underlying token" and receive a "wrapped token" with a matching tokenId. This is useful * in conjunction with other modules. For example, combining this wrapping mechanism with {ERC721Votes} will allow the * wrapping of an existing "basic" ERC721 into a governance token. - * - * _Available since v4.9.0_ */ abstract contract ERC721Wrapper is ERC721, IERC721Receiver { IERC721 private immutable _underlying; diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index b9183e34e..e683b41c5 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -18,8 +18,6 @@ import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol"; * IMPORTANT: ERC-2981 only specifies a way to signal royalty information and does not enforce its payment. See * https://eips.ethereum.org/EIPS/eip-2981#optional-royalty-payments[Rationale] in the EIP. Marketplaces are expected to * voluntarily pay royalties together with sales, but note that this standard is not yet widely supported. - * - * _Available since v4.5._ */ abstract contract ERC2981 is IERC2981, ERC165 { struct RoyaltyInfo { diff --git a/contracts/utils/Address.sol b/contracts/utils/Address.sol index 859332b39..3f5d0a55b 100644 --- a/contracts/utils/Address.sol +++ b/contracts/utils/Address.sol @@ -64,8 +64,6 @@ library Address { * * - `target` must be a contract. * - calling `target` with `data` must not revert. - * - * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return functionCallWithValue(target, data, 0, defaultRevert); @@ -78,8 +76,6 @@ library Address { * Requirements: * * - `customRevert` must be a reverting function. - * - * _Available since v5.0._ */ function functionCall( address target, @@ -97,8 +93,6 @@ library Address { * * - the calling contract must have an ETH balance of at least `value`. * - the called Solidity function must be `payable`. - * - * _Available since v3.1._ */ function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) { return functionCallWithValue(target, data, value, defaultRevert); @@ -111,8 +105,6 @@ library Address { * Requirements: * * - `customRevert` must be a reverting function. - * - * _Available since v5.0._ */ function functionCallWithValue( address target, @@ -130,8 +122,6 @@ library Address { /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a static call. - * - * _Available since v3.3._ */ function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) { return functionStaticCall(target, data, defaultRevert); @@ -140,8 +130,6 @@ library Address { /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a static call. - * - * _Available since v3.3._ */ function functionStaticCall( address target, @@ -155,8 +143,6 @@ library Address { /** * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], * but performing a delegate call. - * - * _Available since v3.4._ */ function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { return functionDelegateCall(target, data, defaultRevert); @@ -165,8 +151,6 @@ library Address { /** * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], * but performing a delegate call. - * - * _Available since v3.4._ */ function functionDelegateCall( address target, @@ -180,8 +164,6 @@ library Address { /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided `customRevert`) in case of unsuccessful call or if target was not a contract. - * - * _Available since v5.0._ */ function verifyCallResultFromTarget( address target, @@ -206,8 +188,6 @@ library Address { /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or with a default revert error. - * - * _Available since v5.0._ */ function verifyCallResult(bool success, bytes memory returndata) internal view returns (bytes memory) { return verifyCallResult(success, returndata, defaultRevert); @@ -220,8 +200,6 @@ library Address { * Requirements: * * - `customRevert` must be a reverting function. - * - * _Available since v5.0._ */ function verifyCallResult( bool success, diff --git a/contracts/utils/Base64.sol b/contracts/utils/Base64.sol index 9ba6defe0..ae73ec4af 100644 --- a/contracts/utils/Base64.sol +++ b/contracts/utils/Base64.sol @@ -5,8 +5,6 @@ pragma solidity ^0.8.19; /** * @dev Provides a set of functions to operate with Base64 strings. - * - * _Available since v4.5._ */ library Base64 { /** diff --git a/contracts/utils/Multicall.sol b/contracts/utils/Multicall.sol index fed9844c4..12c01ef11 100644 --- a/contracts/utils/Multicall.sol +++ b/contracts/utils/Multicall.sol @@ -7,8 +7,6 @@ import {Address} from "./Address.sol"; /** * @dev Provides a function to batch together multiple calls in a single external call. - * - * _Available since v4.1._ */ abstract contract Multicall { /** diff --git a/contracts/utils/StorageSlot.sol b/contracts/utils/StorageSlot.sol index b0e918967..cae1c8b68 100644 --- a/contracts/utils/StorageSlot.sol +++ b/contracts/utils/StorageSlot.sol @@ -27,9 +27,6 @@ pragma solidity ^0.8.19; * } * } * ``` - * - * _Available since v4.1 for `address`, `bool`, `bytes32`, `uint256`._ - * _Available since v4.9 for `string`, `bytes`._ */ library StorageSlot { struct AddressSlot { diff --git a/contracts/utils/cryptography/ECDSA.sol b/contracts/utils/cryptography/ECDSA.sol index 5e67a7591..aabfb5ca2 100644 --- a/contracts/utils/cryptography/ECDSA.sol +++ b/contracts/utils/cryptography/ECDSA.sol @@ -63,8 +63,6 @@ library ECDSA { * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] - * - * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError, bytes32) { if (signature.length == 65) { @@ -109,8 +107,6 @@ library ECDSA { * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] - * - * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address, RecoverError, bytes32) { unchecked { @@ -123,8 +119,6 @@ library ECDSA { /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. - * - * _Available since v4.2._ */ function recover(bytes32 hash, bytes32 r, bytes32 vs) internal pure returns (address) { (address recovered, RecoverError error, bytes32 errorArg) = tryRecover(hash, r, vs); @@ -135,8 +129,6 @@ library ECDSA { /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. - * - * _Available since v4.3._ */ function tryRecover( bytes32 hash, diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol index d94e956af..ff34e8146 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -28,8 +28,6 @@ import {IERC5267} from "../../interfaces/IERC5267.sol"; * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. * - * _Available since v3.4._ - * * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment */ abstract contract EIP712 is IERC5267 { @@ -111,8 +109,6 @@ abstract contract EIP712 is IERC5267 { /** * @dev See {IERC-5267}. - * - * _Available since v4.9._ */ function eip712Domain() public @@ -144,8 +140,6 @@ abstract contract EIP712 is IERC5267 { * * NOTE: By default this function reads _name which is an immutable value. * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). - * - * _Available since v5.0._ */ // solhint-disable-next-line func-name-mixedcase function _EIP712Name() internal view returns (string memory) { @@ -157,8 +151,6 @@ abstract contract EIP712 is IERC5267 { * * NOTE: By default this function reads _version which is an immutable value. * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). - * - * _Available since v5.0._ */ // solhint-disable-next-line func-name-mixedcase function _EIP712Version() internal view returns (string memory) { diff --git a/contracts/utils/cryptography/MerkleProof.sol b/contracts/utils/cryptography/MerkleProof.sol index 94586ff7b..17a6384fe 100644 --- a/contracts/utils/cryptography/MerkleProof.sol +++ b/contracts/utils/cryptography/MerkleProof.sol @@ -35,8 +35,6 @@ library MerkleProof { /** * @dev Calldata version of {verify} - * - * _Available since v4.7._ */ function verifyCalldata(bytes32[] calldata proof, bytes32 root, bytes32 leaf) internal pure returns (bool) { return processProofCalldata(proof, leaf) == root; @@ -47,8 +45,6 @@ library MerkleProof { * from `leaf` using `proof`. A `proof` is valid if and only if the rebuilt * hash matches the root of the tree. When processing the proof, the pairs * of leafs & pre-images are assumed to be sorted. - * - * _Available since v4.4._ */ function processProof(bytes32[] memory proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; @@ -60,8 +56,6 @@ library MerkleProof { /** * @dev Calldata version of {processProof} - * - * _Available since v4.7._ */ function processProofCalldata(bytes32[] calldata proof, bytes32 leaf) internal pure returns (bytes32) { bytes32 computedHash = leaf; @@ -76,8 +70,6 @@ library MerkleProof { * `root`, according to `proof` and `proofFlags` as described in {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. - * - * _Available since v4.7._ */ function multiProofVerify( bytes32[] memory proof, @@ -92,8 +84,6 @@ library MerkleProof { * @dev Calldata version of {multiProofVerify} * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. - * - * _Available since v4.7._ */ function multiProofVerifyCalldata( bytes32[] calldata proof, @@ -113,8 +103,6 @@ library MerkleProof { * CAUTION: Not all merkle trees admit multiproofs. To use multiproofs, it is sufficient to ensure that: 1) the tree * is complete (but not necessarily perfect), 2) the leaves to be proven are in the opposite order they are in the * tree (i.e., as seen from right to left starting at the deepest layer and continuing at the next layer). - * - * _Available since v4.7._ */ function processMultiProof( bytes32[] memory proof, @@ -171,8 +159,6 @@ library MerkleProof { * @dev Calldata version of {processMultiProof}. * * CAUTION: Not all merkle trees admit multiproofs. See {processMultiProof} for details. - * - * _Available since v4.7._ */ function processMultiProofCalldata( bytes32[] calldata proof, diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index dfc512b39..f2cc2c4ed 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -9,9 +9,7 @@ import {IERC1271} from "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like - * Argent and Gnosis Safe. - * - * _Available since v4.1._ + * Argent and Safe Wallet (previously Gnosis Safe). */ library SignatureChecker { /** diff --git a/contracts/utils/introspection/ERC165Checker.sol b/contracts/utils/introspection/ERC165Checker.sol index d614c6755..86212695a 100644 --- a/contracts/utils/introspection/ERC165Checker.sol +++ b/contracts/utils/introspection/ERC165Checker.sol @@ -45,8 +45,6 @@ library ERC165Checker { * is that some interfaces may not be supported. * * See {IERC165-supportsInterface}. - * - * _Available since v3.4._ */ function getSupportedInterfaces( address account, diff --git a/contracts/utils/math/Math.sol b/contracts/utils/math/Math.sol index d372295d7..f55b69afc 100644 --- a/contracts/utils/math/Math.sol +++ b/contracts/utils/math/Math.sol @@ -20,8 +20,6 @@ library Math { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. - * - * _Available since v5.0._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { @@ -33,8 +31,6 @@ library Math { /** * @dev Returns the subtraction of two unsigned integers, with an overflow flag. - * - * _Available since v5.0._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { @@ -45,8 +41,6 @@ library Math { /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. - * - * _Available since v5.0._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { @@ -62,8 +56,6 @@ library Math { /** * @dev Returns the division of two unsigned integers, with a division by zero flag. - * - * _Available since v5.0._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { @@ -74,8 +66,6 @@ library Math { /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. - * - * _Available since v5.0._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { diff --git a/contracts/utils/math/SafeCast.sol b/contracts/utils/math/SafeCast.sol index d3b86b088..64f180cd2 100644 --- a/contracts/utils/math/SafeCast.sol +++ b/contracts/utils/math/SafeCast.sol @@ -46,8 +46,6 @@ library SafeCast { * Requirements: * * - input must fit into 248 bits - * - * _Available since v4.7._ */ function toUint248(uint256 value) internal pure returns (uint248) { if (value > type(uint248).max) { @@ -65,8 +63,6 @@ library SafeCast { * Requirements: * * - input must fit into 240 bits - * - * _Available since v4.7._ */ function toUint240(uint256 value) internal pure returns (uint240) { if (value > type(uint240).max) { @@ -84,8 +80,6 @@ library SafeCast { * Requirements: * * - input must fit into 232 bits - * - * _Available since v4.7._ */ function toUint232(uint256 value) internal pure returns (uint232) { if (value > type(uint232).max) { @@ -103,8 +97,6 @@ library SafeCast { * Requirements: * * - input must fit into 224 bits - * - * _Available since v4.2._ */ function toUint224(uint256 value) internal pure returns (uint224) { if (value > type(uint224).max) { @@ -122,8 +114,6 @@ library SafeCast { * Requirements: * * - input must fit into 216 bits - * - * _Available since v4.7._ */ function toUint216(uint256 value) internal pure returns (uint216) { if (value > type(uint216).max) { @@ -141,8 +131,6 @@ library SafeCast { * Requirements: * * - input must fit into 208 bits - * - * _Available since v4.7._ */ function toUint208(uint256 value) internal pure returns (uint208) { if (value > type(uint208).max) { @@ -160,8 +148,6 @@ library SafeCast { * Requirements: * * - input must fit into 200 bits - * - * _Available since v4.7._ */ function toUint200(uint256 value) internal pure returns (uint200) { if (value > type(uint200).max) { @@ -179,8 +165,6 @@ library SafeCast { * Requirements: * * - input must fit into 192 bits - * - * _Available since v4.7._ */ function toUint192(uint256 value) internal pure returns (uint192) { if (value > type(uint192).max) { @@ -198,8 +182,6 @@ library SafeCast { * Requirements: * * - input must fit into 184 bits - * - * _Available since v4.7._ */ function toUint184(uint256 value) internal pure returns (uint184) { if (value > type(uint184).max) { @@ -217,8 +199,6 @@ library SafeCast { * Requirements: * * - input must fit into 176 bits - * - * _Available since v4.7._ */ function toUint176(uint256 value) internal pure returns (uint176) { if (value > type(uint176).max) { @@ -236,8 +216,6 @@ library SafeCast { * Requirements: * * - input must fit into 168 bits - * - * _Available since v4.7._ */ function toUint168(uint256 value) internal pure returns (uint168) { if (value > type(uint168).max) { @@ -255,8 +233,6 @@ library SafeCast { * Requirements: * * - input must fit into 160 bits - * - * _Available since v4.7._ */ function toUint160(uint256 value) internal pure returns (uint160) { if (value > type(uint160).max) { @@ -274,8 +250,6 @@ library SafeCast { * Requirements: * * - input must fit into 152 bits - * - * _Available since v4.7._ */ function toUint152(uint256 value) internal pure returns (uint152) { if (value > type(uint152).max) { @@ -293,8 +267,6 @@ library SafeCast { * Requirements: * * - input must fit into 144 bits - * - * _Available since v4.7._ */ function toUint144(uint256 value) internal pure returns (uint144) { if (value > type(uint144).max) { @@ -312,8 +284,6 @@ library SafeCast { * Requirements: * * - input must fit into 136 bits - * - * _Available since v4.7._ */ function toUint136(uint256 value) internal pure returns (uint136) { if (value > type(uint136).max) { @@ -331,8 +301,6 @@ library SafeCast { * Requirements: * * - input must fit into 128 bits - * - * _Available since v2.5._ */ function toUint128(uint256 value) internal pure returns (uint128) { if (value > type(uint128).max) { @@ -350,8 +318,6 @@ library SafeCast { * Requirements: * * - input must fit into 120 bits - * - * _Available since v4.7._ */ function toUint120(uint256 value) internal pure returns (uint120) { if (value > type(uint120).max) { @@ -369,8 +335,6 @@ library SafeCast { * Requirements: * * - input must fit into 112 bits - * - * _Available since v4.7._ */ function toUint112(uint256 value) internal pure returns (uint112) { if (value > type(uint112).max) { @@ -388,8 +352,6 @@ library SafeCast { * Requirements: * * - input must fit into 104 bits - * - * _Available since v4.7._ */ function toUint104(uint256 value) internal pure returns (uint104) { if (value > type(uint104).max) { @@ -407,8 +369,6 @@ library SafeCast { * Requirements: * * - input must fit into 96 bits - * - * _Available since v4.2._ */ function toUint96(uint256 value) internal pure returns (uint96) { if (value > type(uint96).max) { @@ -426,8 +386,6 @@ library SafeCast { * Requirements: * * - input must fit into 88 bits - * - * _Available since v4.7._ */ function toUint88(uint256 value) internal pure returns (uint88) { if (value > type(uint88).max) { @@ -445,8 +403,6 @@ library SafeCast { * Requirements: * * - input must fit into 80 bits - * - * _Available since v4.7._ */ function toUint80(uint256 value) internal pure returns (uint80) { if (value > type(uint80).max) { @@ -464,8 +420,6 @@ library SafeCast { * Requirements: * * - input must fit into 72 bits - * - * _Available since v4.7._ */ function toUint72(uint256 value) internal pure returns (uint72) { if (value > type(uint72).max) { @@ -483,8 +437,6 @@ library SafeCast { * Requirements: * * - input must fit into 64 bits - * - * _Available since v2.5._ */ function toUint64(uint256 value) internal pure returns (uint64) { if (value > type(uint64).max) { @@ -502,8 +454,6 @@ library SafeCast { * Requirements: * * - input must fit into 56 bits - * - * _Available since v4.7._ */ function toUint56(uint256 value) internal pure returns (uint56) { if (value > type(uint56).max) { @@ -521,8 +471,6 @@ library SafeCast { * Requirements: * * - input must fit into 48 bits - * - * _Available since v4.7._ */ function toUint48(uint256 value) internal pure returns (uint48) { if (value > type(uint48).max) { @@ -540,8 +488,6 @@ library SafeCast { * Requirements: * * - input must fit into 40 bits - * - * _Available since v4.7._ */ function toUint40(uint256 value) internal pure returns (uint40) { if (value > type(uint40).max) { @@ -559,8 +505,6 @@ library SafeCast { * Requirements: * * - input must fit into 32 bits - * - * _Available since v2.5._ */ function toUint32(uint256 value) internal pure returns (uint32) { if (value > type(uint32).max) { @@ -578,8 +522,6 @@ library SafeCast { * Requirements: * * - input must fit into 24 bits - * - * _Available since v4.7._ */ function toUint24(uint256 value) internal pure returns (uint24) { if (value > type(uint24).max) { @@ -597,8 +539,6 @@ library SafeCast { * Requirements: * * - input must fit into 16 bits - * - * _Available since v2.5._ */ function toUint16(uint256 value) internal pure returns (uint16) { if (value > type(uint16).max) { @@ -616,8 +556,6 @@ library SafeCast { * Requirements: * * - input must fit into 8 bits - * - * _Available since v2.5._ */ function toUint8(uint256 value) internal pure returns (uint8) { if (value > type(uint8).max) { @@ -632,8 +570,6 @@ library SafeCast { * Requirements: * * - input must be greater than or equal to 0. - * - * _Available since v3.0._ */ function toUint256(int256 value) internal pure returns (uint256) { if (value < 0) { @@ -652,8 +588,6 @@ library SafeCast { * Requirements: * * - input must fit into 248 bits - * - * _Available since v4.7._ */ function toInt248(int256 value) internal pure returns (int248 downcasted) { downcasted = int248(value); @@ -672,8 +606,6 @@ library SafeCast { * Requirements: * * - input must fit into 240 bits - * - * _Available since v4.7._ */ function toInt240(int256 value) internal pure returns (int240 downcasted) { downcasted = int240(value); @@ -692,8 +624,6 @@ library SafeCast { * Requirements: * * - input must fit into 232 bits - * - * _Available since v4.7._ */ function toInt232(int256 value) internal pure returns (int232 downcasted) { downcasted = int232(value); @@ -712,8 +642,6 @@ library SafeCast { * Requirements: * * - input must fit into 224 bits - * - * _Available since v4.7._ */ function toInt224(int256 value) internal pure returns (int224 downcasted) { downcasted = int224(value); @@ -732,8 +660,6 @@ library SafeCast { * Requirements: * * - input must fit into 216 bits - * - * _Available since v4.7._ */ function toInt216(int256 value) internal pure returns (int216 downcasted) { downcasted = int216(value); @@ -752,8 +678,6 @@ library SafeCast { * Requirements: * * - input must fit into 208 bits - * - * _Available since v4.7._ */ function toInt208(int256 value) internal pure returns (int208 downcasted) { downcasted = int208(value); @@ -772,8 +696,6 @@ library SafeCast { * Requirements: * * - input must fit into 200 bits - * - * _Available since v4.7._ */ function toInt200(int256 value) internal pure returns (int200 downcasted) { downcasted = int200(value); @@ -792,8 +714,6 @@ library SafeCast { * Requirements: * * - input must fit into 192 bits - * - * _Available since v4.7._ */ function toInt192(int256 value) internal pure returns (int192 downcasted) { downcasted = int192(value); @@ -812,8 +732,6 @@ library SafeCast { * Requirements: * * - input must fit into 184 bits - * - * _Available since v4.7._ */ function toInt184(int256 value) internal pure returns (int184 downcasted) { downcasted = int184(value); @@ -832,8 +750,6 @@ library SafeCast { * Requirements: * * - input must fit into 176 bits - * - * _Available since v4.7._ */ function toInt176(int256 value) internal pure returns (int176 downcasted) { downcasted = int176(value); @@ -852,8 +768,6 @@ library SafeCast { * Requirements: * * - input must fit into 168 bits - * - * _Available since v4.7._ */ function toInt168(int256 value) internal pure returns (int168 downcasted) { downcasted = int168(value); @@ -872,8 +786,6 @@ library SafeCast { * Requirements: * * - input must fit into 160 bits - * - * _Available since v4.7._ */ function toInt160(int256 value) internal pure returns (int160 downcasted) { downcasted = int160(value); @@ -892,8 +804,6 @@ library SafeCast { * Requirements: * * - input must fit into 152 bits - * - * _Available since v4.7._ */ function toInt152(int256 value) internal pure returns (int152 downcasted) { downcasted = int152(value); @@ -912,8 +822,6 @@ library SafeCast { * Requirements: * * - input must fit into 144 bits - * - * _Available since v4.7._ */ function toInt144(int256 value) internal pure returns (int144 downcasted) { downcasted = int144(value); @@ -932,8 +840,6 @@ library SafeCast { * Requirements: * * - input must fit into 136 bits - * - * _Available since v4.7._ */ function toInt136(int256 value) internal pure returns (int136 downcasted) { downcasted = int136(value); @@ -952,8 +858,6 @@ library SafeCast { * Requirements: * * - input must fit into 128 bits - * - * _Available since v3.1._ */ function toInt128(int256 value) internal pure returns (int128 downcasted) { downcasted = int128(value); @@ -972,8 +876,6 @@ library SafeCast { * Requirements: * * - input must fit into 120 bits - * - * _Available since v4.7._ */ function toInt120(int256 value) internal pure returns (int120 downcasted) { downcasted = int120(value); @@ -992,8 +894,6 @@ library SafeCast { * Requirements: * * - input must fit into 112 bits - * - * _Available since v4.7._ */ function toInt112(int256 value) internal pure returns (int112 downcasted) { downcasted = int112(value); @@ -1012,8 +912,6 @@ library SafeCast { * Requirements: * * - input must fit into 104 bits - * - * _Available since v4.7._ */ function toInt104(int256 value) internal pure returns (int104 downcasted) { downcasted = int104(value); @@ -1032,8 +930,6 @@ library SafeCast { * Requirements: * * - input must fit into 96 bits - * - * _Available since v4.7._ */ function toInt96(int256 value) internal pure returns (int96 downcasted) { downcasted = int96(value); @@ -1052,8 +948,6 @@ library SafeCast { * Requirements: * * - input must fit into 88 bits - * - * _Available since v4.7._ */ function toInt88(int256 value) internal pure returns (int88 downcasted) { downcasted = int88(value); @@ -1072,8 +966,6 @@ library SafeCast { * Requirements: * * - input must fit into 80 bits - * - * _Available since v4.7._ */ function toInt80(int256 value) internal pure returns (int80 downcasted) { downcasted = int80(value); @@ -1092,8 +984,6 @@ library SafeCast { * Requirements: * * - input must fit into 72 bits - * - * _Available since v4.7._ */ function toInt72(int256 value) internal pure returns (int72 downcasted) { downcasted = int72(value); @@ -1112,8 +1002,6 @@ library SafeCast { * Requirements: * * - input must fit into 64 bits - * - * _Available since v3.1._ */ function toInt64(int256 value) internal pure returns (int64 downcasted) { downcasted = int64(value); @@ -1132,8 +1020,6 @@ library SafeCast { * Requirements: * * - input must fit into 56 bits - * - * _Available since v4.7._ */ function toInt56(int256 value) internal pure returns (int56 downcasted) { downcasted = int56(value); @@ -1152,8 +1038,6 @@ library SafeCast { * Requirements: * * - input must fit into 48 bits - * - * _Available since v4.7._ */ function toInt48(int256 value) internal pure returns (int48 downcasted) { downcasted = int48(value); @@ -1172,8 +1056,6 @@ library SafeCast { * Requirements: * * - input must fit into 40 bits - * - * _Available since v4.7._ */ function toInt40(int256 value) internal pure returns (int40 downcasted) { downcasted = int40(value); @@ -1192,8 +1074,6 @@ library SafeCast { * Requirements: * * - input must fit into 32 bits - * - * _Available since v3.1._ */ function toInt32(int256 value) internal pure returns (int32 downcasted) { downcasted = int32(value); @@ -1212,8 +1092,6 @@ library SafeCast { * Requirements: * * - input must fit into 24 bits - * - * _Available since v4.7._ */ function toInt24(int256 value) internal pure returns (int24 downcasted) { downcasted = int24(value); @@ -1232,8 +1110,6 @@ library SafeCast { * Requirements: * * - input must fit into 16 bits - * - * _Available since v3.1._ */ function toInt16(int256 value) internal pure returns (int16 downcasted) { downcasted = int16(value); @@ -1252,8 +1128,6 @@ library SafeCast { * Requirements: * * - input must fit into 8 bits - * - * _Available since v3.1._ */ function toInt8(int256 value) internal pure returns (int8 downcasted) { downcasted = int8(value); @@ -1268,8 +1142,6 @@ library SafeCast { * Requirements: * * - input must be less than or equal to maxInt256. - * - * _Available since v3.0._ */ function toInt256(uint256 value) internal pure returns (int256) { // Note: Unsafe cast below is okay because `type(int256).max` is guaranteed to be positive diff --git a/contracts/utils/structs/Checkpoints.sol b/contracts/utils/structs/Checkpoints.sol index 56b7035b9..6c73a08d8 100644 --- a/contracts/utils/structs/Checkpoints.sol +++ b/contracts/utils/structs/Checkpoints.sol @@ -12,8 +12,6 @@ import {Math} from "../math/Math.sol"; * * To create a history of checkpoints define a variable type `Checkpoints.Trace*` in your contract, and store a new * checkpoint for the current transaction block using the {push} function. - * - * _Available since v4.5._ */ library Checkpoints { /** diff --git a/contracts/utils/structs/DoubleEndedQueue.sol b/contracts/utils/structs/DoubleEndedQueue.sol index 5183bad8c..30d953239 100644 --- a/contracts/utils/structs/DoubleEndedQueue.sol +++ b/contracts/utils/structs/DoubleEndedQueue.sol @@ -15,8 +15,6 @@ import {SafeCast} from "../math/SafeCast.sol"; * ```solidity * DoubleEndedQueue.Bytes32Deque queue; * ``` - * - * _Available since v4.6._ */ library DoubleEndedQueue { /** diff --git a/hardhat.config.js b/hardhat.config.js index 6cb8b9144..8ee5d05e5 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -78,6 +78,7 @@ module.exports = { warnings: { 'contracts-exposed/**/*': { 'code-size': 'off', + 'initcode-size': 'off', }, '*': { 'code-size': withOptimizations, diff --git a/package-lock.json b/package-lock.json index a85611941..3f9a4f5da 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,34 +51,43 @@ "yargs": "^17.0.0" } }, + "node_modules/@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" }, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true, "engines": { "node": ">=6.9.0" } }, "node_modules/@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -87,9 +96,9 @@ } }, "node_modules/@babel/runtime": { - "version": "7.22.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz", - "integrity": "sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", "dev": true, "dependencies": { "regenerator-runtime": "^0.13.11" @@ -125,13 +134,13 @@ } }, "node_modules/@changesets/apply-release-plan": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.3.tgz", - "integrity": "sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", + "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/config": "^2.3.0", + "@changesets/config": "^2.3.1", "@changesets/get-version-range-type": "^0.3.2", "@changesets/git": "^2.0.0", "@changesets/types": "^5.2.1", @@ -142,39 +151,21 @@ "outdent": "^0.5.0", "prettier": "^2.7.1", "resolve-from": "^5.0.0", - "semver": "^5.4.1" - } - }, - "node_modules/@changesets/apply-release-plan/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" + "semver": "^7.5.3" } }, "node_modules/@changesets/assemble-release-plan": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.3.tgz", - "integrity": "sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", + "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.5", + "@changesets/get-dependents-graph": "^1.3.6", "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", - "semver": "^5.4.1" - } - }, - "node_modules/@changesets/assemble-release-plan/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" + "semver": "^7.5.3" } }, "node_modules/@changesets/changelog-git": { @@ -198,19 +189,19 @@ } }, "node_modules/@changesets/cli": { - "version": "2.26.1", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.1.tgz", - "integrity": "sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==", + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", + "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/apply-release-plan": "^6.1.3", - "@changesets/assemble-release-plan": "^5.2.3", + "@changesets/apply-release-plan": "^6.1.4", + "@changesets/assemble-release-plan": "^5.2.4", "@changesets/changelog-git": "^0.1.14", - "@changesets/config": "^2.3.0", + "@changesets/config": "^2.3.1", "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.5", - "@changesets/get-release-plan": "^3.0.16", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/get-release-plan": "^3.0.17", "@changesets/git": "^2.0.0", "@changesets/logger": "^0.0.5", "@changesets/pre": "^1.0.14", @@ -219,7 +210,7 @@ "@changesets/write": "^0.2.3", "@manypkg/get-packages": "^1.1.3", "@types/is-ci": "^3.0.0", - "@types/semver": "^6.0.0", + "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", "chalk": "^2.1.0", "enquirer": "^2.3.0", @@ -232,7 +223,7 @@ "p-limit": "^2.2.0", "preferred-pm": "^3.0.0", "resolve-from": "^5.0.0", - "semver": "^5.4.1", + "semver": "^7.5.3", "spawndamnit": "^2.0.0", "term-size": "^2.1.0", "tty-table": "^4.1.5" @@ -256,23 +247,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@changesets/cli/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, "node_modules/@changesets/config": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.0.tgz", - "integrity": "sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", + "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", "dev": true, "dependencies": { "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.5", + "@changesets/get-dependents-graph": "^1.3.6", "@changesets/logger": "^0.0.5", "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", @@ -290,25 +272,16 @@ } }, "node_modules/@changesets/get-dependents-graph": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.5.tgz", - "integrity": "sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", + "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", "dev": true, "dependencies": { "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", "chalk": "^2.1.0", "fs-extra": "^7.0.1", - "semver": "^5.4.1" - } - }, - "node_modules/@changesets/get-dependents-graph/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true, - "bin": { - "semver": "bin/semver" + "semver": "^7.5.3" } }, "node_modules/@changesets/get-github-info": { @@ -322,14 +295,14 @@ } }, "node_modules/@changesets/get-release-plan": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.16.tgz", - "integrity": "sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", + "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", "dev": true, "dependencies": { "@babel/runtime": "^7.20.1", - "@changesets/assemble-release-plan": "^5.2.3", - "@changesets/config": "^2.3.0", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/config": "^2.3.1", "@changesets/pre": "^1.0.14", "@changesets/read": "^0.5.9", "@changesets/types": "^5.2.1", @@ -549,14 +522,14 @@ } }, "node_modules/@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", + "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "dev": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -590,9 +563,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", + "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -1369,9 +1342,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -2257,9 +2230,9 @@ } }, "node_modules/@openzeppelin/upgrades-core": { - "version": "1.26.2", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.26.2.tgz", - "integrity": "sha512-TJORrgyun5qflPos/47P3j61gDw+7W+tEirSBOYRxfVL1WGjX1n8iaLrijPIqzyeS1MKguN1nckAMspQ4SKrxw==", + "version": "1.27.1", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.27.1.tgz", + "integrity": "sha512-6tLcu6jt0nYdJNr+LRicBgP3jp+//B+dixgB3KsvycSglCHNfmBNDf0ZQ3ZquDdLL0QQmKzIs1EBRVp6lNvPnQ==", "dev": true, "dependencies": { "cbor": "^8.0.0", @@ -2267,8 +2240,12 @@ "compare-versions": "^5.0.0", "debug": "^4.1.1", "ethereumjs-util": "^7.0.3", + "minimist": "^1.2.7", "proper-lockfile": "^4.1.1", "solidity-ast": "^0.4.15" + }, + "bin": { + "openzeppelin-upgrades-core": "dist/cli/cli.js" } }, "node_modules/@openzeppelin/upgrades-core/node_modules/ansi-styles": { @@ -2522,9 +2499,9 @@ } }, "node_modules/@truffle/abi-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-1.0.0.tgz", - "integrity": "sha512-h1wGFB28YfByAWm/uBeMCwqDlGsrcMYTumLC/sB/qYhHisi1LK6tV47FEF7zKyf6Al2CtsO28v02+wfLXbUVRg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-1.0.1.tgz", + "integrity": "sha512-ZQUY3XUxEPdqxNaoXsOqF0spTtb6f5RNlnN4MUrVsJ64sOh0FJsY7rxZiUI3khfePmNh4i2qcJrQlKT36YcWUA==", "dev": true, "dependencies": { "change-case": "3.0.2", @@ -2533,25 +2510,25 @@ } }, "node_modules/@truffle/blockchain-utils": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.7.tgz", - "integrity": "sha512-1nibqGjEHC7KAyDThEFvbm2+EO8zAHee/VjCtxkYBE3ySwP50joh0QCEBjy7K/9z+icpMoDucfxmgaKToBFUgQ==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.8.tgz", + "integrity": "sha512-ZskpYDNHkXD3ota4iU3pZz6kLth87RC+wDn66Rp2Or+DqqJCKdnmS9GDctBi1EcMPDEi0BqpkdrfBuzA9uIkGg==", "dev": true }, "node_modules/@truffle/codec": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.15.1.tgz", - "integrity": "sha512-OBANcmefxEXLApWl/uU1SOHQJixO8pDaRTybP0YMvxPhgyj7G7+wC+fUvnZdmrTJD2WJFLuoYvZbxILmycEvPg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.17.0.tgz", + "integrity": "sha512-0Z7DQNCnvW++JuvNj35v/CuJoaFSAp7/+lXWwe+Zoe++E27V+hzRI88ZYxRJa0/q1HE81epd1r0ipqc7WBotig==", "dev": true, "dependencies": { - "@truffle/abi-utils": "^1.0.0", - "@truffle/compile-common": "^0.9.5", + "@truffle/abi-utils": "^1.0.1", + "@truffle/compile-common": "^0.9.6", "big.js": "^6.0.3", "bn.js": "^5.1.3", "cbor": "^5.2.0", "debug": "^4.3.1", "lodash": "^4.17.21", - "semver": "7.3.7", + "semver": "7.5.2", "utf8": "^3.0.0", "web3-utils": "1.10.0" } @@ -2606,9 +2583,9 @@ } }, "node_modules/@truffle/codec/node_modules/semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2627,33 +2604,33 @@ "dev": true }, "node_modules/@truffle/compile-common": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.9.5.tgz", - "integrity": "sha512-qOIT7nYzQsrnpjk8LurKE6EYYvvJIk3rCHfn+xed88aG6F1l4WYtkUKl+Dcwgxgv3LH0khcQOpjqkXK5kUIJ8A==", + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.9.6.tgz", + "integrity": "sha512-TCcmr1E0GqMZJ2tOaCRNEllxTBJ/g7TuD6jDJpw5Gt9Bw0YO3Cmp6yPQRynRSO4xMJbHUgiEsSfRgIhswut5UA==", "dev": true, "dependencies": { - "@truffle/error": "^0.2.0", + "@truffle/error": "^0.2.1", "colors": "1.4.0" } }, "node_modules/@truffle/compile-common/node_modules/@truffle/error": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.0.tgz", - "integrity": "sha512-Fe0/z4WWb7IP2gBnv3l6zqP87Y0kSMs7oiSLakKJq17q3GUunrHSdioKuNspdggxkXIBhEQLhi8C+LJdwmHKWQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.1.tgz", + "integrity": "sha512-5Qy+z9dg9hP37WNdLnXH4b9MzemWrjTufRq7/DTKqimjyxCP/1zlL8gQEMdiSx1BBtAZz0xypkID/jb7AF/Osg==", "dev": true }, "node_modules/@truffle/contract": { - "version": "4.6.22", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.22.tgz", - "integrity": "sha512-081tM5CBBLgTQX0Fhzp0nlZHnfgojRXweV7/d6v7LHe6QGrGBmgvUy3EIbO+R3P1uaxeGVijMvB4Ok8md9IpYQ==", + "version": "4.6.26", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.26.tgz", + "integrity": "sha512-B3KM8fW9dKJCzMRD40r+u+iqQtBGFbcMr2GML31iUkjC77Wn/KlM9cCGZiuXcOquWmBlKrpD4nJCoGirPhyPTQ==", "dev": true, "dependencies": { "@ensdomains/ensjs": "^2.1.0", - "@truffle/blockchain-utils": "^0.1.7", + "@truffle/blockchain-utils": "^0.1.8", "@truffle/contract-schema": "^3.4.14", - "@truffle/debug-utils": "^6.0.50", - "@truffle/error": "^0.2.0", - "@truffle/interface-adapter": "^0.5.33", + "@truffle/debug-utils": "^6.0.54", + "@truffle/error": "^0.2.1", + "@truffle/interface-adapter": "^0.5.34", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -2675,18 +2652,18 @@ } }, "node_modules/@truffle/contract/node_modules/@truffle/error": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.0.tgz", - "integrity": "sha512-Fe0/z4WWb7IP2gBnv3l6zqP87Y0kSMs7oiSLakKJq17q3GUunrHSdioKuNspdggxkXIBhEQLhi8C+LJdwmHKWQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.1.tgz", + "integrity": "sha512-5Qy+z9dg9hP37WNdLnXH4b9MzemWrjTufRq7/DTKqimjyxCP/1zlL8gQEMdiSx1BBtAZz0xypkID/jb7AF/Osg==", "dev": true }, "node_modules/@truffle/debug-utils": { - "version": "6.0.50", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.50.tgz", - "integrity": "sha512-OWdSoOsPW7/jvcO7ASBRzXDzXQNb7dg8UqwoBAI7j7UpdQoCAhz7JQsusSNiFN6g1qrxEpGzeh5iIMDq9WxO3w==", + "version": "6.0.54", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.54.tgz", + "integrity": "sha512-ENv5TQQv+CJrwSX9AdXXTDHVNHpPfH+yCpRSnM3Sg0dx7IeWJAjGA66/BiucNBUiAgLhV2EcvkMo+4tEPoR+YQ==", "dev": true, "dependencies": { - "@truffle/codec": "^0.15.1", + "@truffle/codec": "^0.17.0", "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", @@ -2707,9 +2684,9 @@ "dev": true }, "node_modules/@truffle/interface-adapter": { - "version": "0.5.33", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.33.tgz", - "integrity": "sha512-vbVcH2I8hX+wM0Xj9uAjpgxMHqfT+y6m26zSkOVvZ2wo9Ez1slaOJkK1/TZK+7nJitGZSXeJeB4purMDuADvGA==", + "version": "0.5.34", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.34.tgz", + "integrity": "sha512-gPxabfMi2TueE4VxnNuyeudOfvGJQ1ofVC02PFw14cnRQhzH327JikjjQbZ1bT6S7kWl9H6P3hQPFeYFMHdm1g==", "dev": true, "dependencies": { "bn.js": "^5.1.3", @@ -2917,9 +2894,9 @@ } }, "node_modules/@types/semver": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.3.tgz", - "integrity": "sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", "dev": true }, "node_modules/abbrev": { @@ -3002,9 +2979,9 @@ } }, "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true, "bin": { "acorn": "bin/acorn" @@ -3473,9 +3450,9 @@ } }, "node_modules/bigint-crypto-utils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", - "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", + "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", "dev": true, "engines": { "node": ">=14.0.0" @@ -3758,9 +3735,9 @@ } }, "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, "dependencies": { "clone-response": "^1.0.2", @@ -4440,9 +4417,9 @@ } }, "node_modules/cosmiconfig": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", - "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", "dev": true, "dependencies": { "import-fresh": "^3.2.1", @@ -4515,12 +4492,12 @@ } }, "node_modules/cross-fetch": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", - "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "dev": true, "dependencies": { - "node-fetch": "^2.6.11" + "node-fetch": "^2.6.12" } }, "node_modules/cross-spawn": { @@ -5332,16 +5309,16 @@ } }, "node_modules/eslint": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", + "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/eslintrc": "^2.1.0", + "@eslint/js": "8.44.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -5352,7 +5329,7 @@ "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.0", "eslint-visitor-keys": "^3.4.1", - "espree": "^9.5.2", + "espree": "^9.6.0", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -5372,7 +5349,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" @@ -5607,12 +5584,12 @@ } }, "node_modules/espree": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", + "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", "dev": true, "dependencies": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" }, @@ -6707,9 +6684,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -7401,9 +7378,9 @@ } }, "node_modules/hardhat": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.14.1.tgz", - "integrity": "sha512-H3Qp/UKyQGmPDDBSfMoSyH18rRnac90rsb0LNer+sKe6at6rxLe4D5j+M+1icqZQF02iLPjNRwc/PA8OPf757A==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.16.1.tgz", + "integrity": "sha512-QpBjGXFhhSYoYBGEHyoau/A63crZOP+i3GbNxzLGkL6IklzT+piN14+wGnINNCg5BLSKisQI/RAySPzaWRcx/g==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.1.2", @@ -7445,7 +7422,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -7504,9 +7480,9 @@ } }, "node_modules/hardhat-ignore-warnings": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.8.tgz", - "integrity": "sha512-vPX94rJyTzYsCOzGIYdOcJgn3iQI6qa+CI9ZZfgDhdXJpda8ljpOT7bdUKAYC4LyoP0Z5fWTmupXoPaQrty0gw==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.9.tgz", + "integrity": "sha512-q1oj6/ixiAx+lgIyGLBajVCSC7qUtAoK7LS9Nr8UVHYo8Iuh5naBiVGo4RDJ6wxbDGYBkeSukUGZrMqzC2DWwA==", "dev": true, "dependencies": { "minimatch": "^5.1.0", @@ -8635,9 +8611,9 @@ "dev": true }, "node_modules/js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.1.tgz", + "integrity": "sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==", "dev": true, "funding": { "type": "opencollective", @@ -9978,9 +9954,9 @@ } }, "node_modules/node-fetch": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", - "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", "dev": true, "dependencies": { "whatwg-url": "^5.0.0" @@ -10234,17 +10210,17 @@ } }, "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "dependencies": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" }, "engines": { "node": ">= 0.8.0" @@ -10832,18 +10808,12 @@ ] }, "node_modules/qs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", - "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", "dev": true, - "dependencies": { - "side-channel": "^1.0.4" - }, "engines": { "node": ">=0.6" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" } }, "node_modules/query-string": { @@ -11183,15 +11153,6 @@ "request": "^2.34" } }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true, - "engines": { - "node": ">=0.6" - } - }, "node_modules/request/node_modules/uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -11596,9 +11557,9 @@ } }, "node_modules/semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -12796,13 +12757,13 @@ } }, "node_modules/solidity-coverage": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.2.tgz", - "integrity": "sha512-cv2bWb7lOXPE9/SSleDO6czkFiMHgP4NXPj+iW9W7iEKLBk7Cj0AGBiNmGX3V1totl9wjPrT0gHmABZKZt65rQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.4.tgz", + "integrity": "sha512-xeHOfBOjdMF6hWTbt42iH4x+7j1Atmrf5OldDPMxI+i/COdExUxszOswD9qqvcBTaLGiOrrpnh9UZjSpt4rBsg==", "dev": true, "dependencies": { "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.14.1", + "@solidity-parser/parser": "^0.16.0", "chalk": "^2.4.2", "death": "^1.1.0", "detect-port": "^1.3.0", @@ -12829,6 +12790,15 @@ "hardhat": "^2.11.0" } }, + "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.0.tgz", + "integrity": "sha512-ESipEcHyRHg4Np4SqBCfcXwyxxna1DgFVz69bgpLV8vzl/NP1DtcKsJ4dJZXWQhY/Z4J2LeKBiOkOVZn9ct33Q==", + "dev": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "node_modules/solidity-coverage/node_modules/ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", @@ -15438,36 +15408,42 @@ } }, "dependencies": { + "@aashutoshrathi/word-wrap": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@aashutoshrathi/word-wrap/-/word-wrap-1.2.6.tgz", + "integrity": "sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==", + "dev": true + }, "@babel/code-frame": { - "version": "7.21.4", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz", - "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.5.tgz", + "integrity": "sha512-Xmwn266vad+6DAqEB2A6V/CcZVp62BbwVmcOJc2RPuwih1kw02TjQvWVWlcKGbBPd+8/0V5DEkOcizRGYsspYQ==", "dev": true, "requires": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.22.5" } }, "@babel/helper-validator-identifier": { - "version": "7.19.1", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz", - "integrity": "sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.5.tgz", + "integrity": "sha512-aJXu+6lErq8ltp+JhkJUfk1MTGyuA4v7f3pA+BJ5HLfNC6nAQ0Cpi9uOquUj8Hehg0aUiHzWQbOVJGao6ztBAQ==", "dev": true }, "@babel/highlight": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.18.6.tgz", - "integrity": "sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g==", + "version": "7.22.5", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.5.tgz", + "integrity": "sha512-BSKlD1hgnedS5XRnGOljZawtag7H1yPfQp0tdNJCHoH6AZ+Pcm9VvkrK59/Yy593Ypg0zMxH2BxD1VPYUQ7UIw==", "dev": true, "requires": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.22.5", "chalk": "^2.0.0", "js-tokens": "^4.0.0" } }, "@babel/runtime": { - "version": "7.22.3", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.3.tgz", - "integrity": "sha512-XsDuspWKLUsxwCp6r7EhsExHtYfbe5oAGQ19kqngTdCPUoPQzOPdUbD/pB9PJiwb2ptYKQDjSJT3R6dC+EPqfQ==", + "version": "7.22.6", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.22.6.tgz", + "integrity": "sha512-wDb5pWm4WDdF6LFUde3Jl8WzPA+3ZbxYqkC6xAXuD3irdEHN1k0NfTRrJD8ZD378SJ61miMLCqIOXYhd8x+AJQ==", "dev": true, "requires": { "regenerator-runtime": "^0.13.11" @@ -15500,13 +15476,13 @@ } }, "@changesets/apply-release-plan": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.3.tgz", - "integrity": "sha512-ECDNeoc3nfeAe1jqJb5aFQX7CqzQhD2klXRez2JDb/aVpGUbX673HgKrnrgJRuQR/9f2TtLoYIzrGB9qwD77mg==", + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/@changesets/apply-release-plan/-/apply-release-plan-6.1.4.tgz", + "integrity": "sha512-FMpKF1fRlJyCZVYHr3CbinpZZ+6MwvOtWUuO8uo+svcATEoc1zRDcj23pAurJ2TZ/uVz1wFHH6K3NlACy0PLew==", "dev": true, "requires": { "@babel/runtime": "^7.20.1", - "@changesets/config": "^2.3.0", + "@changesets/config": "^2.3.1", "@changesets/get-version-range-type": "^0.3.2", "@changesets/git": "^2.0.0", "@changesets/types": "^5.2.1", @@ -15517,37 +15493,21 @@ "outdent": "^0.5.0", "prettier": "^2.7.1", "resolve-from": "^5.0.0", - "semver": "^5.4.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "semver": "^7.5.3" } }, "@changesets/assemble-release-plan": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.3.tgz", - "integrity": "sha512-g7EVZCmnWz3zMBAdrcKhid4hkHT+Ft1n0mLussFMcB1dE2zCuwcvGoy9ec3yOgPGF4hoMtgHaMIk3T3TBdvU9g==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@changesets/assemble-release-plan/-/assemble-release-plan-5.2.4.tgz", + "integrity": "sha512-xJkWX+1/CUaOUWTguXEbCDTyWJFECEhmdtbkjhn5GVBGxdP/JwaHBIU9sW3FR6gD07UwZ7ovpiPclQZs+j+mvg==", "dev": true, "requires": { "@babel/runtime": "^7.20.1", "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.5", + "@changesets/get-dependents-graph": "^1.3.6", "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", - "semver": "^5.4.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "semver": "^7.5.3" } }, "@changesets/changelog-git": { @@ -15571,19 +15531,19 @@ } }, "@changesets/cli": { - "version": "2.26.1", - "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.1.tgz", - "integrity": "sha512-XnTa+b51vt057fyAudvDKGB0Sh72xutQZNAdXkCqPBKO2zvs2yYZx5hFZj1u9cbtpwM6Sxtcr02/FQJfZOzemQ==", + "version": "2.26.2", + "resolved": "https://registry.npmjs.org/@changesets/cli/-/cli-2.26.2.tgz", + "integrity": "sha512-dnWrJTmRR8bCHikJHl9b9HW3gXACCehz4OasrXpMp7sx97ECuBGGNjJhjPhdZNCvMy9mn4BWdplI323IbqsRig==", "dev": true, "requires": { "@babel/runtime": "^7.20.1", - "@changesets/apply-release-plan": "^6.1.3", - "@changesets/assemble-release-plan": "^5.2.3", + "@changesets/apply-release-plan": "^6.1.4", + "@changesets/assemble-release-plan": "^5.2.4", "@changesets/changelog-git": "^0.1.14", - "@changesets/config": "^2.3.0", + "@changesets/config": "^2.3.1", "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.5", - "@changesets/get-release-plan": "^3.0.16", + "@changesets/get-dependents-graph": "^1.3.6", + "@changesets/get-release-plan": "^3.0.17", "@changesets/git": "^2.0.0", "@changesets/logger": "^0.0.5", "@changesets/pre": "^1.0.14", @@ -15592,7 +15552,7 @@ "@changesets/write": "^0.2.3", "@manypkg/get-packages": "^1.1.3", "@types/is-ci": "^3.0.0", - "@types/semver": "^6.0.0", + "@types/semver": "^7.5.0", "ansi-colors": "^4.1.3", "chalk": "^2.1.0", "enquirer": "^2.3.0", @@ -15605,7 +15565,7 @@ "p-limit": "^2.2.0", "preferred-pm": "^3.0.0", "resolve-from": "^5.0.0", - "semver": "^5.4.1", + "semver": "^7.5.3", "spawndamnit": "^2.0.0", "term-size": "^2.1.0", "tty-table": "^4.1.5" @@ -15619,23 +15579,17 @@ "requires": { "p-try": "^2.0.0" } - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true } } }, "@changesets/config": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.0.tgz", - "integrity": "sha512-EgP/px6mhCx8QeaMAvWtRrgyxW08k/Bx2tpGT+M84jEdX37v3VKfh4Cz1BkwrYKuMV2HZKeHOh8sHvja/HcXfQ==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@changesets/config/-/config-2.3.1.tgz", + "integrity": "sha512-PQXaJl82CfIXddUOppj4zWu+987GCw2M+eQcOepxN5s+kvnsZOwjEJO3DH9eVy+OP6Pg/KFEWdsECFEYTtbg6w==", "dev": true, "requires": { "@changesets/errors": "^0.1.4", - "@changesets/get-dependents-graph": "^1.3.5", + "@changesets/get-dependents-graph": "^1.3.6", "@changesets/logger": "^0.0.5", "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", @@ -15653,24 +15607,16 @@ } }, "@changesets/get-dependents-graph": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.5.tgz", - "integrity": "sha512-w1eEvnWlbVDIY8mWXqWuYE9oKhvIaBhzqzo4ITSJY9hgoqQ3RoBqwlcAzg11qHxv/b8ReDWnMrpjpKrW6m1ZTA==", + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/@changesets/get-dependents-graph/-/get-dependents-graph-1.3.6.tgz", + "integrity": "sha512-Q/sLgBANmkvUm09GgRsAvEtY3p1/5OCzgBE5vX3vgb5CvW0j7CEljocx5oPXeQSNph6FXulJlXV3Re/v3K3P3Q==", "dev": true, "requires": { "@changesets/types": "^5.2.1", "@manypkg/get-packages": "^1.1.3", "chalk": "^2.1.0", "fs-extra": "^7.0.1", - "semver": "^5.4.1" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } + "semver": "^7.5.3" } }, "@changesets/get-github-info": { @@ -15684,14 +15630,14 @@ } }, "@changesets/get-release-plan": { - "version": "3.0.16", - "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.16.tgz", - "integrity": "sha512-OpP9QILpBp1bY2YNIKFzwigKh7Qe9KizRsZomzLe6pK8IUo8onkAAVUD8+JRKSr8R7d4+JRuQrfSSNlEwKyPYg==", + "version": "3.0.17", + "resolved": "https://registry.npmjs.org/@changesets/get-release-plan/-/get-release-plan-3.0.17.tgz", + "integrity": "sha512-6IwKTubNEgoOZwDontYc2x2cWXfr6IKxP3IhKeK+WjyD6y3M4Gl/jdQvBw+m/5zWILSOCAaGLu2ZF6Q+WiPniw==", "dev": true, "requires": { "@babel/runtime": "^7.20.1", - "@changesets/assemble-release-plan": "^5.2.3", - "@changesets/config": "^2.3.0", + "@changesets/assemble-release-plan": "^5.2.4", + "@changesets/config": "^2.3.1", "@changesets/pre": "^1.0.14", "@changesets/read": "^0.5.9", "@changesets/types": "^5.2.1", @@ -15892,14 +15838,14 @@ "dev": true }, "@eslint/eslintrc": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.3.tgz", - "integrity": "sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.1.0.tgz", + "integrity": "sha512-Lj7DECXqIVCqnqjjHMPna4vn6GJcMgul/wuS0je9OZ9gsL0zzDpKPVtcG1HaDVc+9y+qgXneTeUMbCqXJNpH1A==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.5.2", + "espree": "^9.6.0", "globals": "^13.19.0", "ignore": "^5.2.0", "import-fresh": "^3.2.1", @@ -15926,9 +15872,9 @@ } }, "@eslint/js": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.41.0.tgz", - "integrity": "sha512-LxcyMGxwmTh2lY9FwHPGWOHmYFCZvbrFCBZL4FzSSsxsRPuhrYUg/49/0KDfW8tnIEaEHtfmn6+NPN+1DqaNmA==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.44.0.tgz", + "integrity": "sha512-Ag+9YM4ocKQx9AarydN0KY2j0ErMHNIocPDrVo8zAE44xLTjEtz81OdR68/cydGtk6m6jDb5Za3r2useMzYmSw==", "dev": true }, "@ethereumjs/common": { @@ -16392,9 +16338,9 @@ "dev": true }, "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.10.tgz", + "integrity": "sha512-KVVjQmNUepDVGXNuoRRdmmEjruj0KfiGSbS8LVc12LMsWDQzRXJ0qdhN8L8uUigKpfEHRhlaQFY0ib1tnUbNeQ==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -17066,9 +17012,9 @@ } }, "@openzeppelin/upgrades-core": { - "version": "1.26.2", - "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.26.2.tgz", - "integrity": "sha512-TJORrgyun5qflPos/47P3j61gDw+7W+tEirSBOYRxfVL1WGjX1n8iaLrijPIqzyeS1MKguN1nckAMspQ4SKrxw==", + "version": "1.27.1", + "resolved": "https://registry.npmjs.org/@openzeppelin/upgrades-core/-/upgrades-core-1.27.1.tgz", + "integrity": "sha512-6tLcu6jt0nYdJNr+LRicBgP3jp+//B+dixgB3KsvycSglCHNfmBNDf0ZQ3ZquDdLL0QQmKzIs1EBRVp6lNvPnQ==", "dev": true, "requires": { "cbor": "^8.0.0", @@ -17076,6 +17022,7 @@ "compare-versions": "^5.0.0", "debug": "^4.1.1", "ethereumjs-util": "^7.0.3", + "minimist": "^1.2.7", "proper-lockfile": "^4.1.1", "solidity-ast": "^0.4.15" }, @@ -17264,9 +17211,9 @@ } }, "@truffle/abi-utils": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-1.0.0.tgz", - "integrity": "sha512-h1wGFB28YfByAWm/uBeMCwqDlGsrcMYTumLC/sB/qYhHisi1LK6tV47FEF7zKyf6Al2CtsO28v02+wfLXbUVRg==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@truffle/abi-utils/-/abi-utils-1.0.1.tgz", + "integrity": "sha512-ZQUY3XUxEPdqxNaoXsOqF0spTtb6f5RNlnN4MUrVsJ64sOh0FJsY7rxZiUI3khfePmNh4i2qcJrQlKT36YcWUA==", "dev": true, "requires": { "change-case": "3.0.2", @@ -17275,25 +17222,25 @@ } }, "@truffle/blockchain-utils": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.7.tgz", - "integrity": "sha512-1nibqGjEHC7KAyDThEFvbm2+EO8zAHee/VjCtxkYBE3ySwP50joh0QCEBjy7K/9z+icpMoDucfxmgaKToBFUgQ==", + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/@truffle/blockchain-utils/-/blockchain-utils-0.1.8.tgz", + "integrity": "sha512-ZskpYDNHkXD3ota4iU3pZz6kLth87RC+wDn66Rp2Or+DqqJCKdnmS9GDctBi1EcMPDEi0BqpkdrfBuzA9uIkGg==", "dev": true }, "@truffle/codec": { - "version": "0.15.1", - "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.15.1.tgz", - "integrity": "sha512-OBANcmefxEXLApWl/uU1SOHQJixO8pDaRTybP0YMvxPhgyj7G7+wC+fUvnZdmrTJD2WJFLuoYvZbxILmycEvPg==", + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@truffle/codec/-/codec-0.17.0.tgz", + "integrity": "sha512-0Z7DQNCnvW++JuvNj35v/CuJoaFSAp7/+lXWwe+Zoe++E27V+hzRI88ZYxRJa0/q1HE81epd1r0ipqc7WBotig==", "dev": true, "requires": { - "@truffle/abi-utils": "^1.0.0", - "@truffle/compile-common": "^0.9.5", + "@truffle/abi-utils": "^1.0.1", + "@truffle/compile-common": "^0.9.6", "big.js": "^6.0.3", "bn.js": "^5.1.3", "cbor": "^5.2.0", "debug": "^4.3.1", "lodash": "^4.17.21", - "semver": "7.3.7", + "semver": "7.5.2", "utf8": "^3.0.0", "web3-utils": "1.10.0" }, @@ -17336,9 +17283,9 @@ "dev": true }, "semver": { - "version": "7.3.7", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz", - "integrity": "sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==", + "version": "7.5.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz", + "integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -17353,35 +17300,35 @@ } }, "@truffle/compile-common": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.9.5.tgz", - "integrity": "sha512-qOIT7nYzQsrnpjk8LurKE6EYYvvJIk3rCHfn+xed88aG6F1l4WYtkUKl+Dcwgxgv3LH0khcQOpjqkXK5kUIJ8A==", + "version": "0.9.6", + "resolved": "https://registry.npmjs.org/@truffle/compile-common/-/compile-common-0.9.6.tgz", + "integrity": "sha512-TCcmr1E0GqMZJ2tOaCRNEllxTBJ/g7TuD6jDJpw5Gt9Bw0YO3Cmp6yPQRynRSO4xMJbHUgiEsSfRgIhswut5UA==", "dev": true, "requires": { - "@truffle/error": "^0.2.0", + "@truffle/error": "^0.2.1", "colors": "1.4.0" }, "dependencies": { "@truffle/error": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.0.tgz", - "integrity": "sha512-Fe0/z4WWb7IP2gBnv3l6zqP87Y0kSMs7oiSLakKJq17q3GUunrHSdioKuNspdggxkXIBhEQLhi8C+LJdwmHKWQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.1.tgz", + "integrity": "sha512-5Qy+z9dg9hP37WNdLnXH4b9MzemWrjTufRq7/DTKqimjyxCP/1zlL8gQEMdiSx1BBtAZz0xypkID/jb7AF/Osg==", "dev": true } } }, "@truffle/contract": { - "version": "4.6.22", - "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.22.tgz", - "integrity": "sha512-081tM5CBBLgTQX0Fhzp0nlZHnfgojRXweV7/d6v7LHe6QGrGBmgvUy3EIbO+R3P1uaxeGVijMvB4Ok8md9IpYQ==", + "version": "4.6.26", + "resolved": "https://registry.npmjs.org/@truffle/contract/-/contract-4.6.26.tgz", + "integrity": "sha512-B3KM8fW9dKJCzMRD40r+u+iqQtBGFbcMr2GML31iUkjC77Wn/KlM9cCGZiuXcOquWmBlKrpD4nJCoGirPhyPTQ==", "dev": true, "requires": { "@ensdomains/ensjs": "^2.1.0", - "@truffle/blockchain-utils": "^0.1.7", + "@truffle/blockchain-utils": "^0.1.8", "@truffle/contract-schema": "^3.4.14", - "@truffle/debug-utils": "^6.0.50", - "@truffle/error": "^0.2.0", - "@truffle/interface-adapter": "^0.5.33", + "@truffle/debug-utils": "^6.0.54", + "@truffle/error": "^0.2.1", + "@truffle/interface-adapter": "^0.5.34", "bignumber.js": "^7.2.1", "debug": "^4.3.1", "ethers": "^4.0.32", @@ -17393,9 +17340,9 @@ }, "dependencies": { "@truffle/error": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.0.tgz", - "integrity": "sha512-Fe0/z4WWb7IP2gBnv3l6zqP87Y0kSMs7oiSLakKJq17q3GUunrHSdioKuNspdggxkXIBhEQLhi8C+LJdwmHKWQ==", + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/@truffle/error/-/error-0.2.1.tgz", + "integrity": "sha512-5Qy+z9dg9hP37WNdLnXH4b9MzemWrjTufRq7/DTKqimjyxCP/1zlL8gQEMdiSx1BBtAZz0xypkID/jb7AF/Osg==", "dev": true } } @@ -17411,12 +17358,12 @@ } }, "@truffle/debug-utils": { - "version": "6.0.50", - "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.50.tgz", - "integrity": "sha512-OWdSoOsPW7/jvcO7ASBRzXDzXQNb7dg8UqwoBAI7j7UpdQoCAhz7JQsusSNiFN6g1qrxEpGzeh5iIMDq9WxO3w==", + "version": "6.0.54", + "resolved": "https://registry.npmjs.org/@truffle/debug-utils/-/debug-utils-6.0.54.tgz", + "integrity": "sha512-ENv5TQQv+CJrwSX9AdXXTDHVNHpPfH+yCpRSnM3Sg0dx7IeWJAjGA66/BiucNBUiAgLhV2EcvkMo+4tEPoR+YQ==", "dev": true, "requires": { - "@truffle/codec": "^0.15.1", + "@truffle/codec": "^0.17.0", "@trufflesuite/chromafi": "^3.0.0", "bn.js": "^5.1.3", "chalk": "^2.4.2", @@ -17439,9 +17386,9 @@ "dev": true }, "@truffle/interface-adapter": { - "version": "0.5.33", - "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.33.tgz", - "integrity": "sha512-vbVcH2I8hX+wM0Xj9uAjpgxMHqfT+y6m26zSkOVvZ2wo9Ez1slaOJkK1/TZK+7nJitGZSXeJeB4purMDuADvGA==", + "version": "0.5.34", + "resolved": "https://registry.npmjs.org/@truffle/interface-adapter/-/interface-adapter-0.5.34.tgz", + "integrity": "sha512-gPxabfMi2TueE4VxnNuyeudOfvGJQ1ofVC02PFw14cnRQhzH327JikjjQbZ1bT6S7kWl9H6P3hQPFeYFMHdm1g==", "dev": true, "requires": { "bn.js": "^5.1.3", @@ -17651,9 +17598,9 @@ } }, "@types/semver": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-6.2.3.tgz", - "integrity": "sha512-KQf+QAMWKMrtBMsB8/24w53tEsxllMj6TuA80TT/5igJalLI/zm0L3oXRbIAl4Ohfc85gyHX/jhMwsVkmhLU4A==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.0.tgz", + "integrity": "sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw==", "dev": true }, "abbrev": { @@ -17715,9 +17662,9 @@ } }, "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "version": "8.10.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.10.0.tgz", + "integrity": "sha512-F0SAmZ8iUtS//m8DmCTA0jlh6TDKkHQyK6xc6V4KDTyZKA9dnvX9/3sRTVQrWm79glUAZbnmmNcdYwUIHWVybw==", "dev": true }, "acorn-jsx": { @@ -18064,9 +18011,9 @@ "dev": true }, "bigint-crypto-utils": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.2.2.tgz", - "integrity": "sha512-U1RbE3aX9ayCUVcIPHuPDPKcK3SFOXf93J1UK/iHlJuQB7bhagPIX06/CLpLEsDThJ7KA4Dhrnzynl+d2weTiw==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/bigint-crypto-utils/-/bigint-crypto-utils-3.3.0.tgz", + "integrity": "sha512-jOTSb+drvEDxEq6OuUybOAv/xxoh3cuYRUIPyu8sSHQNKM303UQ2R1DAo45o1AkcIXw6fzbaFI1+xGGdaXs2lg==", "dev": true }, "bignumber.js": { @@ -18302,9 +18249,9 @@ "dev": true }, "cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.4.tgz", + "integrity": "sha512-v+p6ongsrp0yTGbJXjgxPow2+DL93DASP4kXCDKb8/bwRtt9OEF3whggkkDkGNzgcWy2XaF4a8nZglC7uElscg==", "dev": true, "requires": { "clone-response": "^1.0.2", @@ -18845,9 +18792,9 @@ } }, "cosmiconfig": { - "version": "8.1.3", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.1.3.tgz", - "integrity": "sha512-/UkO2JKI18b5jVMJUp0lvKFMpa/Gye+ZgZjKD+DGEN9y7NRcf/nK1A0sp67ONmKtnDCNMS44E6jrk0Yc3bDuUw==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-8.2.0.tgz", + "integrity": "sha512-3rTMnFJA1tCOPwRxtgF4wd7Ab2qvDbL8jX+3smjIbS4HlZBagTlpERbdN7iAbWlrfxE3M8c27kTwTawQ7st+OQ==", "dev": true, "requires": { "import-fresh": "^3.2.1", @@ -18907,12 +18854,12 @@ } }, "cross-fetch": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", - "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", + "version": "3.1.8", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", + "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", "dev": true, "requires": { - "node-fetch": "^2.6.11" + "node-fetch": "^2.6.12" } }, "cross-spawn": { @@ -19538,16 +19485,16 @@ } }, "eslint": { - "version": "8.41.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.41.0.tgz", - "integrity": "sha512-WQDQpzGBOP5IrXPo4Hc0814r4/v2rrIsB0rhT7jtunIalgg6gYXWhRMOejVO8yH21T/FGaxjmFjBMNqcIlmH1Q==", + "version": "8.44.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.44.0.tgz", + "integrity": "sha512-0wpHoUbDUHgNCyvFB5aXLiQVfK9B0at6gUvzy83k4kAsQ/u769TQDX6iKC+aO4upIHO9WSaA3QoXYQDHbNwf1A==", "dev": true, "requires": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.4.0", - "@eslint/eslintrc": "^2.0.3", - "@eslint/js": "8.41.0", - "@humanwhocodes/config-array": "^0.11.8", + "@eslint/eslintrc": "^2.1.0", + "@eslint/js": "8.44.0", + "@humanwhocodes/config-array": "^0.11.10", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", "ajv": "^6.10.0", @@ -19558,7 +19505,7 @@ "escape-string-regexp": "^4.0.0", "eslint-scope": "^7.2.0", "eslint-visitor-keys": "^3.4.1", - "espree": "^9.5.2", + "espree": "^9.6.0", "esquery": "^1.4.2", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -19578,7 +19525,7 @@ "lodash.merge": "^4.6.2", "minimatch": "^3.1.2", "natural-compare": "^1.4.0", - "optionator": "^0.9.1", + "optionator": "^0.9.3", "strip-ansi": "^6.0.1", "strip-json-comments": "^3.1.0", "text-table": "^0.2.0" @@ -19732,12 +19679,12 @@ "dev": true }, "espree": { - "version": "9.5.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.2.tgz", - "integrity": "sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw==", + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.0.tgz", + "integrity": "sha512-1FH/IiruXZ84tpUlm0aCUEwMl2Ho5ilqVh0VvQXw+byAz/4SAciyHLlfmL5WYqsvD38oymdUwBss0LtK8m4s/A==", "dev": true, "requires": { - "acorn": "^8.8.0", + "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.4.1" } @@ -20668,9 +20615,9 @@ "dev": true }, "fast-glob": { - "version": "3.2.12", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", - "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.0.tgz", + "integrity": "sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==", "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", @@ -21205,9 +21152,9 @@ "dev": true }, "hardhat": { - "version": "2.14.1", - "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.14.1.tgz", - "integrity": "sha512-H3Qp/UKyQGmPDDBSfMoSyH18rRnac90rsb0LNer+sKe6at6rxLe4D5j+M+1icqZQF02iLPjNRwc/PA8OPf757A==", + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.16.1.tgz", + "integrity": "sha512-QpBjGXFhhSYoYBGEHyoau/A63crZOP+i3GbNxzLGkL6IklzT+piN14+wGnINNCg5BLSKisQI/RAySPzaWRcx/g==", "dev": true, "requires": { "@ethersproject/abi": "^5.1.2", @@ -21249,7 +21196,6 @@ "mnemonist": "^0.38.0", "mocha": "^10.0.0", "p-map": "^4.0.0", - "qs": "^6.7.0", "raw-body": "^2.4.1", "resolve": "1.17.0", "semver": "^6.3.0", @@ -21441,9 +21387,9 @@ } }, "hardhat-ignore-warnings": { - "version": "0.2.8", - "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.8.tgz", - "integrity": "sha512-vPX94rJyTzYsCOzGIYdOcJgn3iQI6qa+CI9ZZfgDhdXJpda8ljpOT7bdUKAYC4LyoP0Z5fWTmupXoPaQrty0gw==", + "version": "0.2.9", + "resolved": "https://registry.npmjs.org/hardhat-ignore-warnings/-/hardhat-ignore-warnings-0.2.9.tgz", + "integrity": "sha512-q1oj6/ixiAx+lgIyGLBajVCSC7qUtAoK7LS9Nr8UVHYo8Iuh5naBiVGo4RDJ6wxbDGYBkeSukUGZrMqzC2DWwA==", "dev": true, "requires": { "minimatch": "^5.1.0", @@ -22126,9 +22072,9 @@ "dev": true }, "js-sdsl": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", - "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.1.tgz", + "integrity": "sha512-6Gsx8R0RucyePbWqPssR8DyfuXmLBooYN5cZFZKjHGnQuaf7pEzhtpceagJxVu4LqhYY5EYA7nko3FmeHZ1KbA==", "dev": true }, "js-sha3": { @@ -23190,9 +23136,9 @@ } }, "node-fetch": { - "version": "2.6.11", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", - "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "version": "2.6.12", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.12.tgz", + "integrity": "sha512-C/fGU2E8ToujUivIO0H+tpQ6HWo4eEmchoPIoXtxCrVghxdKq+QOHqEZW7tuP3KlV3bC8FRMO5nMCC7Zm1VP6g==", "dev": true, "requires": { "whatwg-url": "^5.0.0" @@ -23376,17 +23322,17 @@ } }, "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.3.tgz", + "integrity": "sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==", "dev": true, "requires": { + "@aashutoshrathi/word-wrap": "^1.2.3", "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", "levn": "^0.4.1", "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" + "type-check": "^0.4.0" } }, "os-locale": { @@ -23825,13 +23771,10 @@ "dev": true }, "qs": { - "version": "6.11.2", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.2.tgz", - "integrity": "sha512-tDNIz22aBzCDxLtVH++VnTfzxlfeK5CbqohpSqpJgj1Wg/cQbStNAz3NuqCs5vV+pjBsK4x4pN9HlVh7rcYRiA==", - "dev": true, - "requires": { - "side-channel": "^1.0.4" - } + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "dev": true }, "query-string": { "version": "5.1.1", @@ -24064,12 +24007,6 @@ "uuid": "^3.3.2" }, "dependencies": { - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "dev": true - }, "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", @@ -24382,9 +24319,9 @@ } }, "semver": { - "version": "7.5.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", - "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "version": "7.5.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.3.tgz", + "integrity": "sha512-QBlUtyVk/5EeHbi7X0fw6liDZc7BBmEaSYn01fMU1OUYbf6GPsbTtd8WmnqbI20SeycoHSeiybkE/q1Q+qlThQ==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -25290,13 +25227,13 @@ "optional": true }, "solidity-coverage": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.2.tgz", - "integrity": "sha512-cv2bWb7lOXPE9/SSleDO6czkFiMHgP4NXPj+iW9W7iEKLBk7Cj0AGBiNmGX3V1totl9wjPrT0gHmABZKZt65rQ==", + "version": "0.8.4", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.4.tgz", + "integrity": "sha512-xeHOfBOjdMF6hWTbt42iH4x+7j1Atmrf5OldDPMxI+i/COdExUxszOswD9qqvcBTaLGiOrrpnh9UZjSpt4rBsg==", "dev": true, "requires": { "@ethersproject/abi": "^5.0.9", - "@solidity-parser/parser": "^0.14.1", + "@solidity-parser/parser": "^0.16.0", "chalk": "^2.4.2", "death": "^1.1.0", "detect-port": "^1.3.0", @@ -25317,6 +25254,15 @@ "web3-utils": "^1.3.6" }, "dependencies": { + "@solidity-parser/parser": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.16.0.tgz", + "integrity": "sha512-ESipEcHyRHg4Np4SqBCfcXwyxxna1DgFVz69bgpLV8vzl/NP1DtcKsJ4dJZXWQhY/Z4J2LeKBiOkOVZn9ct33Q==", + "dev": true, + "requires": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, "ansi-colors": { "version": "3.2.3", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-3.2.3.tgz", diff --git a/scripts/generate/templates/Checkpoints.js b/scripts/generate/templates/Checkpoints.js index d635c8462..3bd4589d2 100644 --- a/scripts/generate/templates/Checkpoints.js +++ b/scripts/generate/templates/Checkpoints.js @@ -13,8 +13,6 @@ import {Math} from "../math/Math.sol"; * * To create a history of checkpoints define a variable type \`Checkpoints.Trace*\` in your contract, and store a new * checkpoint for the current transaction block using the {push} function. - * - * _Available since v4.5._ */ `; diff --git a/scripts/generate/templates/SafeCast.js b/scripts/generate/templates/SafeCast.js index 6a4a80c2b..afc31a641 100644 --- a/scripts/generate/templates/SafeCast.js +++ b/scripts/generate/templates/SafeCast.js @@ -1,65 +1,8 @@ -const assert = require('assert'); const format = require('../format-lines'); const { range } = require('../../helpers'); const LENGTHS = range(8, 256, 8).reverse(); // 248 → 8 (in steps of 8) -// Returns the version of OpenZeppelin Contracts in which a particular function was introduced. -// This is used in the docs for each function. -const version = (selector, length) => { - switch (selector) { - case 'toUint(uint)': { - switch (length) { - case 8: - case 16: - case 32: - case 64: - case 128: - return '2.5'; - case 96: - case 224: - return '4.2'; - default: - assert(LENGTHS.includes(length)); - return '4.7'; - } - } - case 'toInt(int)': { - switch (length) { - case 8: - case 16: - case 32: - case 64: - case 128: - return '3.1'; - default: - assert(LENGTHS.includes(length)); - return '4.7'; - } - } - case 'toUint(int)': { - switch (length) { - case 256: - return '3.0'; - default: - assert(false); - return; - } - } - case 'toInt(uint)': { - switch (length) { - case 256: - return '3.0'; - default: - assert(false); - return; - } - } - default: - assert(false); - } -}; - const header = `\ pragma solidity ^0.8.19; @@ -109,8 +52,6 @@ const toUintDownCast = length => `\ * Requirements: * * - input must fit into ${length} bits - * - * _Available since v${version('toUint(uint)', length)}._ */ function toUint${length}(uint256 value) internal pure returns (uint${length}) { if (value > type(uint${length}).max) { @@ -132,8 +73,6 @@ const toIntDownCast = length => `\ * Requirements: * * - input must fit into ${length} bits - * - * _Available since v${version('toInt(int)', length)}._ */ function toInt${length}(int256 value) internal pure returns (int${length} downcasted) { downcasted = int${length}(value); @@ -151,8 +90,6 @@ const toInt = length => `\ * Requirements: * * - input must be less than or equal to maxInt${length}. - * - * _Available since v${version('toInt(uint)', length)}._ */ function toInt${length}(uint${length} value) internal pure returns (int${length}) { // Note: Unsafe cast below is okay because \`type(int${length}).max\` is guaranteed to be positive @@ -170,8 +107,6 @@ const toUint = length => `\ * Requirements: * * - input must be greater than or equal to 0. - * - * _Available since v${version('toUint(int)', length)}._ */ function toUint${length}(int${length} value) internal pure returns (uint${length}) { if (value < 0) { diff --git a/scripts/generate/templates/StorageSlot.js b/scripts/generate/templates/StorageSlot.js index 3e2263a0c..a9fa11fe3 100644 --- a/scripts/generate/templates/StorageSlot.js +++ b/scripts/generate/templates/StorageSlot.js @@ -1,22 +1,15 @@ const format = require('../format-lines'); -const { capitalize, unique } = require('../../helpers'); +const { capitalize } = require('../../helpers'); const TYPES = [ - { type: 'address', isValueType: true, version: '4.1' }, - { type: 'bool', isValueType: true, name: 'Boolean', version: '4.1' }, - { type: 'bytes32', isValueType: true, version: '4.1' }, - { type: 'uint256', isValueType: true, version: '4.1' }, - { type: 'string', isValueType: false, version: '4.9' }, - { type: 'bytes', isValueType: false, version: '4.9' }, + { type: 'address', isValueType: true }, + { type: 'bool', isValueType: true, name: 'Boolean' }, + { type: 'bytes32', isValueType: true }, + { type: 'uint256', isValueType: true }, + { type: 'string', isValueType: false }, + { type: 'bytes', isValueType: false }, ].map(type => Object.assign(type, { struct: (type.name ?? capitalize(type.type)) + 'Slot' })); -const VERSIONS = unique(TYPES.map(t => t.version)).map( - version => - `_Available since v${version} for ${TYPES.filter(t => t.version == version) - .map(t => `\`${t.type}\``) - .join(', ')}._`, -); - const header = `\ pragma solidity ^0.8.19; @@ -43,8 +36,6 @@ pragma solidity ^0.8.19; * } * } * \`\`\` - * -${VERSIONS.map(s => ` * ${s}`).join('\n')} */ `; diff --git a/scripts/upgradeable/upgradeable.patch b/scripts/upgradeable/upgradeable.patch index 466d1d1ca..ebf3aa4e2 100644 --- a/scripts/upgradeable/upgradeable.patch +++ b/scripts/upgradeable/upgradeable.patch @@ -105,32 +105,6 @@ index 27627f43..e42a66e8 100644 } } ``` -diff --git a/contracts/finance/VestingWallet.sol b/contracts/finance/VestingWallet.sol -index f776a7ca..d7a7e0b0 100644 ---- a/contracts/finance/VestingWallet.sol -+++ b/contracts/finance/VestingWallet.sol -@@ -19,6 +19,8 @@ import {Context} from "../utils/Context.sol"; - * - * By setting the duration to 0, one can configure this contract to behave like an asset timelock that hold tokens for - * a beneficiary until a specified time. -+ * -+ * @custom:storage-size 52 - */ - contract VestingWallet is Context { - event EtherReleased(uint256 amount); -diff --git a/contracts/governance/extensions/GovernorVotes.sol b/contracts/governance/extensions/GovernorVotes.sol -index bb14d7fd..0785ebbd 100644 ---- a/contracts/governance/extensions/GovernorVotes.sol -+++ b/contracts/governance/extensions/GovernorVotes.sol -@@ -12,6 +12,8 @@ import {SafeCast} from "../../utils/math/SafeCast.sol"; - * @dev Extension of {Governor} for voting weight extraction from an {ERC20Votes} token, or since v4.5 an {ERC721Votes} token. - * - * _Available since v4.3._ -+ * -+ * @custom:storage-size 51 - */ - abstract contract GovernorVotes is Governor { - IERC5805 public immutable token; diff --git a/contracts/package.json b/contracts/package.json index df141192..1cf90ad1 100644 --- a/contracts/package.json @@ -151,47 +125,8 @@ index df141192..1cf90ad1 100644 }, "keywords": [ "solidity", -diff --git a/contracts/token/ERC20/extensions/ERC20Capped.sol b/contracts/token/ERC20/extensions/ERC20Capped.sol -index 98ec7144..4992115b 100644 ---- a/contracts/token/ERC20/extensions/ERC20Capped.sol -+++ b/contracts/token/ERC20/extensions/ERC20Capped.sol -@@ -7,6 +7,8 @@ import {ERC20} from "../ERC20.sol"; - - /** - * @dev Extension of {ERC20} that adds a cap to the supply of tokens. -+ * -+ * @custom:storage-size 51 - */ - abstract contract ERC20Capped is ERC20 { - uint256 private immutable _cap; -diff --git a/contracts/token/ERC20/extensions/ERC20Permit.sol b/contracts/token/ERC20/extensions/ERC20Permit.sol -index 8778f4ba..825d4e16 100644 ---- a/contracts/token/ERC20/extensions/ERC20Permit.sol -+++ b/contracts/token/ERC20/extensions/ERC20Permit.sol -@@ -18,6 +18,8 @@ import {Nonces} from "../../../utils/Nonces.sol"; - * need to send a transaction, and thus is not required to hold Ether at all. - * - * _Available since v3.4._ -+ * -+ * @custom:storage-size 51 - */ - abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces { - // solhint-disable-next-line var-name-mixedcase -diff --git a/contracts/token/ERC20/extensions/ERC20Wrapper.sol b/contracts/token/ERC20/extensions/ERC20Wrapper.sol -index 2cbff622..97f43d7a 100644 ---- a/contracts/token/ERC20/extensions/ERC20Wrapper.sol -+++ b/contracts/token/ERC20/extensions/ERC20Wrapper.sol -@@ -14,6 +14,8 @@ import {SafeERC20} from "../utils/SafeERC20.sol"; - * wrapping of an existing "basic" ERC20 into a governance token. - * - * _Available since v4.2._ -+ * -+ * @custom:storage-size 51 - */ - abstract contract ERC20Wrapper is ERC20 { - IERC20 private immutable _underlying; diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol -index d94e956a..86bb5713 100644 +index ff34e814..a9d08d5c 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -4,7 +4,6 @@ @@ -202,12 +137,12 @@ index d94e956a..86bb5713 100644 import {IERC5267} from "../../interfaces/IERC5267.sol"; /** -@@ -30,27 +29,19 @@ import {IERC5267} from "../../interfaces/IERC5267.sol"; - * - * _Available since v3.4._ - * +@@ -27,28 +26,18 @@ import {IERC5267} from "../../interfaces/IERC5267.sol"; + * NOTE: In the upgradeable version of this contract, the cached values will correspond to the address, and the domain + * separator of the implementation contract. This will cause the `_domainSeparatorV4` function to always rebuild the + * separator from the immutable values, which is cheaper than accessing a cached version in cold storage. +- * - * @custom:oz-upgrades-unsafe-allow state-variable-immutable state-variable-assignment -+ * @custom:storage-size 52 */ abstract contract EIP712 is IERC5267 { - using ShortStrings for *; @@ -235,7 +170,7 @@ index d94e956a..86bb5713 100644 /** * @dev Initializes the domain separator and parameter caches. -@@ -65,29 +56,23 @@ abstract contract EIP712 is IERC5267 { +@@ -63,29 +52,23 @@ abstract contract EIP712 is IERC5267 { * contract upgrade]. */ constructor(string memory name, string memory version) { @@ -273,7 +208,7 @@ index d94e956a..86bb5713 100644 } /** -@@ -128,6 +113,10 @@ abstract contract EIP712 is IERC5267 { +@@ -124,6 +107,10 @@ abstract contract EIP712 is IERC5267 { uint256[] memory extensions ) { @@ -284,14 +219,12 @@ index d94e956a..86bb5713 100644 return ( hex"0f", // 01111 _EIP712Name(), -@@ -142,26 +131,62 @@ abstract contract EIP712 is IERC5267 { +@@ -138,22 +125,62 @@ abstract contract EIP712 is IERC5267 { /** * @dev The name parameter for the EIP712 domain. * - * NOTE: By default this function reads _name which is an immutable value. - * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). -- * -- * _Available since v5.0._ + * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs + * are a concern. */ @@ -309,7 +242,10 @@ index d94e956a..86bb5713 100644 - * It only reads from storage if necessary (in case the value is too large to fit in a ShortString). + * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs + * are a concern. -+ */ + */ +- // solhint-disable-next-line func-name-mixedcase +- function _EIP712Version() internal view returns (string memory) { +- return _version.toStringWithFallback(_versionFallback); + function _EIP712Version() internal view virtual returns (string memory) { + return _version; + } @@ -337,13 +273,9 @@ index d94e956a..86bb5713 100644 + + /** + * @dev The hash of the version parameter for the EIP712 domain. - * -- * _Available since v5.0._ ++ * + * NOTE: In previous versions this function was virtual. In this version you should override `_EIP712Version` instead. - */ -- // solhint-disable-next-line func-name-mixedcase -- function _EIP712Version() internal view returns (string memory) { -- return _version.toStringWithFallback(_versionFallback); ++ */ + function _EIP712VersionHash() internal view returns (bytes32) { + string memory version = _EIP712Version(); + if (bytes(version).length > 0) { diff --git a/test/governance/Governor.test.js b/test/governance/Governor.test.js index 909c38686..4e47ab9f2 100644 --- a/test/governance/Governor.test.js +++ b/test/governance/Governor.test.js @@ -2,7 +2,6 @@ const { constants, expectEvent, expectRevert } = require('@openzeppelin/test-hel const { expect } = require('chai'); const ethSigUtil = require('eth-sig-util'); const Wallet = require('ethereumjs-wallet').default; -const { fromRpcSig } = require('ethereumjs-util'); const Enums = require('../helpers/enums'); const { getDomain, domainType } = require('../helpers/eip712'); @@ -18,6 +17,7 @@ const Governor = artifacts.require('$GovernorMock'); const CallReceiver = artifacts.require('CallReceiverMock'); const ERC721 = artifacts.require('$ERC721'); const ERC1155 = artifacts.require('$ERC1155'); +const ERC1271WalletMock = artifacts.require('ERC1271WalletMock'); const TOKENS = [ { Token: artifacts.require('$ERC20Votes'), mode: 'blocknumber' }, @@ -166,46 +166,6 @@ contract('Governor', function (accounts) { expect(await web3.eth.getBalance(this.receiver.address)).to.be.bignumber.equal(value); }); - it('vote with signature', async function () { - const voterBySig = Wallet.generate(); - const voterBySigAddress = web3.utils.toChecksumAddress(voterBySig.getAddressString()); - - const signature = (contract, message) => - getDomain(contract) - .then(domain => ({ - primaryType: 'Ballot', - types: { - EIP712Domain: domainType(domain), - Ballot: [ - { name: 'proposalId', type: 'uint256' }, - { name: 'support', type: 'uint8' }, - ], - }, - domain, - message, - })) - .then(data => ethSigUtil.signTypedMessage(voterBySig.getPrivateKey(), { data })) - .then(fromRpcSig); - - await this.token.delegate(voterBySigAddress, { from: voter1 }); - - // Run proposal - await this.helper.propose(); - await this.helper.waitForSnapshot(); - expectEvent(await this.helper.vote({ support: Enums.VoteType.For, signature }), 'VoteCast', { - voter: voterBySigAddress, - support: Enums.VoteType.For, - }); - await this.helper.waitForDeadline(); - await this.helper.execute(); - - // After - expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); - expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(false); - expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(false); - expect(await this.mock.hasVoted(this.proposal.id, voterBySigAddress)).to.be.equal(true); - }); - it('send ethers', async function () { const empty = web3.utils.toChecksumAddress(web3.utils.randomHex(20)); @@ -235,6 +195,106 @@ contract('Governor', function (accounts) { expect(await web3.eth.getBalance(empty)).to.be.bignumber.equal(value); }); + describe('vote with signature', function () { + const sign = privateKey => async (contract, message) => { + const domain = await getDomain(contract); + return ethSigUtil.signTypedMessage(privateKey, { + data: { + primaryType: 'Ballot', + types: { + EIP712Domain: domainType(domain), + Ballot: [ + { name: 'proposalId', type: 'uint256' }, + { name: 'support', type: 'uint8' }, + { name: 'voter', type: 'address' }, + { name: 'nonce', type: 'uint256' }, + ], + }, + domain, + message, + }, + }); + }; + + afterEach('no other votes are cast for proposalId', async function () { + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(false); + }); + + it('votes with an EOA signature', async function () { + const voterBySig = Wallet.generate(); + const voterBySigAddress = web3.utils.toChecksumAddress(voterBySig.getAddressString()); + + await this.token.delegate(voterBySigAddress, { from: voter1 }); + + const nonce = await this.mock.nonces(voterBySigAddress); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + expectEvent( + await this.helper.vote({ + support: Enums.VoteType.For, + voter: voterBySigAddress, + nonce, + signature: sign(voterBySig.getPrivateKey()), + }), + 'VoteCast', + { + voter: voterBySigAddress, + support: Enums.VoteType.For, + }, + ); + await this.helper.waitForDeadline(); + await this.helper.execute(); + + // After + expect(await this.mock.hasVoted(this.proposal.id, voterBySigAddress)).to.be.equal(true); + expect(await this.mock.nonces(voterBySigAddress)).to.be.bignumber.equal(nonce.addn(1)); + }); + + it('votes with a valid EIP-1271 signature', async function () { + const ERC1271WalletOwner = Wallet.generate(); + ERC1271WalletOwner.address = web3.utils.toChecksumAddress(ERC1271WalletOwner.getAddressString()); + + const wallet = await ERC1271WalletMock.new(ERC1271WalletOwner.address); + + await this.token.delegate(wallet.address, { from: voter1 }); + + const nonce = await this.mock.nonces(wallet.address); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + expectEvent( + await this.helper.vote({ + support: Enums.VoteType.For, + voter: wallet.address, + nonce, + signature: sign(ERC1271WalletOwner.getPrivateKey()), + }), + 'VoteCast', + { + voter: wallet.address, + support: Enums.VoteType.For, + }, + ); + await this.helper.waitForDeadline(); + await this.helper.execute(); + + // After + expect(await this.mock.hasVoted(this.proposal.id, wallet.address)).to.be.equal(true); + expect(await this.mock.nonces(wallet.address)).to.be.bignumber.equal(nonce.addn(1)); + }); + + afterEach('no other votes are cast', async function () { + expect(await this.mock.hasVoted(this.proposal.id, owner)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter1)).to.be.equal(false); + expect(await this.mock.hasVoted(this.proposal.id, voter2)).to.be.equal(false); + }); + }); + describe('should revert', function () { describe('on propose', function () { it('if proposal already exists', async function () { @@ -297,6 +357,76 @@ contract('Governor', function (accounts) { }); }); + describe('on vote by signature', function () { + beforeEach(async function () { + this.voterBySig = Wallet.generate(); + this.voterBySig.address = web3.utils.toChecksumAddress(this.voterBySig.getAddressString()); + + this.data = (contract, message) => + getDomain(contract).then(domain => ({ + primaryType: 'Ballot', + types: { + EIP712Domain: domainType(domain), + Ballot: [ + { name: 'proposalId', type: 'uint256' }, + { name: 'support', type: 'uint8' }, + { name: 'voter', type: 'address' }, + { name: 'nonce', type: 'uint256' }, + ], + }, + domain, + message, + })); + + this.signature = (contract, message) => + this.data(contract, message).then(data => + ethSigUtil.signTypedMessage(this.voterBySig.getPrivateKey(), { data }), + ); + + await this.token.delegate(this.voterBySig.address, { from: voter1 }); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + }); + + it('if signature does not match signer', async function () { + const nonce = await this.mock.nonces(this.voterBySig.address); + + const voteParams = { + support: Enums.VoteType.For, + voter: this.voterBySig.address, + nonce, + signature: async (...params) => { + const sig = await this.signature(...params); + const tamperedSig = web3.utils.hexToBytes(sig); + tamperedSig[42] ^= 0xff; + return web3.utils.bytesToHex(tamperedSig); + }, + }; + + await expectRevertCustomError(this.helper.vote(voteParams), 'GovernorInvalidSignature', [voteParams.voter]); + }); + + it('if vote nonce is incorrect', async function () { + const nonce = await this.mock.nonces(this.voterBySig.address); + + const voteParams = { + support: Enums.VoteType.For, + voter: this.voterBySig.address, + nonce: nonce.addn(1), + signature: this.signature, + }; + + await expectRevertCustomError( + this.helper.vote(voteParams), + // The signature check implies the nonce can't be tampered without changing the signer + 'GovernorInvalidSignature', + [voteParams.voter], + ); + }); + }); + describe('on execute', function () { it('if proposal does not exist', async function () { await expectRevertCustomError(this.helper.execute(), 'GovernorNonexistentProposal', [this.proposal.id]); diff --git a/test/governance/TimelockController.test.js b/test/governance/TimelockController.test.js index d8fcdce6c..ce051e787 100644 --- a/test/governance/TimelockController.test.js +++ b/test/governance/TimelockController.test.js @@ -1,5 +1,6 @@ const { BN, constants, expectEvent, expectRevert, time } = require('@openzeppelin/test-helpers'); const { ZERO_ADDRESS, ZERO_BYTES32 } = constants; +const { proposalStatesToBitMap } = require('../helpers/governance'); const { expect } = require('chai'); @@ -195,7 +196,7 @@ contract('TimelockController', function (accounts) { { from: proposer }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Unset], + [this.operation.id, proposalStatesToBitMap(OperationState.Unset)], ); }); @@ -267,7 +268,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Ready], + [this.operation.id, proposalStatesToBitMap(OperationState.Ready)], ); }); @@ -295,7 +296,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Ready], + [this.operation.id, proposalStatesToBitMap(OperationState.Ready)], ); }); @@ -313,7 +314,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Ready], + [this.operation.id, proposalStatesToBitMap(OperationState.Ready)], ); }); @@ -408,7 +409,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [reentrantOperation.id, OperationState.Ready], + [reentrantOperation.id, proposalStatesToBitMap(OperationState.Ready)], ); // Disable reentrancy @@ -505,7 +506,7 @@ contract('TimelockController', function (accounts) { { from: proposer }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Unset], + [this.operation.id, proposalStatesToBitMap(OperationState.Unset)], ); }); @@ -596,7 +597,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Ready], + [this.operation.id, proposalStatesToBitMap(OperationState.Ready)], ); }); @@ -624,7 +625,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Ready], + [this.operation.id, proposalStatesToBitMap(OperationState.Ready)], ); }); @@ -642,7 +643,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [this.operation.id, OperationState.Ready], + [this.operation.id, proposalStatesToBitMap(OperationState.Ready)], ); }); @@ -784,7 +785,7 @@ contract('TimelockController', function (accounts) { { from: executor }, ), 'TimelockUnexpectedOperationState', - [reentrantBatchOperation.id, OperationState.Ready], + [reentrantBatchOperation.id, proposalStatesToBitMap(OperationState.Ready)], ); // Disable reentrancy @@ -881,7 +882,7 @@ contract('TimelockController', function (accounts) { await expectRevertCustomError( this.mock.cancel(constants.ZERO_BYTES32, { from: canceller }), 'TimelockUnexpectedOperationState', - [constants.ZERO_BYTES32, OperationState.Pending], + [constants.ZERO_BYTES32, proposalStatesToBitMap([OperationState.Waiting, OperationState.Ready])], ); }); diff --git a/test/governance/extensions/GovernorTimelockControl.test.js b/test/governance/extensions/GovernorTimelockControl.test.js index 3265dfa68..5954d4117 100644 --- a/test/governance/extensions/GovernorTimelockControl.test.js +++ b/test/governance/extensions/GovernorTimelockControl.test.js @@ -159,7 +159,7 @@ contract('GovernorTimelockControl', function (accounts) { await expectRevertCustomError(this.helper.execute(), 'TimelockUnexpectedOperationState', [ this.proposal.timelockid, - Enums.OperationState.Ready, + proposalStatesToBitMap(Enums.OperationState.Ready), ]); }); @@ -174,7 +174,7 @@ contract('GovernorTimelockControl', function (accounts) { await expectRevertCustomError(this.helper.execute(), 'TimelockUnexpectedOperationState', [ this.proposal.timelockid, - Enums.OperationState.Ready, + proposalStatesToBitMap(Enums.OperationState.Ready), ]); }); diff --git a/test/governance/extensions/GovernorWithParams.test.js b/test/governance/extensions/GovernorWithParams.test.js index 00936c505..896c2e094 100644 --- a/test/governance/extensions/GovernorWithParams.test.js +++ b/test/governance/extensions/GovernorWithParams.test.js @@ -2,14 +2,15 @@ const { expectEvent } = require('@openzeppelin/test-helpers'); const { expect } = require('chai'); const ethSigUtil = require('eth-sig-util'); const Wallet = require('ethereumjs-wallet').default; -const { fromRpcSig } = require('ethereumjs-util'); const Enums = require('../../helpers/enums'); const { getDomain, domainType } = require('../../helpers/eip712'); const { GovernorHelper } = require('../../helpers/governance'); +const { expectRevertCustomError } = require('../../helpers/customError'); const Governor = artifacts.require('$GovernorWithParamsMock'); const CallReceiver = artifacts.require('CallReceiverMock'); +const ERC1271WalletMock = artifacts.require('ERC1271WalletMock'); const rawParams = { uintParam: web3.utils.toBN('42'), @@ -119,56 +120,157 @@ contract('GovernorWithParams', function (accounts) { expect(votes.forVotes).to.be.bignumber.equal(weight); }); - it('Voting with params by signature is properly supported', async function () { - const voterBySig = Wallet.generate(); - const voterBySigAddress = web3.utils.toChecksumAddress(voterBySig.getAddressString()); + describe('voting by signature', function () { + beforeEach(async function () { + this.voterBySig = Wallet.generate(); + this.voterBySig.address = web3.utils.toChecksumAddress(this.voterBySig.getAddressString()); - const signature = (contract, message) => - getDomain(contract) - .then(domain => ({ + this.data = (contract, message) => + getDomain(contract).then(domain => ({ primaryType: 'ExtendedBallot', types: { EIP712Domain: domainType(domain), ExtendedBallot: [ { name: 'proposalId', type: 'uint256' }, { name: 'support', type: 'uint8' }, + { name: 'voter', type: 'address' }, + { name: 'nonce', type: 'uint256' }, { name: 'reason', type: 'string' }, { name: 'params', type: 'bytes' }, ], }, domain, message, - })) - .then(data => ethSigUtil.signTypedMessage(voterBySig.getPrivateKey(), { data })) - .then(fromRpcSig); + })); - await this.token.delegate(voterBySigAddress, { from: voter2 }); - - // Run proposal - await this.helper.propose(); - await this.helper.waitForSnapshot(); - - const weight = web3.utils.toBN(web3.utils.toWei('7')).sub(rawParams.uintParam); - - const tx = await this.helper.vote({ - support: Enums.VoteType.For, - reason: 'no particular reason', - params: encodedParams, - signature, + this.sign = privateKey => async (contract, message) => + ethSigUtil.signTypedMessage(privateKey, { data: await this.data(contract, message) }); }); - expectEvent(tx, 'CountParams', { ...rawParams }); - expectEvent(tx, 'VoteCastWithParams', { - voter: voterBySigAddress, - proposalId: this.proposal.id, - support: Enums.VoteType.For, - weight, - reason: 'no particular reason', - params: encodedParams, + it('suports EOA signatures', async function () { + await this.token.delegate(this.voterBySig.address, { from: voter2 }); + + const weight = web3.utils.toBN(web3.utils.toWei('7')).sub(rawParams.uintParam); + + const nonce = await this.mock.nonces(this.voterBySig.address); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + const tx = await this.helper.vote({ + support: Enums.VoteType.For, + voter: this.voterBySig.address, + nonce, + reason: 'no particular reason', + params: encodedParams, + signature: this.sign(this.voterBySig.getPrivateKey()), + }); + + expectEvent(tx, 'CountParams', { ...rawParams }); + expectEvent(tx, 'VoteCastWithParams', { + voter: this.voterBySig.address, + proposalId: this.proposal.id, + support: Enums.VoteType.For, + weight, + reason: 'no particular reason', + params: encodedParams, + }); + + const votes = await this.mock.proposalVotes(this.proposal.id); + expect(votes.forVotes).to.be.bignumber.equal(weight); + expect(await this.mock.nonces(this.voterBySig.address)).to.be.bignumber.equal(nonce.addn(1)); }); - const votes = await this.mock.proposalVotes(this.proposal.id); - expect(votes.forVotes).to.be.bignumber.equal(weight); + it('supports EIP-1271 signature signatures', async function () { + const ERC1271WalletOwner = Wallet.generate(); + ERC1271WalletOwner.address = web3.utils.toChecksumAddress(ERC1271WalletOwner.getAddressString()); + + const wallet = await ERC1271WalletMock.new(ERC1271WalletOwner.address); + + await this.token.delegate(wallet.address, { from: voter2 }); + + const weight = web3.utils.toBN(web3.utils.toWei('7')).sub(rawParams.uintParam); + + const nonce = await this.mock.nonces(wallet.address); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + const tx = await this.helper.vote({ + support: Enums.VoteType.For, + voter: wallet.address, + nonce, + reason: 'no particular reason', + params: encodedParams, + signature: this.sign(ERC1271WalletOwner.getPrivateKey()), + }); + + expectEvent(tx, 'CountParams', { ...rawParams }); + expectEvent(tx, 'VoteCastWithParams', { + voter: wallet.address, + proposalId: this.proposal.id, + support: Enums.VoteType.For, + weight, + reason: 'no particular reason', + params: encodedParams, + }); + + const votes = await this.mock.proposalVotes(this.proposal.id); + expect(votes.forVotes).to.be.bignumber.equal(weight); + expect(await this.mock.nonces(wallet.address)).to.be.bignumber.equal(nonce.addn(1)); + }); + + it('reverts if signature does not match signer', async function () { + await this.token.delegate(this.voterBySig.address, { from: voter2 }); + + const nonce = await this.mock.nonces(this.voterBySig.address); + + const signature = this.sign(this.voterBySig.getPrivateKey()); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + const voteParams = { + support: Enums.VoteType.For, + voter: this.voterBySig.address, + nonce, + signature: async (...params) => { + const sig = await signature(...params); + const tamperedSig = web3.utils.hexToBytes(sig); + tamperedSig[42] ^= 0xff; + return web3.utils.bytesToHex(tamperedSig); + }, + reason: 'no particular reason', + params: encodedParams, + }; + + await expectRevertCustomError(this.helper.vote(voteParams), 'GovernorInvalidSignature', [voteParams.voter]); + }); + + it('reverts if vote nonce is incorrect', async function () { + await this.token.delegate(this.voterBySig.address, { from: voter2 }); + + const nonce = await this.mock.nonces(this.voterBySig.address); + + // Run proposal + await this.helper.propose(); + await this.helper.waitForSnapshot(); + const voteParams = { + support: Enums.VoteType.For, + voter: this.voterBySig.address, + nonce: nonce.addn(1), + signature: this.sign(this.voterBySig.getPrivateKey()), + reason: 'no particular reason', + params: encodedParams, + }; + + await expectRevertCustomError( + this.helper.vote(voteParams), + // The signature check implies the nonce can't be tampered without changing the signer + 'GovernorInvalidSignature', + [voteParams.voter], + ); + }); }); }); } diff --git a/test/helpers/enums.js b/test/helpers/enums.js index d4a4fdbd0..75746e087 100644 --- a/test/helpers/enums.js +++ b/test/helpers/enums.js @@ -7,5 +7,5 @@ module.exports = { ProposalState: Enum('Pending', 'Active', 'Canceled', 'Defeated', 'Succeeded', 'Queued', 'Expired', 'Executed'), VoteType: Enum('Against', 'For', 'Abstain'), Rounding: Enum('Down', 'Up', 'Zero'), - OperationState: Enum('Unset', 'Pending', 'Ready', 'Done'), + OperationState: Enum('Unset', 'Waiting', 'Ready', 'Done'), }; diff --git a/test/helpers/governance.js b/test/helpers/governance.js index 665c21605..3ae0695ac 100644 --- a/test/helpers/governance.js +++ b/test/helpers/governance.js @@ -91,26 +91,17 @@ class GovernorHelper { return vote.signature ? // if signature, and either params or reason → vote.params || vote.reason - ? vote - .signature(this.governor, { - proposalId: proposal.id, - support: vote.support, - reason: vote.reason || '', - params: vote.params || '', - }) - .then(({ v, r, s }) => - this.governor.castVoteWithReasonAndParamsBySig( - ...concatOpts([proposal.id, vote.support, vote.reason || '', vote.params || '', v, r, s], opts), + ? this.sign(vote).then(signature => + this.governor.castVoteWithReasonAndParamsBySig( + ...concatOpts( + [proposal.id, vote.support, vote.voter, vote.reason || '', vote.params || '', signature], + opts, ), - ) - : vote - .signature(this.governor, { - proposalId: proposal.id, - support: vote.support, - }) - .then(({ v, r, s }) => - this.governor.castVoteBySig(...concatOpts([proposal.id, vote.support, v, r, s], opts)), - ) + ), + ) + : this.sign(vote).then(signature => + this.governor.castVoteBySig(...concatOpts([proposal.id, vote.support, vote.voter, signature], opts)), + ) : vote.params ? // otherwise if params this.governor.castVoteWithReasonAndParams( @@ -122,6 +113,23 @@ class GovernorHelper { : this.governor.castVote(...concatOpts([proposal.id, vote.support], opts)); } + sign(vote = {}) { + return vote.signature(this.governor, this.forgeMessage(vote)); + } + + forgeMessage(vote = {}) { + const proposal = this.currentProposal; + + const message = { proposalId: proposal.id, support: vote.support, voter: vote.voter, nonce: vote.nonce }; + + if (vote.params || vote.reason) { + message.reason = vote.reason || ''; + message.params = vote.params || ''; + } + + return message; + } + async waitForSnapshot(offset = 0) { const proposal = this.currentProposal; const timepoint = await this.governor.proposalSnapshot(proposal.id); diff --git a/test/utils/introspection/SupportsInterface.behavior.js b/test/utils/introspection/SupportsInterface.behavior.js index 201a55f47..80e144f18 100644 --- a/test/utils/introspection/SupportsInterface.behavior.js +++ b/test/utils/introspection/SupportsInterface.behavior.js @@ -2,6 +2,7 @@ const { makeInterfaceId } = require('@openzeppelin/test-helpers'); const { expect } = require('chai'); +const INVALID_ID = '0xffffffff'; const INTERFACES = { ERC165: ['supportsInterface(bytes4)'], ERC721: [ @@ -66,7 +67,7 @@ const INTERFACES = { 'execute(address[],uint256[],bytes[],bytes32)', 'castVote(uint256,uint8)', 'castVoteWithReason(uint256,uint8,string)', - 'castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)', + 'castVoteBySig(uint256,uint8,address,bytes)', ], GovernorWithParams: [ 'name()', @@ -87,8 +88,8 @@ const INTERFACES = { 'castVote(uint256,uint8)', 'castVoteWithReason(uint256,uint8,string)', 'castVoteWithReasonAndParams(uint256,uint8,string,bytes)', - 'castVoteBySig(uint256,uint8,uint8,bytes32,bytes32)', - 'castVoteWithReasonAndParamsBySig(uint256,uint8,string,bytes,uint8,bytes32,bytes32)', + 'castVoteBySig(uint256,uint8,address,bytes)', + 'castVoteWithReasonAndParamsBySig(uint256,uint8,address,string,bytes,bytes)', ], GovernorCancel: ['proposalProposer(uint256)', 'cancel(address[],uint256[],bytes[],bytes32)'], GovernorTimelock: ['timelock()', 'proposalEta(uint256)', 'queue(address[],uint256[],bytes[],bytes32)'], @@ -111,18 +112,30 @@ function shouldSupportInterfaces(interfaces = []) { this.contractUnderTest = this.mock || this.token || this.holder || this.accessControl; }); - it('supportsInterface uses less than 30k gas', async function () { - for (const k of interfaces) { - const interfaceId = INTERFACE_IDS[k] ?? k; - expect(await this.contractUnderTest.supportsInterface.estimateGas(interfaceId)).to.be.lte(30000); - } + describe('when the interfaceId is supported', function () { + it('uses less than 30k gas', async function () { + for (const k of interfaces) { + const interfaceId = INTERFACE_IDS[k] ?? k; + expect(await this.contractUnderTest.supportsInterface.estimateGas(interfaceId)).to.be.lte(30000); + } + }); + + it('returns true', async function () { + for (const k of interfaces) { + const interfaceId = INTERFACE_IDS[k] ?? k; + expect(await this.contractUnderTest.supportsInterface(interfaceId)).to.equal(true, `does not support ${k}`); + } + }); }); - it('all interfaces are reported as supported', async function () { - for (const k of interfaces) { - const interfaceId = INTERFACE_IDS[k] ?? k; - expect(await this.contractUnderTest.supportsInterface(interfaceId)).to.equal(true, `does not support ${k}`); - } + describe('when the interfaceId is not supported', function () { + it('uses less thank 30k', async function () { + expect(await this.contractUnderTest.supportsInterface.estimateGas(INVALID_ID)).to.be.lte(30000); + }); + + it('returns false', async function () { + expect(await this.contractUnderTest.supportsInterface(INVALID_ID)).to.be.equal(false, `supports ${INVALID_ID}`); + }); }); it('all interface functions are in ABI', async function () {