Compare commits

...

2 Commits

Author SHA1 Message Date
4e60480fdc Add a changelog entry 2021-03-03 16:49:15 -03:00
bb068ed5d9 Make ERC721._approve internal 2021-03-03 16:39:08 -03:00
2 changed files with 10 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## Unreleased
* `ERC721`: made `_approve` an internal function (was private).
## 3.4.0 (2021-02-02)
* `BeaconProxy`: added new kind of proxy that allows simultaneous atomic upgrades. ([#2411](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2411))

View File

@ -449,7 +449,12 @@ contract ERC721 is Context, ERC165, IERC721, IERC721Metadata, IERC721Enumerable
return (retval == _ERC721_RECEIVED);
}
function _approve(address to, uint256 tokenId) private {
/**
* @dev Approve `to` to operate on `tokenId`
*
* Emits an {Approval} event.
*/
function _approve(address to, uint256 tokenId) internal virtual {
_tokenApprovals[tokenId] = to;
emit Approval(ERC721.ownerOf(tokenId), to, tokenId); // internal owner
}