anvil-patterns

Automate local Ethereum node setup and testing with Anvil patterns.

120|12|Updated Apr 10, 2026
One-click install
npx skills add https://github.com/ccashwell/evm-cortex --skill anvil-patterns
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: anvil-patterns
Source: https://github.com/ccashwell/evm-cortex/tree/main/skills/anvil-patterns
Command: npx skills add https://github.com/ccashwell/evm-cortex --skill anvil-patterns

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill provides patterns and commands to efficiently run and manage a local Ethereum node using Anvil, enabling reproducible states, account impersonation, and flexible mining/ fork configurations.

Core Features & Use Cases

  • Fork mainnet or other chains at the current or specific blocks to reproduce states.
  • Impersonate accounts to test interactions without private keys.
  • Manipulate state: set balances, modify storage, mine blocks, and snapshot/restore state.

Quick Start

Launch a default Anvil node with anvil and then apply the recommended options to fork, impersonate accounts, and adjust mining or state settings as needed.

Frequently Asked Questions about anvil-patterns

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

FAQPage Schema
How do I fork mainnet state at a specific block using Anvil?

Account impersonation in local Ethereum nodes allows you to test interactions without private keys by assuming control of specified addresses. This Skill provides tooling to impersonate accounts within your Anvil environment.

What is the best way to manipulate Ethereum chain state in a local testing environment?

Manipulating Ethereum chain state in a local testing environment involves setting balances, modifying storage, and mining blocks within controlled Anvil instances. This Skill provides patterns to automate these state manipulation workflows deterministically.

Can I snapshot and restore local node state during Foundry testing workflows?

You need a basic Foundry and Anvil environment setup to use these patterns, as they are designed specifically for developers building and testing smart contracts within Foundry local node environments. No additional dependencies are required.

Why does my local Anvil node fail to maintain reproducible states between test runs?

Local Anvil nodes fail to maintain reproducible states without proper configuration. Applying this Skill's deterministic state handling patterns ensures your node setup, mining configurations, and state manipulations remain consistent across test runs.