Uint256 max value

Jeffrey Scholz
RareSkills
Published in
1 min readApr 5, 2023

--

The maximum value of uint256 can be obtained with

type(uint256).max;

Which is equal to 115792089237316195423570985008687907853269984665640564039457584007913129639935 (2²⁵⁶ — 1). But it’s cleaner and safer to use type(uint256).max.

The same can be used for signed integer types

//57896044618658097711785492504343953926634992332820282019728792003956564819967
type(int256).max;

//-57896044618658097711785492504343953926634992332820282019728792003956564819968
type(int256).min;

Hacky ways to get the…

--

--