fix(erc20Fulfillment): skip ERC20 preflight for partial fills - #1993
Closed
MrFaruk0 wants to merge 1 commit into
Closed
fix(erc20Fulfillment): skip ERC20 preflight for partial fills#1993MrFaruk0 wants to merge 1 commit into
MrFaruk0 wants to merge 1 commit into
Conversation
Collaborator
|
This is the most valuable contribution in the current batch, so thank you. Summing the full order's consideration for a partial fill made Failing open is also exactly what the function already promised in its own docstring: it returns null for anything it cannot read with confidence so an unfamiliar response shape can never block a working purchase. Your change brings the code back in line with that. This repo is a read-only mirror, so it is recreated in our internal monorepo with you credited as co-author and ships in the next release. Closing in favor of that. |
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