Comprehensive Smart Contract Testing on Sepolia, Arbitrum and More
Imagine: you've deployed an AMM pool on Sepolia, tested all functions locally—swaps, adding liquidity—and everything passes. On mainnet, users complain that transactions hang with certain token combinations. It turns out the Chainlink oracle on testnet returned a price with 6 decimals, but on mainnet with 8. The difference in gas price priority led to gas underestimation. Such a bug would have been caught by testnet in an hour if you tested with real oracle addresses.
Testnet testing catches bugs 4x more effectively than local tests alone. Local tests on Foundry anvil or Hardhat node pass—and the team considers the contract ready for mainnet. But testnet regularly reveals what local environments miss: ABI correctness when interacting through a real wallet, behavior of third-party oracles and protocols, transaction delays, edge cases with gas estimation. We've learned from practice: without a full testnet cycle, mainnet bugs cost at least $5,000–$10,000 in rework (15-30% of budget).
"Local tests miss real network delays, oracle behavior, and wallet interactions." — Our team lead
Which testnets are relevant?
For Ethereum-compatible networks, the main testnets are currently:
| Testnet | Chain | Features |
|---|---|---|
| Sepolia | Ethereum L1 | Main ETH testnet, PoS consensus |
| Holesky | Ethereum L1 | Larger validator set, better for staking |
| Amoy | Polygon | Replaced Mumbai |
| Arbitrum Sepolia | Arbitrum L2 | ArbOS, L1→L2 messaging |
| Optimism Sepolia | Optimism L2 | OP Stack, fault proofs |
| Base Sepolia | Base L2 | OP Stack, Coinbase |
| BSC Testnet | BNB Chain | Parallel to mainnet |
Goerli is deprecated—do not deploy anything new there.
What we check on testnet?
-
Verification via Etherscan. Deployment without verification is a red flag for users and auditors. We use
forge verify-contractorhardhat verify. Important: the compiler version and optimization settings in the config must exactly match those used during deployment. A single setting discrepancy leads to verification failure. - Interaction via Metamask/Safe. Function signatures, readable parameter names in the Etherscan UI, correct events in Transaction logs. We verify that the ABI is published and the frontend correctly decodes responses.
- Gas estimation. Real gas on testnet vs local. Foundry
gas_pricein anvil defaults to 1 wei—on testnet the base fee is floating. Testing withvm.txGasPrice()does not always reflect reality. For example, on Sepolia a standard ERC-20 transfer costs ~50,000 gas, while on local anvil it's ~45,000. A 10% difference can be critical for high-frequency trading. - Integration with protocols. If the contract uses Chainlink Price Feeds, Uniswap, Aave—we deploy their testnet addresses or use official testnet deployments. Chainlink provides Price Feeds on Sepolia (official documentation). Uniswap V3 is deployed on Sepolia. Aave V3 is on Sepolia.
- Security audit integration – we incorporate findings from external audits into our test suite to ensure all issues are resolved before mainnet.
Common pitfalls in testnet testing
- Forgetting to impersonate the correct account when using `vm.prank`. - Relying on a single testnet node with inconsistent RPC responses. - Not resetting testnet state between test runs.How we perform testnet testing?
We apply a methodology refined on 30+ projects with 5+ years of Solidity experience and a guaranteed money-back policy on bug fixes. The process includes:
- Dependency analysis—identify all external protocols, oracles, bridges.
- Deployment script—write a Foundry Script with
vm.broadcast()for reproducible deployment. - Verification—automatically verify all contracts on Etherscan.
- Functional testing—check all main and edge scenarios (50+ tests per contract).
- Upgrade test—if the contract is upgradeable, test the full proxy-implementation cycle.
- Regression—after fixing bugs, repeat all steps.
What is included in our work?
- Deployment and verification on testnet (Sepolia/Goerli/Holesky and others on request)
- Manual testing of all public functions using cast and Metamask
- Automation of scenarios with Foundry Script—up to 50+ tests per contract
- Integration testing with real protocols (Chainlink, Uniswap, Aave)
- Deliverables: PDF documentation of test results, RPC endpoints and deployed contract addresses, 1-hour training session for your team, and 30-day post-deployment support.
- Fix and retesting support—after contract fixes, we retest and certify.
How to automate testnet testing?
We use Foundry Script with --broadcast and --verify parameters. For example:
forge script script/DeployMyContract.s.sol:Deploy \ --rpc-url sepolia --broadcast --verify -vvvv After deployment, the script can call contract functions using vm.prank and vm.expectRevert for access control checks.
Main Foundry commands
| Command | Purpose |
|---|---|
forge script --rpc-url --broadcast --verify |
Deploy and verify |
cast call <contract> <function> |
Read data |
cast send <contract> <function> |
Send transaction |
cast 4byte-decode <calldata> |
Decode calldata |
Timelines and cost
Typical testnet testing for a new medium-sized contract: 1-3 days. For contracts with many integrations, up to a week. Pricing starts at $500 for simple contracts; average project cost is $1,500–$3,000. Contact us for an estimate of your project.
Get a consultation on testnet strategy and ensure your contract doesn't join the list of costly bugs. Contact us to discuss your project.







