skills/vulnerability-patterns/share-accounting-desynchronization/SKILL.md
Asset/share systems drift out of sync across views, transfers, or reward logic, enabling value leakage, bypasses, or protocol lockups.
npx skillsauth add apegurus/solidity-argus share-accounting-desynchronizationInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Share-accounting desynchronization appears when a protocol tracks ownership in shares but exposes user actions, approvals, rewards, or integrations in asset-denominated values without guaranteed synchronization. If share supply, token supply, and fee accrual are updated at different times or with inconsistent caps, attackers and edge cases can exploit the mismatch to bypass approvals, drain value, lock funds, or break reward accounting.
Unlike a single arithmetic bug, this is a system-level failure of consistency across view logic, state updates, and transfer semantics.
pending, preview, realBalance) against state-changing mint/burn/update behavior.Adopt a single canonical accounting model and centralize conversions in audited helper functions with documented rounding policy. Enforce that view and state paths share the same cap logic and fee-mint assumptions. Add invariant tests ensuring assets <-> shares coherence under updates, pauses, and collector changes. When conversions can become stale, force synchronization before sensitive operations or require bounded slippage from callers. This reduces drift accumulation and makes behavior predictable for integrations.
testing
Specialist profile for mechanically applying the attack-vector deck and classifying vectors as skip, drop, or investigate.
tools
Specialist profile for libraries, helpers, base contracts, adapters, encoders, wrappers, and integration glue.
testing
Specialist profile for rounding, scale, decimal, downcast, and arithmetic accounting edge cases.
testing
Specialist profile for extracting conservation laws and state couplings, then searching for violating paths.