iktok90-design/ai-smart-contract-auditor/reentrancy
Claude Code and agent skill by iktok90-design/ai-smart-contract-auditor
- community
Checking that the SKILL.md file is still in the repository.
Detect reentrancy vulnerabilities — classic, cross-function, and cross-contract (especially read-only reentrancy). Activate whenever Solidity/Vyper code performs external calls, low-level call/transfer/send, ERC-721 safeTransfer with a receiver hook, or any pattern where control flow leaves the contract before state finalization.
Install
npx vskill@latest install iktok90-design/ai-smart-contract-auditor/reentrancySKILL.md
Reentrancy detection
When this applies
Trigger on any of:
- External calls via
call,delegatecall,staticcall,transfer,send safeTransferFrom/onERC721Received/onERC1155Receivedcallbacks- ERC-777
tokensReceived/tokensToSendhooks - Cross-contract calls preceding state writes
- View functions that read state which is mid-update (read-only reentrancy)
- Custom token callbacks, governance vote-cast hooks, flash-loan callbacks
- Compound/Aave-style accounting that updates user balances after external transfers
Detection patterns
Classic reentrancy (CRITICAL / HIGH)
Signal: state mutation after external call. CEI (Checks-Effects-Interactions) violated.
Cross-function reentrancy (HIGH)
Two functions sharing state where one calls externally and the other reads/mutates the same state. Attacker re-enters via the second function.
Cross-contract reentrancy (HIGH)
Contract A updates state, calls B; B calls back into a different contract C that reads A's stale state.
Read-only reentrancy (HIGH — frequently missed)
Victim contract reads getReserves() / getPrice() from a pool mid-callback, before the pool finalizes its state. Example: Curve pools, Balancer vaults, Uniswap V2 mid-removeLiquidity.
ERC-777 / ERC-721 hook reentrancy (HIGH)
_safeTransfer calls onERC721Received on the recipient — if recipient is a contract, it can re-enter.
Severity rubric
| Pattern | Severity | Notes | |
|---|---|---|---|
| Funds-draining classic reentrancy | Critical | Direct loss of funds, no preconditions | |
| Cross-function with shared balance state | High | Requires specific call sequence | |
| Read-only reentrancy on price/oracle read | High | Common pattern, often missed | |
Reentrancy gated by onlyOwner / trusted role | Medium | Centralization-bounded | |
| ERC-777 hook with no state-after-call writes | Low | Defense-in-depth issue | |
| Single-actor self-reentrancy with no value flow | Info |
Remediation patterns
- CEI ordering — effects before interactions, always.
- `nonReentrant` modifier (
ReentrancyGuardfrom OpenZeppelin). Add per-function. - For read-only reentrancy — guard the view function too, or use a separate "settled price" cache that only updates outside callbacks. Curve's solution:
withdraw_admin_feeslock, Balancer'sensureNotInVaultContext. - Pull over push payments — let users withdraw rather than pushing transfers.
- Token whitelist — avoid ERC-777 and rebasing tokens in untested paths.
False-positive notes
- A function that uses
nonReentrantfrom a known-good library and only calls trusted contracts is generally safe — note it but don't flag as Critical. transfer(2300 gas) blocks classic reentrancy but is brittle on L2s with higher base gas costs — flag as a separate issue, not as reentrancy resolved.- Reentrancy into a function that only reads (no state writes downstream) and that read isn't used in a check — Info, not High.
Related
- [[oracle-manipulation]] — read-only reentrancy often is an oracle issue
- [[token-compatibility]] — ERC-777 / rebasing tokens widen the attack surface
- [[delegatecall-risks]] — delegatecall through untrusted target = reentrancy + storage corruption combo
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/reentrancy/SKILL.md
Popularity
- Repository stars
- 37
- Repository forks
- 5
- 7-day trend score
- 18
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/iktok90-design/ai-smart-contract-auditor/reentrancy)