fix dynamic byte array

pull/7/head
yann300 8 years ago
parent cbc10638e8
commit 9c7db6d20a
  1. 6
      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)

Loading…
Cancel
Save