Skip to content

Latest commit

 

History

History
26 lines (22 loc) · 931 Bytes

Unnecessarily small integer sizes.md

File metadata and controls

26 lines (22 loc) · 931 Bytes

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.

Recommendation:

Consider using integers of size 256 bits to improve gas efficiency and mitigate function reverts.


Slide Screenshot

188.jpg


Slide Text

  • OpenZeppelin Fei Protocol Finding N23
  • Specification
  • Integer Constants
  • Size < 256 Bits
  • Gas Costs
  • Execution vs Storage

References


Tags