remix-lib/src/code/codeUtils.js
function (raw) {
    var code = []
    for (var i = 0; i < raw.length; i++) {
      var opcode = opcodes(raw[i], true)
      if (opcode.name.slice(0, 4) === 'PUSH') {
        var length = raw[i] - 0x5f
        opcode.pushData = raw.slice(i + 1, i + length + 1)
        // in case pushdata extends beyond code
        if (i + 1 + length > raw.length) {
          for (var j = opcode.pushData.length; j < length; j++) {
            opcode.pushData.push(0)
          }
        }
        i += length
      }
      code.push(opcode)
    }
    return code
  }
function (raw) {
    var code = []
    for (var i = 0; i < raw.length; i++) {
      var opcode = opcodes(raw[i], true)
      if (opcode.name.slice(0, 4) === 'PUSH') {
        var length = raw[i] - 0x5f
        opcode.pushData = raw.slice(i + 1, i + length + 1)
        // in case pushdata extends beyond code
        if (i + 1 + length > raw.length) {
          for (var j = opcode.pushData.length; j < length; j++) {
            opcode.pushData.push(0)
          }
        }
        i += length
      }
      code.push(opcode)
    }
    return code
  }
function ( raw ) { var code = [ ] for ( var i = 0 ; i < raw . length ; i ++ ) { var opcode = opcodes ( raw [ i ] , true ) if ( opcode . name . slice ( 0 , 4 ) === 'PUSH' ) { var length = raw [ i ] - 0x5f opcode . pushData = raw . slice ( i + 1 , i + length + 1 ) // in case pushdata extends beyond code if ( i + 1 + length > raw . length ) { for ( var j = opcode . pushData . length ; j < length ; j ++ ) { opcode . pushData . push ( 0 ) } } i += length } code . push ( opcode ) } return code }
Parses code as a list of integers into a list of objects containing
information about the opcode.
Parses code as a list of integers into a list of objects containing information about the opcode .