Skip to content

Type Errors (E25xx)

Back to Error Reference

CodeNameDescriptionCommon Cause
E2501IntegerOverflowInteger overflowCompile-time constant exceeds type range
E2502IntegerUnderflowInteger underflowCompile-time constant below type minimum
E2503DivisionByZeroDivision by zeroCompile-time division by zero constant
E2504ArrayOutOfBoundsArray index out of boundsCompile-time index exceeds fixed array length
E2505InvalidCastInvalid type castIncompatible explicit cast (e.g., string to uint)
E2506NullReferenceNull referenceAccessing member on potentially null reference

Example: E2501 IntegerOverflow

error[E2501]: integer overflow: value 999999999999999999999 exceeds uint256 range
  --> MyContract.sol:8:20

Fix: Use a value within the valid range for the target type, or split the computation across multiple steps.

MIT Licensed