Using the maximum integer in Solidity

Hi @Alice,

Welcome to the community forum :wave:

I am not keen on approving a maximum as an allowance for ERC20 nor semantic overloading. Interested to learn other use cases.

I had a quick look through the List of Solidity libraries in the wild to see if any had a max uint256 constant.

OpenZeppelin Test Helpers have JavaScript constants such as MAX_UINT256. If there are use cases and a need then there would be an argument for adding common constants to OpenZeppelin Contracts.

1 Like