web3-testing

Automates structured testing of Solidity contracts using Hardhat and Foundry.

Updated Apr 4, 2026
One-click install
npx skills add https://github.com/emilneuraz-ai/neuraz-web --skill web3-testing-emilneuraz-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web3-testing
Source: https://github.com/emilneuraz-ai/neuraz-web/tree/main/.agents/skills/.agents/skills/web3-testing
Command: npx skills add https://github.com/emilneuraz-ai/neuraz-web --skill web3-testing-emilneuraz-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Tests are essential to guarantee Solidity contracts behave as intended across development, staging, and deployment environments. This Skill provides comprehensive guidance and patterns to set up and run unit tests, integration tests, and mainnet-forking simulations using Hardhat and Foundry.

Core Features & Use Cases

  • Hardhat testing setup with a reproducible config for Solidity versions, optimizer, forking, and Etherscan verification.
  • Unit testing, integration testing, and fuzz testing patterns with examples in JavaScript/TypeScript and Foundry (Forge) Solidity tests.
  • Mainnet forking and impersonation patterns to validate with real chain data and edge-case scenarios.

Quick Start

Run a basic test suite using Hardhat against a sample Token contract to verify the environment and tooling are correctly configured.

Frequently Asked Questions about web3-testing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Solidity testing pipelines using Hardhat and Foundry?

Solidity testing pipelines with Hardhat and Foundry require a local development environment configured with reproducible Solidity version settings, optimizer options, and Etherscan verification. You need to install both frameworks and set environment variables for RPC endpoints and API keys to run unit tests, integration tests, and fuzzing.

What is mainnet forking and when do I need it for smart contract testing?

Mainnet forking is a testing technique that simulates realistic blockchain conditions by using real chain data. You need mainnet forking when validating smart contract behavior against edge-case scenarios or when your contracts interact with existing protocols, requiring impersonation patterns to test with actual on-chain state.

Can I run fuzz tests and gas optimization checks for Solidity contracts with Foundry Forge?

Yes, Foundry Forge supports fuzz testing and gas optimization checks for Solidity contracts. The testing pipeline includes Forge Solidity test patterns that automate fuzz test execution and gas reporting alongside JavaScript and TypeScript unit tests run through Hardhat.

Does mainnet forking for Solidity testing require specific API keys and RPC endpoints?

Mainnet forking requires RPC endpoints to access real chain data and API keys for services like Etherscan verification. You must configure these as environment variables in your local development environment before running Hardhat or Foundry tests that depend on forked network state.

What is the best way to validate smart contract behavior across development and staging environments?

The best way to validate smart contract behavior is through a comprehensive testing pipeline covering unit tests, integration tests, and mainnet-forking simulations. Using both Hardhat for JavaScript or TypeScript tests and Foundry Forge for Solidity tests ensures contracts behave as intended across development, staging, and deployment environments.