In Solidity, using integers smaller than 256 bits tends to increase gas costs because the Ethereum Virtual Machine must perform additional operations to zero out the unused bits.
This can be justified by savings in storage costs in some scenarios, however, that is not generally the case in this codebase.
Consider using integers of size 256 bits to improve gas efficiency and mitigate function reverts.
- OpenZeppelin Fei Protocol Finding N23
- Specification
- Integer Constants
- Size < 256 Bits
- Gas Costs
- Execution vs Storage