From bf6eb27b720df6e88b9fa7a2f62d4e649603fb2d Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 7 Dec 2023 12:57:18 +0100 Subject: [PATCH] fix using codeHash --- libs/remix-simulator/src/vm-context.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/remix-simulator/src/vm-context.ts b/libs/remix-simulator/src/vm-context.ts index 605a3bf9717..4cd25f07f9d 100644 --- a/libs/remix-simulator/src/vm-context.ts +++ b/libs/remix-simulator/src/vm-context.ts @@ -230,10 +230,11 @@ class CustomEthersStateManager extends StateManagerCommonStorageDump { [], this.blockTag, ]) + const codeHash = accountData.codeHash === '0x0000000000000000000000000000000000000000000000000000000000000000' ? '0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470' : accountData.codeHash const account = Account.fromAccountData({ balance: BigInt(accountData.balance), nonce: BigInt(accountData.nonce), - codeHash: toBuffer(accountData.codeHash) + codeHash: toBuffer(codeHash) // storageRoot: toBuffer([]), // we have to remove this in order to force the creation of the Trie in the local state. }) return account