...by Daniel Szego
quote
"On a long enough timeline we will all become Satoshi Nakamoto.."
Daniel Szego

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));
  }