<< All versions

Skill v1.0.0

currentAutomated scan100/100
bittersecurity/vigilo/code-analysis
──Details
PublishedSeptember 29, 2026 at 09:15 PM
Content Hashsha256:a25f6c5afa9ec654...
Git SHA
──Files
Files (1 file, 5.6 KB)
SKILL.md5.6 KBactive
SKILL.md · 218 lines · 5.6 KB

version: "1.0.0" name: code-analysis description: > Auto-loaded by explorator agent during Audit Phase 1 (Reconnaissance). Provides methodology for: contract structure mapping, execution flow tracing, protocol type classification, and entry point identification. Output: .vigilo/recon/code-findings.md user-invocable: false


Code Reconnaissance Methodology

Purpose

Rapidly understand what the code does through structural analysis and flow tracing. This is reconnaissance, not vulnerability hunting.


1. File Discovery

By Language

LanguageFind FilesFramework Markers
SolidityGlob("**/*.sol")foundry.toml, hardhat.config.*
RustGlob("**/programs/**/*.rs")Anchor.toml, Cargo.toml
CairoGlob("**/*.cairo")Scarb.toml
MoveGlob("**/*.move")Move.toml

Skip These

  • test/, tests/, *.t.sol, *.test.sol
  • mock/, mocks/, *Mock.sol
  • node_modules/, lib/ (dependencies)
  • Generated/compiled files

2. Contract Structure Analysis

For Each Contract, Extract:

Contract: {Name}
File: {path}
Purpose: {one line description}
Inherits: {parent contracts}
Key State: {important state variables}
Entry Points: {external/public functions}

Inheritance Mapping

BaseContract
├── ChildA
│ └── GrandchildA1
└── ChildB

External Dependencies

ImportTypeNotes
@openzeppelin/...Standard libUsually safe
@chainlink/...OraclePrice dependency
@uniswap/...DEX integrationExternal call

3. Flow Tracing

The Core Question

"How does value enter, move through, and exit this protocol?"

Entry Flows (How users put value in)

PatternFunction NamesWhat Happens
Depositdeposit, supply, provideAssets in, receipts out
Stakestake, lock, bondAssets locked, tracking updated
Swap Inswap, exchangeAsset A in, Asset B out
Mintmint, createPayment in, tokens created

Internal Flows (How value transforms)

PatternWhat to Look For
CalculationsFee deductions, interest accrual, share pricing
State ChangesBalance updates, position tracking
Internal CallsFunction-to-function flow within contract
External CallsInteractions with other contracts

Exit Flows (How users get value out)

PatternFunction NamesWhat Happens
Withdrawwithdraw, remove, redeemReceipts burned, assets out
Unstakeunstake, unlock, unbondAssets released
Claimclaim, harvest, collectRewards distributed

Privileged Flows (Admin operations)

PatternRisk LevelWhat to Note
emergencyWithdrawHighCan bypass normal checks
sweep, rescueHighCan move arbitrary tokens
pause, unpauseMediumCan halt operations
setFee, setRateMediumCan change economics

4. Protocol Type Classification

Identify by Code Patterns

Protocol TypeKey IndicatorsMain Flows
AMM/DEXreserve0, reserve1, k, swap(), addLiquidity()swap, add/remove liquidity
Lendingborrow(), collateral, liquidate(), interestRatesupply, borrow, repay, liquidate
VaulttotalAssets(), totalSupply(), shares, ERC4626deposit, withdraw, yield
Governancepropose(), vote(), execute(), quorumpropose, vote, execute
Stakingstake(), rewards, epoch, rewardPerTokenstake, claim rewards
Bridgelock(), mint(), relayMessage(), noncelock on L1, mint on L2

5. Asset Storage Patterns

ETH Storage

solidity
// Direct balance
address(this).balance
// Wrapped
WETH.balanceOf(address(this))

Token Storage

solidity
// External balance check
IERC20(token).balanceOf(address(this))
// Internal accounting
mapping(address => uint256) balances;
uint256 totalDeposited;

Share/Receipt Tokens

solidity
// Protocol issues these
mapping(address => uint256) shares;
uint256 totalSupply;
function balanceOf(address) external view returns (uint256);

6. Notable Patterns to Mark

Mark location only. No analysis needed - Phase 2 handles that.

PatternWhy Notable
.call{value:}External call with ETH
delegatecallCode execution delegation
External contract callsTrust boundary crossing
onlyOwner, onlyAdminPrivileged operations
Oracle integrationExternal data dependency
Complex mathPotential calculation issues
Assembly blocksLow-level operations

7. Search Queries

Find Entry Points

Grep("function.*external|function.*public", glob="**/*.sol")

Find Asset Movements

Grep("transfer\\(|transferFrom\\(|safeTransfer", glob="**/*.sol")

Find Privileged Functions

Grep("onlyOwner|onlyAdmin|onlyRole|require.*msg\\.sender", glob="**/*.sol")

Find External Calls

Grep("\\.call\\{|\\.delegatecall\\(|address\\(.*\\)\\..*\\(", glob="**/*.sol")

Output

Write findings to .vigilo/recon/code-findings.md following the format in template.md.


Additional Resources

All versions