Lesson 14: RandomIpfsNft- Different error message displayed on testnet #2800
-
Hi all, I tried to execute But, the error message that showed up on the testnet UI is different from the one in
Why is that ? Code snippets below: safeTransferFrom(3 args) function safeTransferFrom(
address from,
address to,
uint256 tokenId
) public virtual override {
safeTransferFrom(from, to, tokenId, "");
} nested safeTransferFrom(4 args) function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes memory data
) public virtual override {
require(_isApprovedOrOwner(_msgSender(), tokenId), "ERC721: caller is not token owner nor approved");
_safeTransfer(from, to, tokenId, data);
} _isApprovedOrOwner() function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {
address owner = ERC721.ownerOf(tokenId);
return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);
} |
Beta Was this translation helpful? Give feedback.
Answered by
RoboCrypter
Sep 22, 2022
Replies: 1 comment 6 replies
-
@ManuWeb3 : The error is saying the sender is not approved by the from address! |
Beta Was this translation helpful? Give feedback.
6 replies
Answer selected by
ManuWeb3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ManuWeb3 : The error is saying the sender is not approved by the from address!