Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    thank you! you are probably right. I'm using my own fork of truffle because it was lacking overloads.. we'll go back to main branch soon but upgrade of ganache-cli is really appreciated!
    Filip Małachowicz
    Hello! I've tried to update your package to the newest version of ganache-cli, but something is wrong for me. I created own fork of testrpc-sc (https://github.com/Exef/testrpc-sc ) which I updated using ganache-cli master branch. Next I build it, and published it to npm under https://www.npmjs.com/package/ethereumjs-testrpc-sc-fork. I used this as a new dependency of my fork of solidity-coverage (https://github.com/Exef/solidity-coverage/tree/develop). All test passes using new dependency, so for tests I pushed it to npm as https://www.npmjs.com/package/solidity-coverage-fork. I've also corrected all places that used solidity-coverage instead of solidity-coverage-fork (especially require.resolve in app.js). Unfortunately something goes wrong and my truffle package during running solidity-coverage command errors with Error: Cannot find module 'ethereumjs-testrpc-sc-fork/build/cli.node.js', cause there is no build folder inside of the node_modules/ethereumjs-testrpc-sc-fork.
    Hi there, thanks to the project maintainers for your great work on this project, I can't wait to get it integrated in our development. I'm using darq-truffle instead of truffle, and I can't get solidity-coverage to work. I've searched and tried various things to no avail, so I've opened this issue: sc-forks/solidity-coverage#304
    I just wanted to say hello đź‘‹and make myself available here in case I can help troubleshoot this issue faster. Thank you
    George Spasov
    @cgewecke Hey guys. George from etherlime here. Quite some time ago I had to change the library for keccak due to heavy installation issues of sol-cov as dependancy.
    Did noticed that I had no response to the PR
    youve probably missed it
    Can you please take a look at it
    I hate for etherlime to be pointing to our own fork repo
    Juwita W
    Hi guys, I'm facing error instrumenting when using solidity-coverage on my ERC-20 contract. It said There was a problem instrumenting ./coverageEnv/contracts/LearnToken.sol: SyntaxError: Expected ")", ",", "days", "ether", "finney", "hours", "minutes", "seconds", "szabo", "weeks", "wei", "years", comment, end of line, or whitespace but "*" found.
    on line above
    contract LearnToken is IBuyMechanism, BurnableToken, CappedToken(1200000000 * (10 ** uint256(18))) {
    Any idea how to resolve this beside changing 1200000000 * (10 ** uint256(18)) into 1200000000000000000000000000?

    Hey guys, are you already supporting payable addresses?
    Because when I run the coverage I get:
    Skipping instrumentation of ./coverageEnv/contracts/Migrations.sol Instrumenting ./coverageEnv/contracts/Owned.sol Cleaning up... There was a problem instrumenting ./coverageEnv/contracts/Owned.sol: SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "p" found. Line: 7, Column: 21

    Really great that you put a tool out there for test coverage :)

    Good question @simonschmoll , I have the same issue with a contract I am working on.
    address payable public wallet; coverage error: There was a problem instrumenting ./coverageEnv/contracts/AbstractPaymentQuantum.sol: SyntaxError: Expected ";", "=", comment, end of line, or whitespace but "p" found. Line: 7, Column: 21
    As I can see it is not supported and the question would be if is there any solution for this at this moment?
    Stef Heyenrath
    @fpaun23 : I noticed the same. For now I did remove payable from my address.
    Stef Heyenrath

    I've troubles running coverage using:

    solidity-coverage 0.5.11
    Truffle v5.0.0-beta.2 (core: 5.0.0-beta.2)
    [Coverage] Solidity v0.5.0 (solc-js)

    I get an error like

    Error: while migrating Migrations: Returned error: Exceeds block gas limit
    [Coverage]     at ...\node_modules\truffle\build\webpack:\packages\truffle-deployer\src\deployment.js:364:1
    [Coverage]     at <anonymous>
    [Coverage]     at process._tickCallback (internal/process/next_tick.js:188:7)

    Example project can be found at : https://github.com/mstack/bootcamp-blockchain-smartcontracts/tree/master/Lab 2 in the Solidity folder.

    Stef Heyenrath
    It seems to work now. I did change some settings. If you want to know the details, take a look at that Lab 2 or Lab 4 solutions in that GitHub project.

    Hello, I am getting this error:

    Event trace could not be read.
    Error: ENOENT: no such file or directory, open './allFiredEvents'

    How can I fix this?

    Stef Heyenrath

    I fixed this by using nodetouch allFiredEvents

    Example coverage command:

    `"coverage": "npm run clean && nodetouch allFiredEvents && concurrently --names \"GanacheCLI,Coverage\" --kill-others \"node_modules\\.bin\\ganache-cli --quiet --port 8555 --gasPrice 0x01 --gasLimit 0xfffffffffff --allowUnlimitedContractSize\" \"node_modules\\.bin\\solidity-coverage\" || true",
    Guy Lando
    no matter what I do solidity-coverage runs out of gas (while normal test does not run out of gas). I even increased ganache gas limit to 40 million and truffle config coverage network gas limit to 20 million and still nothing helps. any ideas?
    transaction with 1,000,000,000 gas still ran out of gas
    Guy Lando
    solved by adding --allowUnlimitedContractSize parameter to testchain
    Hi there - running into an issue using 0.6.0-beta.5 and Solidity 0.5.8 where instrumentation is inserting events in require statements between the close parenthesis and the semicolon, i.e. require(value == true, "value cannot be false")<emit __BAD_INSTRUMENTATION_GOING_HERE>;
    Getting ParsedContract.sol:129:6: ParserError: Expected ';' but got 'emit'
    Any idea what could be causing this or how to go about fixing it? I wasn't hitting this error back when the contract was pared down a bit from its current size if it's any help
    Found the cause - I had emojis in the comments
    removing them fixed the coverage - interesting edge-case!
    Ah, right, the old 'how many characters is a Unicode character' dilemma
    Never considered that :)
    Well most sane devs never considered putting emoji in their comments!
    Makoto Inoue
    @cgewecke hello. Do you have any plan about when to release 0.7 mentioned at https://github.com/sc-forks/solidity-coverage/issues/355#issuecomment-514862829 ?
    Hi @makoto, there should be a beta version ready by the end of August. Do you have a repo you would like to use this in? We could use it as a test target for 0.7.0 to make sure everything works ok.
    @makoto The work on 0.7.0 is happening in #357, design discussion for it is happening in #346.
    Makoto Inoue
    I am currently using it at https://github.com/wearekickback/contracts
    I am in the middle of making big change and test coverage started failing even though the same test passes if I run as normal test
    Keen to try out if the latest could fix what I a encountering
    @makoto I opened a PR at wearekickback which might fix: wearekickback/contracts#27
    Makoto Inoue
    ah thanks. I will give a try
    Makoto Inoue
    @cgewecke it passed!!! You are genious!
    Xiao Liang
    @cgewecke Happy to see you release 0.7 beta! Thanks for your effort :) This is going to be very helpful. :rocket:
    Thanks @yxliang01!
    Richard Abambillah

    Hello, I integrated solidity-coverage with my smart contract and I run into these issues. Is there any help or workaround

    TypeError: Overriding function changes state mutability from "view" to "nonpayable". function acceptRelayedCall( ^ (Relevant source part starts here and spans across multiple lines). tabookey-gasless/contracts/IRelayRecipient.sol:35:5: Overridden function is here: function acceptRelayedCall(address ... alData) public view returns (uint); ^-------------------------------------------------------------------------^

    Hi @Anthler - Could you try with the 0.7.0 beta? It avoids rewriting state-mutability modifiers so this error shouldn't occur there...
    npm install --save-dev solidity-coverage@beta
    The installation instructions are different...the beta README is here: https://github.com/sc-forks/solidity-coverage/tree/beta#install
    Richard Abambillah
    Thank you so much @cgewecke it works now
    Richard Abambillah
    @cgewecke I'm using the beta version now and everything works but this is the error I get now SchLoToken has no network configuration for its current network id (*). ? How do I resove this ? I added several configurations in .solcover and truffle.js but none helped
    @Anthler Do you have a link to your project I could look at, or could you post the truffle-config.js here? One thing you might try as quick check is to run the command with the --network flag, specifying the network you usually use with your tests:
    truffle run coverage --network  <your-test-network-name>
    Richard Abambillah
    @cgewecke Thank you for your response , I did supply the --network command-line argument and there was no luck, I also added providerOptions object in .solcover.js also tried running local ganache-cli with a network_id and all had no luck.
    Richard Abambillah
    Below is my truffle-config.js. By adding coverage object and also removing it in truffle-config.js didn't work, also changing the port for development network to port 8555 and 8545 for both coverage and development network still didn't work. The token contract is just a contract that extends openzeppelin ERC20 contract
     development: {
          host: '',
          port: 8545,
          network_id: '*', // Match any network id
        coverage: {
          host: 'localhost',
          network_id: '*',
          port: 8555,         // <-- If you change this, also set the port option in .solcover.js.
          gas: 0xfffffffffff, // <-- Use this high gas value
          gasPrice: 0x01      // <-- Use this low gas price