ak1 - TwoTokenPoolMixin.sol : the token's decimals could not be same. Calculation based on token decimal will not give correct result.
Closed this issue · 0 comments
sherlock-admin commented
ak1
high
TwoTokenPoolMixin.sol : the token's decimals could not be same. Calculation based on token decimal will not give correct result.
Summary
TwoTokenPoolMixin.sol : the token's decimals could not be same.
Vulnerability Detail
In TwoTokenPoolMixin.sol
, primary and secondary token's decimals are set by checking that they should be <= 18. But they can be different.
When they are different, the calculation based on decimal values will not be correct.
Impact
The calculation based on primary and secondary decimals will not give correct result.
Code Snippet
Tool used
Manual Review
Recommendation
Add validation to check whether both of the token decimals are equal.
or
Do normalization of data based on the decimals while using them.
Duplicate of #88