example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect misuse of tx.origin, block.timestamp, block.number — phishing via tx.origin, timestamp dependence, L2-block-number assumptions. Activate on `tx.origin`, `block.timestamp`, `block.number`, `blockhash`, `block.prevrandao`, `block.coinbase`.
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill tx-context-misuse --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill tx-context-misuse -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill tx-context-misuse -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill tx-context-misuse -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill tx-context-misuse -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill tx-context-misuse -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill tx-context-misuse -a windsurf -y
name: tx-context-misuse description: Detect misuse of tx.origin, block.timestamp, block.number — phishing via tx.origin, timestamp dependence, L2-block-number assumptions. Activate on `tx.origin`, `block.timestamp`, `block.number`, `blockhash`, `block.prevrandao`, `block.coinbase`.
require(tx.origin == owner); // ← phishable via intermediate contract
A contract the owner has interacted with can drain by calling back into this function — owner-EOA is `tx.origin` even if direct caller is the malicious contract.
Exception: `tx.origin == msg.sender` check to enforce EOA-only is *sometimes* valid for limiting bots — but EIP-7702 will invalidate even this. Flag as outdated pattern.
Miners (post-merge: validators) can skew timestamp ±~15s. Don't use for sub-15s precision.
uint r = uint(keccak256(abi.encode(block.timestamp, msg.sender))); // ← validator can simulate
Arbitrum: `block.number` is L1 block number, NOT L2. `block.timestamp` is L2. Optimism: `block.number` is L2. Get this wrong and rate limits fire 12x too fast (or too slow).
Random distribution becomes biased / predictable.
Validator can rotate addresses; using coinbase for auth or whitelisting is unsafe.
Post-merge `prevrandao` is the previous block's randao; validators can sometimes choose to skip producing a block to influence it (limited but real). Don't use for valuable mints.
Basefee can be manipulated within bounds by miners. Use sparingly.
Generally fine, but document tolerance for ±15s.
| Pattern | Severity | |---|---| | `tx.origin == admin` for sensitive auth | **High** | | `block.timestamp` as RNG seed for valuable outcomes | **High** | | `block.number` confused L1-vs-L2 on Arbitrum | **High** | | `block.coinbase` for auth | **High** | | `block.prevrandao` for high-value mint | **High** | | Timestamp deadline with <30s precision | **Medium** | | `blockhash` with out-of-range input | **Medium** | | EOA-only check via `tx.origin == msg.sender` | **Medium** *(EIP-7702 invalidates)* |
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…