example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on `<your trigger keywords or…
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.
$ npx -y skills add omermaksutii/RugProof --skill pragma-and-addresses --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/pragma-and-addressesContext preview
The summary Claude sees to decide when to auto-load this skill.
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.
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
Repo: omermaksutii/RugProof
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on `<your trigger keywords or…
Detect unsafe assumptions about Solady's gas-optimized ERC20/ERC2612 permit and DN404 metadata. Solady's ERC20 uses custom storage slots, returns bools via…
Detect front-runnable ownership initialization in Solady Ownable / OwnableRoles. Solady's `_initializeOwner` is a guarded one-time setter (it reverts with…
Detect Solady SafeTransferLib calls that assume the token has code. SafeTransferLib.safeTransfer/safeTransferFrom/safeApprove deliberately skip the EXTCODESIZE…
Detect Uniswap V4 hooks that fail to settle currency deltas with the PoolManager. Every credit/debit a hook creates (BeforeSwapDelta, afterSwap hookDelta,…
Detect Uniswap V4 hooks whose address-encoded permission flags don't match the callbacks the hook actually implements. In V4 the hook's permissions live in the…