[Ethereum] How to check for 0 address with web 3

truffleweb3js

I have a method that can return data from a struct that might contain a 0 address 0x0000000000000000000000000000000000000000. Is there a way to check for this address using web 3? I know there is web3.isAddress but I would think this would return true for a valid address.

Best Answer

Either do a string comparison to "0x0000000000000000000000000000000000000000" or make a BigNumber with it and compare it to zero.

Related Topic