add special case for 0x0000 address parsing (#3837)

pull/3839/head
Rongjian Lan 3 years ago committed by GitHub
parent 4c6659ff25
commit af7f34fa78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      internal/common/address.go

@ -225,6 +225,11 @@ func MustAddressToBech32(addr ethCommon.Address) string {
// ParseAddr parses the given address, either as bech32 or as hex.
// Return error if the address is invalid.
func ParseAddr(s string) (ethCommon.Address, error) {
// empty address in 0x format is still a valid address
if s == "0x0000000000000000000000000000000000000000" {
return ethCommon.Address{}, nil
}
if addr, err := Bech32ToAddress(s); err == nil {
return addr, nil
}

Loading…
Cancel
Save