fix(erc20Fulfillment): skip ERC20 preflight for partial fills - #1993
Open
MrFaruk0 wants to merge 1 commit into
Open
fix(erc20Fulfillment): skip ERC20 preflight for partial fills#1993MrFaruk0 wants to merge 1 commit into
MrFaruk0 wants to merge 1 commit into
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.
Summary
Fixes a false-positive ERC20 balance/allowance preflight for partial fills.
For
AdvancedOrderpartial fills,getErc20Payment()previously summed the full ERC20 consideration without accounting for the order'snumerator/denominator. This could cause a valid partial fill to be rejected beforesendTransaction()because the SDK checked the buyer against the full-order payment amount.Changes
AdvancedOrderfills ingetErc20Payment().The implementation intentionally does not scale the aggregate consideration by the fraction. Seaport applies fractions per consideration item and enforces exact divisibility, so aggregate-first scaling could produce incorrect results.
Tests
Added regression coverage for:
AdvancedOrderfills skipping the incorrect full-order preflight2/2