example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect floating pragma, hardcoded addresses, missing zero-address checks, deprecated Solidity versions. Activate on every `pragma solidity` line, `constant ADDRESS = 0x...`, `immutable` address parameters, address comparisons.
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill pragma-and-addresses --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill pragma-and-addresses -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill pragma-and-addresses -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill pragma-and-addresses -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill pragma-and-addresses -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill pragma-and-addresses -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill pragma-and-addresses -a windsurf -y
name: pragma-and-addresses description: Detect floating pragma, hardcoded addresses, missing zero-address checks, deprecated Solidity versions. Activate on every `pragma solidity` line, `constant ADDRESS = 0x...`, `immutable` address parameters, address comparisons.
pragma solidity ^0.8.0; // ← floats to any 0.8.x
Production deployments should pin: `pragma solidity 0.8.24;`. Floating pragma means audited bytecode ≠ deployed bytecode.
`<0.8.0` lacks built-in overflow checks. `<0.8.20` lacks PUSH0 opcode handling for some L2s. Audit pin date vs known compiler bugs.
address constant WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2; // ← mainnet WETH, breaks on Base/Arbitrum
WETH/USDC/USDT all have *different* addresses per chain. Use a chain-configurable resolver.
function setOwner(address newOwner) external onlyOwner {
owner = newOwner; // ← if 0x0, contract is bricked
}Affects ownership, oracles, treasury, fee receiver, token addresses.
Using `address(0)` to mean "unset" works but is brittle — collides with default mapping values.
Burning by sending to `address(0)`'s payable is legal but locks ether forever. Document intent.
`address(this)` differs unless deterministically deployed at same address across chains.
Mutable when it shouldn't be — gas cost + risk of accidental setter.
if (block.chainid == 1) router = MAINNET_ROUTER;
else if (block.chainid == 42161) router = ARB_ROUTER;
else revert("unsupported chain"); // ← without this, unsupported chain silently uses mainnet address| Pattern | Severity | |---|---| | Hardcoded mainnet address in multi-chain deployment | **High** | | Missing zero-address check on owner/admin set | **High** | | Chain-ID-based resolver missing for cross-chain | **High** | | Outdated Solidity version with known CVE | **High** | | Floating pragma (`^0.8.0`) in production | **Medium** | | Mutable address that should be immutable | **Low** | | Outdated but CVE-free Solidity version | **Low** | | Comment-only address documentation outdated | **Info** |
function _weth() internal view returns (address) {
if (block.chainid == 1) return MAINNET_WETH;
if (block.chainid == 8453) return BASE_WETH;
if (block.chainid == 42161) return ARB_WETH;
revert UnsupportedChain();
}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…