web3-testing

Automate Solidity smart contract testing with Hardhat and Foundry.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/ekremmkasap/jarvis --skill web3-testing-ekremmkasap
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: web3-testing
Source: https://github.com/ekremmkasap/jarvis/tree/main/server/agent_prompts/wshobson/plugins/blockchain-web3/skills/web3-testing
Command: npx skills add https://github.com/ekremmkasap/jarvis --skill web3-testing-ekremmkasap

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill helps developers test Solidity smart contracts comprehensively by providing structured testing strategies and examples using Hardhat and Foundry, enabling reliable unit and integration tests as well as mainnet forking for realistic scenarios.

Core Features & Use Cases

  • Hardhat-based unit and integration tests with coverage, gas reporting, and Etherscan verification patterns.
  • Foundry (Forge) testing approaches for Solidity contracts, including fixture usage and fuzzing patterns.
  • Mainnet forking and forked test environments to validate interactions with real-world contracts.
  • CI/CD integration guidelines and contract verification workflows for end-to-end reliability.

Quick Start

Install Hardhat and Foundry, set up your environment (MAINNET_RPC_URL, PRIVATE_KEY), and begin running unit and integration tests with mainnet forking.

Frequently Asked Questions about web3-testing

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

FAQPage Schema
How do I test Solidity smart contracts using Hardhat and Foundry?

Solidity smart contract testing is automated using Hardhat and Foundry. This skill structures unit and integration tests while providing test coverage, gas reporting, and Etherscan verification patterns for reliable contract validation.

What is mainnet forking and how does it work for smart contract testing?

Mainnet forking creates a test environment replicating real-world blockchain state. It allows smart contract tests to validate interactions with live deployed contracts deterministically without spending real gas.

Do I need a MAINNET_RPC_URL and PRIVATE_KEY to run forked smart contract tests?

Yes, MAINNET_RPC_URL and PRIVATE_KEY are required for environment setup. These variables configure the deterministic test suites needed to execute mainnet forking and validate real-world contract interactions.

Can I use Foundry fuzzing and fixtures for Solidity contract unit tests?

Yes, Foundry Forge testing approaches are supported for Solidity contracts. You can apply fixture usage and fuzzing patterns to execute comprehensive unit tests alongside Hardhat integration tests.

What's the best way to integrate gas testing and Etherscan verification into a CI/CD pipeline?

The best way to integrate gas testing and verification is using the provided CI/CD guidelines and contract verification workflows. These configure end-to-end reliability across decentralized applications during automated deployments.

Why does my mainnet forking test suite fail to execute deterministically?

Mainnet forking test suites fail when MAINNET_RPC_URL or PRIVATE_KEY environment variables are missing. Proper environment setup is required to run deterministic tests and validate real-world contract interactions.