example-fork-detection
TEMPLATE — replace with the description of your rule. Should activate on the specific code patterns your fork has. Activate on…
Detect delegatecall risks — uninitialized proxies, malicious implementations, storage-slot collisions, delegatecall to user-controlled addresses, library delegatecall pitfalls. Activate on `delegatecall`, UUPS proxy upgrades, multicall implementations, diamond facets,
Claude Code
$ npx -y skills add omermaksutii/RugProof --skill delegatecall-risks --agent claude-code
Codex
$ npx skills add omermaksutii/RugProof --skill delegatecall-risks -a codex -y
Cursor
$ npx skills add omermaksutii/RugProof --skill delegatecall-risks -a cursor -y
Gemini CLI
$ npx skills add omermaksutii/RugProof --skill delegatecall-risks -a gemini-cli -y
GitHub Copilot
$ npx skills add omermaksutii/RugProof --skill delegatecall-risks -a github-copilot -y
OpenCode
$ npx skills add omermaksutii/RugProof --skill delegatecall-risks -a opencode -y
Windsurf
$ npx skills add omermaksutii/RugProof --skill delegatecall-risks -a windsurf -y
name: delegatecall-risks description: Detect delegatecall risks — uninitialized proxies, malicious implementations, storage-slot collisions, delegatecall to user-controlled addresses, library delegatecall pitfalls. Activate on `delegatecall`, UUPS proxy upgrades, multicall implementations, diamond facets, governor-execute patterns.
function exec(address impl, bytes calldata data) external {
impl.delegatecall(data); // ← attacker provides impl, owns storage + can selfdestruct
}The *implementation* contract, if uninitialized, can be `initialize`d by anyone, then UUPS-upgraded to a `selfdestruct` impl, bricking the implementation. (Famous: Parity multisig.) Always `_disableInitializers()` in constructor.
Proxy uses slot 0 for admin, impl uses slot 0 for `owner` → impl writes corrupt proxy admin. Use EIP-1967 namespaced slots.
Forwarding `msg.value` via delegatecall to a function that doesn't expect ether → trapped funds or double-accounting.
`Multicall` via delegatecall preserves `msg.sender`, so signed-payload-based functions (`permit`, ERC-2771) can be combined in surprising ways. Audit each function for "what if called via multicall with attacker-controlled previous step?"
A malicious or buggy facet that calls `selfdestruct` deletes the diamond. EIP-6780 limits this to same-tx-deploy, but old diamonds remain at risk. See [[selfdestruct-eip6780]].
Solidity compiles "linked" libraries to `delegatecall`. Linking the wrong library (or address) bricks downstream contracts.
UUPS upgrade gate. If unguarded, anyone can upgrade the proxy.
function _authorizeUpgrade(address) internal override {} // ← no auth, anyone upgradesUsed (rarely) for pattern obfuscation; usually a code smell.
| Pattern | Severity | |---|---| | delegatecall to user-supplied address | **Critical** | | UUPS `_authorizeUpgrade` unguarded | **Critical** | | Uninitialized UUPS impl with no `_disableInitializers` | **Critical** | | Storage collision proxy/impl | **Critical** | | Forwarding `msg.value` to non-payable target | **High** | | Multicall + signed-msg sender ambiguity | **High** | | Library linkage to wrong address | **High** | | Diamond facet with selfdestruct path | **High** *(see [[selfdestruct-eip6780]])* |
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…