Update types.go

This commit is contained in:
Alvarez 2025-10-31 13:21:17 +01:00 committed by GitHub
parent 72f3bfd838
commit 1ed3fd3140
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -231,7 +231,7 @@ func HexToAddress(s string) Address { return BytesToAddress(FromHex(s)) }
// IsHexAddress verifies whether a string can represent a valid hex-encoded
// Ethereum address or not.
func IsHexAddress(s string) bool {
if has0xPrefix(s) {
if hexutil.Has0xPrefix(s) {
s = s[2:]
}
return len(s) == 2*AddressLength && isHex(s)