Submitted by jonah1005
CustomPrecisionMultipliers are set in the constructor:
originalPrecisionMultipliers equal to 1 if the tokens decimal = 18. The targe price could only be an integer.
If the target price is bigger than 10**18, the user can deposit and trade in the pool. Though, the functionality would be far from the spec.
If the target price is set to be smaller than 10**18, the pool would be broken and all funds would be stuck.
I consider this is a high-risk issue.
Please refer to the implementation.
Swap.sol#L184-L187
We can also trigger the bug by setting a pool with target price = 0.5. (0.5 * 10**18)
None
I recommend providing extra 10**18 in both multipliers.
The customswap only supports two tokens in a pool, theres should be enough space. Recommend the devs to go through the trade-off saddle finance has paid to support multiple tokens. The code could be more clean and efficient if the pools not support multiple tokens.
chickenpie347 (Boot Finance) confirmed
