|
|
@ -11,7 +11,8 @@ module.exports = { |
|
|
|
sha3: sha3, |
|
|
|
sha3: sha3, |
|
|
|
toBN: toBN, |
|
|
|
toBN: toBN, |
|
|
|
add: add, |
|
|
|
add: add, |
|
|
|
extractLocation: extractLocation |
|
|
|
extractLocation: extractLocation, |
|
|
|
|
|
|
|
removeLocation: removeLocation |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function decodeInt (location, storageContent, byteLength, signed) { |
|
|
|
function decodeInt (location, storageContent, byteLength, signed) { |
|
|
@ -93,6 +94,10 @@ function add (value1, value2) { |
|
|
|
return toBN(value1).add(toBN(value2)) |
|
|
|
return toBN(value1).add(toBN(value2)) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function removeLocation (type) { |
|
|
|
|
|
|
|
return type.replace(/( storage ref| storage pointer| memory| calldata)/g, '') |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function extractLocation (type) { |
|
|
|
function extractLocation (type) { |
|
|
|
var match = type.match(/( storage ref| storage pointer| memory| calldata)?$/) |
|
|
|
var match = type.match(/( storage ref| storage pointer| memory| calldata)?$/) |
|
|
|
if (match[1] !== '') { |
|
|
|
if (match[1] !== '') { |
|
|
|