From 4f596483b81f4dcc10c72d686e3c914335545ea9 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Thu, 26 Sep 2024 16:29:04 +0200 Subject: [PATCH] core/vm: fix eofcreate auxdata --- core/vm/evm.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/vm/evm.go b/core/vm/evm.go index f5563a031a97..51f8b923397f 100644 --- a/core/vm/evm.go +++ b/core/vm/evm.go @@ -544,7 +544,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 { @@ -556,7 +556,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) { @@ -564,7 +564,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 } @@ -627,7 +627,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