smoke-test

Generate Foundry smoke tests that verify deployment health against live on-chain state.

152|115|Updated Aug 3, 2020
One-click install
npx skills add https://github.com/OriginProtocol/origin-dollar --skill smoke-test-originprotocol
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: smoke-test
Source: https://github.com/OriginProtocol/origin-dollar/tree/main/.codex/skills/smoke-test
Command: npx skills add https://github.com/OriginProtocol/origin-dollar --skill smoke-test-originprotocol

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Writing post-deployment verification tests for DeFi contracts is error-prone: developers must bootstrap real deployed state, apply pending governance, resolve live actors, and handle rounding from live balances. This Skill encodes the conventions and patterns needed to generate correct Foundry smoke tests for OUSD, OETH, OSonic, and OETHBase deployments. ## Core Features & Use Cases - Deployment health verification: Generates smoke tests that bootstrap actual deployed state via the DeployManager/Resolver pipeline, including pending governance actions. - Convention enforcement: Applies the correct directory layout, inheritance chain (Base → BaseFork → BaseSmoke → Shared → Concrete), interface-only typing, and naming patterns. - Live-state patterns: Provides deal()-based token funding, additive yield dealing, vault liquidity management for withdrawal queues, and tolerant approximate assertions. - Use Case: After writing a new deployment script for an OToken product, ask for smoke tests covering mint, redeem, and rebase behavior to confirm the deployment is safe to execute on mainnet. ## Quick Start Generate Foundry smoke tests for the OUSD vault covering mint, redeem, and rebase behavior using the deployed mainnet state.

Frequently Asked Questions about smoke-test

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

FAQPage Schema
How do I write Foundry smoke tests for deployed contracts?

Bootstrap the actual deployed state by igniting the DeployManager, which etches the Resolver, replays deployment scripts, and simulates pending governance. Resolve contracts by name from the Resolver, cast them to interfaces, and resolve actors like the governor from live contracts rather than using makeAddr.

What is the difference between smoke tests, fork tests, and unit tests in Foundry?

Unit tests use fresh deploys with mocks for full coverage and fuzzing. Fork tests mix fresh and forked contracts for integration paths. Smoke tests resolve everything from the DeployManager against actual deployed state to verify deployment health, with no fuzzing.

How do I fund accounts with real tokens in Foundry fork tests?

Use the deal() cheatcode instead of mock minting, since tokens on a fork are real. For yield simulation, add to the existing balance rather than overwriting it: deal(token, vault, token.balanceOf(vault) + yieldAmount).

Why do smoke test assertions fail due to small rounding differences?

Live on-chain state has accumulated rounding, so exact equality checks fail. Use tolerant assertions like assertApproxEqRel with a 0.01% tolerance or assertApproxEqAbs, and use assertGe for supply changes when a rebase may occur during mint.

What should not be covered in deployment smoke tests?

Smoke tests should not cover access control, input validation, edge cases, or fuzz properties, which belong in unit tests. Strategy internals belong in fork tests. Smoke tests focus on core operations, supply invariants, rebase correctness, and withdrawal queue flows.