Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

solidity compiler settings in project.json don't work as expected #468

Open
voith opened this issue Jun 25, 2018 · 1 comment
Open

solidity compiler settings in project.json don't work as expected #468

voith opened this issue Jun 25, 2018 · 1 comment

Comments

@voith
Copy link
Collaborator

voith commented Jun 25, 2018

  • Populus Version: on master
  • OS: OSx

What was wrong?

providing any command_line option like evm_version in the example below doesn't work

"SolcAutoBackend": {
        "class": "populus.compilation.backends.SolcAutoBackend",
        "settings": {
          "optimize": true,
          "command_line_options": {
            "allow_paths": "/",
            "evm_version": "homestead"
          }
}

This is because populus uses standard-json as input to py-solc:

std_input = {
'language': 'Solidity',
'sources': sources,
'settings': {
'remappings': import_remappings,
'outputSelection': {
'*': {
'*': REQUIRED_OUTPUT_SELECTION
}
}
}
}

Whenever standard-json is passed to py-solc all other options are ignored.

$solc --help
...
 --standard-json      Switch to Standard JSON input / output mode, ignoring
                       all options. It reads from standard input and provides
                       the result on the standard output.
...

Cute Animal Picture

@voith
Copy link
Collaborator Author

voith commented Jun 25, 2018

However, populus provides another way to configure settings in standard-json. Use stdin instead of command_line_options

"SolcAutoBackend": {
        "class": "populus.compilation.backends.SolcAutoBackend",
        "settings": {
          "optimize": true,
          "output_values": [
            "abi",
            "bin",
            "bin-runtime",
            "metadata"
          ],
          "command_line_options": {
            "allow_paths": "/"
          },
          "stdin": {
            "evmVersion": "homestead"
          }
}

However, allow_paths seems to work for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant