# Users will lose a majority or even all of the rewards when the amount of total shares is too large, due to precision loss

Biconomy Hyphen LiquidityFarming divides accumulator by totalSharesStaked, so when staked shares exceed ~1e36 the reward-per-share rounds to zero and stakers get nothing.

- Payout: Audit contest
- Severity: high
- Program: Biconomy
- Found by: WatchPug
- Disclosed: 2022-07-25
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2022-03-biconomy-findings/issues/140
- Library page: https://bugbountylibrary.com/r/c4%3A2022-03-biconomy%3AH-05
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity vuln:accounting-error vuln:precision-loss vuln:reward-distribution

**Target:** Hyphen LiquidityFarming / LiquidityProviders share accounting
**Root cause:** mintedSharesAmount scales with totalSharesMinted/totalReserve and can grow huge; getUpdatedAccTokenPerShare multiplies accumulator by ACC_TOKEN_PRECISION then divides by totalSharesStaked, truncating to 0 once totalSharesStaked exceeds accumulator*precision.
**Steps:**
1. Set rewardsPerSecond = 10e18 and lastRewardTime 24h ago.
2. Alice calls addTokenLiquidity() with 1e8*1e18 XYZ on B-Chain; totalSharesMinted becomes 1e44.
3. Alice calls deposit() into HyphenLiquidityFarming; totalSharesStaked = 1e44.
4. Wait 24h; accumulator = 10e18*86400 = 8.64e23.
5. Claim: accumulator = (8.64e23 * ACC_TOKEN_PRECISION) / 1e44 rounds to 0, so Alice receives 0 instead of 864000e18.
**How found:** Code review of getUpdatedAccTokenPerShare's multiply-then-divide ordering combined with LiquidityProviders' share minting formula, noticing shares can grow arbitrarily large relative to ACC_TOKEN_PRECISION.
**Exploitation:** Any staker (or the sole staker) in a pool whose totalSharesStaked exceeds ~1e36 receives zero rewards because the per-share accumulator truncates to 0; no attacker action needed beyond normal large liquidity provision.
**Insight:** When auditing reward-per-share accumulators, check the magnitude of the share denominator against the precision constant: if shares are minted as amount*totalShares/totalReserve with a large BASE_DIVISOR, the denominator can dwarf precision and truncate rewards to zero.
