core/vm: don't call SetCode on target of contract creation if initcode didn't return anything.

This commit is contained in:
Jared Wasinger 2025-10-15 16:05:09 +08:00
parent 3cfc33477b
commit 0d6ed68910

View file

@ -601,7 +601,9 @@ func (evm *EVM) initNewContract(contract *Contract, address common.Address) ([]b
}
}
if len(ret) > 0 {
evm.StateDB.SetCode(address, ret, tracing.CodeChangeContractCreation)
}
return ret, nil
}