Encyclopedia DeFi · Entry 173
Vault inflation attacks: donations, rounding and first deposits
In this article
At a glance
Key facts
| Fact | Detail | Source |
|---|---|---|
| Rounding | Deposits that convert to less than one smallest share unit can round to zero in the illustrated vulnerable design. | [1] |
| Donation | Adding assets without minting proportional shares can move the conversion rate. | [1] |
| Defense example | OpenZeppelin describes virtual assets and shares with a precision offset as a defense. | [1] |
Use base units to see the rounding problem
Consider an intentionally simplified unprotected vault with one smallest share unit and 100 asset base units after a donation. A deposit of 50 asset units computes 50 × 1 / 100 = 0.5 share units, which rounds down to zero.
The depositor receives no shares in that vulnerable calculation. This assumes the vault accepts the deposit and has no offset or minimum-share protection; it is not the behavior of every deployed vault.
The donation changes who receives future value
The attacker must already hold shares to benefit from increasing assets behind existing shares. A later depositor’s rounding loss can then accrue to those holders.
A donation by itself is not proof of an attack or of profitability. Share ownership, precision, transaction ordering and protection mechanisms determine the actual outcome.
Inspect the implementation and transaction limits
OpenZeppelin explains how virtual balances and increased share precision reduce rounding exposure and make its illustrated donation attack costly. Those properties must actually be present in the implementation being assessed.
ERC-4626 also tells integrators to handle slippage and unexpected conversion changes. Review the exact contract version and caller-enforced minimum outcome rather than assuming a familiar vault interface guarantees safe accounting.
Direct answers
Questions people ask
Does any increase in assets per share mean the strategy earned yield?
No. A direct asset donation can change the conversion without strategy earnings. Establish the cause before presenting a share-price change as investment performance.
Inspect the evidence
The answer and key facts have stable claim links. These records retain the scope and qualification when reused.
A vault inflation attack manipulates the assets-to-shares conversion of a vulnerable vault, often using a donation when few shares exist. A later deposit can then round to very few or even zero shares, shifting value toward existing holders. The weakness depends on implementation; ERC-4626 compatibility alone does not establish that a vault has suitable defenses.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:19:48.887Z.
Link to this claimRounding: Deposits that convert to less than one smallest share unit can round to zero in the illustrated vulnerable design.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:19:48.887Z.
Link to this claimDonation: Adding assets without minting proportional shares can move the conversion rate.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:19:48.887Z.
Link to this claimDefense example: OpenZeppelin describes virtual assets and shares with a precision offset as a defense.
Scope: DeFi · data through 2026-10-02. Verification: verified · 2026-10-02T18:19:48.887Z.
Link to this claimRevision history
- — First publication after primary-source research and independent automated verification.
Source register
Sources and references
Retrieval dates and locators are recorded individually.- ERC-4626OpenZeppelin
Vault share conversion, rounding, donations and inflation-attack defenses.
Locator: Security concern: Inflation attack; Defending with a virtual offset · Version / scope: OpenZeppelin Contracts 5.x · Retrieved: 2026-10-02T17:03:43.088ZOpen source - Tokenized VaultsEthereum Improvement Proposals
Assets, shares, deposits, withdrawals, limits and preview rounding.
Locator: Specification; Security Considerations · Version / scope: EIP/ERC-4626; retrieved document hash recorded · Retrieved: 2026-10-02T17:03:42.366ZOpen source
Research and drafting use AI assistance. A separate automated review checks claims against primary sources; no external expert or named human review is implied. Publication, substantive editing, source retrieval and verification are recorded separately. This version was independently checked by an automated reviewer on 2 October 2026.
Editorial method and correctionsDegrees of Satoshi editorial project. “Vault inflation attacks: donations, rounding and first deposits.” Published 2026-10-02; updated 2026-10-02. https://degreesofsatoshi.com/encyclopedia/vault-inflation-attacks/