foundry

Automates Foundry Solidity tests and deployment scripts for CMTAT projects.

7|7|Updated Sep 28, 2022
One-click install
npx skills add https://github.com/CMTA/RuleEngine --skill foundry-cmta
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: foundry
Source: https://github.com/CMTA/RuleEngine/tree/main/.claude/skills/foundry
Command: npx skills add https://github.com/CMTA/RuleEngine --skill foundry-cmta

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Foundry-based Solidity projects often require separate test and deployment scripts; setting up test scaffolds and consistent patterns can be error-prone and slow.

Core Features & Use Cases

  • Test scaffolding with .t.sol tests and HelperContract utilities
  • Cheatcode guidance and vm cheatcodes usage for deterministic tests
  • Deployment script templates for lib/CMTAT contracts and multi-environment runs

Quick Start

Run forge test to execute Foundry tests defined in test/ using .t.sol templates.

Frequently Asked Questions about foundry

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

FAQPage Schema
How do I scaffold Foundry tests for Solidity smart contracts?

To scaffold Foundry tests, create files in the test/ directory using the .t.sol suffix and utilize HelperContract.sol utilities to set up consistent test patterns. This structure automates test execution and ensures deterministic results when running forge test.

What is the correct file structure for Foundry deployment scripts?

The correct Foundry deployment script structure places scripts in the script/ directory, applying file-structure conventions for multi-environment runs. This setup streamlines deployment for lib/CMTAT contracts and ensures consistent execution across different environments.

How do vm cheatcodes work in Foundry for deterministic testing?

Foundry vm cheatcodes manipulate the blockchain state during test execution to force specific conditions and ensure deterministic tests. They allow you to set block numbers, impersonate addresses, and mock external calls within your .t.sol test files.

Can I use Foundry to manage multi-environment deployment runs?

Yes, Foundry supports multi-environment deployment runs through script templates in the script/ directory. You can configure and execute forge script commands to deploy lib/CMTAT contracts across different networks while maintaining consistent deployment patterns.

Why does my Foundry test setup fail without a HelperContract file?

Foundry test setups rely on HelperContract.sol to provide shared utility functions and initialization logic across .t.sol test files. Without it, your tests lack the necessary scaffolding to properly initialize contract states and execute deterministic test scenarios.

Do I need Forge installed to run Solidity deployment scripts?

Yes, you need Forge installed to execute Foundry-based Solidity deployment scripts and tests. The workflow relies on forge commands like forge test and forge script to compile contracts, run .t.sol tests, and execute deployment scripts in the script/ directory.