Skip to content

hevm/dapp: solc 0.8.9/0.8.8 support #827

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

Merged
merged 17 commits into from
Oct 8, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/scripts/install-solc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ fetch_solc_macos() {

if [ "$HOST_OS" = "Linux" ]; then
if [ "${SOLC_VER:-}" == "" ]; then
travis_retry fetch_solc_linux "0.8.6"
travis_retry fetch_solc_linux "0.8.9"
else
travis_retry fetch_solc_linux "$SOLC_VER"
fi
else
if [ "${SOLC_VER:-}" == "" ]; then
travis_retry fetch_solc_macos "0.8.6"
travis_retry fetch_solc_macos "0.8.9"
else
travis_retry fetch_solc_macos "$SOLC_VER"
fi
Expand Down
2 changes: 1 addition & 1 deletion nix/hevm-tests/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ pkgs }:
let
solc = "${pkgs.solc-static-versions.solc_0_8_6}/bin/solc-0.8.6";
solc = "${pkgs.solc-static-versions.solc_0_8_9}/bin/solc-0.8.9";
solidity = pkgs.fetchFromGitHub {
owner = "ethereum";
repo = "solidity";
Expand Down
4 changes: 4 additions & 0 deletions nix/solc-static-versions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ rec {
solc_0_8_5 = { version = "0.8.5"; path = "solc-linux-amd64-v0.8.5+commit.a4f2e591"; sha256 = "1rrkzajrzaxf5k5hy3fdag41dja4dp75l5034z9001fmlw3j0y5x"; };
solc_0_8_6 = { version = "0.8.6"; path = "solc-linux-amd64-v0.8.6+commit.11564f7e"; sha256 = "0gpc18jlkb3f62mnhdawk9nzd0wfz5iqr5hvjpbkxg32ybrw9mdb"; };
solc_0_8_7 = { version = "0.8.7"; path = "solc-linux-amd64-v0.8.7+commit.e28d00a7"; sha256 = "16bdi52r67znh8l8sdvckqikpz990gcsvdnh2ac2y8a57qw7ag80"; };
solc_0_8_8 = { version = "0.8.8"; path = "solc-linux-amd64-v0.8.8+commit.dddeac2f"; sha256 = "1c6bn1wa1m3b0h7qzcks7mrkzpk7iqxdx8rli7in2v0kdchv2xz6"; };
solc_0_8_9 = { version = "0.8.9"; path = "solc-linux-amd64-v0.8.9+commit.e5eed63a"; sha256 = "156b53bpy3aqmd8s7dyx9xsxk83w0mfcpmpqpam6nj9pmlgz2lgq"; };
};
x86_64-darwin = {
solc_0_3_6 = { version = "0.3.6"; path = "solc-macosx-amd64-v0.3.6+commit.988fe5e5"; sha256 = "1x4xq0j84sfh9jjvv6x3yvhc76785vfr1mkmkq5idn3knfsq3m82"; };
Expand Down Expand Up @@ -139,5 +141,7 @@ rec {
solc_0_8_5 = { version = "0.8.5"; path = "solc-macosx-amd64-v0.8.5+commit.a4f2e591"; sha256 = "0f5rvl98p5iylfs0pmxwxyfwivkdp7czyccmwwhagx3fl9kyw89l"; };
solc_0_8_6 = { version = "0.8.6"; path = "solc-macosx-amd64-v0.8.6+commit.11564f7e"; sha256 = "0dnvynr264phf34y04gd2x8b63n1sjjbcsb10kx6pqy79zv9kvl6"; };
solc_0_8_7 = { version = "0.8.7"; path = "solc-macosx-amd64-v0.8.7+commit.e28d00a7"; sha256 = "143rcxifcs8543cp3jjz4f2qfsy8g9w574m0mjs4wzg13wyncp6c"; };
solc_0_8_8 = { version = "0.8.8"; path = "solc-macosx-amd64-v0.8.8+commit.dddeac2f"; sha256 = "1paib39vmh0bb37bswszwdx4cvws40pgnh19yvz5c795ah2f28hl"; };
solc_0_8_9 = { version = "0.8.9"; path = "solc-macosx-amd64-v0.8.9+commit.e5eed63a"; sha256 = "1klli28jpld11llg1k5iia6wqp4hkrs7wh326b38p67xv3sx86fn"; };
};
}
2 changes: 1 addition & 1 deletion overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ in rec {
fetchSolcVersions { owner = "dapphub"; attr = "unreleased_" + super.system; }
);

solc = self.pkgs.runCommand "solc" { } "mkdir -p $out/bin; ln -s ${solc-static-versions.solc_0_8_6}/bin/solc-0.8.6 $out/bin/solc";
solc = self.pkgs.runCommand "solc" { } "mkdir -p $out/bin; ln -s ${solc-static-versions.solc_0_8_9}/bin/solc-0.8.9 $out/bin/solc";

solc-static-versions =
let
Expand Down
4 changes: 2 additions & 2 deletions src/dapp-tests/default.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{ pkgs }:

let
solc-0_8_6 = "${pkgs.solc-static-versions.solc_0_8_6}/bin/solc-0.8.6";
solc-0_8_9 = "${pkgs.solc-static-versions.solc_0_8_6}/bin/solc-0.8.9";
solc-0_7_6 = "${pkgs.solc-static-versions.solc_0_7_6}/bin/solc-0.7.6";
solc-0_6_7 = "${pkgs.solc-static-versions.solc_0_6_7}/bin/solc-0.6.7";

Expand Down Expand Up @@ -135,7 +135,7 @@ in
libraries0_8 = pkgs.buildDappPackage {
name = "libraries-0.8";
shouldFail = false;
solc=solc-0_8_6;
solc=solc-0_8_9;
src = pkgs.runCommand "src" {} ''
mkdir -p $out
cp ${./pass/libraries.sol} $out/libraries.sol;
Expand Down
1 change: 1 addition & 0 deletions src/dapp/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- solc 0.8.9 is now the default compiler version
- Dapp remappings ignores non-directories in `DAPP_LIB`

### Fixed
Expand Down
8 changes: 4 additions & 4 deletions src/dapp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ This creates two contracts, `Dapptutorial.sol` and `Dapptutorial.t.sol` in the `
For the sake of this tutorial, let's change `Dapptutorial.sol` to a simple vault with an eth bounty that can be accessed by giving the password 42:

```solidity
pragma solidity ^0.8.6;
pragma solidity ^0.8.9;

contract Dapptutorial {
receive() external payable {
Expand Down Expand Up @@ -287,7 +287,7 @@ variables](../hevm/README.md#environment-variables).
| `DAPP_LIB` | `lib` | Directory for installed Dapp packages |
| `DAPP_OUT` | `out` | Directory for compilation artifacts |
| `DAPP_ROOT` | `.` | Root directory of compilation |
| `DAPP_SOLC_VERSION` | `0.8.6` | Solidity compiler version to use |
| `DAPP_SOLC_VERSION` | `0.8.9` | Solidity compiler version to use |
| `DAPP_SOLC` | n/a | solc binary to use |
| `DAPP_LIBRARIES` | automatically deployed | Library addresses to link to |
| `DAPP_SKIP_BUILD` | n/a | Avoid compiling this time |
Expand Down Expand Up @@ -328,7 +328,7 @@ A global (always loaded) config file is located in `~/.dapprc`. A local `.dapprc
Whenever you run a `dapp` command the `.dapprc` files are sourced in order (global first, then the one in the current working directory, if it exists). If you wish to set configuration variables, you must use `export` as below:

```sh
export DAPP_SOLC_VERSION=0.8.6
export DAPP_SOLC_VERSION=0.8.9
export DAPP_REMAPPINGS=$(cat remappings.txt)
export DAPP_BUILD_OPTIMIZE=1
export DAPP_BUILD_OPTIMIZE_RUNS=1000000000
Expand Down Expand Up @@ -551,7 +551,7 @@ Spins up a geth testnet.

dapp-verify-contract -- verify contract source on etherscan
Usage: dapp verify-contract <path>:<contractname> <address> [constructorArgs]

Example: `dapp verify-contract src/auth/authorities/RolesAuthority.sol:RolesAuthority 0x9ed0e..`

Requires `ETHERSCAN_API_KEY` to be set.
Expand Down
2 changes: 1 addition & 1 deletion src/hevm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ Counterexamples will be returned for any reachable assertion violations. Where a
violation is defined as either an execution of the invalid opcode (`0xfe`), or a revert with a
message of the form `abi.encodeWithSelector('Panic(uint256)', errCode)` with `errCode` being one of
the predefined solc assertion codes defined
[here](https://docs.soliditylang.org/en/v0.8.6/control-structures.html?highlight=Panic#panic-via-assert-and-error-via-require).
[here](https://docs.soliditylang.org/en/v0.8.9/control-structures.html#panic-via-assert-and-error-via-require).

By default hevm ignores assertion violations that result from arithmetic overflow (`Panic(0x11)`),
although this behaviour can be customised via the `--assertions` flag. For example, the following
Expand Down
2 changes: 1 addition & 1 deletion src/hevm/src/EVM/Solidity.hs
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ toCode t = case BS16.decode (encodeUtf8 t) of
solidity' :: Text -> IO (Text, Text)
solidity' src = withSystemTempFile "hevm.sol" $ \path handle -> do
hClose handle
writeFile path ("//SPDX-License-Identifier: UNLICENSED\n" <> "pragma solidity ^0.8.6;\n" <> src)
writeFile path ("//SPDX-License-Identifier: UNLICENSED\n" <> "pragma solidity ^0.8.9;\n" <> src)
writeFile (path <> ".json")
[Here.i|
{
Expand Down