From d1a581b18c03631df9d3fd53135e92deb3fc6ec1 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Thu, 19 Aug 2021 13:28:58 +0300 Subject: [PATCH] Fix eip1559 contract transactions --- VERSION | 2 +- transactions/transactor.go | 17 ++++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index ea2ccc8ac..5f50a3aa3 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.83.12 +0.83.13 diff --git a/transactions/transactor.go b/transactions/transactor.go index e5208a3a6..9e9517d20 100644 --- a/transactions/transactor.go +++ b/transactions/transactor.go @@ -382,7 +382,22 @@ func (t *Transactor) buildTransactionWithOverrides(nonce uint64, value *big.Int, tx = gethtypes.NewTx(txData) t.logNewTx(args, gas, gasPrice, value) } else { - tx = gethtypes.NewContractCreation(nonce, value, gas, gasPrice, args.GetInput()) + if args.IsDynamicFeeTx() { + gasTipCap := (*big.Int)(args.MaxPriorityFeePerGas) + gasFeeCap := (*big.Int)(args.MaxFeePerGas) + + txData := &gethtypes.DynamicFeeTx{ + Nonce: nonce, + Value: value, + Gas: gas, + GasTipCap: gasTipCap, + GasFeeCap: gasFeeCap, + Data: args.GetInput(), + } + tx = gethtypes.NewTx(txData) + } else { + tx = gethtypes.NewContractCreation(nonce, value, gas, gasPrice, args.GetInput()) + } t.logNewContract(args, gas, gasPrice, value, nonce) }