/auditsentry:centralization-riskfrom auditsentry
Audits Solidity smart contracts for centralization and trust-assumption risks including admin powers, single-key control, missing timelocks, upgrade authority, and treasury key risks.
Ships in auditsentry. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Centralization findings are non-exploits in the traditional sense, but they're the most common reason audits flag a protocol as "rugpullable". The protocol can be the attacker. Investors deserve a clear inventory.
_authorizeUpgrade)contract X is Ownable {
function upgradeTo(address impl) external onlyOwner { ... }
function setFee(uint256 fee) external onlyOwner { ... }
// ← one key, can pull rug
}
Findings:
onlyOwner upgrades / fee changes / oracle changes that take effect immediately. Add a Timelock (OZ TimelockController), document the delay.
pause() with no auto-unpause. Owner can permanently freeze user funds.
function mint(address to, uint256 amt) external onlyMinter { _mint(to, amt); } // ← no cap, inflation risk
A blacklist(address) function with no public criteria = "the protocol's discretion to freeze you".
function setOracle(address o) external onlyOwner { oracle = IOracle(o); }
Admin → switches to malicious oracle → liquidates everyone.
recoverERC20(token) that can sweep user deposits.
Users should have a window after upgrade announcement to withdraw if they disagree. Without it, governance can rug by upgrade.
Ownable renounced but DEFAULT_ADMIN_ROLE retained. Or admin role transferred to a smart contract that has its own backdoor.
Marketed as "multi-sig" but threshold == 1 defeats the purpose.
Single sequencer / centralized validator set. Document for bridges + L2 deployments.
Owner can drain treasury immediately.
selfdestruct reachable by admin (MEDIUM-HIGH)See [[selfdestruct-eip6780]].
| Pattern | Severity |
|---|---|
| EOA controls upgrade + treasury + oracle | Critical (for trust report) |
| Pause with no auto-unpause | High |
| Mint with no cap | High |
| Unrestricted blacklist | High |
| No timelock on key params | High |
| Sweep includes user deposits | High |
| Multisig threshold = 1 | High |
| Renounce + retained admin role | High |
| Timelock < 24h on high-impact ops | Medium |
| Single-sequencer L2 | Medium-Info (contextual) |
Centralization findings should produce a "Trust report" section in /report:
Admin powers:
setOracle— can replace price oracle → drain liquidations (no timelock).upgradeTo— can swap implementation (UUPS, no timelock).recoverERC20— can sweep any token, including user deposits.pause— can freeze withdrawals indefinitely (no auto-unpause).setFee— can set fee to 100% (no cap).Mitigations in place:
- Owner is a Gnosis Safe at
0x…with 3/5 threshold.- 24h Timelock at
0x…mediatessetOracleandupgradeTo.Trust assumption: Users must trust the multi-sig signers and the 24h timelock window.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub iktok90-design/ai-smart-contract-auditor --plugin auditsentry45 skills in this plugin
/access-controlDetect missing or incorrect access control — missing modifiers, wrong role checks, privileged function exposure, public initializers, and role-escalation paths. Activate on any function that mutates state, transfers funds, mints tokens, sets admin parameters, upgrades implementations, or pauses/unpauses./approval-issuesDetect ERC-20 approval pitfalls — approve race (front-run), missing safeApprove, infinite approvals, approval-without-revoke, Permit2 misuse, max-approval to untrusted contracts. Activate on `approve`, `safeApprove`, `permit`, `forceApprove`, `Permit2`, `IERC20.allowance`./caching-and-incrementalAlways-on meta-skill — cache audit results per file by content hash so unchanged files aren't re-analyzed on subsequent runs. Activate on every /audit, /quick-scan, /audit-changes invocation./confidence-scoringAlways-on meta-skill — for every finding produced, attach a confidence level (HIGH/MEDIUM/LOW) and a reasoning trace. Activate on every /audit, /audit-deep, /audit-changes, /audit-live, /quick-scan invocation./cosmwasmDetect bug classes specific to CosmWasm (Rust) contracts — missing info.sender authorization in execute handlers, unbounded map iteration → gas/DoS, reply/submessage reply_id confusion, migrate admin backdoors, addr_validate vs raw string addresses, unchecked info.funds, Uint128 overflow, query reentrancy, and migration/version state. Activate on any `.rs` file with `use cosmwasm_std`, `#[entry_point]`, `ExecuteMsg`, `InstantiateMsg`, `QueryMsg`, `cw_storage_plus`, or `DepsMut`./cross-chain-messagingDetect cross-chain messaging bugs — replay protection gaps, untrusted-remote acceptance, default-config inheritance, validator-set misconfig, force-include vulnerabilities, chainId / domain-separator omissions. Activate on `_lzReceive`, `ccipReceive`, `handle` (Hyperlane), `receiveMessage`, `verifyVAA`, IRouterClient, IMailbox, EndpointV2, OApp/OFT, LayerZero / CCIP / Hyperlane / Wormhole / Axelar / Polyhedra integration code.Other plugins' skills for the same job