Repository navigation
Conversation
Remove exactly the ABI padding from address-valued bytes32 fields so valid leading-zero addresses reach auction matching unchanged.\n\nFixes t1protocol#245.
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.
Description
bytes32-encoded Ethereum addresses by removing exactly the 12-byte ABI padding.sender,recipient,inputToken,outputToken, anddestinationSettler.Motivation and Context
ViemIntentObserverused Viem'strim()for address-valuedbytes32fields.trim()removes every leading zero byte, including bytes that belong to the 20-byte address. A valid token such as0x00000000000000000000000000000000000000a1therefore became0xa1before reaching the auction service, preventing exact token-address matching.The new helper uses
sliceHex(value, 12)to discard only the ABI padding and preserve the full address width.Fixes #245.
Open PR #223 also modifies the observer for recovery behavior but does not address fixed-width address decoding. It currently reports
mergeable: falseagainstcanary, and a pre-pushmerge-treecheck conflicts inViemIntentObserver.ts; this PR remains independently based on currentcanary.How Has This Been Tested?
canaryreproduced0x0000…00a1becoming0xa1; ordinary-address, ABI tuple/event, and EIP-712 controls passed.0xa1.bun test test/ViemIntentObserver.address-decoding.test.ts— 1 passed, 0 failed, 5 assertions after the fix.Invalid argument type in ToBigInt operation, andprocessIntentLogs.test.tschecks an asynchronous notification before it occurs.bun x tsc -p tsconfig.json --noEmit— blocked by the same pre-existing ABI event typing, WebSocket response typing, missingvitest, and stale test-signature errors on cleancanary; no new diagnostic references the added regression test or fixed-width conversion.git diff --cached --check— passed.Types of changes (remove all unchecked types)
Checklist: