Skip to content
Security
Command

/fuzz

Generate property-based fuzz tests for a specific function.

From plugin
rugproof
1045 skills23 agents45 commands4 hooks
> /plugin marketplace add omermaksutii/RugProof
> /plugin install rugproof@rugproof

Command definition

fuzz.md
description: Generate property-based fuzz tests for a specific function.
argument-hint: "<Contract.function>"
allowed-tools: Read, Write, Bash, Agent, Skill, mcp__forge-runner__*, mcp__fuzz-runner__*

/fuzz — fuzz tests for one function

Lighter than `/invariant` — targets a specific function with bounded random inputs.

For deeper campaigns, drive the dedicated fuzzers via the `fuzz-runner` MCP — `mcp__fuzz-runner__echidna` (property fuzzing) or `mcp__fuzz-runner__medusa` (parallel, Go). Call `mcp__fuzz-runner__is_available` first; if a fuzzer isn't installed the tool returns a labeled sample so the flow still demonstrates.

Procedure

1. Read the function and identify input types + valid ranges. 2. Generate Foundry fuzz tests:

function testFuzz_DepositReturnsCorrectShares(uint256 amount) public {
    amount = bound(amount, 1, 1e30);
    vm.deal(address(this), amount);
    uint256 sharesBefore = vault.totalSupply();
    uint256 minted = vault.deposit{value: amount}();

    assertEq(vault.totalSupply(), sharesBefore + minted);
    assertGt(minted, 0, "minted zero shares");
}

3. Add property assertions specific to the function:

  • Idempotency: f(f(x)) == f(x) for view-or-once-only ops
  • Inverse: encode(decode(x)) == x
  • Monotonicity: f(a) ≤ f(b) for a ≤ b on monotone fns
  • Conservation: balance changes sum to zero on transfers

4. Run with `mcp__forge-runner__test(flags="--fuzz-runs 10000")`.

Output

Same as `/test-gen` but scoped to the target function.

Notes

  • Use `bound(input, lo, hi)` instead of `vm.assume` for better coverage.
  • Don't fuzz with unrealistic ranges (e.g. transfer amounts of `2**256-1`) — bound to plausible values.
  • For functions with multiple inputs, fuzz them independently or together depending on their semantic coupling.
Read more
@omermaksutii
Ships withrugproof

Rugproof your code before someone else does. 🌐 Live site: omermaksutii.github.io/RugProof 📦 Latest: v1.0.0 — 45 commands · 23 agents · 45 skills · 13 MCP servers · tested, offline-first, with rule packs, a benchmark, non-EVM coverage, and post-deploy

1052 skills23 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
10
Star history of omermaksutii/RugProof on GitHub, a chart by star-history.com

Other commands on rugproof.

audit-deep

audit-deep

Command

Deep audit — same as /audit but spawns more parallel subagents, runs multi-pass review, and chases exploit chains across files.

@omermaksutii@omermaksutiiInstall Command
audit-deps

audit-deps

Command

Audit third-party dependencies — resolve installed versions, cross-reference known-vulnerable releases, and flag vendored code…

@omermaksutii@omermaksutiiInstall Command
audit-diff

audit-diff

Command

Diff two Rugproof audit reports (before vs after) to track regressions — what's new, what's fixed, and whether the grade moved.

@omermaksutii@omermaksutiiInstall Command
audit-history

audit-history

Command

Pull past public audits (Code4rena, Sherlock, Spearbit, etc.) for a deployed contract or known protocol.

@omermaksutii@omermaksutiiInstall Command
audit-live

audit-live

Command

Audit a deployed contract on a live chain. Pulls verified source from the block explorer, optionally forks the chain for…

@omermaksutii@omermaksutiiInstall Command

More commands from other plugins.

deslop-reborn

deslop-reborn

Command

One iteration of the IronClaw Reborn de-slop loop — take ONE Reborn crate, fan out parallel review sub-agents (thermo-nuclear…

ironclaw12d13k
@nearai@nearaiInstall Command
audit

audit

Command

Audit a file, directory, or whole repo for insecure default configuration: fallback secrets, default credentials, fail-open…

@trailofbits@trailofbitsInstall Command
arsenal

arsenal

Command

Show which external bug-bounty tools are installed on this machine and print install hints for the missing ones. Curated from…

@awarexone@awarexoneInstall Command