# customPrecisionMultipliers would be rounded to zero and break the pool

Integer division in customPrecisionMultipliers truncates to zero when target price < 1e18, breaking the pool and locking all deposited funds.

- Payout: Audit contest
- Severity: high
- Program: Boot Finance
- Found by: jonah1005
- Disclosed: 2022-01-21
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2021-11-bootfinance-findings/issues/183
- Library page: https://bugbountylibrary.com/r/c4%3A2021-11-bootfinance%3AH-07
- Tags: area:web3 domain:web3 impact:dos impact:funds-loss kind:contest platform:code4rena sev:high tech:evm tech:solidity technique:source-review vuln:accounting-error vuln:precision-loss

**Target:** Solidity customswap pool constructor (Swap.sol)
**Root cause:** customPrecisionMultipliers[0] = originalPrecisionMultipliers[0] * _targetPrice / 1e18; with originalPrecisionMultipliers=1 for 18-decimal tokens and integer _targetPrice, any target price below 1e18 truncates the multiplier to zero.
**Steps:**
1. Deploy pool with an 18-decimal token so originalPrecisionMultipliers[0]=1
2. Set target price to 0.5e18 (integer < 1e18)
3. Constructor computes customPrecisionMultipliers[0] = 1 * 0.5e18 / 1e18 = 0
4. Pool math divides/multiplies by zero multiplier, breaking swaps and locking deposits
**How found:** Code reading of the constructor's fixed-point scaling: noticed originalPrecisionMultipliers is 1 for 18-decimal tokens and _targetPrice is an integer, so the /1e18 division can floor to zero for sub-1.0 prices.
**Insight:** In fixed-point pool math, check every division for truncation when the numerator can be smaller than the scaling factor; a zero precision multiplier silently bricks pool accounting rather than reverting.
