# Cairo Smart Contract Testing

> Explain how to test Starknet contracts with Foundry tools, deploy and call contracts, and use cheatcodes; use when a request involves contract test setup or testing patterns.

- Skill: `teddyjfpender/cairo-smart-contract-testing` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add teddyjfpender/cairo-smart-contract-testing`
- Raw SKILL.md: https://api.skillmd.com/api/skills/teddyjfpender/cairo-smart-contract-testing/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: teddyjfpender (https://skillmd.com/u/teddyjfpender)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/teddyjfpender/cairo-smart-contract-testing

---


# Cairo Smart Contract Testing

## Overview
Explain common testing workflows for Starknet contracts, including deployment, dispatchers, and cheatcodes.

## Quick Use
- Read `references/smart-contract-testing.md` before answering.
- Use snforge standard library helpers for declare and deploy.
- Use dispatchers to call contract entry points in tests.

## Response Checklist
- Deploy test contracts and use their dispatchers for calls.
- Use cheatcodes to set caller, block info, or spoof events.
- Validate events and storage state after calls.

## Example Requests
- "How do I write a contract test with snforge?"
- "How do I call a contract from a test?"
- "What cheatcodes are available for Starknet tests?"

