You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the case of ERC721, the _update function does not include a from parameter, as the sender is implicitly the previous owner of the tokenId. The address of this previous owner is returned by the _update function, so it can be used for a posteriori checks. In addition to to and tokenId, a third parameter (auth) is present in this function. This parameter enabled an optional check that the caller/spender is approved to do the transfer. This check cannot be performed after the transfer (because the transfer resets the approval), and doing it before _update would require a duplicate call to _ownerOf.
In this logic of removing hidden SLOADs, the _isApprovedOrOwner function was removed in favor of a new _isAuthorized function. Overrides that used to target the _isApprovedOrOwner should now be performed on the _isAuthorized function. Calls to _isApprovedOrOwner that preceded a call to _transfer, _burn or _approve should be removed in favor of using the auth argument in _update and _approve. This is showcased in ERC721Burnable.burn and in ERC721Wrapper.withdrawTo.
The _exists function was removed. Calls to this function can be replaced by _ownerOf(tokenId) != address(0)."
The text was updated successfully, but these errors were encountered:
Hello,
I used remix ide to compile my contract.
As you can see in the screenshots, *I used the 0.8.20+commit.a1b79de6
compiler*, because the OpenZeppelin ERC721 (latest update version 5.0.0)
require ^0.8.20.
I think because OpenZeppelin removed the _isApprovedOrOwner and _exists
functions in their latest ERC721 update, but these functions are called in
the onft721 contract, the "DeclarationError: Undeclared identifier" error
occurred.
I solved my problem by going back and adding ERC721 version 4.9 to my
contract.
i get DeclarationError: Undeclared identifier. for _isApprovedOrOwner and _exists functions on ONFT721.sol contract when trying to compile.
i think it is due to openzeppelin contracts change declered here : https://github.com/OpenZeppelin/openzeppelin-contracts/blob/149e1b79fecb9db32f732c8c9f05ac2d8fa97471/CHANGELOG.md?plain=1#L179
"#### More about ERC721
In the case of
ERC721
, the_update
function does not include afrom
parameter, as the sender is implicitly the previous owner of thetokenId
. The address of this previous owner is returned by the_update
function, so it can be used for a posteriori checks. In addition toto
andtokenId
, a third parameter (auth
) is present in this function. This parameter enabled an optional check that the caller/spender is approved to do the transfer. This check cannot be performed after the transfer (because the transfer resets the approval), and doing it before_update
would require a duplicate call to_ownerOf
.In this logic of removing hidden SLOADs, the
_isApprovedOrOwner
function was removed in favor of a new_isAuthorized
function. Overrides that used to target the_isApprovedOrOwner
should now be performed on the_isAuthorized
function. Calls to_isApprovedOrOwner
that preceded a call to_transfer
,_burn
or_approve
should be removed in favor of using theauth
argument in_update
and_approve
. This is showcased inERC721Burnable.burn
and inERC721Wrapper.withdrawTo
.The
_exists
function was removed. Calls to this function can be replaced by_ownerOf(tokenId) != address(0)
."The text was updated successfully, but these errors were encountered: