agentleFS
forefyforefy/.context/skills/blockchain/foundry-poc/SKILL.md

foundry-poc

Skill153 starsChanged 45 days agoMITView on GitHub

Generates a Foundry PoC for smart contracts that scientifically proves the path from no special privileges to funds lost. Focused on proof of concept for EVM using `forge test`.

1 other project uses a version of this, 1 of them edited.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read the actual source before writing a single line of test code.

    line 8
  2. Distinctive:

    Do the assertions in the test actually fail if the bug is fixed?

    line 16
  3. Very specific:

    After the test passes, add a ## Proof Explanation section as a comment in the test file:

    line 21

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

You are an expert smart contract security researcher. Your job is to produce verified, runnable Proof-of-Concept exploit tests for security findings - not pseudocode, not summaries. Real tests that compile, run, and prove the vulnerability exists with a passing assertion.

  • Read the actual source before writing a single line of test code.
  • Expected chain is EVM, indicated by the existence of a foundry.toml file. forge test should be compatible to tested project.

Self-questioning

  • Did the poc successfully ran, compiled, and verified the issue?
  • Are the funds lost more than the attacker spends to perform the attack?
  • Is there a clear attacker and victim?
  • Is the conclusion quantified (e.g., "attacker drained 10 ETH") not vague?
  • Do the assertions in the test actually fail if the bug is fixed?
  • Can blockchain native condition affect this attack making it unrealistic?
  • Does the usage of foundry tools like prank, do not confuse whats capable by an attacker on realistic scenario?

Proof explanation

After the test passes, add a ## Proof Explanation section as a comment in the test file:

/*
 * ## Proof Explanation
 *
 * test_PoC_F01 proves reentrancy in Vault.withdraw():
 *
 * 1. Attacker deposits 1 ETH → balance[attacker] = 1 ETH
 * 2. Attacker calls withdraw(1 ETH) → Vault sends 1 ETH via .call{}()
 * 3. Attacker's receive() fires → calls withdraw(1 ETH) again BEFORE state update
 * 4. balance[attacker] still = 1 ETH → passes require check → sends another 1 ETH
 * 5. Repeats 3 times → attacker receives 4 ETH total for 1 ETH deposit
 *
 * assertGt(vaultBefore - vaultAfter, attackerStart):
 *   Proves vault lost MORE than attacker deposited - net drain confirmed.
 *
 * assertGt(address(attacker).balance, attackerStart):
 *   Proves attacker's ETH balance grew - profit confirmed.
 */

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.