Skip to content

fix(paywall): respect token decimals in EVM paywall#2004

Closed
Bortlesboat wants to merge 3 commits intox402-foundation:mainfrom
Bortlesboat:codex/x402-paywall-decimals-1979
Closed

fix(paywall): respect token decimals in EVM paywall#2004
Bortlesboat wants to merge 3 commits intox402-foundation:mainfrom
Bortlesboat:codex/x402-paywall-decimals-1979

Conversation

@Bortlesboat
Copy link
Copy Markdown
Contributor

Fixes #1979.

Summary

  • stop assuming every accepted EVM token uses 6 decimals in the paywall amount display
  • read balances and decimals from the actual accepted asset instead of hardcoded USDC helpers
  • add regressions for 18-decimal tokens and generic token-balance reads

Verification

  • pnpm --dir typescript/packages/http/paywall test -- src/builder.test.ts src/evm/utils.test.ts
  • pnpm --dir typescript/packages/http/paywall test
  • pnpm --dir typescript/packages/http/paywall exec eslint src/builder.test.ts src/evm/utils.test.ts src/evm/index.ts src/evm/utils.ts src/evm/EvmPaywall.tsx
  • pnpm --dir typescript --filter @x402/core --filter @x402/evm --filter @x402/svm --filter @x402/avm build
  • pnpm --dir typescript/packages/http/paywall build:paywall

@github-actions github-actions bot added typescript go sdk Changes to core v2 packages python labels Apr 11, 2026
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 11, 2026

@Bortlesboat is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@Bortlesboat Bortlesboat marked this pull request as ready for review April 11, 2026 21:52
@phdargen
Copy link
Copy Markdown
Collaborator

Duplicate of #1980

@phdargen phdargen marked this as a duplicate of #1980 Apr 12, 2026
@phdargen phdargen closed this Apr 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

go python sdk Changes to core v2 packages typescript

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug(paywall): EVM paywall hardcodes 6 decimals — breaks non-6-decimal tokens

2 participants