|
|
@ -1,6 +1,7 @@ |
|
|
|
'use strict' |
|
|
|
'use strict' |
|
|
|
var traceHelper = require('../helpers/traceHelper') |
|
|
|
var traceHelper = require('../helpers/traceHelper') |
|
|
|
var stateDecoder = require('./stateDecoder') |
|
|
|
var stateDecoder = require('./stateDecoder') |
|
|
|
|
|
|
|
var astHelper = require('./astHelper') |
|
|
|
|
|
|
|
|
|
|
|
class SolidityProxy { |
|
|
|
class SolidityProxy { |
|
|
|
constructor (traceManager, codeManager) { |
|
|
|
constructor (traceManager, codeManager) { |
|
|
@ -59,6 +60,22 @@ class SolidityProxy { |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* extract the state variables of the given compiled @arg contractName (cached) |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param {String} contractName - name of the contract to retrieve state variables from |
|
|
|
|
|
|
|
* @return {Object} - returns state variables of @args contractName |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
extractStatesDefinitions () { |
|
|
|
|
|
|
|
if (!this.cache.contractDeclarations) { |
|
|
|
|
|
|
|
this.cache.contractDeclarations = astHelper.extractContractDefinitions(this.sources) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!this.cache.statesDefinitions) { |
|
|
|
|
|
|
|
this.cache.statesDefinitions = astHelper.extractStatesDefinitions(this.sources, this.cache.contractDeclarations) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return this.cache.statesDefinitions |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* extract the state variables of the given compiled @arg contractName (cached) |
|
|
|
* extract the state variables of the given compiled @arg contractName (cached) |
|
|
|
* |
|
|
|
* |
|
|
@ -118,6 +135,8 @@ class Cache { |
|
|
|
reset () { |
|
|
|
reset () { |
|
|
|
this.contractNameByAddress = {} |
|
|
|
this.contractNameByAddress = {} |
|
|
|
this.stateVariablesByContractName = {} |
|
|
|
this.stateVariablesByContractName = {} |
|
|
|
|
|
|
|
this.contractDeclarations = null |
|
|
|
|
|
|
|
this.statesDefinitions = null |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|