DeFi Security · Vulnerability class
Accounting and share-price errors
Internal records of who owns what drift apart from the real token balance or from each other, so someone can redeem more than they put in.
The concept
Pooled vaults, ledgers and vesting contracts depend on invariants such as total shares equal the sum of positions. Direct token transfers, failed callbacks and stale counters can break them.
Defensive lessons
- Write the invariant down and test it in every call order.
- Update every record in the same place a quantity changes.
- Treat direct token transfers as inputs.
- Compare internal balances with real holdings, and pause automatically if they diverge.
Stored incidents
2026-10-14 · reported loss $808K
UNCX Vesting V2: share records and token balance made to disagreeOfficial statement
2026-09-29 · reported loss $3.8M
NEAR Intents: ghost funds from a deposit notification bugOfficial statement