From 734b12f54e0b9de113ac2d060382b55fdda3fbb3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 21 Dec 2022 16:24:51 +0100 Subject: [PATCH] fix dumping the storage --- libs/remix-simulator/src/VmProxy.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libs/remix-simulator/src/VmProxy.ts b/libs/remix-simulator/src/VmProxy.ts index 488c80752d..a2015d6296 100644 --- a/libs/remix-simulator/src/VmProxy.ts +++ b/libs/remix-simulator/src/VmProxy.ts @@ -255,10 +255,12 @@ export class VmProxy { this.processingAddress = normalizeHexAddress(step.stack[step.stack.length - 2]) this.processingAddress = toChecksumAddress(this.processingAddress) if (!this.storageCache[this.processingHash][this.processingAddress]) { - const account = Address.fromString(this.processingAddress) - this.vm.stateManager.dumpStorage(account).then((storage) => { - this.storageCache[this.processingHash][this.processingAddress] = storage - }).catch(console.log) + ((processingHash, processingAddress, self) => { + const account = Address.fromString(processingAddress) + self.vm.stateManager.dumpStorage(account).then((storage) => { + self.storageCache[processingHash][processingAddress] = storage + }).catch(console.log) + })(this.processingHash, this.processingAddress, this) } } }