rename from → previousOwner
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user