Skip to content

[codex] add calldata decoder#5

Draft
alextnetto wants to merge 5 commits into
mainfrom
codex/calldata-decoder
Draft

[codex] add calldata decoder#5
alextnetto wants to merge 5 commits into
mainfrom
codex/calldata-decoder

Conversation

@alextnetto

Copy link
Copy Markdown
Member

Summary

  • Adds a server-side calldata decoder that prefers verified contract ABIs, falls back to public selector databases, and returns normalized JSON for decoded calls, ambiguity, invalid calldata, native transfers, and unknown selectors.
  • Adds a /api/calldata/decode route and React Query hook, then renders decoded action details on draft pages while keeping raw target/value/selector/calldata visible.
  • Splits the draft detail route into a server wrapper plus client component so metadata and draft detail rendering can coexist, and adds OG metadata helpers/assets for draft links.
  • Fixes existing React Compiler lint issues in the new draft form and action builder by removing render-time timestamp/state synchronization patterns.

Notes

  • extraData is accepted by the decoder API but intentionally not trusted as an ABI source yet; persisted ABI hints should be a follow-up once the gas/user-data tradeoff is settled.
  • ETHERSCAN_API_KEY is optional. Without it, decoding still falls back to selector database candidates.

Validation

  • pnpm --filter web lint
  • pnpm --filter web build
  • pnpm -r --if-present build
  • forge test
  • pnpm test:e2e
  • Smoke-tested /api/calldata/decode with an encoded ERC20 transfer(address,uint256) payload.
  • Smoke-tested /new in Playwright with no console errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant