According to solidity docs the type
address has the following operators:
<=, <, ==, !=, >= and >
Besides checking for equality - Why would I want to check if an address is greater or smaller than another one? What is the usecase?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
address is a 20 byte number, so it gets comparison operators for free: Solidity doesn't have to implement anything, and the gas costs for using them are the same as comparing integers.
In the future, the comparison operators might be useful depending on how sharding in Ethereum works. For example, one of the simplest and early ideas was to shard according to address space, like shard1 contains the first billion addresses, shard2 contains the next billion, and so on. A contract might then use the comparison operators to determine which shard another contract was in.