Skip to content
Security
Command

/replay-incident

Replay a historical exploit tx (by tx hash) on a fork. Explains step-by-step what the attacker did.

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

Command definition

replay-incident.md
description: Replay a historical exploit tx (by tx hash) on a fork. Explains step-by-step what the attacker did.
argument-hint: "<chain> <tx-hash>"
allowed-tools: Read, Bash, Agent, mcp__block-explorer__*, mcp__anvil__*, mcp__forge-runner__*

/replay-incident — replay a historical hack

Pulls a real exploit tx from chain, replays it on a fork, and walks through what happened.

Great teaching tool. Also great content — every replay can become a tweet or blog post.

Procedure

Step 1 — Fetch the tx

mcp__block-explorer__get_tx(chain=<chain>, hash=<hash>)
mcp__block-explorer__get_trace(chain=<chain>, hash=<hash>)

Pull the calldata, value, from/to, internal calls, state diff, gas, and block.

Step 2 — Fork just before the tx

mcp__anvil__fork(chain=<chain>, block=<tx_block - 1>)

This gives us the pre-attack state.

Step 3 — Identify the protocol and contracts touched

Pull the verified source of every contract in the trace.

Step 4 — Replay

mcp__anvil__send_raw_tx(<original-tx>)

Capture the actual state changes; compare to the live chain post-tx data — should match.

Step 5 — Annotate the trace

Walk through each internal call:

Block 18,234,567 — Curve Finance exploit (2023-07-30)

  External call: 0xattacker → 0xfraxusdc_pool.remove_liquidity_one_coin(...)
    │
    ├─ Internal: pool transfers $1M USDC to attacker
    │   Then calls pool.balanceOf(attacker) for reward accounting...
    │     │
    │     └─ READ-ONLY REENTRANCY: pool state is mid-update during this read
    │
    └─ attacker contract uses the stale read to mint reward shares
        based on the larger-than-real balance

Step 6 — Vuln-class mapping

Map the incident to the [[skills]] taxonomy:

Root cause:  read-only reentrancy (skills/reentrancy)
Amplifier:   reward accounting based on token.balanceOf during mid-update
Lesson:      for any oracle/getter call from a reentrant contract, add
             ReentrancyGuard or rely on a settled-state snapshot.

Step 7 — Output

The full walkthrough + a "what to learn" section + (if `--card` flag) a PNG card for sharing.

Notable replayable incidents to demo

  • 2022-04-17: Beanstalk governance flash-loan ($182M)
  • 2022-08-01: Nomad bridge replay attack ($190M)
  • 2023-07-30: Curve / Vyper compiler reentrancy ($73M)
  • 2023-11-22: KyberSwap concentrated liquidity precision ($55M)
  • 2024-03-13: Munchables blacklist-able EOA admin ($63M)

Bundle these as `/replay-incident demo-curve` shortcuts.

Notes

  • Replays are non-destructive (fork is local).
  • The actual tx hash and trace must match the live chain — verify post-replay.
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

1152 skills23 agents
Get the whole plugin

Stars on GitHub

Momentum

stars in total
11
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…

@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