Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeclarationError: Undeclared identifier. on contracts/token/onft721/ONFT721.sol #114

Closed
arRasoul opened this issue Oct 19, 2023 · 3 comments

Comments

@arRasoul
Copy link

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 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)."

@ryandgoulding
Copy link
Collaborator

Can you please provide the steps to reproduce this error? Additionally, please include the versions of yarn and node that you utilized. Thanks!

@arRasoul
Copy link
Author

arRasoul commented Oct 26, 2023 via email

@ryandgoulding
Copy link
Collaborator

#118 tracks possibility of upgrade, closing this as a duplicate.

@ryandgoulding ryandgoulding closed this as not planned Won't fix, can't repro, duplicate, stale Nov 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants