diff --git a/src/solidity/types/DynamicByteArray.js b/src/solidity/types/DynamicByteArray.js index c09b41b189..4441e9f7bc 100644 --- a/src/solidity/types/DynamicByteArray.js +++ b/src/solidity/types/DynamicByteArray.js @@ -35,4 +35,22 @@ DynamicByteArray.prototype.decodeFromStorage = function (location, storageConten } } +DynamicByteArray.prototype.decodeLocals = function (stackHeight, stack, memory) { + if (stack.length - 1 < stackHeight) { + return { + value: '0x', + length: '0x' + } + } else { + var offset = stack[stack.length - 1 - stackHeight] + offset = 2 * parseInt(offset, 16) + var length = memory.substr(offset, 64) + length = parseInt(length, 16) + return { + length: 2 * length, + value: '0x' + memory.substr(offset + 64, 2 * length) + } + } +} + module.exports = DynamicByteArray