diff --git a/src/eei.cpp b/src/eei.cpp index 6a06b8ce8..6c381208c 100644 --- a/src/eei.cpp +++ b/src/eei.cpp @@ -801,17 +801,22 @@ inline int64_t maxCallGas(int64_t gas) { } create_message.code_hash = {}; - create_message.gas = result.gasLeft - (result.gasLeft / 64); create_message.depth = msg.depth + 1; create_message.kind = EVMC_CREATE; create_message.flags = 0; evmc_result create_result; - takeInterfaceGas(create_message.gas); takeInterfaceGas(GasSchedule::create); + + create_message.gas = maxCallGas(result.gasLeft); + takeInterfaceGas(create_message.gas); + context->fn_table->call(&create_result, context, &create_message); + /* Return unspent gas */ + result.gasLeft += create_result.gas_left; + if (create_result.status_code == EVMC_SUCCESS) { storeUint160(create_result.create_address, resultOffset); lastReturnData.clear();