example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect ERC-7683 / intent-based protocol bugs — solver griefing, intent expiration, settlement race conditions, surplus theft, cross-chain replay, allowance front-runs. Activate on `IOriginSettler`, `IDestinationSettler`, `CrossChainOrder`, ERC-7683 imports, UniswapX reactor
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill intents-erc7683 --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill intents-erc7683 -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill intents-erc7683 -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill intents-erc7683 -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill intents-erc7683 -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill intents-erc7683 -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill intents-erc7683 -a windsurf -y
name: intents-erc7683 description: Detect ERC-7683 / intent-based protocol bugs — solver griefing, intent expiration, settlement race conditions, surplus theft, cross-chain replay, allowance front-runs. Activate on `IOriginSettler`, `IDestinationSettler`, `CrossChainOrder`, ERC-7683 imports, UniswapX reactor patterns, CoW settlement, 1inch Fusion, Across spoke pool / hub pool.
Intent specifies `amountOutMin` (user's floor). Solver delivers exactly the min, pockets actual market surplus. UX issue but real for intents with tight min — solver fills inferior route. Defense: surplus distribution to user (CoW does this).
ERC-7683 intent payload signable for one (origin, destination) pair must include both chainIds. Otherwise replay on another destination.
Solver A's fill is in mempool; Solver B copies and submits with higher gas → A's tx reverts. Mitigations: private mempools, MEV-Share, exclusivity windows.
`require(block.timestamp <= deadline)` at settlement. If deadline is checked at the wrong step (e.g. at origin lock but not destination fill), funds can be stuck.
`reactor.execute(order, fillerCallback)` → callback in attacker-controlled filler contract. If reactor state is mutated mid-callback, reentrancy possible. Required: `nonReentrant` on the reactor.
Intent assumes user's Permit2 sig was just executed. Solver can race: front-run the permit, grief the intent.
Intent restricts to specific solvers. If the list check is via `tx.origin` (instead of `msg.sender` or signature recovery), trivially bypassable.
Dutch auction: output token amount decays over time. If decay math overflows or rounds wrong, solver fills at the *minimum* before decay completes.
Intent identifies itself by `(user, salt)`. If salt isn't enforced unique on-chain, multiple identical intents replayable.
Cross-chain intents (ERC-7683): solver bonds on destination to prove they'll bring liquidity. If bond is too small, solver can grief by filling and abandoning.
If fast solver doesn't fill: fallback to a slower, trustless path. Bug surface: race between fast and slow paths.
User cancels intent (`cancel`); solver fills in the same block. Order-of-execution determines who wins. Required: cancel must invalidate fills in the same tx.
| Pattern | Severity | |---|---| | Origin lock without atomic destination fill / refund | **Critical** | | Cross-chain replay (no chainId binding) | **Critical** | | Reactor callback reentrancy | **High** | | Solver-allowed-list using tx.origin | **High** | | Surplus theft (silent) | **High** | | Decay function precision wrong | **High** | | Salt nonce not enforced unique | **High** | | Insufficient solver bond | **High** | | Cancellation race | **High** | | Deadline not enforced atomically | **High** | | Permit2 race | **Medium** |
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
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect unsafe assumptions about Solady's gas-optimized ERC20/ERC2612 permit and DN404 metadata. Solady's ERC20 uses custom…
Detect front-runnable ownership initialization in Solady Ownable / OwnableRoles. Solady's `_initializeOwner` is a guarded…
Detect Solady SafeTransferLib calls that assume the token has code. SafeTransferLib.safeTransfer/safeTransferFrom/safeApprove…
Detect Uniswap V4 hooks that fail to settle currency deltas with the PoolManager. Every credit/debit a hook creates…
Detect Uniswap V4 hooks whose address-encoded permission flags don't match the callbacks the hook actually implements. In V4 the…
Use for authorized security assessment of REST, GraphQL, WebSocket, or SOAP APIs, including discovery, authentication,…
Extract and decrypt Windows DPAPI-protected secrets (Credential Manager, browser logins/cookies, Wi-Fi credentials, KeePass keys)…
Clean and finalize authorized natural-language text intended for readers by auditing suspicious invisible Unicode and rewriting…