A CLI tool for simulating Compound governance proposals on Tenderly virtual testnets. Supports mainnet and L2 chains (Arbitrum, Scroll, Optimism, Base, Mantle).
- Node.js 20+
- pnpm 9+
- Tenderly Virtual TestNet subscription
-
Install dependencies from the monorepo root:
pnpm install
-
Configure
proposal.config.jsonwith your Tenderly RPC URLs and contract addresses.
From the monorepo root:
pnpm simulate <command> [options]Or from this package directory:
pnpm simulate <command> [options]| Command | Description |
|---|---|
simulate <id|0xcalldata> |
Simulate a proposal (default) |
revert |
Revert to snapshot (mainnet by default) |
snapshot |
Create snapshots for all chains |
list |
List available snapshots |
# Simulate proposal 524 (full governance flow)
pnpm simulate 524
# Simulate from raw calldata
pnpm simulate 0x7d5e81e2...
# Direct execution (skip governance, execute from timelock)
pnpm simulate 524 --direct
# Direct execution with state persistence
pnpm simulate 524 --direct --persist
# List available snapshots
pnpm simulate list
# Revert mainnet to latest snapshot
pnpm simulate revert
# Revert all chains
pnpm simulate revert --all
# Revert to second-to-last snapshot
pnpm simulate revert --snapshot -2
# Revert specific chain
pnpm simulate revert --chain arbitrum
# Create new snapshots for all chains
pnpm simulate snapshot| Option | Description |
|---|---|
--direct |
Execute directly from timelock (skip governance flow) |
--persist |
Persist state changes (only with --direct) |
--all |
Apply to all chains (for revert command) |
--snapshot <ref> |
Snapshot reference: latest, -1, -2, or full hash |
--chain <name> |
Target specific chain (mainnet, arbitrum, scroll, etc.) |
Full Simulation (default)
- Delegates COMP to robinhood address
- Advances blocks to make proposal active
- Casts vote
- Advances blocks to end voting
- Queues proposal via timelock
- Advances time past grace period
- Executes proposal
- Simulates L2 bridging if applicable
Direct Mode (--direct)
- Skips governance flow, executes directly from timelock
- Useful for debugging individual transactions
- Without
--persist: Usestenderly_simulateBundle(read-only) - With
--persist: Creates snapshot and executes real transactions
- Create clean snapshots:
pnpm simulate snapshot - Simulate a proposal:
pnpm simulate 524 --direct --persist - Revert to clean state:
pnpm simulate revert --all - Repeat as needed
# Build (from monorepo root)
docker build -f packages/simulator/Dockerfile . -t proposal-simulator
# Run
docker run -it proposal-simulator 524
docker run -it proposal-simulator --help- State Sync is a Tenderly Virtual TestNet configuration setting (enabled in dashboard)
- Snapshots are stored in
.snapshots/<chain>.jsonfiles (keyed by RPC URL) - The
--snapshotoption supports negative indices:-1= latest,-2= second-to-last