# First user can inflate `pointsPerShare` and cause `_correctPoints()` to revert due to overflow

First depositor mints 1 wei then distributes rewards, inflating pointsPerShare so later deposits overflow in _correctPoints, bricking mints/burns and locking funds.

- Payout: Contest reward
- Severity: medium
- Program: Merit Circle
- Credited: WATCHPUG
- Disclosed: 2022-10-14
- Write-up quality: 7/10
- Original: https://github.com/sherlock-audit/2022-10-merit-circle-judging/issues/103
- Library page: https://bugbountylibrary.com/r/sherlock%3A2022-10-merit-circle%3AM-5
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:dos vuln:share-inflation

**Target:** AbstractRewards/BasePool liquidity mining contracts
**Root cause:** pointsPerShare uses POINTS_MULTIPLIER ~ type(uint128).max; with only 1 wei of shares, a reward distribution inflates pointsPerShare to ~3e59, and _correctPoints computes _shares * pointsPerShare which overflows int256 for later users.
**Steps:**
1. `deposit(1 wei)` with 10 min lock, `mint()` 1 wei shares
2. `distributeRewards(1000e18)` -> `pointsPerShare += 1000e18 * type(uint128).max / 1` ~= 3e59
3. Victim `deposit(100e18)` for 1 year, `mint()` 150e18 shares
4. `_shares * pointsPerShare == -150e18 * 3e59` exceeds type(int256).min, transaction reverts
5. Tune pointsPerShare slightly lower so overflow only triggers after a chosen deposit volume
**How found:** Noticed POINTS_MULTIPLIER is unusually large (type(uint128).max) as a precision fix, reasoned that with tiny initial share supply pointsPerShare can be driven near int256 max, then traced _correctPoints multiplication for overflow.
**Exploitation:** Attacker is first depositor with minimal capital (1 wei), calls distributeRewards to inflate pointsPerShare, then later mints/burns revert in _correctPoints, trapping prior depositors' funds.
**Escalation:** Precisely tuning pointsPerShare so the system works briefly then bricks after accumulated deposits, maximizing trapped funds.
**Insight:** When a share/points accumulator uses a huge precision multiplier, check the first-depositor case: tiny share supply lets a single reward distribution blow up the accumulator and overflow downstream multiplications.
