From 5ff7314c277e5b4315ec55a8d155aaaf97f05b82 Mon Sep 17 00:00:00 2001 From: Will Sewell Date: Wed, 6 May 2026 15:53:42 +0100 Subject: [PATCH] docs(examples): note RPC fix for intermittent allowance error on bid The post-approval simulateContract for the bid can revert with "ERC20: transfer amount exceeds allowance" when the configured RPC is load-balanced (e.g. the default sepolia.base.org), because the eth_call may be served by a node that hasn't yet synced the approval block. Add a comment pointing developers to the existing NEXT_PUBLIC_BASE_RPC_URL / VITE_BASE_RPC_URL env var as the fix. Co-Authored-By: Claude Opus 4.7 --- .../framework/nextjs-evm/src/app/hooks/use-sale-contract.ts | 5 +++++ examples/framework/react-evm/src/hooks.ts | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/examples/framework/nextjs-evm/src/app/hooks/use-sale-contract.ts b/examples/framework/nextjs-evm/src/app/hooks/use-sale-contract.ts index 9275892..b61f270 100644 --- a/examples/framework/nextjs-evm/src/app/hooks/use-sale-contract.ts +++ b/examples/framework/nextjs-evm/src/app/hooks/use-sale-contract.ts @@ -75,6 +75,11 @@ export const useSaleContract = (saleSpecificEntityID: Hex) => { ] as const; // TODO could also show an example of using the replaceBidWithPermit function instead of the replaceBidWithApproval function + // If this simulation intermittently reverts with "ERC20: transfer amount exceeds allowance", + // the configured RPC is load-balanced across nodes that haven't all synced the approval block + // above (the public sepolia.base.org default has this behavior). The on-chain transaction + // itself is unaffected. Set NEXT_PUBLIC_BASE_RPC_URL to a dedicated, non-load-balanced + // endpoint (see .env.example) to fix. const { request: bidRequest } = await simulateContract(config, { address: saleContract, abi: settlementSaleAbi, diff --git a/examples/framework/react-evm/src/hooks.ts b/examples/framework/react-evm/src/hooks.ts index 78e0c48..97b0847 100644 --- a/examples/framework/react-evm/src/hooks.ts +++ b/examples/framework/react-evm/src/hooks.ts @@ -75,6 +75,11 @@ export const useSaleContract = (saleSpecificEntityID: Hex) => { ] as const; // TODO could also show an example of using the replaceBidWithPermit function instead of the replaceBidWithApproval function + // If this simulation intermittently reverts with "ERC20: transfer amount exceeds allowance", + // the configured RPC is load-balanced across nodes that haven't all synced the approval block + // above (the public sepolia.base.org default has this behavior). The on-chain transaction + // itself is unaffected. Set VITE_BASE_RPC_URL to a dedicated, non-load-balanced endpoint + // (see .env.example) to fix. const { request: bidRequest } = await simulateContract(config, { address: saleContract, abi: settlementSaleAbi,