From 87026dc2a740cd382297472463453cd188b44bc9 Mon Sep 17 00:00:00 2001 From: fox Date: Wed, 22 Apr 2026 15:45:26 -0400 Subject: [PATCH] fix(paywall/evm): route Mezo users to mezo.org/feature/borrow faucet link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The testnet-only "Need {tokenName} on {chainName}? Get some here" link was hardcoded to https://faucet.circle.com/, which is Circle's USDC faucet for Circle-native chains. On Mezo (chainId 31611 testnet, 31612 mainnet), users are paying in Mezo USD and the Circle faucet is a dead-end. Make the link conditional on chain: Mezo chains route to the canonical MUSD mint flow at https://mezo.org/feature/borrow; all other chains continue to use faucet.circle.com (correct for Base Sepolia USDC, Arbitrum Sepolia USDC, etc., which the upstream paywall is designed for). Regenerates the EVM paywall bundle (TS/Go/Python templates). Reported by docscrew from novice-tester feedback on the x402 quickstart. Ships on 2.10.0-mezo.7 for the Mezo hackathon preview. After this lands, queue an upstream PR to x402-foundation/x402 (broader fix needed there — should drive the URL from chain/token metadata, not a hardcoded list). --- go/http/evm_paywall_template.go | 2 +- python/x402/http/paywall/evm_paywall_template.py | 2 +- typescript/packages/http/paywall/src/evm/EvmPaywall.tsx | 9 ++++++++- typescript/packages/http/paywall/src/evm/gen/template.ts | 3 +-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/go/http/evm_paywall_template.go b/go/http/evm_paywall_template.go index 08914e85ff..cb49396775 100644 --- a/go/http/evm_paywall_template.go +++ b/go/http/evm_paywall_template.go @@ -2,4 +2,4 @@ package http // EVMPaywallTemplate is the pre-built EVM paywall template with inlined CSS and JS -const EVMPaywallTemplate = "\n \n \n Payment Required\n \n
\n \n \n " +const EVMPaywallTemplate = "\n \n \n Payment Required\n \n
\n \n \n " diff --git a/python/x402/http/paywall/evm_paywall_template.py b/python/x402/http/paywall/evm_paywall_template.py index 92884dee89..d46ebb6325 100644 --- a/python/x402/http/paywall/evm_paywall_template.py +++ b/python/x402/http/paywall/evm_paywall_template.py @@ -1,2 +1,2 @@ # THIS FILE IS AUTO-GENERATED - DO NOT EDIT -EVM_PAYWALL_TEMPLATE = '\n \n \n Payment Required\n \n
\n \n \n ' +EVM_PAYWALL_TEMPLATE = "\n \n \n Payment Required\n \n
\n \n \n " diff --git a/typescript/packages/http/paywall/src/evm/EvmPaywall.tsx b/typescript/packages/http/paywall/src/evm/EvmPaywall.tsx index 1272de6338..566f69ecbb 100644 --- a/typescript/packages/http/paywall/src/evm/EvmPaywall.tsx +++ b/typescript/packages/http/paywall/src/evm/EvmPaywall.tsx @@ -56,6 +56,13 @@ export function EvmPaywall({ paymentRequired, onSuccessfulResponse }: EvmPaywall const chainId = parseInt(network.split(":")[1]); + // Mezo Testnet (31611) and Mezo Mainnet (31612) use Mezo USD, not Circle USDC; + // the Circle faucet is a dead-end for these users. Route them to Mezo's mint flow. + const faucetUrl = + chainId === 31611 || chainId === 31612 + ? "https://mezo.org/feature/borrow" + : "https://faucet.circle.com/"; + // Find the chain from viem's chain definitions const paymentChain: Chain | undefined = Object.values(allChains).find(c => c.id === chainId); @@ -205,7 +212,7 @@ export function EvmPaywall({ paymentRequired, onSuccessfulResponse }: EvmPaywall {testnet && (

Need {tokenName} on {chainName}?{" "} - + Get some here.

diff --git a/typescript/packages/http/paywall/src/evm/gen/template.ts b/typescript/packages/http/paywall/src/evm/gen/template.ts index 792cb85ec1..c7f39fd2f5 100644 --- a/typescript/packages/http/paywall/src/evm/gen/template.ts +++ b/typescript/packages/http/paywall/src/evm/gen/template.ts @@ -2,5 +2,4 @@ /** * The pre-built EVM paywall template with inlined CSS and JS */ -export const EVM_PAYWALL_TEMPLATE = - '\n \n \n Payment Required\n \n
\n \n \n '; +export const EVM_PAYWALL_TEMPLATE = "\n \n \n Payment Required\n \n
\n \n \n ";