From 30b642bc5155ca17f9c446193875cb7ed534042c Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Tue, 4 Feb 2025 10:41:19 +0100 Subject: [PATCH] applied suggestion --- core/state_transition.go | 2 +- core/vm/evm.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/core/state_transition.go b/core/state_transition.go index 57e0293867..aa6a946a74 100644 --- a/core/state_transition.go +++ b/core/state_transition.go @@ -17,8 +17,8 @@ package core import ( - "errors" "bytes" + "errors" "fmt" "math" "math/big" diff --git a/core/vm/evm.go b/core/vm/evm.go index ee0be3b454..6123f3e447 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -485,7 +485,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil { evm.Config.Tracer.OnGasChange(gas, gas-statelessGas, tracing.GasChangeWitnessContractCollisionCheck) } - contract.Gas = contract.Gas - statelessGas + gas = gas - statelessGas } // We add this to the access list _before_ taking a snapshot. Even if the @@ -533,9 +533,10 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil { evm.Config.Tracer.OnGasChange(gas, gas-statelessGas, tracing.GasChangeWitnessContractInit) } - contract.Gas = contract.Gas - statelessGas + gas = gas - statelessGas } evm.Context.Transfer(evm.StateDB, caller.Address(), address, value) + contract.Gas = gas ret, err = evm.initNewContract(contract, address, value, input, isInitcodeEOF) if err != nil && (evm.chainRules.IsHomestead || err != ErrCodeStoreOutOfGas) {