...by Daniel Szego
"Simplicity is the ultimate sophistication."
Leonardo da Vinci

Tuesday, April 3, 2018

Solidity Tips and Tricks - empty address

If you want to check if your address is null or equals to the 0 address, you have to use the address(0) keyword, like in the following example:

contract TestContract {

  function isAddressEmpty(address addr) returns (bool) {
    return (addr == address(0));