Closed github-actions[bot] closed 1 year ago
kaysoft
medium
deployPool
The deployPool function will fail for tokens that have decimals more than 18
The code for the deployPool function assumes that all tokens will have 18 decimals or lower some tokens like YAM token has 24 decimals.
File: contracts/src/ERC20PoolFactory.sol 53: uint256 quoteTokenScale = 10 ** (18 - IERC20Token(quote_).decimals()); 54: uint256 collateralScale = 10 ** (18 - IERC20Token(collateral_).decimals());
Transaction will fail for tokens that have decimals more than 18.
contracts/src/ERC20PoolFactory.sol#L53
Manual Review
Consider implementing the lines to take into account of tokens that have more than 18 decimals.
Duplicate of #123
kaysoft
medium
The
deployPool
function will fail for tokens that have decimals more than 18Summary
The
deployPool
function will fail for tokens that have decimals more than 18Vulnerability Detail
The code for the
deployPool
function assumes that all tokens will have 18 decimals or lower some tokens like YAM token has 24 decimals.Impact
Transaction will fail for tokens that have decimals more than 18.
Code Snippet
contracts/src/ERC20PoolFactory.sol#L53
Tool used
Manual Review
Recommendation
Consider implementing the lines to take into account of tokens that have more than 18 decimals.
Duplicate of #123