# Deflation attack

SiloVault ERC4626 share price can be deflated to near-overflow by repeated 1-wei deposits that mint shares while totalAssets stays zero, bricking the vault or capturing rewards.

- Payout: Contest reward
- Severity: medium
- Program: Silo Finance
- Credited: d3e4
- Disclosed: 2025-05-23
- Write-up quality: 7/10
- Original: https://code4rena.com/reports/2025-03-silo-finance#m-06
- Library page: https://bugbountylibrary.com/r/c4%3A2025-03-silo-finance%3AM-06
- Tags: domain:web3 impact:dos kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:share-inflation

**Target:** SiloVault ERC4626 vault contract
**Root cause:** Shares are minted from _newTotalSupply and _newTotalAssets+1 with virtual assets hardcoded to 1, so deposits whose market shares round away leave totalAssets at zero while still minting 10**_decimalsOffset() shares, doubling supply each round.
**Steps:**
1. Deposit 1 wei into SiloVault; it deposits into a market which rounds the share away, so totalAssets stays 0 but 10**_decimalsOffset() shares are minted.
2. Repeat 1-wei deposits: each mints another 10**_decimalsOffset() shares without increasing totalAssets, doubling total supply.
3. Alternatively deposit 10 wei for 8 market shares redeemable for 9 assets, minting 9*10**_decimalsOffset() shares; redeem 8*10**_decimalsOffset() shares to withdraw 8 assets, burning all 8 market shares and leaving totalAssets 0 with supply 1*10**_decimalsOffset().
4. Continue until shares-per-asset approaches overflow, bricking the vault or making attacker sole holder of incentive rewards.
**How found:** Reasoned from ERC4626 spec that asset flow favors markets, so SiloVault can lose assets vs share supply; noticed at low totalAssets the mulDiv with _newTotalAssets+1 and hardcoded virtual assets of 1 lets zero-asset deposits still mint shares, doubling supply.
**Exploitation:** Attacker repeatedly deposits minimal wei amounts so market rounding zeroes totalAssets while shares keep minting, driving share supply toward overflow; this either bricks deposits/withdrawals or leaves attacker as guaranteed sole holder collecting incentive rewards.
**Insight:** When auditing ERC4626 vaults wrapping external markets, check whether market-side rounding can zero totalAssets while shares still mint; virtual assets should match virtual shares (10**decimalsOffset) not 1.
