Commit dd2e9479 by Nicolás Venturo Committed by Francisco Giordano

Deprecated ERC721._burn(address, uint256) (#1550)

* Deprecated ERC721._burn(address, uint256)

* Added missing natspec comment.
parent 357fded2
......@@ -12,6 +12,6 @@ contract ERC721Mock is ERC721 {
}
function burn(uint256 tokenId) public {
_burn(ownerOf(tokenId), tokenId);
_burn(tokenId);
}
}
......@@ -13,7 +13,7 @@ contract ERC721PausableMock is ERC721Pausable, PauserRoleMock {
}
function burn(uint256 tokenId) public {
super._burn(ownerOf(tokenId), tokenId);
super._burn(tokenId);
}
function exists(uint256 tokenId) public view returns (bool) {
......
......@@ -198,7 +198,7 @@ contract ERC721 is ERC165, IERC721 {
* @dev Internal function to mint a new token
* Reverts if the given token ID already exists
* @param to The address that will own the minted token
* @param tokenId uint256 ID of the token to be minted by the msg.sender
* @param tokenId uint256 ID of the token to be minted
*/
function _mint(address to, uint256 tokenId) internal {
require(to != address(0));
......@@ -209,7 +209,9 @@ contract ERC721 is ERC165, IERC721 {
/**
* @dev Internal function to burn a specific token
* Reverts if the token does not exist
* @param tokenId uint256 ID of the token being burned by the msg.sender
* Deprecated, use _burn(uint256) instead.
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
_clearApproval(tokenId);
......@@ -218,6 +220,15 @@ contract ERC721 is ERC165, IERC721 {
}
/**
* @dev Internal function to burn a specific token
* Reverts if the token does not exist
* @param tokenId uint256 ID of the token being burned
*/
function _burn(uint256 tokenId) internal {
_burn(ownerOf(tokenId), tokenId);
}
/**
* @dev Internal function to add a token ID to the list of a given address
* Note that this function is left internal to make ERC721Enumerable possible, but is not
* intended to be called by custom derived contracts: in particular, it emits no Transfer event.
......
......@@ -13,6 +13,6 @@ contract ERC721Burnable is ERC721 {
*/
function burn(uint256 tokenId) public {
require(_isApprovedOrOwner(msg.sender, tokenId));
_burn(ownerOf(tokenId), tokenId);
_burn(tokenId);
}
}
......@@ -117,7 +117,7 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
* @dev Internal function to mint a new token
* Reverts if the given token ID already exists
* @param to address the beneficiary that will own the minted token
* @param tokenId uint256 ID of the token to be minted by the msg.sender
* @param tokenId uint256 ID of the token to be minted
*/
function _mint(address to, uint256 tokenId) internal {
super._mint(to, tokenId);
......@@ -129,8 +129,9 @@ contract ERC721Enumerable is ERC165, ERC721, IERC721Enumerable {
/**
* @dev Internal function to burn a specific token
* Reverts if the token does not exist
* Deprecated, use _burn(uint256) instead
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned by the msg.sender
* @param tokenId uint256 ID of the token being burned
*/
function _burn(address owner, uint256 tokenId) internal {
super._burn(owner, tokenId);
......
......@@ -73,6 +73,7 @@ contract ERC721Metadata is ERC165, ERC721, IERC721Metadata {
/**
* @dev Internal function to burn a specific token
* Reverts if the token does not exist
* Deprecated, use _burn(uint256) instead
* @param owner owner of the token to burn
* @param tokenId uint256 ID of the token being burned by the msg.sender
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment