Skip to content

Commit

Permalink
accounts/abi/bind: fix destructive packing of *big.Int (ethereum#20412)
Browse files Browse the repository at this point in the history
  • Loading branch information
gzliudan committed Jan 7, 2025
1 parent 3688c9e commit 4a4f8b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion accounts/abi/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func packNum(value reflect.Value) []byte {
case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
return math.U256Bytes(big.NewInt(value.Int()))
case reflect.Ptr:
return math.U256Bytes(value.Interface().(*big.Int))
return math.U256Bytes(new(big.Int).Set(value.Interface().(*big.Int)))
default:
panic("abi: fatal error")
}
Expand Down

0 comments on commit 4a4f8b6

Please sign in to comment.