Open
Conversation
krboktv
approved these changes
Apr 2, 2026
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.
Change Summary
What does this PR change?
Fix: preserve
preInteractionin extension round-tripProblem
Orders containing a
preInteractionfield (e.g., Permit2 approve-then-swap flows used by OKX) were rejected with"invalid salt for passed extension".When
FusionOrder.fromDataAndExtension()validates an incoming order, it decodes the extension, rebuilds it from parsed fields, and compares the hash against the salt. ThepreInteractionfield was silently dropped during rebuild, producing a shorter extension with a different hash — causing the salt mismatch.Changes
types.ts— Add optionalpreInteraction?: stringtoExtrawith JSDoc documenting the0x{target}{calldata}formatfusion-order.tsextra.preInteractionand pass toFusionExtensionPRE_INTERACTION_CALL_FLAG(bit 252) inmakerTraitswhen presentfromDataAndExtension(): preserveextension.preInteractionthrough to the constructorfusion-extension.tspreInteraction?: Interactionto constructor'sextratypefromExtension(): parsepreInteractionfromExtensionbytesbuild(): emitpreInteractionviaExtensionBuilder.withPreInteraction()fusion-order.spec.ts— 4 new tests:preInteractionsetsPRE_INTERACTION_CALL_FLAGin makerTraitspreInteractionis absentnew()→build()→fromDataAndExtension()preserves salt and extensionNotes
preInteractionis optional, existing orders without it are unaffectedRelated Issue/Ticket:
https://1inch.atlassian.net/browse/PT9-335
Testing & Verification
How was this tested?
Risk Assessment
Risk Level:
Risks & Impact