Technical Details:
- Using Viem for contract interactions
- BSC Testnet
- Gas Limit: 35,000,000 units (seems too high)
- Max Fee Per Gas: 0.00000001 TBNB
Current Implementation:
const gasPrice = await publicClient.getGasPrice();
return walletClient.writeContract({
// ... contract details
maxFeePerGas: gasPrice,
maxPriorityFeePerGas: gasPrice / BigInt(2)
});
've tried:
1. Setting custom gas limits
2. Using maxFeePerGas and maxPriorityFeePerGas
3. Letting MetaMask handle gas estimation
How can I properly handle gas estimation to prevent this MetaMask warning?
