diff --git a/core/vm/evm.go b/core/vm/evm.go index e733e79793..9330d72aa5 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -544,10 +544,12 @@ func (evm *EVM) create(caller common.Address, code []byte, gas GasBudget, value if evm.Config.Tracer != nil && evm.Config.Tracer.OnGasChange != nil { evm.Config.Tracer.OnGasChange(gas.RegularGas, 0, tracing.GasChangeCallFailedExecution) } - // Record all burned gas - burned := gas.RegularGas + // Drain the entire budget on collision gas.Exhaust() - return nil, common.Address{}, gas, GasUsed{RegularGas: burned}, ErrContractAddressCollision + if evm.chainRules.IsAmsterdam { + gas.StateGas = 0 + } + return nil, common.Address{}, gas, GasUsed{}, ErrContractAddressCollision } // Create a new account on the state only if the object was not present. // It might be possible the contract code is deployed to a pre-existent