cleanunicorn / mythos

CLI client for the MythX API
https://mythx.io/
20 stars 6 forks source link

Correctly pick a Solidity version from the specified interval #12

Closed cleanunicorn closed 5 years ago

cleanunicorn commented 5 years ago

Description

Consider this contract

pragma solidity >=0.4.20 <0.4.22;

contract A {}

Running mythos will not correctly identify the Solidity version and will pick latest which will fail at compilation time

$ mythos analyze ./a.sol A                                                                 
Reading contract ./a.sol... done
Downloading Solidity version latest
./a.sol:3:1: ParserError: Source file requires different compiler version (current compiler is 0.5.5+commit.47a71e8f.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
contract A {}
^------^

Compiling contract ./a.sol... failed

Remediation

Pick the correct Solidity version when an interval is specified.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 0.28 ETH (38.83 USD @ $138.69/ETH) attached to it.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 12 months from now. Please review their action plans below:

1) mpetrunic has applied to start work _(Funders only: approve worker | reject worker)_.

Will detect if pragma line is interval, parse interval and pick top version that is within interval

Learn more on the Gitcoin Issue Details page.

2) nanspro has been approved to start work.

If a interval is provided, check the latest version between the interval and select it Will submit a PR today only

Learn more on the Gitcoin Issue Details page.

gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 0.28 ETH (39.65 USD @ $141.6/ETH) has been submitted by:

  1. @nanspro

@b-mueller please take a look at the submitted work:


gitcoinbot commented 5 years ago

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


The funding of 0.28 ETH (39.65 USD @ $141.6/ETH) attached to this issue has been approved & issued to @nanspro.