decode int, uint, address

pull/7/head
yann300 8 years ago
parent a2cf573a79
commit e3f6b8d124
  1. 2
      src/solidity/types/Address.js
  2. 2
      src/solidity/types/Int.js
  3. 2
      src/solidity/types/Uint.js

@ -13,7 +13,7 @@ Address.prototype.decodeFromStorage = function (location, storageContent) {
}
Address.prototype.decodeLocals = function (stackHeight, stack, memory) {
if (stack.length - 1 < stackHeight) {
if (stackHeight >= stack.length) {
return '0x0000000000000000000000000000000000000000'
} else {
return '0x' + util.extractHexByteSlice(stack[stack.length - 1 - stackHeight], this.storageBytes, 0)

@ -12,7 +12,7 @@ Int.prototype.decodeFromStorage = function (location, storageContent) {
}
Int.prototype.decodeLocals = function (stackHeight, stack, memory) {
if (stack.length - 1 < stackHeight) {
if (stackHeight >= stack.length) {
return '0'
} else {
return util.decodeIntFromHex(stack[stack.length - 1 - stackHeight].replace('0x', ''), 32, true)

@ -12,7 +12,7 @@ Uint.prototype.decodeFromStorage = function (location, storageContent) {
}
Uint.prototype.decodeLocals = function (stackHeight, stack, memory) {
if (stack.length - 1 < stackHeight) {
if (stackHeight >= stack.length) {
return '0'
} else {
return util.decodeIntFromHex(stack[stack.length - 1 - stackHeight].replace('0x', ''), this.storageBytes, false)

Loading…
Cancel
Save