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

ParserError: Could not instrument: ... extraneous input '....' expecting {';', '='} #493

Closed
gitpusha opened this issue Apr 7, 2020 · 3 comments

Comments

@gitpusha
Copy link

gitpusha commented Apr 7, 2020

Hi @cgewecke ,

First of all thank you for building this amazing tool and the buidler plugin.

I am trying to use the solidity-coverage buidler plugin for the first time, and so far I have taken these steps to get my first coverage report for my buidler-waffle test suite:

  1. yarn add -D solidity-coverage@beta
  2. usePlugin(solidity-coverage)

I also added this network entry to buidler.config.js, since apparently solidity-coverage shouldnt be run using the buidlerevm network (is that correct?).

    coverage: {
      url: "http://127.0.0.1:8555"
    },

Furthermore this is my solc config inside buidler.config.js

  solc: {
    version: "0.6.4",
    optimizer: { enabled: true },
  },

and this is my .solcover.js config file

module.exports = {
  skipFiles: [
    "dapp_interfaces",
    "debugging",
    "external",
    "gelato_actions",
    "gelato_conditions",
    "user_proxies/gnosis_safe_proxy",
  ],
};

Now I get this error when I run npx buidler coverage --network coverage

An unexpected error occurred:

ParserError: Could not instrument: gelato_core/gelato_provider_module_examples/gelato_user_proxy_provider/ProviderModuleGelatoUserProxy.sol. (Please verify solc can compile this file without errors.) extraneous input 'isProxyExtcodehashProvided' expecting {';', '='} (17:45)
    at Object.parse (/Users/luis/Desktop/gelato-gnosis-safe/node_modules/solidity-parser-antlr/dist/index.js:79:11)
    at Instrumenter.instrument (/Users/luis/Desktop/gelato-gnosis-safe/node_modules/solidity-coverage/lib/instrumenter.js:63:30)
    at API.instrument (/Users/luis/Desktop/gelato-gnosis-safe/node_modules/solidity-coverage/lib/api.js:91:48)
    at SimpleTaskDefinition.action (/Users/luis/Desktop/gelato-gnosis-safe/node_modules/solidity-coverage/plugins/buidler.plugin.js:86:23)
    at processTicksAndRejections (internal/process/task_queues.js:94:5)
    at Environment._runTaskDefinition (/Users/luis/Desktop/gelato-gnosis-safe/node_modules/@nomiclabs/buidler/src/internal/core/runtime-environment.ts:190:14)
    at main (/Users/luis/Desktop/gelato-gnosis-safe/node_modules/@nomiclabs/buidler/src/internal/cli/cli.ts:151:5)

This is the source solidity code:

mapping(bytes32 => bool) public override isProxyExtcodehashProvided;

And all my contracts compile without errors using npx buidler compile.

Does solidity-coverage work with solc 0.6.4 compiled contracts ?

I would appreciate your input on how I can get this to work, and whether any of my configs are incompatible with solidity-coverage and its buidler plugin use.

@gitpusha gitpusha changed the title ParserError: Could not instrument: ... extraneous input 'isProxyExtcodehashProvided' expecting {';', '='} (17:45) ParserError: Could not instrument: ... extraneous input '....' expecting {';', '='} Apr 7, 2020
@cgewecke
Copy link
Member

cgewecke commented Apr 7, 2020

@gitpusha Thanks!

Your config looks fine to me...as you've seen from the other issues, problems w/ solc 0.6.x parsing is probably the cause of this.

Can you share the Solidity code around the location indicated in the parser error message? This would help identify which syntax is a problem.

FILE: ProviderModuleGelatoUserProxy.sol
LINE: extraneous input 'isProxyExtcodehashProvided' expecting {';', '='} (17:45)

@gitpusha
Copy link
Author

gitpusha commented Apr 7, 2020

Hi @cgewecke . Thanks for helping out. Yes, indeed. Solc 0.6 still seems to break a lot of tools.

Here is the source for this specific error log (although I think I also got different error logs for other .sol files before I added them to skipFiles):
I am declaring a public mapping state variable overriding it's automatic Getter fn which I inherit from a base interface.

FILE: ProviderModuleGelatoUserProxy.sol
LINE 17: mapping(bytes32 => bool) public override isProxyExtcodehashProvided;

Sorry I can't give you a link to the repo atm, as we are going into an audit very soon, and will only make it public after the audit (and open-source of course.)

But I am happy to share any code you need as snippets here.

@cgewecke
Copy link
Member

@gitpusha 0.7.4 is published, this should be ok.

Closing but please ping if you run into further problems...

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

2 participants