# A malicious early user/attacker can manipulate the LToken's pricePerShare to take an unfair share of future users' deposits

First depositor of Sentiment LToken mints 1 wei then donates assets to inflate pricePerShare, causing later depositors' shares to round to near-zero.

- Payout: Contest reward
- Severity: high
- Program: Sentiment
- Credited: kankodu
- Disclosed: 2022-08-30
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2022-08-sentiment-judging/tree/main/004-H
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-08-sentiment%3AH-1
- Tags: domain:web3 impact:funds-loss kind:contest platform:sherlock sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:precision-loss vuln:share-inflation

**Target:** ERC4626 LToken vault (deposit/convertToShares)
**Root cause:** convertToShares uses mulDivDown(supply, totalAssets()); with supply=1 and totalAssets inflated by direct transfer, later deposits round down to ~0 shares.
**Steps:**
1. Attacker is first depositor: `deposit(1, attacker)` mints 1 wei of shares
2. Attacker transfers `10000e18 - 1` asset tokens directly to LToken, inflating pricePerShare to ~1e22
3. Victim calls `deposit(19999e18, victim)`; previewDeposit returns `19999e18 * 1 / 10000e18 = 1` wei of shares
4. Victim redeems immediately and loses ~9999e18 (half of deposit) to the inflated share price
**How found:** Known ERC4626 share-inflation pattern; reviewers read convertToShares rounding and totalAssets() including raw balanceOf, spotting that direct transfers inflate pricePerShare.
**Exploitation:** Attacker seeds vault with 1 wei, donates large asset balance to inflate share price, then later depositors' shares round down; attacker redeems to capture the donated value plus victim losses.
**Insight:** When auditing ERC4626-style vaults, check whether totalAssets() uses raw balanceOf (donation-inflatable) and whether first-mint has a minimum/dead-shares guard; the 1-wei seed plus direct transfer is the canonical trigger.
