From 9fc9344ca260a07ac9f3d049033d81cc50c640e6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 31 Jan 2017 13:13:42 +0100 Subject: [PATCH] use BN for storage decoding --- src/solidity/types/RefType.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/solidity/types/RefType.js b/src/solidity/types/RefType.js index 4701885a70..8d0d7fcca1 100644 --- a/src/solidity/types/RefType.js +++ b/src/solidity/types/RefType.js @@ -1,4 +1,5 @@ 'use strict' +var util = require('./util') class RefType { constructor (storageSlots, storageBytes, typeName, location) { @@ -29,10 +30,11 @@ class RefType { storage = {} // TODO this is a fallback, should manage properly locals store in storage } var offset = stack[stack.length - 1 - stackDepth] - offset = parseInt(offset, 16) if (this.isInStorage()) { + offset = util.toBN(offset) return this.decodeFromStorage({ offset: 0, slot: offset }, storage) } else if (this.isInMemory()) { + offset = parseInt(offset, 16) return this.decodeFromMemoryInternal(offset, memory) } else { return {