Skip to free scan
high

ERC-4626 INFLATION ATTACKS

September 14, 2026Updated September 15, 2026
Chainsethereumarbitrumbaseoptimismpolygonbnb-chainavalanche
Review toolsslithermythrilechidnahound-ai

Severity depends on reachable impact and deployment context. Listed tools are review aids; their applicability depends on language, version and configuration.

An ERC-4626 inflation attack manipulates a vault's asset-to-share exchange rate so a later depositor receives too few shares. In the strongest first-deposit case, integer rounding can reduce the victim's result to zero, leaving the deposited assets for existing shareholders.

MECHANISM AND CONDITIONS

ERC-4626 standardizes tokenized-vault conversions but does not prescribe one complete economic defense. Many implementations derive total assets from the vault's live token balance.

In an empty vault, an attacker can deposit a small amount to become the first shareholder, then transfer assets directly to the vault without minting shares. This donation raises assets per share. If a victim's subsequent deposit is small relative to that manipulated rate, the share calculation rounds down. The attacker can later redeem its shares for part or all of the victim's deposit.

The attack depends on conversion math, rounding direction, initial supply, whether unsolicited transfers count as managed assets, and any minimum-share or slippage check. A balance-based totalAssets function is not automatically defective: donations may intentionally accrue to shareholders, and a sufficiently initialized vault may make manipulation uneconomic.

REVIEW AND TEST GUIDANCE

Trace deposit, mint, withdraw, redeem, preview, and conversion functions together. Confirm the previews use the rounding directions required by the standard and agree with execution under the same state. Identify virtual assets or shares, decimal offsets, seeded liquidity, internal accounting, entry fees, and any router-enforced minimum output.

Test an empty vault, one unit of supply, direct donations before and after a pending deposit, repeated small deposits, and a vault returning to near-empty state after redemptions. Fuzz attacker deposit, donation, victim deposit, decimals, and rounding boundaries. Measure attacker profit after accounting for the portion of the donation that cannot be recovered.

Assert that a deposit either mints at least the caller's minimum acceptable shares or reverts. Also test integrators: a safe vault can still expose users if a router accepts any share output.

MITIGATION AND LIMITS

OpenZeppelin's ERC-4626 security guide describes virtual assets, virtual shares, and a configurable decimal offset. These mechanisms capture part of a donation and increase share precision, changing the attack's economics. Choose the offset with the asset's decimals and integration behavior in mind.

Other designs include seeding non-redeemable minimum liquidity, excluding unsolicited transfers through internal accounting, and requiring minimum shares at the user-facing entry point. Do not mint dead shares to the zero address with a standard ERC-20 implementation, which normally rejects zero-address minting. Internal accounting also needs a deliberate policy for yield, losses, and token rebases.

A zero-share revert prevents total loss on that transaction but does not cap lesser rounding loss. Slippage protection and realistic minimum deposit rules remain useful.

Repository analysis can flag balance-based accounting, empty-vault branches, rounding, and missing minimum-output checks. It cannot establish live vault state, pending transaction order, token behavior, or economic profitability without deployment-specific simulation.

FREQUENTLY ASKED QUESTIONS

Does every ERC-4626 vault have this vulnerability?

No. Exposure depends on its conversion math, initialization, donation handling, and caller protections.

Do virtual shares make manipulation impossible?

No. They can make the classic attack uneconomic under modeled conditions. They do not replace slippage limits, integration review, or testing.

Firepan

Scan Your Contracts Now

Run a free scan — results in minutes, no credit card required.

Run Free Scan →