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

Echidna fails with solc 0.6.x #337

Closed
montyly opened this issue Jan 9, 2020 · 6 comments
Closed

Echidna fails with solc 0.6.x #337

montyly opened this issue Jan 9, 2020 · 6 comments
Labels

Comments

@montyly
Copy link
Contributor

montyly commented Jan 9, 2020

For example with:

contract Test{

    bool v = true;

    function set(bool a) external{
        v = a;
    }

    function echidna_test() view external returns(bool){
        return v;
    }

}

If echidna is called with 0.5.14, everything works:

SOLC_VERSION=0.5.14 echidna-test-1.2.0.0 test.sol

But if 0.6.0 is used, echidna crashes:

$ SOLC_VERSION=0.6.0 echidna-test-1.2.0.0 test.sol 
echidna-test-1.2.0.0: srcmap: y u ':'?!?
CallStack (from HasCallStack):
  error, called at src/EVM/Solidity.hs:175:53 in hevm-0.34-E1OHcXdyucEH4I2ysQZGB6:EVM.Solidity

It looks like the src mapping format slightly changed:

0.5.14:
"srcmap": "0:176:0:-;;;29:4;20:13;;;;;;;;;;;;;;;;;;;;0:176;8:9:-1;5:2;;;30:1;27;20:12;5:2;0:176:0;;;;;;;",
0.6.0:
"srcmap": "0:176:0:-:0;;;29:4;20:13;;;;;;;;;;;;;;;;;;;;0:176;8:9:-1;5:2;;;30:1;27;20:12;5:2;0:176:0;;;;;;;"

The Solidity 0.6 changelog mentions:

Source mappings: Add "modifier depth" as a fifth field in the source mappings.

Most likely this "modifier depth" is not handled by hevm?

@montyly montyly added the bug label Jan 9, 2020
@ggrieco-tob
Copy link
Member

We should wait for hevm to merge this.

@incertia
Copy link
Contributor

incertia commented Feb 7, 2020

aside: stripBytecodeMetadata was also merged into hevm so we should delete our local version when bumping the version.

@MrChico
Copy link

MrChico commented Mar 24, 2020

hevm 0.37 now supports 0.6.x source files

@ggrieco-tob
Copy link
Member

Thanks a lot @MrChico!. We will prepare a PR to upgrade to hevm 0.37 soon.

@ggrieco-tob
Copy link
Member

@montyly #383 should fix this. Please test it.

@ggrieco-tob
Copy link
Member

This is already fixed. Please re-open if some example fails.

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

No branches or pull requests

4 participants