# First depositor can abuse exchange rate to steal funds from later depositors

First depositor mints 1 wei then donates to inflate share price, so later depositors' deposits truncate to zero shares and are stolen.

- Payout: Contest reward
- Severity: high
- Program: Surge
- Credited: 0Kage
- Disclosed: 2023-02-18
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-02-surge-judging/issues/125
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-02-surge%3AH-2
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:share-inflation

**Target:** ERC4626-style lending pool vault (Pool.sol deposit/withdraw)
**Root cause:** Share price is derived from total assets divided by total supply with integer truncation; no minimum liquidity or dead shares are locked on first deposit, so an attacker can set an arbitrarily high share price.
**Steps:**
1. Attacker is first depositor: call `deposit(1)` to mint 1 share (1 wei).
2. Attacker donates a large amount of the underlying token directly to the pool, inflating assets-per-share.
3. Victim calls `deposit(N)`; shares computed as `N * totalSupply / totalAssets` truncate to 0.
4. Attacker redeems their 1 share, capturing the victim's deposit.
**How found:** Known classic vault inflation pattern; reviewers checked the deposit share-conversion math in Pool.sol for truncation and absence of first-depositor safeguards.
**Exploitation:** Attacker front-runs the first real deposit with a 1 wei deposit plus a direct token transfer to inflate the exchange rate; the victim's shares round down to zero and the attacker withdraws the inflated share value.
**Insight:** On any share-based vault, check whether the first deposit locks minimum liquidity/dead shares; if share math truncates and donations count toward totalAssets, the inflation attack is live.
