fix: deduplicate ERC20 batch approvals - #1992
Open
Mabolla wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for opening a PR!
We really appreciate you taking the time to contribute. It means a lot to the OpenSea team and the broader developer community.
A quick note about how this repo works
This repository is a read-only mirror of a package maintained in an internal monorepo. Because of that, pull requests cannot be merged directly here.
But don't worry -- your contribution won't be lost! Here's what happens next:
We'll keep you posted on the PR as things progress.
Is this a bug report?
If you're reporting a bug rather than submitting a code fix, opening an issue is usually the fastest path to a resolution. Bug report issues help us triage and prioritize effectively.
Thanks again for helping make OpenSea better for everyone!
Summary
Deduplicates ERC20 approvals in
batchApproveAssetswhen the same token contract appears multiple times, including addresses that differ only by casing.Root cause
batchApproveAssetsalready tracks processed contract addresses for NFT approvals, but the ERC20 branch did not use that set. Duplicate entries could therefore generate multiple identicalapprove(conduit, MAX_UINT256)calls and unnecessarily take the multicall path.Changes
processedContractsso only one unlimited approval is generated per ERC20 contract.Validation