asset-flow-analysis

Maps asset storage, movement paths, and leakage points in Solidity smart contracts.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Auditors need a systematic way to answer the attacker's first question about any protocol: where is the money, how does it move, and where can it leak. This Skill provides a structured framework for tracing funds through smart contracts so no deposit, withdrawal, or privileged path is overlooked. ## Core Features & Use Cases - Asset Storage Identification: Catalogs ETH balances, ERC20 holdings, share/LP tokens, and internal accounting variables across vaults, AMMs, lending, staking, and bridge protocols. - Flow Path Mapping: Documents deposit inflows, withdrawal outflows, internal transfers, and privileged admin paths like emergencyWithdraw, skim, sweep, and rescue. - Leakage Detection Patterns: Flags unvalidated withdrawals, precision-loss calculation errors, reentrancy via callbacks, and oracle price manipulation, with ready-to-use grep queries and an output report template. - Use Case: During a vault audit, use this framework to map totalAssets and totalSupply, trace deposit and withdraw flows, and identify a first-depositor inflation attack path before writing the finding. ## Quick Start Analyze this Solidity protocol and produce an asset flow report covering storage locations, deposit and withdrawal paths, and potential leakage points.

Frequently Asked Questions about asset-flow-analysis

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

FAQPage Schema
How do I map asset flows in a Solidity smart contract audit?▼

Start by identifying asset storage such as address(this).balance, token balanceOf, and totalSupply variables. Then trace deposit inflows, withdrawal outflows, internal transfers, and privileged paths like emergencyWithdraw, documenting each in a flow diagram.

What are common asset leakage points in DeFi protocols?▼

Common leakage points include withdrawals without access control, division-before-multiplication precision loss, reentrancy through token callbacks before state updates, and oracle spot price manipulation during liquidation.

How do I find privileged withdrawal functions in smart contracts?▼

Search the codebase with grep patterns for emergencyWithdraw, sweep, rescue, and skim functions. These admin-only paths are high-risk because they can enable rug pulls or unintended asset extraction if access controls are weak.

Does asset flow analysis differ by protocol type?▼

Yes, each protocol type has distinct storage patterns. Vaults use totalAssets and totalSupply, AMMs use reserve0 and reserve1, lending tracks totalDeposits and totalBorrowed, and bridges track lockedAmount and pendingTransfers.

What is a first depositor attack in vault contracts?▼

A first depositor attack occurs when an attacker deposits a small amount, donates funds directly to inflate the share price, then causes subsequent depositors to receive zero or rounded-down shares. It is detected by tracing the deposit path and share calculation logic.