Skip to content

Commit

Permalink
Abstract contract build setups and port to Cygwin.
Browse files Browse the repository at this point in the history
  • Loading branch information
saurik committed Sep 8, 2020
1 parent 99e8c0d commit 143744c
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 6 deletions.
2 changes: 1 addition & 1 deletion dir-ethereum/directory_test.sol
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

pragma solidity 0.5.13;

import "directory.sol";
import "./directory.sol";


contract TestOrchidDirectory is OrchidDirectory
Expand Down
1 change: 1 addition & 0 deletions dir-ethereum/env
2 changes: 1 addition & 1 deletion dir-ethereum/make
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
set -e
for sol in *.sol; do
solc --bin --optimize --overwrite --allow-paths . "$@" -o build "${sol}"
env/solc.sh 0.5.13 build "${sol}" --optimize
done
1 change: 1 addition & 0 deletions env/cwd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
which cygpath &>/dev/null && cwd=$(cygpath -t mixed "${PWD}" | sed -e 's@^\(.\):@/\1@') || cwd=${PWD}
12 changes: 12 additions & 0 deletions env/solc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
set -e
. env/cwd.sh

version=$1
output=$2
source=$3
shift 3

exec docker run -v "${cwd%/*}":/mnt ethereum/solc:"${version}" \
-o /mnt/"${PWD##*/}"/"${output}" /mnt/"${PWD##*/}"/"${source}" \
--bin --overwrite --allow-paths . "$@"
1 change: 1 addition & 0 deletions lot-ethereum/env
4 changes: 2 additions & 2 deletions lot-ethereum/make
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -e
docker run -v "${PWD%/*}":/mnt ethereum/solc:0.5.13 -o /mnt/"${PWD##*/}"/build --bin /mnt/"${PWD##*/}"/lottery.sol --overwrite --evm-version istanbul
docker run -v "${PWD%/*}":/mnt ethereum/solc:0.7.0 -o /mnt/"${PWD##*/}"/build --bin /mnt/"${PWD##*/}"/lottery1.sol --optimize --overwrite --evm-version istanbul
env/solc.sh 0.5.13 build lottery.sol --evm-version istanbul
env/solc.sh 0.7.0 build lottery1.sol --evm-version istanbul --optimize
1 change: 1 addition & 0 deletions pac-ethereum/env
2 changes: 1 addition & 1 deletion pac-ethereum/make
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
solc --evm-version homestead --bin --overwrite --allow-paths . "$@" -o build verifier.sol
env/solc.sh 0.6.6 build verifier.sol --evm-version homestead
1 change: 1 addition & 0 deletions tok-ethereum/env
2 changes: 1 addition & 1 deletion tok-ethereum/make
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
#!/bin/bash
set -e
solc --abi --bin --optimize --overwrite --allow-paths . -o build token.sol
env/solc.sh 0.5.12 build token.sol --optimize --abi

0 comments on commit 143744c

Please sign in to comment.