diff --git a/common/math/big.go b/common/math/big.go index 0b67a1b503..5255a88e9f 100644 --- a/common/math/big.go +++ b/common/math/big.go @@ -51,6 +51,9 @@ func (i *HexOrDecimal256) UnmarshalText(input []byte) error { // MarshalText implements encoding.TextMarshaler. func (i *HexOrDecimal256) MarshalText() ([]byte, error) { + if i == nil { + return []byte("0x0"), nil + } return []byte(fmt.Sprintf("%#x", (*big.Int)(i))), nil }