From 4daab31eeb8c9cd36b29fc52f7f9f5ccbcf723b6 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 11:31:51 -0300 Subject: [PATCH 01/29] AccessControl --- contracts/access/AccessControl.sol | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contracts/access/AccessControl.sol b/contracts/access/AccessControl.sol index 82a43933d72..df16dbdab6f 100644 --- a/contracts/access/AccessControl.sol +++ b/contracts/access/AccessControl.sol @@ -82,7 +82,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { /** * @dev Returns `true` if `account` has been granted `role`. */ - function hasRole(bytes32 role, address account) public view virtual override returns (bool) { + function hasRole(bytes32 role, address account) public view virtual returns (bool) { return _roles[role].members[account]; } @@ -126,7 +126,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * * To change a role's admin, use {_setRoleAdmin}. */ - function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) { + function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) { return _roles[role].adminRole; } @@ -142,7 +142,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * * May emit a {RoleGranted} event. */ - function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { + function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _grantRole(role, account); } @@ -157,7 +157,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * * May emit a {RoleRevoked} event. */ - function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) { + function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) { _revokeRole(role, account); } @@ -177,7 +177,7 @@ abstract contract AccessControl is Context, IAccessControl, ERC165 { * * May emit a {RoleRevoked} event. */ - function renounceRole(bytes32 role, address account) public virtual override { + function renounceRole(bytes32 role, address account) public virtual { require(account == _msgSender(), "AccessControl: can only renounce roles for self"); _revokeRole(role, account); From ebf635cd74ac977ebcbf6d0c03e2711e19512468 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 11:36:18 -0300 Subject: [PATCH 02/29] AccessControlEnumerable --- contracts/access/AccessControlEnumerable.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/access/AccessControlEnumerable.sol b/contracts/access/AccessControlEnumerable.sol index 1c37a30a9fe..297d345361a 100644 --- a/contracts/access/AccessControlEnumerable.sol +++ b/contracts/access/AccessControlEnumerable.sol @@ -34,7 +34,7 @@ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessCon * https://forum.openzeppelin.com/t/iterating-over-elements-on-enumerableset-in-openzeppelin-contracts/2296[forum post] * for more information. */ - function getRoleMember(bytes32 role, uint256 index) public view virtual override returns (address) { + function getRoleMember(bytes32 role, uint256 index) public view virtual returns (address) { return _roleMembers[role].at(index); } @@ -42,7 +42,7 @@ abstract contract AccessControlEnumerable is IAccessControlEnumerable, AccessCon * @dev Returns the number of accounts that have `role`. Can be used * together with {getRoleMember} to enumerate all bearers of a role. */ - function getRoleMemberCount(bytes32 role) public view virtual override returns (uint256) { + function getRoleMemberCount(bytes32 role) public view virtual returns (uint256) { return _roleMembers[role].length(); } From 7a0466f5b1075fb0105d0ec96a25ec9673ba6ff1 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 11:40:49 -0300 Subject: [PATCH 03/29] Governor --- contracts/governance/Governor.sol | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contracts/governance/Governor.sol b/contracts/governance/Governor.sol index 4ff8c34924d..74d60c7423d 100644 --- a/contracts/governance/Governor.sol +++ b/contracts/governance/Governor.sol @@ -605,20 +605,14 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive /** * @dev See {IERC721Receiver-onERC721Received}. */ - function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { + function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC721Received.selector; } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ - function onERC1155Received( - address, - address, - uint256, - uint256, - bytes memory - ) public virtual override returns (bytes4) { + function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC1155Received.selector; } @@ -631,7 +625,7 @@ abstract contract Governor is Context, ERC165, EIP712, IGovernor, IERC721Receive uint256[] memory, uint256[] memory, bytes memory - ) public virtual override returns (bytes4) { + ) public virtual returns (bytes4) { return this.onERC1155BatchReceived.selector; } } From f377dd499863614465397ee1cc7eace1f26ea809 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 11:41:37 -0300 Subject: [PATCH 04/29] IGovernor --- contracts/governance/IGovernor.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/governance/IGovernor.sol b/contracts/governance/IGovernor.sol index 245c5d97aeb..992b5ca10b1 100644 --- a/contracts/governance/IGovernor.sol +++ b/contracts/governance/IGovernor.sol @@ -86,14 +86,14 @@ abstract contract IGovernor is IERC165, IERC6372 { * @notice module:core * @dev See {IERC6372} */ - function clock() public view virtual override returns (uint48); + function clock() public view virtual returns (uint48); /** * @notice module:core * @dev See EIP-6372. */ // solhint-disable-next-line func-name-mixedcase - function CLOCK_MODE() public view virtual override returns (string memory); + function CLOCK_MODE() public view virtual returns (string memory); /** * @notice module:voting From 6b50b81f7435c544e533a6ec962f2b059abd957e Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 11:48:25 -0300 Subject: [PATCH 05/29] TimelockController --- contracts/governance/TimelockController.sol | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/contracts/governance/TimelockController.sol b/contracts/governance/TimelockController.sol index 5f09161df11..9930d6a4941 100644 --- a/contracts/governance/TimelockController.sol +++ b/contracts/governance/TimelockController.sol @@ -384,20 +384,14 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver /** * @dev See {IERC721Receiver-onERC721Received}. */ - function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { + function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC721Received.selector; } /** * @dev See {IERC1155Receiver-onERC1155Received}. */ - function onERC1155Received( - address, - address, - uint256, - uint256, - bytes memory - ) public virtual override returns (bytes4) { + function onERC1155Received(address, address, uint256, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC1155Received.selector; } @@ -410,7 +404,7 @@ contract TimelockController is AccessControl, IERC721Receiver, IERC1155Receiver uint256[] memory, uint256[] memory, bytes memory - ) public virtual override returns (bytes4) { + ) public virtual returns (bytes4) { return this.onERC1155BatchReceived.selector; } } From bec26fce2b69c5b681ece077eed16afd864f4e22 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 11:58:14 -0300 Subject: [PATCH 06/29] Votes --- contracts/governance/utils/Votes.sol | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/contracts/governance/utils/Votes.sol b/contracts/governance/utils/Votes.sol index 94f6d4fb941..5fc15da292b 100644 --- a/contracts/governance/utils/Votes.sol +++ b/contracts/governance/utils/Votes.sol @@ -46,7 +46,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { * @dev Clock used for flagging checkpoints. Can be overridden to implement timestamp based * checkpoints (and voting), in which case {CLOCK_MODE} should be overridden as well to match. */ - function clock() public view virtual override returns (uint48) { + function clock() public view virtual returns (uint48) { return SafeCast.toUint48(block.number); } @@ -54,7 +54,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { * @dev Machine-readable description of the clock as specified in EIP-6372. */ // solhint-disable-next-line func-name-mixedcase - function CLOCK_MODE() public view virtual override returns (string memory) { + function CLOCK_MODE() public view virtual returns (string memory) { // Check that the clock was not modified require(clock() == block.number, "Votes: broken clock mode"); return "mode=blocknumber&from=default"; @@ -63,7 +63,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { /** * @dev Returns the current amount of votes that `account` has. */ - function getVotes(address account) public view virtual override returns (uint256) { + function getVotes(address account) public view virtual returns (uint256) { return _delegateCheckpoints[account].latest(); } @@ -75,7 +75,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { * * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined. */ - function getPastVotes(address account, uint256 timepoint) public view virtual override returns (uint256) { + function getPastVotes(address account, uint256 timepoint) public view virtual returns (uint256) { require(timepoint < clock(), "Votes: future lookup"); return _delegateCheckpoints[account].upperLookupRecent(SafeCast.toUint32(timepoint)); } @@ -92,7 +92,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { * * - `timepoint` must be in the past. If operating using block numbers, the block must be already mined. */ - function getPastTotalSupply(uint256 timepoint) public view virtual override returns (uint256) { + function getPastTotalSupply(uint256 timepoint) public view virtual returns (uint256) { require(timepoint < clock(), "Votes: future lookup"); return _totalCheckpoints.upperLookupRecent(SafeCast.toUint32(timepoint)); } @@ -107,14 +107,14 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { /** * @dev Returns the delegate that `account` has chosen. */ - function delegates(address account) public view virtual override returns (address) { + function delegates(address account) public view virtual returns (address) { return _delegation[account]; } /** * @dev Delegates votes from the sender to `delegatee`. */ - function delegate(address delegatee) public virtual override { + function delegate(address delegatee) public virtual { address account = _msgSender(); _delegate(account, delegatee); } @@ -129,7 +129,7 @@ abstract contract Votes is Context, EIP712, Nonces, IERC5805 { uint8 v, bytes32 r, bytes32 s - ) public virtual override { + ) public virtual { require(block.timestamp <= expiry, "Votes: signature expired"); address signer = ECDSA.recover( _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), From 17401edeac1a887f51b101d7de4e1869bcde732c Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:02:52 -0300 Subject: [PATCH 07/29] ERC1271WalletMock --- contracts/mocks/ERC1271WalletMock.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/mocks/ERC1271WalletMock.sol b/contracts/mocks/ERC1271WalletMock.sol index a28fd0fb9eb..2bc39063630 100644 --- a/contracts/mocks/ERC1271WalletMock.sol +++ b/contracts/mocks/ERC1271WalletMock.sol @@ -9,13 +9,13 @@ import "../utils/cryptography/ECDSA.sol"; contract ERC1271WalletMock is Ownable, IERC1271 { constructor(address originalOwner) Ownable(originalOwner) {} - function isValidSignature(bytes32 hash, bytes memory signature) public view override returns (bytes4 magicValue) { + function isValidSignature(bytes32 hash, bytes memory signature) public view returns (bytes4 magicValue) { return ECDSA.recover(hash, signature) == owner() ? this.isValidSignature.selector : bytes4(0); } } contract ERC1271MaliciousMock is IERC1271 { - function isValidSignature(bytes32, bytes memory) public pure override returns (bytes4) { + function isValidSignature(bytes32, bytes memory) public pure returns (bytes4) { assembly { mstore(0, 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) return(0, 32) From 8db131c66aca6309fd34f8e03860b2d0efa7ffc9 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:04:39 -0300 Subject: [PATCH 08/29] ERC3156FlashBorrowerMock --- contracts/mocks/ERC3156FlashBorrowerMock.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/mocks/ERC3156FlashBorrowerMock.sol b/contracts/mocks/ERC3156FlashBorrowerMock.sol index 8d24af6c103..abf836606f5 100644 --- a/contracts/mocks/ERC3156FlashBorrowerMock.sol +++ b/contracts/mocks/ERC3156FlashBorrowerMock.sol @@ -33,7 +33,7 @@ contract ERC3156FlashBorrowerMock is IERC3156FlashBorrower { uint256 amount, uint256 fee, bytes calldata data - ) public override returns (bytes32) { + ) public returns (bytes32) { require(msg.sender == token); emit BalanceOf(token, address(this), IERC20(token).balanceOf(address(this))); From 5d2969584fc20d6c5c0fa3a825446597241297e6 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:09:31 -0300 Subject: [PATCH 09/29] ERC20VotesLegacyMock --- contracts/mocks/token/ERC20VotesLegacyMock.sol | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/mocks/token/ERC20VotesLegacyMock.sol b/contracts/mocks/token/ERC20VotesLegacyMock.sol index cf8afa58a9f..88ba8423616 100644 --- a/contracts/mocks/token/ERC20VotesLegacyMock.sol +++ b/contracts/mocks/token/ERC20VotesLegacyMock.sol @@ -41,14 +41,14 @@ abstract contract ERC20VotesLegacyMock is IVotes, ERC20Permit { /** * @dev Get the address `account` is currently delegating to. */ - function delegates(address account) public view virtual override returns (address) { + function delegates(address account) public view virtual returns (address) { return _delegates[account]; } /** * @dev Gets the current votes balance for `account` */ - function getVotes(address account) public view virtual override returns (uint256) { + function getVotes(address account) public view virtual returns (uint256) { uint256 pos = _checkpoints[account].length; unchecked { return pos == 0 ? 0 : _checkpoints[account][pos - 1].votes; @@ -62,7 +62,7 @@ abstract contract ERC20VotesLegacyMock is IVotes, ERC20Permit { * * - `blockNumber` must have been already mined */ - function getPastVotes(address account, uint256 blockNumber) public view virtual override returns (uint256) { + function getPastVotes(address account, uint256 blockNumber) public view virtual returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_checkpoints[account], blockNumber); } @@ -75,7 +75,7 @@ abstract contract ERC20VotesLegacyMock is IVotes, ERC20Permit { * * - `blockNumber` must have been already mined */ - function getPastTotalSupply(uint256 blockNumber) public view virtual override returns (uint256) { + function getPastTotalSupply(uint256 blockNumber) public view virtual returns (uint256) { require(blockNumber < block.number, "ERC20Votes: block not yet mined"); return _checkpointsLookup(_totalSupplyCheckpoints, blockNumber); } @@ -127,7 +127,7 @@ abstract contract ERC20VotesLegacyMock is IVotes, ERC20Permit { /** * @dev Delegate votes from the sender to `delegatee`. */ - function delegate(address delegatee) public virtual override { + function delegate(address delegatee) public virtual { _delegate(_msgSender(), delegatee); } @@ -141,7 +141,7 @@ abstract contract ERC20VotesLegacyMock is IVotes, ERC20Permit { uint8 v, bytes32 r, bytes32 s - ) public virtual override { + ) public virtual { require(block.timestamp <= expiry, "ERC20Votes: signature expired"); address signer = ECDSA.recover( _hashTypedDataV4(keccak256(abi.encode(_DELEGATION_TYPEHASH, delegatee, nonce, expiry))), From 75cb14f590d5153ead2366262d843bb8e2491418 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:11:49 -0300 Subject: [PATCH 10/29] ERC721ReceiverMock --- contracts/mocks/token/ERC721ReceiverMock.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/mocks/token/ERC721ReceiverMock.sol b/contracts/mocks/token/ERC721ReceiverMock.sol index 01526566ab0..e97ceacf323 100644 --- a/contracts/mocks/token/ERC721ReceiverMock.sol +++ b/contracts/mocks/token/ERC721ReceiverMock.sol @@ -27,7 +27,7 @@ contract ERC721ReceiverMock is IERC721Receiver { address from, uint256 tokenId, bytes memory data - ) public override returns (bytes4) { + ) public returns (bytes4) { if (_error == Error.RevertWithMessage) { revert("ERC721ReceiverMock: reverting"); } else if (_error == Error.RevertWithoutMessage) { From 92dad67cdc1838fb248fa6bf2c19c8730f8ce82b Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:13:19 -0300 Subject: [PATCH 11/29] ERC1155ReceiverMock --- contracts/mocks/token/ERC1155ReceiverMock.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/mocks/token/ERC1155ReceiverMock.sol b/contracts/mocks/token/ERC1155ReceiverMock.sol index 9f75f002bc6..2b591c058b9 100644 --- a/contracts/mocks/token/ERC1155ReceiverMock.sol +++ b/contracts/mocks/token/ERC1155ReceiverMock.sol @@ -27,7 +27,7 @@ contract ERC1155ReceiverMock is ERC165, IERC1155Receiver { uint256 id, uint256 value, bytes calldata data - ) external override returns (bytes4) { + ) external returns (bytes4) { require(!_recReverts, "ERC1155ReceiverMock: reverting on receive"); emit Received(operator, from, id, value, data, gasleft()); return _recRetval; @@ -39,7 +39,7 @@ contract ERC1155ReceiverMock is ERC165, IERC1155Receiver { uint256[] calldata ids, uint256[] calldata values, bytes calldata data - ) external override returns (bytes4) { + ) external returns (bytes4) { require(!_batReverts, "ERC1155ReceiverMock: reverting on batch receive"); emit BatchReceived(operator, from, ids, values, data, gasleft()); return _batRetval; From f20a8d10a89e056ab5fac9321172c3a8203ef400 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:14:52 -0300 Subject: [PATCH 12/29] UpgradeableBeacon --- contracts/proxy/beacon/UpgradeableBeacon.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/proxy/beacon/UpgradeableBeacon.sol b/contracts/proxy/beacon/UpgradeableBeacon.sol index 24d167f6025..37d27f67a55 100644 --- a/contracts/proxy/beacon/UpgradeableBeacon.sol +++ b/contracts/proxy/beacon/UpgradeableBeacon.sol @@ -30,7 +30,7 @@ contract UpgradeableBeacon is IBeacon, Ownable { /** * @dev Returns the current implementation address. */ - function implementation() public view virtual override returns (address) { + function implementation() public view virtual returns (address) { return _implementation; } From 86519c35179d969181c9ff4a47322f844e84bc91 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:15:41 -0300 Subject: [PATCH 13/29] UUPSUpgradeable --- contracts/proxy/utils/UUPSUpgradeable.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/proxy/utils/UUPSUpgradeable.sol b/contracts/proxy/utils/UUPSUpgradeable.sol index c281c90910a..1fd73247c9d 100644 --- a/contracts/proxy/utils/UUPSUpgradeable.sol +++ b/contracts/proxy/utils/UUPSUpgradeable.sol @@ -52,7 +52,7 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade { * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this * function revert if invoked through a proxy. This is guaranteed by the `notDelegated` modifier. */ - function proxiableUUID() external view virtual override notDelegated returns (bytes32) { + function proxiableUUID() external view virtual notDelegated returns (bytes32) { return _IMPLEMENTATION_SLOT; } @@ -92,7 +92,7 @@ abstract contract UUPSUpgradeable is IERC1822Proxiable, ERC1967Upgrade { * Normally, this function will use an xref:access.adoc[access control] modifier such as {Ownable-onlyOwner}. * * ```solidity - * function _authorizeUpgrade(address) internal override onlyOwner {} + * function _authorizeUpgrade(address) internal onlyOwner {} * ``` */ function _authorizeUpgrade(address newImplementation) internal virtual; From 88e98536f5b4c7223f27a58faa81e134a4409cd9 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:18:41 -0300 Subject: [PATCH 14/29] ERC2981 --- contracts/token/common/ERC2981.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 5d40388aaba..16e2d4a5bd5 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -40,7 +40,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { /** * @inheritdoc IERC2981 */ - function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual override returns (address, uint256) { + function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { @@ -55,7 +55,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an - * override. + * . */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; From cdf8b1de48e2925cdb1f56c1b9c976b787b453c5 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:20:46 -0300 Subject: [PATCH 15/29] ERC1155 --- contracts/token/ERC1155/ERC1155.sol | 20 +++++++------------- contracts/token/common/ERC2981.sol | 2 +- 2 files changed, 8 insertions(+), 14 deletions(-) diff --git a/contracts/token/ERC1155/ERC1155.sol b/contracts/token/ERC1155/ERC1155.sol index 6761edd248b..c2f217d7e3a 100644 --- a/contracts/token/ERC1155/ERC1155.sol +++ b/contracts/token/ERC1155/ERC1155.sol @@ -53,7 +53,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { * Clients calling this function must replace the `\{id\}` substring with the * actual token type ID. */ - function uri(uint256) public view virtual override returns (string memory) { + function uri(uint256) public view virtual returns (string memory) { return _uri; } @@ -64,7 +64,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { * * - `account` cannot be the zero address. */ - function balanceOf(address account, uint256 id) public view virtual override returns (uint256) { + function balanceOf(address account, uint256 id) public view virtual returns (uint256) { return _balances[id][account]; } @@ -78,7 +78,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { function balanceOfBatch( address[] memory accounts, uint256[] memory ids - ) public view virtual override returns (uint256[] memory) { + ) public view virtual returns (uint256[] memory) { require(accounts.length == ids.length, "ERC1155: accounts and ids length mismatch"); uint256[] memory batchBalances = new uint256[](accounts.length); @@ -93,27 +93,21 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { /** * @dev See {IERC1155-setApprovalForAll}. */ - function setApprovalForAll(address operator, bool approved) public virtual override { + function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC1155-isApprovedForAll}. */ - function isApprovedForAll(address account, address operator) public view virtual override returns (bool) { + function isApprovedForAll(address account, address operator) public view virtual returns (bool) { return _operatorApprovals[account][operator]; } /** * @dev See {IERC1155-safeTransferFrom}. */ - function safeTransferFrom( - address from, - address to, - uint256 id, - uint256 amount, - bytes memory data - ) public virtual override { + function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) public virtual { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" @@ -130,7 +124,7 @@ contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI { uint256[] memory ids, uint256[] memory amounts, bytes memory data - ) public virtual override { + ) public virtual { require( from == _msgSender() || isApprovedForAll(from, _msgSender()), "ERC1155: caller is not token owner or approved" diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 16e2d4a5bd5..7a4f3177066 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -40,7 +40,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { /** * @inheritdoc IERC2981 */ - function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { + function royaltyInfo(uint256 tokenId, uint256 salePrice) public view virtual returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[tokenId]; if (royalty.receiver == address(0)) { From 432696434fb802f4575abb032e973b883eda83c1 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:23:27 -0300 Subject: [PATCH 16/29] ERC20 --- contracts/token/ERC20/ERC20.sol | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 2646a0ddc56..96b02b6dd56 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -17,7 +17,7 @@ import "../../utils/Context.sol"; * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * - * The default value of {decimals} is 18. To change this, you should override + * The default value of {decimals} is 18. To change this, you should * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert @@ -58,7 +58,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { /** * @dev Returns the name of the token. */ - function name() public view virtual override returns (string memory) { + function name() public view virtual returns (string memory) { return _name; } @@ -66,7 +66,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { * @dev Returns the symbol of the token, usually a shorter version of the * name. */ - function symbol() public view virtual override returns (string memory) { + function symbol() public view virtual returns (string memory) { return _symbol; } @@ -83,21 +83,21 @@ contract ERC20 is Context, IERC20, IERC20Metadata { * no way affects any of the arithmetic of the contract, including * {IERC20-balanceOf} and {IERC20-transfer}. */ - function decimals() public view virtual override returns (uint8) { + function decimals() public view virtual returns (uint8) { return 18; } /** * @dev See {IERC20-totalSupply}. */ - function totalSupply() public view virtual override returns (uint256) { + function totalSupply() public view virtual returns (uint256) { return _totalSupply; } /** * @dev See {IERC20-balanceOf}. */ - function balanceOf(address account) public view virtual override returns (uint256) { + function balanceOf(address account) public view virtual returns (uint256) { return _balances[account]; } @@ -109,7 +109,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { * - `to` cannot be the zero address. * - the caller must have a balance of at least `amount`. */ - function transfer(address to, uint256 amount) public virtual override returns (bool) { + function transfer(address to, uint256 amount) public virtual returns (bool) { address owner = _msgSender(); _transfer(owner, to, amount); return true; @@ -118,7 +118,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { /** * @dev See {IERC20-allowance}. */ - function allowance(address owner, address spender) public view virtual override returns (uint256) { + function allowance(address owner, address spender) public view virtual returns (uint256) { return _allowances[owner][spender]; } @@ -132,7 +132,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { * * - `spender` cannot be the zero address. */ - function approve(address spender, uint256 amount) public virtual override returns (bool) { + function approve(address spender, uint256 amount) public virtual returns (bool) { address owner = _msgSender(); _approve(owner, spender, amount); return true; @@ -154,7 +154,7 @@ contract ERC20 is Context, IERC20, IERC20Metadata { * - the caller must have allowance for ``from``'s tokens of at least * `amount`. */ - function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) { + function transferFrom(address from, address to, uint256 amount) public virtual returns (bool) { address spender = _msgSender(); _spendAllowance(from, spender, amount); _transfer(from, to, amount); From 320a0c2322f23a30bc4c45ddba95b9385a37a1d0 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:24:47 -0300 Subject: [PATCH 17/29] ERC20FlashMint --- contracts/token/ERC20/extensions/ERC20FlashMint.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/token/ERC20/extensions/ERC20FlashMint.sol b/contracts/token/ERC20/extensions/ERC20FlashMint.sol index 18b0a81c6d1..7a4076678b3 100644 --- a/contracts/token/ERC20/extensions/ERC20FlashMint.sol +++ b/contracts/token/ERC20/extensions/ERC20FlashMint.sol @@ -24,7 +24,7 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { * @param token The address of the token that is requested. * @return The amount of token that can be loaned. */ - function maxFlashLoan(address token) public view virtual override returns (uint256) { + function maxFlashLoan(address token) public view virtual returns (uint256) { return token == address(this) ? type(uint256).max - totalSupply() : 0; } @@ -36,7 +36,7 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { * @param amount The amount of tokens to be loaned. * @return The fees applied to the corresponding flash loan. */ - function flashFee(address token, uint256 amount) public view virtual override returns (uint256) { + function flashFee(address token, uint256 amount) public view virtual returns (uint256) { require(token == address(this), "ERC20FlashMint: wrong token"); return _flashFee(token, amount); } @@ -88,7 +88,7 @@ abstract contract ERC20FlashMint is ERC20, IERC3156FlashLender { address token, uint256 amount, bytes calldata data - ) public virtual override returns (bool) { + ) public virtual returns (bool) { require(amount <= maxFlashLoan(token), "ERC20FlashMint: amount exceeds maxFlashLoan"); uint256 fee = flashFee(token, amount); _mint(address(receiver), amount); From 5da5221809cd2628db4e8c70720156437377f60c Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:26:07 -0300 Subject: [PATCH 18/29] ERC20Permit --- contracts/token/ERC20/extensions/ERC20Permit.sol | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contracts/token/ERC20/extensions/ERC20Permit.sol b/contracts/token/ERC20/extensions/ERC20Permit.sol index e7d43c2dd11..9379e44518d 100644 --- a/contracts/token/ERC20/extensions/ERC20Permit.sol +++ b/contracts/token/ERC20/extensions/ERC20Permit.sol @@ -42,7 +42,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces { uint8 v, bytes32 r, bytes32 s - ) public virtual override { + ) public virtual { require(block.timestamp <= deadline, "ERC20Permit: expired deadline"); bytes32 structHash = keccak256(abi.encode(_PERMIT_TYPEHASH, owner, spender, value, _useNonce(owner), deadline)); @@ -66,7 +66,7 @@ abstract contract ERC20Permit is ERC20, IERC20Permit, EIP712, Nonces { * @dev See {IERC20Permit-DOMAIN_SEPARATOR}. */ // solhint-disable-next-line func-name-mixedcase - function DOMAIN_SEPARATOR() external view virtual override returns (bytes32) { + function DOMAIN_SEPARATOR() external view virtual returns (bytes32) { return _domainSeparatorV4(); } } From 9fb85dbdfd07964fa03b4e8bf7fbecffbec45e77 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:28:41 -0300 Subject: [PATCH 19/29] ERC4626 --- contracts/token/ERC20/extensions/ERC4626.sol | 34 ++++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/contracts/token/ERC20/extensions/ERC4626.sol b/contracts/token/ERC20/extensions/ERC4626.sol index a706b545702..f741e311948 100644 --- a/contracts/token/ERC20/extensions/ERC4626.sol +++ b/contracts/token/ERC20/extensions/ERC4626.sol @@ -39,7 +39,7 @@ import "../../../utils/math/Math.sol"; * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience - * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the + * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to the * `_convertToShares` and `_convertToAssets` functions. * * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide]. @@ -90,67 +90,67 @@ abstract contract ERC4626 is ERC20, IERC4626 { } /** @dev See {IERC4626-asset}. */ - function asset() public view virtual override returns (address) { + function asset() public view virtual returns (address) { return address(_asset); } /** @dev See {IERC4626-totalAssets}. */ - function totalAssets() public view virtual override returns (uint256) { + function totalAssets() public view virtual returns (uint256) { return _asset.balanceOf(address(this)); } /** @dev See {IERC4626-convertToShares}. */ - function convertToShares(uint256 assets) public view virtual override returns (uint256) { + function convertToShares(uint256 assets) public view virtual returns (uint256) { return _convertToShares(assets, Math.Rounding.Down); } /** @dev See {IERC4626-convertToAssets}. */ - function convertToAssets(uint256 shares) public view virtual override returns (uint256) { + function convertToAssets(uint256 shares) public view virtual returns (uint256) { return _convertToAssets(shares, Math.Rounding.Down); } /** @dev See {IERC4626-maxDeposit}. */ - function maxDeposit(address) public view virtual override returns (uint256) { + function maxDeposit(address) public view virtual returns (uint256) { return type(uint256).max; } /** @dev See {IERC4626-maxMint}. */ - function maxMint(address) public view virtual override returns (uint256) { + function maxMint(address) public view virtual returns (uint256) { return type(uint256).max; } /** @dev See {IERC4626-maxWithdraw}. */ - function maxWithdraw(address owner) public view virtual override returns (uint256) { + function maxWithdraw(address owner) public view virtual returns (uint256) { return _convertToAssets(balanceOf(owner), Math.Rounding.Down); } /** @dev See {IERC4626-maxRedeem}. */ - function maxRedeem(address owner) public view virtual override returns (uint256) { + function maxRedeem(address owner) public view virtual returns (uint256) { return balanceOf(owner); } /** @dev See {IERC4626-previewDeposit}. */ - function previewDeposit(uint256 assets) public view virtual override returns (uint256) { + function previewDeposit(uint256 assets) public view virtual returns (uint256) { return _convertToShares(assets, Math.Rounding.Down); } /** @dev See {IERC4626-previewMint}. */ - function previewMint(uint256 shares) public view virtual override returns (uint256) { + function previewMint(uint256 shares) public view virtual returns (uint256) { return _convertToAssets(shares, Math.Rounding.Up); } /** @dev See {IERC4626-previewWithdraw}. */ - function previewWithdraw(uint256 assets) public view virtual override returns (uint256) { + function previewWithdraw(uint256 assets) public view virtual returns (uint256) { return _convertToShares(assets, Math.Rounding.Up); } /** @dev See {IERC4626-previewRedeem}. */ - function previewRedeem(uint256 shares) public view virtual override returns (uint256) { + function previewRedeem(uint256 shares) public view virtual returns (uint256) { return _convertToAssets(shares, Math.Rounding.Down); } /** @dev See {IERC4626-deposit}. */ - function deposit(uint256 assets, address receiver) public virtual override returns (uint256) { + function deposit(uint256 assets, address receiver) public virtual returns (uint256) { require(assets <= maxDeposit(receiver), "ERC4626: deposit more than max"); uint256 shares = previewDeposit(assets); @@ -164,7 +164,7 @@ abstract contract ERC4626 is ERC20, IERC4626 { * As opposed to {deposit}, minting is allowed even if the vault is in a state where the price of a share is zero. * In this case, the shares will be minted without requiring any assets to be deposited. */ - function mint(uint256 shares, address receiver) public virtual override returns (uint256) { + function mint(uint256 shares, address receiver) public virtual returns (uint256) { require(shares <= maxMint(receiver), "ERC4626: mint more than max"); uint256 assets = previewMint(shares); @@ -174,7 +174,7 @@ abstract contract ERC4626 is ERC20, IERC4626 { } /** @dev See {IERC4626-withdraw}. */ - function withdraw(uint256 assets, address receiver, address owner) public virtual override returns (uint256) { + function withdraw(uint256 assets, address receiver, address owner) public virtual returns (uint256) { require(assets <= maxWithdraw(owner), "ERC4626: withdraw more than max"); uint256 shares = previewWithdraw(assets); @@ -184,7 +184,7 @@ abstract contract ERC4626 is ERC20, IERC4626 { } /** @dev See {IERC4626-redeem}. */ - function redeem(uint256 shares, address receiver, address owner) public virtual override returns (uint256) { + function redeem(uint256 shares, address receiver, address owner) public virtual returns (uint256) { require(shares <= maxRedeem(owner), "ERC4626: redeem more than max"); uint256 assets = previewRedeem(shares); From 8cc7431b0966e3e749fcba3372e12b4689521658 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:29:50 -0300 Subject: [PATCH 20/29] ERC721 --- contracts/token/ERC721/ERC721.sol | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index af00ecaf4ee..ea46bd38741 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -57,7 +57,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721-balanceOf}. */ - function balanceOf(address owner) public view virtual override returns (uint256) { + function balanceOf(address owner) public view virtual returns (uint256) { require(owner != address(0), "ERC721: address zero is not a valid owner"); return _balances[owner]; } @@ -65,7 +65,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721-ownerOf}. */ - function ownerOf(uint256 tokenId) public view virtual override returns (address) { + function ownerOf(uint256 tokenId) public view virtual returns (address) { address owner = _ownerOf(tokenId); require(owner != address(0), "ERC721: invalid token ID"); return owner; @@ -74,21 +74,21 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721Metadata-name}. */ - function name() public view virtual override returns (string memory) { + function name() public view virtual returns (string memory) { return _name; } /** * @dev See {IERC721Metadata-symbol}. */ - function symbol() public view virtual override returns (string memory) { + function symbol() public view virtual returns (string memory) { return _symbol; } /** * @dev See {IERC721Metadata-tokenURI}. */ - function tokenURI(uint256 tokenId) public view virtual override returns (string memory) { + function tokenURI(uint256 tokenId) public view virtual returns (string memory) { _requireMinted(tokenId); string memory baseURI = _baseURI(); @@ -107,7 +107,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721-approve}. */ - function approve(address to, uint256 tokenId) public virtual override { + function approve(address to, uint256 tokenId) public virtual { address owner = ownerOf(tokenId); require(to != owner, "ERC721: approval to current owner"); @@ -122,7 +122,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721-getApproved}. */ - function getApproved(uint256 tokenId) public view virtual override returns (address) { + function getApproved(uint256 tokenId) public view virtual returns (address) { _requireMinted(tokenId); return _tokenApprovals[tokenId]; @@ -131,21 +131,21 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721-setApprovalForAll}. */ - function setApprovalForAll(address operator, bool approved) public virtual override { + function setApprovalForAll(address operator, bool approved) public virtual { _setApprovalForAll(_msgSender(), operator, approved); } /** * @dev See {IERC721-isApprovedForAll}. */ - function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) { + function isApprovedForAll(address owner, address operator) public view virtual returns (bool) { return _operatorApprovals[owner][operator]; } /** * @dev See {IERC721-transferFrom}. */ - function transferFrom(address from, address to, uint256 tokenId) public virtual override { + function transferFrom(address from, address to, uint256 tokenId) public virtual { //solhint-disable-next-line max-line-length require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); @@ -155,14 +155,14 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { /** * @dev See {IERC721-safeTransferFrom}. */ - function safeTransferFrom(address from, address to, uint256 tokenId) public virtual override { + function safeTransferFrom(address from, address to, uint256 tokenId) public virtual { safeTransferFrom(from, to, tokenId, ""); } /** * @dev See {IERC721-safeTransferFrom}. */ - function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual override { + function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory data) public virtual { require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner or approved"); _safeTransfer(from, to, tokenId, data); } @@ -305,7 +305,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { // Clear approvals delete _tokenApprovals[tokenId]; - // Decrease balance with checked arithmetic, because an `ownerOf` override may + // Decrease balance with checked arithmetic, because an `ownerOf` may // invalidate the assumption that `_balances[from] >= 1`. _balances[owner] -= 1; @@ -339,7 +339,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; - // Decrease balance with checked arithmetic, because an `ownerOf` override may + // Decrease balance with checked arithmetic, because an `ownerOf` may // invalidate the assumption that `_balances[from] >= 1`. _balances[from] -= 1; @@ -451,7 +451,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** - * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. + * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} . * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such From ff241a87590fe0043165e34da070ce49fbaa2a48 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:32:45 -0300 Subject: [PATCH 21/29] ERC721Enumerable --- contracts/token/ERC721/extensions/ERC721Enumerable.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/token/ERC721/extensions/ERC721Enumerable.sol b/contracts/token/ERC721/extensions/ERC721Enumerable.sol index a9513b21ddb..ecd98f80bb5 100644 --- a/contracts/token/ERC721/extensions/ERC721Enumerable.sol +++ b/contracts/token/ERC721/extensions/ERC721Enumerable.sol @@ -34,7 +34,7 @@ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { /** * @dev See {IERC721Enumerable-tokenOfOwnerByIndex}. */ - function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual override returns (uint256) { + function tokenOfOwnerByIndex(address owner, uint256 index) public view virtual returns (uint256) { require(index < balanceOf(owner), "ERC721Enumerable: owner index out of bounds"); return _ownedTokens[owner][index]; } @@ -42,14 +42,14 @@ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { /** * @dev See {IERC721Enumerable-totalSupply}. */ - function totalSupply() public view virtual override returns (uint256) { + function totalSupply() public view virtual returns (uint256) { return _allTokens.length; } /** * @dev See {IERC721Enumerable-tokenByIndex}. */ - function tokenByIndex(uint256 index) public view virtual override returns (uint256) { + function tokenByIndex(uint256 index) public view virtual returns (uint256) { require(index < ERC721Enumerable.totalSupply(), "ERC721Enumerable: global index out of bounds"); return _allTokens[index]; } From da1225840c5bc87e8233c39909d8f2aa9153eb5a Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:35:20 -0300 Subject: [PATCH 22/29] ERC721Wrapper --- contracts/token/ERC721/extensions/ERC721Wrapper.sol | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/contracts/token/ERC721/extensions/ERC721Wrapper.sol b/contracts/token/ERC721/extensions/ERC721Wrapper.sol index 58346182b0d..9226349f4c0 100644 --- a/contracts/token/ERC721/extensions/ERC721Wrapper.sol +++ b/contracts/token/ERC721/extensions/ERC721Wrapper.sol @@ -67,12 +67,7 @@ abstract contract ERC721Wrapper is ERC721, IERC721Receiver { * WARNING: Doesn't work with unsafe transfers (eg. {IERC721-transferFrom}). Use {ERC721Wrapper-_recover} * for recovering in that scenario. */ - function onERC721Received( - address, - address from, - uint256 tokenId, - bytes memory - ) public virtual override returns (bytes4) { + function onERC721Received(address, address from, uint256 tokenId, bytes memory) public virtual returns (bytes4) { require(address(underlying()) == _msgSender(), "ERC721Wrapper: caller is not underlying"); _safeMint(from, tokenId); return IERC721Receiver.onERC721Received.selector; From 6ee337d735d5126e81fc7bb237c99b125ebc7852 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:36:11 -0300 Subject: [PATCH 23/29] ERC721Holder --- contracts/token/ERC721/utils/ERC721Holder.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/token/ERC721/utils/ERC721Holder.sol b/contracts/token/ERC721/utils/ERC721Holder.sol index 41bee820c87..9f5b2e9f9df 100644 --- a/contracts/token/ERC721/utils/ERC721Holder.sol +++ b/contracts/token/ERC721/utils/ERC721Holder.sol @@ -17,7 +17,7 @@ contract ERC721Holder is IERC721Receiver { * * Always returns `IERC721Receiver.onERC721Received.selector`. */ - function onERC721Received(address, address, uint256, bytes memory) public virtual override returns (bytes4) { + function onERC721Received(address, address, uint256, bytes memory) public virtual returns (bytes4) { return this.onERC721Received.selector; } } From 3cdda53b156faf38fd6cb51169531e144c841047 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:37:41 -0300 Subject: [PATCH 24/29] EIP712 --- contracts/utils/cryptography/EIP712.sol | 1 - 1 file changed, 1 deletion(-) diff --git a/contracts/utils/cryptography/EIP712.sol b/contracts/utils/cryptography/EIP712.sol index 526b13580e7..b9c9c9d195d 100644 --- a/contracts/utils/cryptography/EIP712.sol +++ b/contracts/utils/cryptography/EIP712.sol @@ -118,7 +118,6 @@ abstract contract EIP712 is IERC5267 { public view virtual - override returns ( bytes1 fields, string memory name, From 307c154ad67080f76b86825fd6db9ea3dd7f7e65 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:38:26 -0300 Subject: [PATCH 25/29] EIP165 --- contracts/utils/introspection/ERC165.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/utils/introspection/ERC165.sol b/contracts/utils/introspection/ERC165.sol index 6849637e84e..111913007ea 100644 --- a/contracts/utils/introspection/ERC165.sol +++ b/contracts/utils/introspection/ERC165.sol @@ -21,7 +21,7 @@ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ - function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { + function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) { return interfaceId == type(IERC165).interfaceId; } } From 1372aeb91bf1c1d6fee9b8e2cdb885c70948f76b Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:41:05 -0300 Subject: [PATCH 26/29] Recover comments --- contracts/token/ERC20/ERC20.sol | 2 +- contracts/token/ERC20/extensions/ERC4626.sol | 2 +- contracts/token/ERC721/ERC721.sol | 6 +++--- contracts/token/common/ERC2981.sol | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contracts/token/ERC20/ERC20.sol b/contracts/token/ERC20/ERC20.sol index 96b02b6dd56..4db525a7ad7 100644 --- a/contracts/token/ERC20/ERC20.sol +++ b/contracts/token/ERC20/ERC20.sol @@ -17,7 +17,7 @@ import "../../utils/Context.sol"; * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How * to implement supply mechanisms]. * - * The default value of {decimals} is 18. To change this, you should + * The default value of {decimals} is 18. To change this, you should override * this function so it returns a different value. * * We have followed general OpenZeppelin Contracts guidelines: functions revert diff --git a/contracts/token/ERC20/extensions/ERC4626.sol b/contracts/token/ERC20/extensions/ERC4626.sol index f741e311948..35ae2866aaa 100644 --- a/contracts/token/ERC20/extensions/ERC4626.sol +++ b/contracts/token/ERC20/extensions/ERC4626.sol @@ -39,7 +39,7 @@ import "../../../utils/math/Math.sol"; * The drawback of this approach is that the virtual shares do capture (a very small) part of the value being accrued * to the vault. Also, if the vault experiences losses, the users try to exit the vault, the virtual shares and assets * will cause the first user to exit to experience reduced losses in detriment to the last users that will experience - * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to the + * bigger losses. Developers willing to revert back to the pre-v4.9 behavior just need to override the * `_convertToShares` and `_convertToAssets` functions. * * To learn more, check out our xref:ROOT:erc4626.adoc[ERC-4626 guide]. diff --git a/contracts/token/ERC721/ERC721.sol b/contracts/token/ERC721/ERC721.sol index ea46bd38741..3eb3f74cf35 100644 --- a/contracts/token/ERC721/ERC721.sol +++ b/contracts/token/ERC721/ERC721.sol @@ -305,7 +305,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { // Clear approvals delete _tokenApprovals[tokenId]; - // Decrease balance with checked arithmetic, because an `ownerOf` may + // Decrease balance with checked arithmetic, because an `ownerOf` override may // invalidate the assumption that `_balances[from] >= 1`. _balances[owner] -= 1; @@ -339,7 +339,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { // Clear approvals from the previous owner delete _tokenApprovals[tokenId]; - // Decrease balance with checked arithmetic, because an `ownerOf` may + // Decrease balance with checked arithmetic, because an `ownerOf` override may // invalidate the assumption that `_balances[from] >= 1`. _balances[from] -= 1; @@ -451,7 +451,7 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata { function _afterTokenTransfer(address from, address to, uint256 firstTokenId, uint256 batchSize) internal virtual {} /** - * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} . + * @dev Unsafe write access to the balances, used by extensions that "mint" tokens using an {ownerOf} override. * * WARNING: Anyone calling this MUST ensure that the balances remain consistent with the ownership. The invariant * being that for any address `a` the value returned by `balanceOf(a)` must be equal to the number of tokens such diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 7a4f3177066..85e9027333e 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -55,7 +55,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { /** * @dev The denominator with which to interpret the fee set in {_setTokenRoyalty} and {_setDefaultRoyalty} as a * fraction of the sale price. Defaults to 10000 so fees are expressed in basis points, but may be customized by an - * . + * override. */ function _feeDenominator() internal pure virtual returns (uint96) { return 10000; From ac0a4b2d9f271e997dec0d4427112c91c4d7f17b Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Mon, 5 Jun 2023 12:44:38 -0300 Subject: [PATCH 27/29] Add changeset --- .changeset/violet-dancers-cough.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/violet-dancers-cough.md diff --git a/.changeset/violet-dancers-cough.md b/.changeset/violet-dancers-cough.md new file mode 100644 index 00000000000..a230891758b --- /dev/null +++ b/.changeset/violet-dancers-cough.md @@ -0,0 +1,5 @@ +--- +'openzeppelin-solidity': patch +--- + +Remove override modifier when not needed From 13b211b7c3203ff10e5c0b59e7e723fc72d6bf82 Mon Sep 17 00:00:00 2001 From: RenanSouza2 Date: Tue, 6 Jun 2023 08:32:12 -0300 Subject: [PATCH 28/29] Fix changeset --- .changeset/violet-dancers-cough.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/violet-dancers-cough.md b/.changeset/violet-dancers-cough.md index a230891758b..d33caa2f186 100644 --- a/.changeset/violet-dancers-cough.md +++ b/.changeset/violet-dancers-cough.md @@ -1,5 +1,5 @@ --- -'openzeppelin-solidity': patch +'openzeppelin-solidity': minor --- Remove override modifier when not needed From e6d8ee1f3eda5fc5aab1b5933616f1c548caf23a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ernesto=20Garc=C3=ADa?= Date: Tue, 6 Jun 2023 13:19:24 -0600 Subject: [PATCH 29/29] Update .changeset/violet-dancers-cough.md --- .changeset/violet-dancers-cough.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/violet-dancers-cough.md b/.changeset/violet-dancers-cough.md index d33caa2f186..c6160d2873e 100644 --- a/.changeset/violet-dancers-cough.md +++ b/.changeset/violet-dancers-cough.md @@ -2,4 +2,4 @@ 'openzeppelin-solidity': minor --- -Remove override modifier when not needed +Remove the `override` specifier from functions that only override a single interface function.