# zeroswap/UniswapV2Pair.sol Token reserves per lp token can be manipulated due to lack of MINIMUM_LIQUIDITY when minting the first liquidity with migrator

Migrator path in zeroswap UniswapV2Pair skips MINIMUM_LIQUIDITY lock, letting an attacker mint 1 wei LP then inflate reserves to steal later depositors' funds.

- Payout: Audit contest
- Severity: medium
- Program: Canto
- Found by: WatchPug
- Disclosed: 2022-10-18
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2022-06-newblockchain-findings/issues/162
- Library page: https://bugbountylibrary.com/r/c4%3A2022-06-canto%3AM-08
- Tags: area:web3 domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:business-logic vuln:share-inflation

**Target:** zeroswap UniswapV2Pair.sol mint() / Migrator.sol
**Root cause:** When _totalSupply==0 and msg.sender is the migrator, liquidity is set to desiredLiquidity without minting/burning MINIMUM_LIQUIDITY to address(0), so the first LP position can be arbitrarily small.
**Steps:**
1. Attacker becomes migrator-authorized minter (or migrator path reachable) and mints 1 wei of LP via desiredLiquidity=1.
2. Attacker transfers large amounts (e.g. 1e24) of token0/token1 directly to the pair and calls `sync()` to inflate reserves.
3. Victim calls addLiquidity with ~1.99e24; liquidity = min(amount*_totalSupply/_reserve) rounds to 1 wei LP.
4. Victim receives 1 wei LP for ~1.99e24 tokens; attacker redeems LP to capture the difference.
**How found:** Code review of the mint() branch: noticed the migrator branch skips the MINIMUM_LIQUIDITY mint that UniswapV2 uses to prevent first-depositor share inflation, then traced Migrator.migrate setting desiredLiquidity=lp.
**Exploitation:** Attacker seeds a pair with 1 wei LP through the migrator path, donates large token balances and syncs reserves, then lets subsequent depositors' liquidity be rounded down to near-zero LP shares, extracting the donated value on redemption.
**Insight:** When auditing forks of UniswapV2, diff the first-mint branch against upstream: any alternate path (migrator, hooks, admin mint) that sets liquidity without locking MINIMUM_LIQUIDITY reopens the classic share-inflation/donation attack.

