chore(uniswapx-sdk): rename multicallSameContractManyFunctions to ...ManyCalls - #686
Conversation
The helper resolves `functionName` to a single fragment once, then encodes one call per entry in `functionParams` -- it varies the arguments of one function, not the function itself. `functionName` living in the shared `MulticallParams` base type already makes "many functions" impossible; the sibling `multicallSameFunctionManyContracts` extends the same base, varies the address instead, and is named accurately. Renames it to `multicallSameContractManyCalls` and keeps the old name as a deprecated alias typed `typeof multicallSameContractManyCalls`, which preserves the generic signature -- Uniswap/fee-collector imports the old name and passes it as a first-class function reference. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Graphite Automations"Request reviewers once CI passes on sdks monorepo" took an action on this PR • (08/06/26)1 assignee was added and 2 reviewers were added to this PR based on Siyu Jiang (See-You John)'s automation. |
|
● Reviewed · against Note Approved. Renames AssessmentThe rename fixes a mislabel — the helper varies argument sets over one function, not the function itself. The alias is a direct reference assignment, so the emitted Tip Teach the reviewer. React 👍 on findings that helped, 👎 on false positives. Reply to push back or add context — we aggregate this weekly to tune the bot. Comment |
There was a problem hiding this comment.
Note
✅ Approved — see full review in the sticky comment ↑
Stacked on #685 — review/merge that first.
Problem
multicallSameContractManyFunctionsdoesn't call many functions. It resolvesfunctionNameto a single fragment once, outside the loop, then encodes one call per entry infunctionParams:It varies the arguments of one function, not the function. The structural giveaway is that
functionNamelives in the sharedMulticallParamsbase type, so no helper extending it can vary the function at all:...SameContractManyFunctions...SameFunctionManyContractsThe sibling is named accurately; this one looks like it was named by symmetry without noticing the varying axis differs.
No capability is missing —
multicallis exported and takes arbitrary{target, callData}pairs, so heterogeneous functions and contracts were always reachable. These two are narrow conveniences over it, one mislabeled.Change
Renamed to
multicallSameContractManyCalls. The old name stays exported as a deprecated alias:Nothing breaks
Uniswap/fee-collectorimports the old name and passes it as a first-class function reference tomulticallSameContractChunked, so this had to stay source-compatible. The emitted declaration istypeof multicallSameContractManyCalls, which preserves the full generic signature — every call site and value position that accepted the old name still typechecks. Added a test asserting the alias is the same reference and still executes end-to-end.Minor bump: additive export plus a deprecation, no removal.
bun test src/: 345 pass, 0 fail. Lint andbuild:typesclean.🤖 Generated with Claude Code