From df7996b671d309ee949113c64beee9899133dc05 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 19 Apr 2021 20:55:16 +0200 Subject: [PATCH] add Available since 4.1 comments (cherry picked from commit 9a698e6b7b97a6c6cc78b2df6249ca989b4acd8d) --- contracts/access/AccessControl.sol | 2 ++ contracts/interfaces/IERC1271.sol | 2 ++ contracts/interfaces/IERC3156.sol | 2 ++ contracts/proxy/ERC1967/ERC1967Storage.sol | 2 ++ contracts/proxy/ERC1967/ERC1967Upgrade.sol | 2 ++ contracts/proxy/utils/UUPSUpgradeable.sol | 2 ++ contracts/token/ERC20/extensions/IERC20Metadata.sol | 2 ++ contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol | 2 ++ contracts/token/ERC20/extensions/draft-ERC20Permit.sol | 2 ++ contracts/utils/Multicall.sol | 2 ++ contracts/utils/StorageSlot.sol | 2 +- contracts/utils/cryptography/ECDSA.sol | 2 +- contracts/utils/cryptography/SignatureChecker.sol | 2 ++ 13 files changed, 24 insertions(+), 2 deletions(-) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 5b723def7..cf62500f8 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -99,6 +99,8 @@ 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]{20}) is missing role (0x[0-9a-f]{32})$/ + * + * _Available since v4.1._ */ modifier onlyRole(bytes32 role) { _checkRole(role, _msgSender()); diff --git a/contracts/interfaces/IERC1271.sol b/contracts/interfaces/IERC1271.sol index ca5de924c..b15147fc0 100644 --- a/contracts/interfaces/IERC1271.sol +++ b/contracts/interfaces/IERC1271.sol @@ -5,6 +5,8 @@ pragma solidity ^0.8.0; /** * @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/IERC3156.sol b/contracts/interfaces/IERC3156.sol index 2f3d84608..4b0cb5547 100644 --- a/contracts/interfaces/IERC3156.sol +++ b/contracts/interfaces/IERC3156.sol @@ -5,6 +5,8 @@ pragma solidity ^0.8.0; /** * @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/proxy/ERC1967/ERC1967Storage.sol b/contracts/proxy/ERC1967/ERC1967Storage.sol index ff1753cb3..411402a09 100644 --- a/contracts/proxy/ERC1967/ERC1967Storage.sol +++ b/contracts/proxy/ERC1967/ERC1967Storage.sol @@ -9,6 +9,8 @@ import "../../utils/StorageSlot.sol"; /** * @dev This abstract contract provides setters and getters for the different * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] storage slots. + * + * _Available since v4.1._ */ abstract contract ERC1967Storage { /** diff --git a/contracts/proxy/ERC1967/ERC1967Upgrade.sol b/contracts/proxy/ERC1967/ERC1967Upgrade.sol index 828fb5934..c17fdabb1 100644 --- a/contracts/proxy/ERC1967/ERC1967Upgrade.sol +++ b/contracts/proxy/ERC1967/ERC1967Upgrade.sol @@ -8,6 +8,8 @@ import "./ERC1967Storage.sol"; * @dev This abstract contract provides event emitting update functions for * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots. * + * _Available since v4.1._ + * * @custom:oz-upgrades-unsafe-allow delegatecall */ abstract contract ERC1967Upgrade is ERC1967Storage { diff --git a/contracts/proxy/utils/UUPSUpgradeable.sol b/contracts/proxy/utils/UUPSUpgradeable.sol index 09bf524d5..6f9010233 100644 --- a/contracts/proxy/utils/UUPSUpgradeable.sol +++ b/contracts/proxy/utils/UUPSUpgradeable.sol @@ -10,6 +10,8 @@ import "../ERC1967/ERC1967Upgrade.sol"; * continuation of the upgradability. * * The {_authorizeUpgrade} function MUST be overridden to include access restriction to the upgrade mechanism. + * + * _Available since v4.1._ */ abstract contract UUPSUpgradeable is ERC1967Upgrade { function upgradeTo(address newImplementation) external virtual { diff --git a/contracts/token/ERC20/extensions/IERC20Metadata.sol b/contracts/token/ERC20/extensions/IERC20Metadata.sol index 5bc786069..4fb868ae8 100644 --- a/contracts/token/ERC20/extensions/IERC20Metadata.sol +++ b/contracts/token/ERC20/extensions/IERC20Metadata.sol @@ -6,6 +6,8 @@ import "../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/ERC20/extensions/draft-ERC20FlashMint.sol b/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol index a4f2b04c7..36d23218c 100644 --- a/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/draft-ERC20FlashMint.sol @@ -11,6 +11,8 @@ import "../ERC20.sol"; * * Adds the {flashLoan} method, which provides flash loan support at the token * level. By default there is no fee, but this can be changed by overriding {flashFee}. + * + * _Available since v4.1._ */ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { bytes32 constant private RETURN_VALUE = keccak256("ERC3156FlashBorrower.onFlashLoan"); diff --git a/contracts/token/ERC20/extensions/draft-ERC20Permit.sol b/contracts/token/ERC20/extensions/draft-ERC20Permit.sol index 4dcd9007a..e1341eceb 100644 --- a/contracts/token/ERC20/extensions/draft-ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/draft-ERC20Permit.sol @@ -77,6 +77,8 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712 { /** * @dev "Consume a nonce": return the current value and increment. + * + * _Available since v4.1._ */ function _useNonce(address owner) internal virtual returns (uint256 current) { Counters.Counter storage nonce = _nonces[owner]; diff --git a/contracts/utils/Multicall.sol b/contracts/utils/Multicall.sol index 2dcb1d7fc..43244bdd0 100644 --- a/contracts/utils/Multicall.sol +++ b/contracts/utils/Multicall.sol @@ -6,6 +6,8 @@ import "./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 93a773583..00aa4ec6d 100644 --- a/contracts/utils/StorageSlot.sol +++ b/contracts/utils/StorageSlot.sol @@ -26,7 +26,7 @@ pragma solidity ^0.8.0; * } * ``` * - * Available since v4.1.0 for `address`, `bool`, `bytes32`, and `uint256`. + * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._ */ library StorageSlot { struct AddressSlot { diff --git a/contracts/utils/cryptography/ECDSA.sol b/contracts/utils/cryptography/ECDSA.sol index b58e26e9f..9282977de 100644 --- a/contracts/utils/cryptography/ECDSA.sol +++ b/contracts/utils/cryptography/ECDSA.sol @@ -31,7 +31,7 @@ library ECDSA { // Check the signature length // - case 65: r,s,v signature (standard) - // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) + // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. diff --git a/contracts/utils/cryptography/SignatureChecker.sol b/contracts/utils/cryptography/SignatureChecker.sol index 881ae579a..c678a52b6 100644 --- a/contracts/utils/cryptography/SignatureChecker.sol +++ b/contracts/utils/cryptography/SignatureChecker.sol @@ -13,6 +13,8 @@ import "../../interfaces/IERC1271.sol"; * * Note: unlike ECDSA signatures, contract signature's are revocable, and the outcome of this function can thus change * through time. It could return true at block N and false at block N+1 (or the opposite). + * + * _Available since v4.1._ */ library SignatureChecker { function isValidSignatureNow(address signer, bytes32 hash, bytes memory signature) internal view returns (bool) {