diff --git a/core/vm/evm.go b/core/vm/evm.go index a150872b45c6..92769f18b358 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -521,7 +521,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, } evm.Context.Transfer(evm.StateDB, caller.Address(), address, value) - ret, err = evm.initNewContract(contract, address, value, isInitcodeEOF) + ret, err = evm.initNewContract(contract, address, value, input, isInitcodeEOF) if err != nil && (evm.chainRules.IsHomestead || err != ErrCodeStoreOutOfGas) { evm.StateDB.RevertToSnapshot(snapshot) if err != ErrExecutionReverted { @@ -533,7 +533,7 @@ func (evm *EVM) create(caller ContractRef, codeAndHash *codeAndHash, gas uint64, // initNewContract runs a new contract's creation code, performs checks on the // resulting code that is to be deployed, and consumes necessary gas. -func (evm *EVM) initNewContract(contract *Contract, address common.Address, value *uint256.Int, isInitcodeEOF bool) ([]byte, error) { +func (evm *EVM) initNewContract(contract *Contract, address common.Address, value *uint256.Int, input []byte, isInitcodeEOF bool) ([]byte, error) { // Charge the contract creation init gas in verkle mode if evm.chainRules.IsEIP4762 { if !contract.UseGas(evm.AccessEvents.ContractCreateInitGas(address, value.Sign() != 0), evm.Config.Tracer, tracing.GasChangeWitnessContractInit) { @@ -541,7 +541,7 @@ func (evm *EVM) initNewContract(contract *Contract, address common.Address, valu } } - ret, err := evm.interpreter.Run(contract, nil, false, contract.IsDeployment) + ret, err := evm.interpreter.Run(contract, input, false, contract.IsDeployment) if err != nil { return ret, err } @@ -609,7 +609,7 @@ func (evm *EVM) Create2(caller ContractRef, code []byte, gas uint64, endowment * func (evm *EVM) EOFCreate(caller ContractRef, input []byte, subcontainer []byte, gas uint64, endowment *uint256.Int, salt *uint256.Int) (ret []byte, contractAddr common.Address, leftOverGas uint64, err error) { codeAndHash := &codeAndHash{code: subcontainer} contractAddr = crypto.CreateAddress2(caller.Address(), salt.Bytes32(), codeAndHash.Hash().Bytes()) - return evm.create(caller, codeAndHash, gas, endowment, contractAddr, CREATE2, input, true) + return evm.create(caller, codeAndHash, gas, endowment, contractAddr, EOFCREATE, input, true) } // ChainConfig returns the environment's chain configuration