remix-debug/src/solidity-decoder/stateDecoder.js
async function decodeState (stateVars, storageResolver) {
  var ret = {}
  for (var k in stateVars) {
    var stateVar = stateVars[k]
    try {
      var decoded = await stateVar.type.decodeFromStorage(stateVar.storagelocation, storageResolver)
      decoded.constant = stateVar.constant
      if (decoded.constant) {
        decoded.value = '<constant>'
      }
      ret[stateVar.name] = decoded
    } catch (e) {
      console.log(e)
      ret[stateVar.name] = '<decoding failed - ' + e.message + '>'
    }
  }
  return ret
}
async function decodeState (stateVars, storageResolver) {
  var ret = {}
  for (var k in stateVars) {
    var stateVar = stateVars[k]
    try {
      var decoded = await stateVar.type.decodeFromStorage(stateVar.storagelocation, storageResolver)
      decoded.constant = stateVar.constant
      if (decoded.constant) {
        decoded.value = '<constant>'
      }
      ret[stateVar.name] = decoded
    } catch (e) {
      console.log(e)
      ret[stateVar.name] = '<decoding failed - ' + e.message + '>'
    }
  }
  return ret
}
async function decodeState ( stateVars , storageResolver ) { var ret = { } for ( var k in stateVars ) { var stateVar = stateVars [ k ] try { var decoded = await stateVar . type . decodeFromStorage ( stateVar . storagelocation , storageResolver ) decoded . constant = stateVar . constant if ( decoded . constant ) { decoded . value = '<constant>' } ret [ stateVar . name ] = decoded } catch ( e ) { console . log ( e ) ret [ stateVar . name ] = '<decoding failed - ' + e . message + '>' } } return ret }
decode the contract state storage

@param {Array} storage location  - location of all state variables
@param {Object} storageResolver  - resolve storage queries
@return {Map} - decoded state variable
decode the contract state storage