Submitted by WatchPug, also found by danb
Wrong arithmetic.
https://github.com/code-423n4/2022-01-insure/blob/19d1a7819fe7ce795e6d4814e7ddf8b8e1323df3/contracts/PoolTemplate.sol#L700-L717
[Index Pool 1]:
[Index Pool 2]:
In most cases, the transaction will revet on underflow at:
In some cases, specific pools will be liable for unfair compensation:
If the CSD is empty, Index Pool 1 only have 6,000 * 10**18 and Index Pool 2 only have 4,000 * 10**18, the _actualDeduction will be 10,000 * 10**18, _deductionFromPool will be 0.
Index Pool 1 should only pay 1,000 * 10**18, but actually paid 6,000 * 10**18, the LPs of Index Pool 1 now suffer funds loss.
Change to:
oishun1112 (Insure) confirmed and resolved
