trufflesuite / truffle-compile

Compiler helper and artifact manager
22 stars 46 forks source link

Output selection in Solidity's JSON is wrong #37

Closed axic closed 6 years ago

axic commented 6 years ago
    settings: {
      optimizer: options.solc.optimizer,
      outputSelection: {
        "*": {
          "*": [
            "abi",
            "ast",
            "evm.bytecode.object",
            "evm.bytecode.sourceMap",
            "evm.deployedBytecode.object",
            "evm.deployedBytecode.sourceMap"
          ]
        },
      }
    }

The ast is not an output of a given contract, but a file, therefore it will not be matched against *. Please see the documentation regarding this.

The correct version should be:

    settings: {
      optimizer: options.solc.optimizer,
      outputSelection: {
        "*": {
          "": [
            "ast"
          ],
          "*": [
            "abi",
            "evm.bytecode.object",
            "evm.bytecode.sourceMap",
            "evm.deployedBytecode.object",
            "evm.deployedBytecode.sourceMap"
          ]
        },
      }
    }