Summary
When building a token swap DApp on Arc Testnet using viem, every ERC-20 approve() call fails with "replacement transaction underpriced" unless the caller manually fetches the live gas price and applies at least a 30% upward bump before submitting.
This is separate from #80 (gasLimit override) — the issue here is specifically gasPrice (EIP-1559-style replacement threshold) not gasLimit.
Steps to reproduce
- Connect to Arc Testnet via
createPublicClient / createWalletClient with viem
- Call
walletClient.writeContract({ functionName: "approve", ... }) without an explicit gasPrice
- Transaction is submitted but immediately rejected by the node with:
replacement transaction underpriced
Workaround
Fetch the live gas price and apply a 30% premium before every write:
const networkGasPrice = await publicClient.getGasPrice();
const gasPrice = (networkGasPrice * 130n) / 100n;
await walletClient.writeContract({
...
gasPrice, // must be explicit
});
This applies to every ERC-20 write on Arc Testnet — approve(), transfer(), etc.
Environment
- Network: Arc Testnet (Chain ID 5042002)
- RPC:
https://rpc.testnet.arc.network
- viem v2.48.11
- Observed: May 2025
Impact
Any DApp that submits ERC-20 transactions without an explicit gas price premium will silently fail. The error message does not indicate that the solution is a gas price bump — it looks like a nonce/mempool collision.
Suggested fix
The node should either (a) honor MetaMask/viem default gas price estimates without rejection, or (b) document that a minimum gas price premium is required for all Arc Testnet transactions.
Summary
When building a token swap DApp on Arc Testnet using viem, every ERC-20
approve()call fails with "replacement transaction underpriced" unless the caller manually fetches the live gas price and applies at least a 30% upward bump before submitting.This is separate from #80 (gasLimit override) — the issue here is specifically
gasPrice(EIP-1559-style replacement threshold) notgasLimit.Steps to reproduce
createPublicClient/createWalletClientwith viemwalletClient.writeContract({ functionName: "approve", ... })without an explicitgasPriceWorkaround
Fetch the live gas price and apply a 30% premium before every write:
This applies to every ERC-20 write on Arc Testnet —
approve(),transfer(), etc.Environment
https://rpc.testnet.arc.networkImpact
Any DApp that submits ERC-20 transactions without an explicit gas price premium will silently fail. The error message does not indicate that the solution is a gas price bump — it looks like a nonce/mempool collision.
Suggested fix
The node should either (a) honor MetaMask/viem default gas price estimates without rejection, or (b) document that a minimum gas price premium is required for all Arc Testnet transactions.