|
|
@ -199,7 +199,7 @@ function includeVariableDeclaration (tree, step, sourceLocation, scopeId, newLoc |
|
|
|
// so, either this is the direct value, or the offset in memory. That depends on the type.
|
|
|
|
// so, either this is the direct value, or the offset in memory. That depends on the type.
|
|
|
|
if (!error) { |
|
|
|
if (!error) { |
|
|
|
tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached
|
|
|
|
tree.solidityProxy.contractNameAt(step, (error, contractName) => { // cached
|
|
|
|
if (!error) { |
|
|
|
if (!error && variableDeclaration.attributes.name != '') { |
|
|
|
var states = tree.solidityProxy.extractStatesDefinitions() |
|
|
|
var states = tree.solidityProxy.extractStatesDefinitions() |
|
|
|
var location = typesUtil.extractLocationFromAstVariable(variableDeclaration) |
|
|
|
var location = typesUtil.extractLocationFromAstVariable(variableDeclaration) |
|
|
|
location = location === 'default' ? 'storage' : location |
|
|
|
location = location === 'default' ? 'storage' : location |
|
|
@ -297,8 +297,9 @@ function addParams (parameterList, tree, scopeId, states, contractName, sourceLo |
|
|
|
if (stackDepth >= 0) { |
|
|
|
if (stackDepth >= 0) { |
|
|
|
let location = typesUtil.extractLocationFromAstVariable(param) |
|
|
|
let location = typesUtil.extractLocationFromAstVariable(param) |
|
|
|
location = location === 'default' ? 'memory' : location |
|
|
|
location = location === 'default' ? 'memory' : location |
|
|
|
tree.scopes[scopeId].locals[param.attributes.name] = { |
|
|
|
const attributesName = param.attributes.name === '' ? `$${inputParam}` : param.attributes.name |
|
|
|
name: param.attributes.name, |
|
|
|
tree.scopes[scopeId].locals[attributesName] = { |
|
|
|
|
|
|
|
name: attributesName, |
|
|
|
type: decodeInfo.parseType(param.attributes.type, states, contractName, location), |
|
|
|
type: decodeInfo.parseType(param.attributes.type, states, contractName, location), |
|
|
|
stackDepth: stackDepth, |
|
|
|
stackDepth: stackDepth, |
|
|
|
sourceLocation: sourceLocation |
|
|
|
sourceLocation: sourceLocation |
|
|
|