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

Follow _approve overrides in ERC721._update #4552

Merged
merged 5 commits into from
Aug 31, 2023

Conversation

frangio
Copy link
Contributor

@frangio frangio commented Aug 30, 2023

ERC721._update is currently using delete _tokenApprovals[tokenId], bypassing potential _approve overrides. Originally reported in #4377 (comment), along with an example of an _approve override that would have resulted in an issue.

This PR fixes this in a similar way to how we've set up the _approve function for ERC20, by adding a bool emitEvent argument to the function that defaults to true. I've made the 3-argument variants in both contracts non-virtual because they are aliases of the 4-argument _approve.

No changeset because this is part of the ERC721 refactor.

Fixes #4547

@frangio frangio requested a review from Amxx August 30, 2023 21:46
@changeset-bot
Copy link

changeset-bot bot commented Aug 30, 2023

⚠️ No Changeset found

Latest commit: 78cb272

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@frangio frangio marked this pull request as ready for review August 30, 2023 22:38
@frangio frangio merged commit 8186c07 into OpenZeppelin:master Aug 31, 2023
13 checks passed
@frangio frangio deleted the erc721-approvals branch August 31, 2023 14:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The _update method in ERC721 contains an explicit delete of the approval
2 participants