diff --git a/ethclient/ethclient.go b/ethclient/ethclient.go index 0a6f73ab51..a60d732231 100644 --- a/ethclient/ethclient.go +++ b/ethclient/ethclient.go @@ -514,7 +514,7 @@ func (ec *Client) SendTransaction(ctx context.Context, tx *types.Transaction) er if err != nil { return err } - return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", common.ToHex(data)) + return ec.c.CallContext(ctx, nil, "eth_sendRawTransaction", hexutil.Encode(data)) } func toCallArg(msg ethereum.CallMsg) interface{} {