/auditsentry:integer-issuesfrom auditsentry
Detects integer overflow/underflow, downcasting losses, fixed-point precision errors, and division-before-multiplication in Solidity. Activates on unchecked blocks, SafeCast, and DeFi math.
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.
unchecked { … } blocks (Solidity ≥0.8)uint128(x), int256(uint256(x)), uint8(...)unchecked {
balance[to] += amount; // ← if amount controlled, can overflow back to 0
}
unchecked is fine for proven-safe accumulators (e.g. ++i in bounded loops), not for value math.
uint256 fee = (amount / 100) * feeBps; // ← truncation; do (amount * feeBps) / 100
USDC = 6 decimals, WETH = 18, WBTC = 8. Mixing without scaling produces silent 1e10–1e12 errors.
uint256 wethValue = amountUsdc * price; // ← USDC 6dp × price 8dp = 14dp, need 18dp
uint128 sharesU128 = uint128(shares); // ← silently truncates if shares > 2^128
Use OZ SafeCast.
Compounding interest done as principal * (1 + rate)^t with too-few-decimal rate. Use ray (1e27) or wad (1e18) math via PRBMath / Solady.
ERC-4626 must round shares down on deposit (favor vault) and up on withdraw (favor vault). Reversed direction = donations-style drain. Use OZ Math.mulDiv(_, _, _, Rounding.Down/Up).
int256 delta = int256(a) - int256(b); // a or b might be > 2^255, becomes negative silently
block.timestamp granularity differs (2s on Optimism, 250ms on Arbitrum). Slot-based deadlines can be off.
Custom sqrt implementations are notorious. Use Solady/PRBMath.
fee_bps should be capped (fee_bps <= 10_000).
| Pattern | Severity |
|---|---|
| Unchecked overflow on user input | High |
| ERC-4626 round-direction wrong | High |
| Decimal-mismatch in price/balance math | High |
| Downcast losing high bits silently | High |
| Division before multiplication on financial-critical path | High |
| Custom sqrt/log without overflow proof | Medium |
| Bps fee with no cap | Low |
| Loop index underflow in pre-0.8 code | High |
| Modulo-zero on attacker-controlled divisor | High |
unchecked proven-safe (e.g. ++i in for loops bounded by array length).SafeCast for downcasts.Math.mulDiv (OZ) for multiply-then-divide without intermediate overflow.Math.mulDiv(..., Rounding.Down) on deposits, Rounding.Up on withdrawals; or use OZ's ERC4626Upgradeable which handles this.unchecked { ++i; } in for loops with i < arr.length is the canonical safe use — not a finding.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
45 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./centralization-riskDetect centralization and trust-assumption risks — admin powers, single-key risk, missing timelocks, upgrade authority, treasury keys, pause permanence, blacklisting authority, oracle authority. Activate on `onlyOwner`, `onlyRole`, `AccessControl`, upgrade authorizations, pause/unpause functions, mint/burn caps, treasury/fee setters./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`.npx claudepluginhub iktok90-design/ai-smart-contract-auditor --plugin auditsentryOther plugins' skills for the same job