reentrancy-pattern-analysis

Detect reentrancy vulnerability variants in smart contracts via call graphs and CEI compliance.

Updated Feb 25, 2026
One-click install
npx skills add https://github.com/dajneem23/codex-skills --skill reentrancy-pattern-analysis-dajneem23
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reentrancy-pattern-analysis
Source: https://github.com/dajneem23/codex-skills/tree/main/reentrancy-pattern-analysis
Command: npx skills add https://github.com/dajneem23/codex-skills --skill reentrancy-pattern-analysis-dajneem23

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill systematically detects all variants of reentrancy vulnerabilities in smart contracts, ensuring robust security by identifying subtle flaws that traditional tools might miss.

Core Features & Use Cases

  • Comprehensive Detection: Identifies classic, cross-function, cross-contract, read-only, and callback-based reentrancy.
  • In-depth Analysis: Builds call graphs, verifies CEI pattern compliance, and traces state changes relative to external calls.
  • Use Case: When auditing a DeFi protocol that handles token transfers and interacts with multiple other contracts, this Skill can pinpoint potential reentrancy risks that could lead to fund drains or manipulation.

Quick Start

Analyze the provided smart contract code for any reentrancy vulnerabilities.

Frequently Asked Questions about reentrancy-pattern-analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect all reentrancy vulnerability variants in Solidity smart contracts?

Detect all reentrancy vulnerability variants in Solidity smart contracts by analyzing call graphs, verifying CEI pattern compliance, and tracing state changes relative to external calls. This process identifies classic, cross-function, cross-contract, and read-only reentrancy flaws.

What is cross-function and cross-contract reentrancy in DeFi protocols?

Cross-function and cross-contract reentrancy in DeFi protocols occur when external calls trigger unforeseen callbacks into shared state functions or separate contracts. Analyzing the call graph verifies CEI pattern compliance and traces these state changes relative to external calls to expose the vulnerabilities.

How do I check smart contracts for read-only reentrancy and ERC-777 callback vectors?

Check smart contracts for read-only reentrancy and ERC-777 callback vectors by tracing state changes relative to external calls. The analysis builds a comprehensive call graph to detect callback-based reentrancy paths through ERC-777 and ERC-1155 hooks during asset transfers.

Does this reentrancy analysis work for auditing complex multi-contract architectures?

Yes, reentrancy analysis is applicable for auditing complex multi-contract architectures. It systematically builds call graphs to verify CEI pattern compliance and identify subtle cross-contract reentrancy risks that could lead to fund drains or manipulation in DeFi protocols.

What is the best way to audit smart contracts for CEI pattern compliance and external call vulnerabilities?

The best way to audit smart contracts for CEI pattern compliance is to systematically trace state changes relative to external calls. This detects callback vectors through ERC-777 and ERC-1155 hooks, identifying reentrancy vulnerabilities that traditional security tools might miss.

Why does traditional vulnerability detection miss reentrancy flaws in smart contracts?

Traditional vulnerability detection misses reentrancy flaws in smart contracts because it often fails to build comprehensive call graphs or trace state changes relative to external calls. Systematic analysis of ERC-777 and ERC-1155 callback vectors is required to pinpoint these subtle flaws.