-
Notifications
You must be signed in to change notification settings - Fork 30
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
Disarm fails when instrumented code fails to compile #119
Comments
An issue related to the reason the instrumented version of this contract won't compile: ethereum/solidity#12296 |
Thanks for the report @wolflo . Yeah, this needs to be fixed. The tricky bit is making sure we don't miss any files. This can be a problem, as in certain cases (e.g. when there are contract-wide invariants) scribble may instrument contracts even under
The only risk with this solution is that the metadata file somehow gets out-of-sync with the instrumented files in the repo |
@cd1m0 maybe we can include a series of comments on top of instrumented files indicating that they're auto generated and that they shouldn't be edited directly (only after it has been disarmed). |
I think I expressed myself incorrectly - I was worried about |
What is the reason for compiling the armed contracts before disarming? |
After discussion with @blitz-1306 we decided:
|
This would require a fix in solc-typed-ast to respect |
I would say major reason is (and always been a big pain) an import resolution. We can resolve imports by relying on Solc callbacks while compiling files (unless breadcrumbs idea, suggested by @cd1m0). There are a lot of effort done to make that work:
|
If you have a contract that compiles before being instrumented but fails to compile after being instrumented, scribble will successfully arm the contract but fail to disarm it. This can leave a bit of a mess of armed files to clean up before you can fix or diagnose the issue.
Example
Shadowed.sol
Succeeds.
Succeeds, but leaves an instrumented
Shadowed.sol
that fails to compile.In this case, it is because the function pointer passed to the
_callsite_
method cannot discern between the two versions ofIShadower.shadowed()
. As far as I know, this is a limitation of solidity rather than a scribble bug, but used here as an example.Because the newly instrumented
Shadowed.sol
won't compile, this fails and leaves armed files that must be sorted out manually or reverted to a previous commit.Feature Request
--disarm --force
flag.The text was updated successfully, but these errors were encountered: