From 9c7db6d20af230085c74cabe8b0df339ae3e2f35 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 24 Nov 2016 14:46:17 +0100 Subject: [PATCH] fix dynamic byte array --- src/solidity/types/DynamicByteArray.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/solidity/types/DynamicByteArray.js b/src/solidity/types/DynamicByteArray.js index 2de703f46d..6a6f52c164 100644 --- a/src/solidity/types/DynamicByteArray.js +++ b/src/solidity/types/DynamicByteArray.js @@ -10,8 +10,10 @@ function DynamicByteArray () { DynamicByteArray.prototype.decodeFromStorage = function (location, storageContent) { var value = util.extractHexByte(location, storageContent, this.storageBytes) - var key = util.sha3(location.slot) - if (storageContent[key] && storageContent[key] !== '0x') { + var bn = new BN(value.substr(62, 2), 16) + bn = bn.toString(2) + if (bn[bn.length - 1] === '1') { + var key = util.sha3(location.slot) var ret = '' var currentSlot = storageContent[key] key = new BN(key.replace('0x', ''), 16)