burn nft时判断是否锁定
This commit is contained in:
parent
7be19c26d1
commit
6e10dcfcbc
@ -42,23 +42,7 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev See {IERC721-isApprovedForAll}.
|
||||
*/
|
||||
function isApprovedForAll(address owner, address operator)
|
||||
public
|
||||
view
|
||||
override
|
||||
returns (bool)
|
||||
{
|
||||
if (approvalWhitelists[operator]) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.isApprovedForAll(owner, operator);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Allow operation to reduce gas fee.
|
||||
* @dev Allow operation to approval list.
|
||||
*/
|
||||
function addApprovalWhitelist(address proxy) external onlyOwner {
|
||||
require(!approvalWhitelists[proxy], "Invalid proxy address");
|
||||
@ -161,6 +145,7 @@ abstract contract BEBase is ERC721, AccessControlEnumerable, ERC721Enumerable, O
|
||||
"Must have burn role to burn"
|
||||
);
|
||||
require(_exists(tokenId), "TokenId not exists");
|
||||
require(!lockedTokens[tokenId], "Can not burn locked token");
|
||||
require(
|
||||
ownerOf(tokenId) == owner,
|
||||
"current address is not owner of this item now"
|
||||
|
Loading…
x
Reference in New Issue
Block a user