From b29e57338359832deabaec53ca7095bdf033db09 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 13 Jul 2023 16:14:57 +0200 Subject: [PATCH] =?UTF-8?q?rename=20from=20=E2=86=92=20previousOwner?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../token/ERC721/extensions/ERC721Consecutive.sol | 6 +++--- .../token/ERC721/extensions/ERC721Enumerable.sol | 12 ++++++------ contracts/token/ERC721/extensions/ERC721Royalty.sol | 4 ++-- .../token/ERC721/extensions/ERC721URIStorage.sol | 4 ++-- contracts/token/ERC721/extensions/ERC721Votes.sol | 6 +++--- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/contracts/token/ERC721/extensions/ERC721Consecutive.sol b/contracts/token/ERC721/extensions/ERC721Consecutive.sol index 4e24473f6..b014111ff 100644 --- a/contracts/token/ERC721/extensions/ERC721Consecutive.sol +++ b/contracts/token/ERC721/extensions/ERC721Consecutive.sol @@ -139,10 +139,10 @@ abstract contract ERC721Consecutive is IERC2309, ERC721 { * After construction, {_mintConsecutive} is no longer available and minting through {_update} becomes available. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { - address from = super._update(to, tokenId, auth); + address previousOwner = super._update(to, tokenId, auth); // only mint after construction - if (from == address(0) && address(this).code.length == 0) { + if (previousOwner == address(0) && address(this).code.length == 0) { revert ERC721ForbiddenMint(); } @@ -155,7 +155,7 @@ abstract contract ERC721Consecutive is IERC2309, ERC721 { _sequentialBurn.set(tokenId); } - return from; + return previousOwner; } /** diff --git a/contracts/token/ERC721/extensions/ERC721Enumerable.sol b/contracts/token/ERC721/extensions/ERC721Enumerable.sol index 08d0b3807..3c62f4295 100644 --- a/contracts/token/ERC721/extensions/ERC721Enumerable.sol +++ b/contracts/token/ERC721/extensions/ERC721Enumerable.sol @@ -77,20 +77,20 @@ abstract contract ERC721Enumerable is ERC721, IERC721Enumerable { * @dev See {ERC721-_update}. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { - address from = super._update(to, tokenId, auth); + address previousOwner = super._update(to, tokenId, auth); - if (from == address(0)) { + if (previousOwner == address(0)) { _addTokenToAllTokensEnumeration(tokenId); - } else if (from != to) { - _removeTokenFromOwnerEnumeration(from, tokenId); + } else if (previousOwner != to) { + _removeTokenFromOwnerEnumeration(previousOwner, tokenId); } if (to == address(0)) { _removeTokenFromAllTokensEnumeration(tokenId); - } else if (from != to) { + } else if (previousOwner != to) { _addTokenToOwnerEnumeration(to, tokenId); } - return from; + return previousOwner; } /** diff --git a/contracts/token/ERC721/extensions/ERC721Royalty.sol b/contracts/token/ERC721/extensions/ERC721Royalty.sol index 3b7bb82c4..ff9d31936 100644 --- a/contracts/token/ERC721/extensions/ERC721Royalty.sol +++ b/contracts/token/ERC721/extensions/ERC721Royalty.sol @@ -30,12 +30,12 @@ abstract contract ERC721Royalty is ERC2981, ERC721 { * @dev See {ERC721-_update}. When burning, this override will additionally clear the royalty information for the token. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { - address from = super._update(to, tokenId, auth); + address previousOwner = super._update(to, tokenId, auth); if (to == address(0)) { _resetTokenRoyalty(tokenId); } - return from; + return previousOwner; } } diff --git a/contracts/token/ERC721/extensions/ERC721URIStorage.sol b/contracts/token/ERC721/extensions/ERC721URIStorage.sol index c33480822..28440ef69 100644 --- a/contracts/token/ERC721/extensions/ERC721URIStorage.sol +++ b/contracts/token/ERC721/extensions/ERC721URIStorage.sol @@ -69,12 +69,12 @@ abstract contract ERC721URIStorage is IERC4906, ERC721 { * the storage mapping. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { - address from = super._update(to, tokenId, auth); + address previousOwner = super._update(to, tokenId, auth); if (to == address(0) && bytes(_tokenURIs[tokenId]).length != 0) { delete _tokenURIs[tokenId]; } - return from; + return previousOwner; } } diff --git a/contracts/token/ERC721/extensions/ERC721Votes.sol b/contracts/token/ERC721/extensions/ERC721Votes.sol index b74199b8b..ede3dff8e 100644 --- a/contracts/token/ERC721/extensions/ERC721Votes.sol +++ b/contracts/token/ERC721/extensions/ERC721Votes.sol @@ -21,11 +21,11 @@ abstract contract ERC721Votes is ERC721, Votes { * Emits a {IVotes-DelegateVotesChanged} event. */ function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { - address from = super._update(to, tokenId, auth); + address previousOwner = super._update(to, tokenId, auth); - _transferVotingUnits(from, to, 1); + _transferVotingUnits(previousOwner, to, 1); - return from; + return previousOwner; } /**