-
Notifications
You must be signed in to change notification settings - Fork 279
Send / Transfer fails with 'invalid opcode' if destination fallback function instrumented. #106
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
Comments
@lewisbarber If you could share a link to the code that's producing this error (or generate a minimal truffle project example that produces it) I'll happily take a look at it. |
Hey @cgewecke, thanks! https://github.com/sharpe-capital/sharpe-token/tree/feature/presale-bounties This branch produces the problem: truffle test - everything works |
@lewisbarber Thanks, I'm getting these errors on the coverage run. Is that what you're seeing as well? When I run the regular tests: Using Node 7.10.0, on OSX. Could you verify you're getting a clean run on your end? Or advise re: getting everything to pass so there's a baseline to compare to? |
So your problem with truffle test is you need to run testrpc with more gas per block (so it's more like the live network - our code does quite a bit)... The command is: testrpc -a 10 -l 4000000000 The first error you show for the coverage is the same as what I see. |
@lewisbarber Thanks for reporting this. The problem is with the Tests will pass if you exclude the MultiSigWallet from the instrumentation process by adding the following to
Don't know if you have a pressing audit coming up or something but that Wallet's been combed over pretty carefully so leaving it out might not matter much. Renaming your issue to reflect the underlying problem. |
Ah - that makes perfect sense. I think it's acceptable for us to exclude the MultiSigWallet from the coverage report. In fact, we should probably exclude all third-party libs. Thanks for taking a look at this so quickly, it's great to have such an important Solidity library properly supported! |
Add this to the growing list of reasons to motivate us to move to the |
Closing via #108. Published with |
@lewisbarber Just a heads up - we're reverting our fix for this. I don't think that will affect you since you were going to exclude all 3rd party code in the Re-opening. This will continue to happen for the time being. |
Adds a utility to skip tests if they're being run in coverage. A few of the tests relying on ETH transfers (the proxy recoverability ones) seem to fail under coverage for unknown reasons by reverting (as far as I can tell, the fallbacks aren't instrumented and it shouldn't be due to gas, but could still be related to sc-forks/solidity-coverage#106 (comment)).
@cgewecke is this supposed to be fixed now? I'm confused about why I'm still seeing errors for it in 0.6.0. Specifically when unwrapping WETH, the WETH contracts sends ETH to an empty fallback function that reverts when under coverage |
@BrendanChou Yes it looks like it's fixed on We have a passing unit test for the send/transfer case here. Its relevant solidity source and js test are here: |
Awesome, 0.6.2 fixed it, thank you! |
Uh oh!
There was an error while loading. Please reload this page.
So I've tried everything in the FAQ, but I'm still getting 'invalid opcode' error messages when trying to call the sendTransaction method of web3. Any idea why this might be happening?
When running the tests using only truffle it works... Perhaps I'm missing something?
The text was updated successfully, but these errors were encountered: