state-sync-analysis

Identifies state inconsistency windows and reentrancy attack vectors in Solidity smart contracts.

66|17|Updated Jan 21, 2026
One-click install
npx skills add https://github.com/BitterSecurity/Vigilo --skill state-sync-analysis-bittersecurity
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: state-sync-analysis
Source: https://github.com/BitterSecurity/Vigilo/tree/main/packages/claude/skills/protocol-analysis/state-sync-analysis
Command: npx skills add https://github.com/BitterSecurity/Vigilo --skill state-sync-analysis-bittersecurity

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Smart contract audits often miss vulnerabilities where on-chain state becomes temporarily inconsistent during external calls, enabling read-only reentrancy, CEI violations, and cross-contract manipulation. This Skill provides a structured framework to systematically find and document those gaps. ## Core Features & Use Cases - State Dependency Mapping: Builds dependency graphs across same-contract, cross-contract, and view-function state relationships. - Inconsistency Window Detection: Classifies pre-update, partial-update, and post-update windows around external calls and checks CEI pattern compliance. - Timing Attack Scenarios: Models read-only reentrancy, cross-contract state races, and flash loan manipulation with timeline-based exploit walkthroughs. - Use Case: During a DeFi vault audit, use this framework to trace a withdraw() function's external token transfer, discover that totalAssets() returns stale values during the callback, and document a read-only reentrancy finding affecting an integrated lending protocol. ## Quick Start Ask the reentrancy-auditor agent to run state sync analysis on the target Solidity contracts and report all inconsistency windows with CEI compliance status.

Frequently Asked Questions about state-sync-analysis

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

FAQPage Schema
How do I detect read-only reentrancy in Solidity contracts?▼

Read-only reentrancy occurs when a view function returns stale state during an external call callback. Trace functions that update state before making external calls, then check whether view functions like totalAssets() are consumed by external protocols during that window.

What is the CEI pattern and why does it matter for audits?▼

CEI stands for Checks-Effects-Interactions: validate inputs, update state, then make external calls last. Violating this order leaves state inconsistent during callbacks, enabling reentrancy exploits where attackers act on outdated values.

How can flash loans exploit state inconsistency windows?▼

Flash loans let attackers manipulate pool reserves or oracle prices within a single transaction, call a vulnerable function that reads the manipulated state, then restore values before repaying the loan. The analysis models this as a timing attack scenario.

Does this analysis work for cross-contract dependencies?▼

Yes, the framework maps cross-contract dependencies such as a vault reading an oracle price, and builds a state dependency graph showing risk paths where an attacker manipulates one contract to corrupt another's reads.

What are the limitations of static state sync analysis?▼

Static analysis identifies potential inconsistency windows but cannot confirm exploitability without considering runtime conditions like reentrancy guards, oracle update mechanisms, and access controls. Findings should be validated with proof-of-concept exploits.