From 58eb6962c6b7355d08ee8ca46fc2bf7d9ad825e5 Mon Sep 17 00:00:00 2001 From: Andre Medeiros Date: Mon, 18 Mar 2019 14:09:10 -0400 Subject: [PATCH] fix: handle bignumber conversion on hash without prefix --- remix-debug/src/solidity-decoder/types/util.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/remix-debug/src/solidity-decoder/types/util.js b/remix-debug/src/solidity-decoder/types/util.js index 2593c9058e..ce72b718c5 100644 --- a/remix-debug/src/solidity-decoder/types/util.js +++ b/remix-debug/src/solidity-decoder/types/util.js @@ -75,8 +75,8 @@ async function extractHexValue (location, storageResolver, byteLength) { function toBN (value) { if (value instanceof BN) { return value - } else if (value.indexOf && value.indexOf('0x') === 0) { - value = ethutil.unpad(value.replace('Ox', '')) + } else if (value.match && value.match(/^(?:0x)?(?[a-f0-9])*$/)) { + value = ethutil.unpad(value.replace(/^(0x)/, '')) value = new BN(value === '' ? '0' : value, 16) } else if (!isNaN(value)) { value = new BN(value)