# Early user can break pool via inflation attack due to no minimum liquidity check in the incentive contract

Acala incentive contract lacks minimum liquidity, letting an early depositor manipulate share/reward rounding so reward inflation stays zero and later users' rewards are stolen.

- Payout: Contest reward
- Severity: high
- Program: Acala Network
- Credited: carrotsmuggler
- Disclosed: 2024-05-02
- Write-up quality: 7/10
- Original: https://github.com/code-423n4/2024-03-acala-findings/issues/8
- Library page: https://bugbountylibrary.com/r/c4%3A2024-03-acala%3AH-02
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:high tech:rust technique:source-review vuln:business-logic vuln:precision-loss vuln:share-inflation

**Target:** Substrate incentive/rewards pool contract
**Root cause:** No minimum liquidity/share floor in the incentive contract; reward_inflation uses integer division that truncates to 0 when total_reward < total_shares, so deposits can grow total_shares without increasing reward_inflation.
**Steps:**
1. Reach state with total_shares=2 and total_reward=1 (withdraw 998 of 1000 shares, claim rewards, leave 1 reward token).
2. Deposit 1 share: `1*1/2 = 0` reward_inflation, shares counted.
3. initial_total_shares becomes 3; deposit 2 shares, still inflation 0.
4. Repeat doubling deposits (`2**n`) each iteration, growing total_shares while reward_inflation stays 0.
5. Later users' rewards computed as `total_reward * user_shares / total_shares` are diluted/stolen.
**How found:** Code reading of the reward_inflation formula: noticed integer division truncates to 0 whenever total_reward < total_shares, and that no minimum liquidity check prevents reaching that state; connected to known Wise Lending donation/inflation attack pattern.
**Exploitation:** Attacker seeds a tiny pool, drains shares down to 2, leaves 1 reward token, then repeatedly deposits doubling amounts so integer division yields zero inflation; total_shares inflates while total_reward stays flat, capturing rewards owed to subsequent depositors.
**Insight:** When a share/reward formula divides by total_shares, check whether an attacker can drive total_shares low enough that `deposit*total_reward/total_shares` truncates to 0; a zero inflation increment lets deposits grow shares for free and dilute others.
