feat: expand chains (+6 testnets) and tokens (+EURC, WETH, USDT)#4
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 8bf5696. Configure here.
markwu35
approved these changes
Apr 28, 2026
Merged
2 tasks
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.

Summary
Chain expansion (testnet): adds 6 testnets to
SupportedChain:ethereum-sepolia,arbitrum-sepolia,optimism-sepolia,polygon-amoy,scroll-sepolia,linea-sepolia(chain IDs, USDC addresses, viem chain map, default confirmations = 0, QuickNode slugs).Token expansion: introduces a
SupportedTokenunion (USDC | EURC | WETH | USDT) withTOKEN_CONTRACTS,TOKEN_DECIMALS, andTOKEN_CREDENTIAL_TYPES. Coverage spans testnet and mainnet.USDC_CONTRACTSis preserved as-is so existing consumers don't break.evm.chargeresolver: now resolves the token contract from(token, chain), validates that the requestedcredentialTypesare supported by the token (e.g. WETH and USDT lack EIP-3009transferWithAuthorization), and uses per-token decimals instead of the hardcoded6.Public surface (
mpp/index.ts): exports the new types and lookup maps so downstream consumers (admin layers, balance views) can validate(chain, token, credentialType)tuples without re-hardcoding the matrix.Token availability (testnet)
Token availability (mainnet)
Provenance rules
Tokens added to
TOKEN_CONTRACTSmust be either issuer-deployed (Circle for USDC/EURC, Tether for mainnet USDT, chain team for canonical native ETH wrappers) or verified on-chain. Community deployments and bridged variants are not first-class. Concrete consequences:Per-token credential-type compatibility
evm.chargerejectsauthorizationwhen paired with WETH or USDT at construction time (USDT mainnet uses its own non-standard approve/transferFrom semantics and lacks EIP-3009).Test plan
npm run build— cleannpm run lint— cleannpm run typecheck— cleannpm run test— 82/82 pass (existing chain-expansion tests validate the 6 new testnet entries: chain IDs, USDC addresses, default confirmations, viem mapping, slug coverage, RPC URL shape)agent-proxytypecheck — cleanNote
Medium Risk
Modifies server-side
evm.chargeconstruction to resolve token addresses/decimals and validate credential types, which can change runtime behavior or raise new configuration-time errors for existing integrations. Also expands chain matrices (IDs, slugs, viem mappings, confirmations), increasing the surface area for misconfigured constants.Overview
Adds 6 new testnet chains (
ethereum-sepolia,arbitrum-sepolia,optimism-sepolia,polygon-amoy,scroll-sepolia,linea-sepolia) across the chain matrices (chain IDs, USDC addresses, viem chain mapping, QuickNode slugs, and default confirmations).Introduces multi-token support via
SupportedTokenplus new exported lookup tablesTOKEN_CONTRACTS,TOKEN_DECIMALS, andTOKEN_CREDENTIAL_TYPES(adding EURC, WETH, and mainnet-only USDT).Updates server
charge()to select the ERC-20 contract/decimals from(token, chain), defaultcredentialTypesper token, and reject unsupported(chain, token)pairs or invalid credential types (e.g., disallowingauthorizationfor tokens without EIP-3009).Reviewed by Cursor Bugbot for commit 70f6c54. Bugbot is set up for automated code reviews on this repo. Configure here.