dragonked2/alphacode/defi-accounting

Claude Code and agent skill by dragonked2/alphacode

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

DeFi accounting analysis — ERC4626 share inflation, donation attacks, rounding, decimal mismatch, desync, phantom value, fee/reserve errors. Load when vaults, shares, or paired state variables exist.

Install

npx vskill@latest install dragonked2/alphacode/defi-accounting

SKILL.md

DEFI ACCOUNTING

Core test: paired-state walk

For every pair that must stay in sync (totalAssets/totalSupply, debt/collateral, reserves/LP, balances/accounting):

  1. List all writers of A and all writers of B.
  2. For each path writing A: does it write B? In which order?
  3. Flag early returns, fast paths, callbacks, and donation-receivable

functions (anything accepting raw transfer without deposit).

Bug shapes

  • Share inflation (empty/near-empty vault): deposit 1 wei, donate to

inflate totalAssets, victim deposit rounds to 0 shares. Check _decimalsOffset() / virtual shares; absence on an ERC4626 is a red flag.

  • Donation via direct transfer: totalAssets() reading

token.balanceOf(vault) diverges from internally tracked balances.

  • Rounding direction: mint rounds down, withdraw rounds up — verify

each preview*/convertTo* pair; test first/last wei amounts.

  • Decimal mismatch: underlying (6) vs shares (18) vs oracle (8);

trace every scale factor at mint, conversion, and liquidation.

  • Stale/desynced views: interest accrual, rewards, or strategy profit

updated on some paths only; read-only re-entry returning stale data.

  • Missing debit/credit: deposit path credits but withdraw path skips

the debit on one leg (compare sibling functions line by line).

  • Fee/reserve errors: fees taken from the wrong base, reserves

double-counted as both backing and profit.

Grep anchors

bash
grep -rn "totalAssets\|totalSupply\|totalDebt\|convertTo\|previewDeposit\|previewMint\|_decimalsOffset" contracts/
grep -rn "balanceOf(address(this))" contracts/

Rule

Never report an accounting anomaly without showing the attacker-controlled economic effect: which invariant breaks, the before→after state transition, and the asset movement. A rounding error worth 1 wei with no amplification path is informational at best.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
216
Repository forks
16
7-day trend score
32

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
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/dragonked2/alphacode/defi-accounting/badge)](https://verified-skill.com/skills/dragonked2/alphacode/defi-accounting)

Something wrong with this skill or its page? Tell us.