Repository navigation
fix(0.x): AbiFunction.decodeData drops args when a name overload has zero inputs - #599
Merged
Merged
Conversation
…inputs Backport of the main fix. AbiItem.fromAbi no longer returns early on a zero-input overload when args are omitted; it keeps the other overloads attached so decodeData can resolve the real overload by selector. The fromAbi and decodeData types now reflect the attached overloads. Co-authored-by: gomes <17035424+gomesalexandre@users.noreply.github.com> Amp-Thread-ID: https://ampcode.com/threads/T-01a1bc8e-e129-76ad-b0c4-3188e7e62ad9 Co-authored-by: jxom <jake@tempo.xyz>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Contributor
|
Published pnpm add ox@pr-599
pnpm add ox@0.0.0-pr-599-019d005 |
Merged
This was referenced Nov 8, 2026
This branch was successfully deployed
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.
Supersedes #448 (thanks @gomesalexandre, whose commits are kept here).
AbiFunction.decodeData(abi, name, data)returnedundefinedwhennamehad a zero-input overload anddatawas calldata for another overload, e.g. WETH-styledeposit()+deposit(uint256).AbiItem.fromAbireturned the zero-input overload early without attaching the others, anddecodeDatashort-circuited on it before resolving by selector.AbiItem.fromAbi: withoutargs, the zero-input overload is still the preferred pick, but the other overloads are now attached asoverloads, like the existing fallback.AbiFunction.decodeData: the zero-input check runs on the selector-resolved overload.fromAbinow typesoverloadson a zero-input pick, anddecodeDataincludes overload inputs in its result (readonly [bigint] | undefinedfor the example above, previouslyundefined).Behavior notes:
fromAbiresults gain anoverloadsfield in this case;decodeData(abi, name, data)with a selector matching no overload ofnamenow throwsAbiItem.NotFoundError(matching overload sets without a zero-input member);encodeData(fromAbi(abi, 'deposit'), [123n])now encodesdeposit(uint256).