Skip to content

fix(paywall): use token name from payment requirements instead of hardcoded USDC#1988

Closed
Ai-chan-0411 wants to merge 1 commit intox402-foundation:mainfrom
Ai-chan-0411:fix/paywall-token-name
Closed

fix(paywall): use token name from payment requirements instead of hardcoded USDC#1988
Ai-chan-0411 wants to merge 1 commit intox402-foundation:mainfrom
Ai-chan-0411:fix/paywall-token-name

Conversation

@Ai-chan-0411
Copy link
Copy Markdown

Summary

The EVM paywall currently hardcodes "USDC" as the token label in all user-facing strings. This is incorrect for chains whose default stablecoin is not named USDC (e.g. MegaETH uses MegaUSD, Stable uses USDT0).

This PR reads the token name from firstRequirement.extra.name (set by the server from the default asset registry) and falls back to "USDC" when the field is absent, maintaining backward compatibility.

Changes

  • Extract tokenName from firstRequirement.extra.name with "USDC" fallback
  • Replace 7 hardcoded "USDC" display strings in EvmPaywall.tsx:
    • Status messages ("Checking balance...", "Insufficient balance...")
    • Payment description text
    • Balance display
    • Amount display

Testing

  • For USDC chains: extra.name is "USDC", behavior is identical to before
  • For MegaETH: extra.name is "MegaUSD", paywall now correctly shows "MegaUSD" instead of "USDC"
  • When extra.name is absent: falls back to "USDC" (backward compatible)

Closes #1972

…dcoded USDC

Read the token name from firstRequirement.extra.name and fall back to
"USDC" when the field is absent. This fixes incorrect labels for
non-USDC tokens like MegaUSD and USDT0.

Closes x402-foundation#1972
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 10, 2026

@aoi-dev-0411 is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions bot added typescript sdk Changes to core v2 packages labels Apr 10, 2026
@phdargen
Copy link
Copy Markdown
Collaborator

Duplicate of #1973

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

Labels

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 "USDC" label for all tokens

2 participants