# First depositor can break minting of shares

First depositor mints 1 share for 2 wei then donates 1M tokens to inflate share price, causing later depositors to receive 0 shares.

- Payout: Audit contest
- Severity: high
- Program: prePO
- Found by: GreyArt
- Disclosed: 2022-05-09
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-03-prepo-findings/issues/27
- Library page: https://bugbountylibrary.com/r/c4%3A2022-03-prepo%3AH-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:share-inflation

**Target:** Collateral.sol deposit/share minting
**Root cause:** Share price is derived from total assets including unsolicited donations to the strategy controller, and deposit() does not require minted shares to be non-zero, so a single inflated share makes subsequent deposits round to zero.
**Steps:**
1. Attacker deposits 2 wei (above 1 wei fee) to mint 1 share.
2. Attacker transfers 1,000,000 tokens directly to `_strategyController`, which deposits its full balance to the strategy on `deposit()`, inflating share price.
3. Victim deposits 10,000 tokens via `collateral.deposit(10000e18)`.
4. Victim receives 0 shares (`collateral.balanceOf(victim) == 0`); deposit accrues to attacker's single share.
**How found:** Recognized the classic first-depositor / donation share-inflation pattern (referenced ToB Yearn vault finding) and confirmed via a Foundry/Hardhat test showing 0-share issuance.
**Exploitation:** Attacker needs only 2 wei plus a large donation to the strategy controller to become sole share holder; subsequent depositors' funds are captured by the attacker's single share since minted shares round down to zero.
**Insight:** In vault-style share accounting, check whether total assets include direct token transfers to the strategy/controller; if so, a 1-share holder can inflate price and round later mints to zero. Test deposit() with a tiny first deposit followed by a large direct transfer.
