Closed code423n4 closed 2 years ago
pauliax
payout token exponent in function valueOfToken can be precalculated as this value is constant and does not change:
value = _amount.mul(10**PAYOUT_TOKEN_DECIMALS).div(10**IERC20Metadata(_principalToken).decimals());
Extract 10**PAYOUT_TOKEN_DECIMALS as a constant.
Same situation here with 232 and 1010:
uint32 blockTimestamp = uint32(block.timestamp % 2**32); sumUSD += uint256(price) * (10**10);
Handle
pauliax
Vulnerability details
Impact
payout token exponent in function valueOfToken can be precalculated as this value is constant and does not change:
Extract 10**PAYOUT_TOKEN_DECIMALS as a constant.
Same situation here with 232 and 1010: