From 57d5cfb40c1916ecfef051f5329f7e9176a67e99 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 2 Jan 2023 10:51:31 +0100 Subject: [PATCH] set allowUnlimitedContractSize from EVM obj --- libs/remix-simulator/src/vm-context.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts index 0354b3eeaa..851cbfab89 100644 --- a/libs/remix-simulator/src/vm-context.ts +++ b/libs/remix-simulator/src/vm-context.ts @@ -9,6 +9,9 @@ import { Common } from '@ethereumjs/common' import { Trie } from '@ethereumjs/trie' import { DefaultStateManager } from '@ethereumjs/statemanager' import { StorageDump } from '@ethereumjs/statemanager/dist/interface' +import { EVM } from '@ethereumjs/evm' +import { EEI } from '@ethereumjs/vm' +import { Blockchain } from '@ethereumjs/blockchain' import { Block } from '@ethereumjs/block' import { Transaction } from '@ethereumjs/tx' import { bigIntToHex } from '@ethereumjs/util' @@ -136,11 +139,17 @@ export class VMContext { async createVm (hardfork) { const stateManager = new StateManagerCommonStorageDump() const common = new Common({ chain: 'mainnet', hardfork }) + const blockchain = new (Blockchain as any)({ common }) + const eei = new EEI(stateManager, common, blockchain) + const evm = new EVM({ common, eei, allowUnlimitedContractSize: true }) + const vm = await VM.create({ common, activatePrecompiles: true, - stateManager - // allowUnlimitedContractSize: true + stateManager, + blockchain, + eei, + evm }) // VmProxy and VMContext are very intricated.