Due to how the EVM natively works on 256 numbers, using a 8 bit number in loops introduces additional costs as the EVM has to properly enforce the limits of this smaller type.
GeneralConverter.sol line 189: for (uint8 i = 0; i < tokens.length; i++)
GeneralConverter.sol line 137: for (uint8 i = 0; i < tokens.length; i++)
GeneralConverter.sol line 109: for (uint8 i = 0; i < tokens.length; i++)
Handle
pants
Vulnerability details
Due to how the EVM natively works on 256 numbers, using a 8 bit number in loops introduces additional costs as the EVM has to properly enforce the limits of this smaller type.
GeneralConverter.sol line 189:
for (uint8 i = 0; i < tokens.length; i++)
GeneralConverter.sol line 137:for (uint8 i = 0; i < tokens.length; i++)
GeneralConverter.sol line 109:for (uint8 i = 0; i < tokens.length; i++)
See the warning at this link: https://docs.soliditylang.org/en/v0.8.0/internals/layout_in_storage.html#layout-of-state-variables-in-storage
Impact
Increase GAS cost
Tool Used
Manual code review.
Recommended Mitigation Steps
Use uint256 instead