Skip to content

Instantly share code, notes, and snippets.

@miohtama
Created December 31, 2020 11:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miohtama/03e2eafa349474042675b44ca519af96 to your computer and use it in GitHub Desktop.
Save miohtama/03e2eafa349474042675b44ca519af96 to your computer and use it in GitHub Desktop.
#!/bin/sh
#
# This is a faux solc stub that runs a dockerized solc
#
VERSION=$SOLC_VERSION
# Docker complains about abs paths
ME=`dirname "$0"`
ME=`realpath $ME`
if [ -z "$SOLC_VERSION" ] ; then
echo "You need to give SOLC_VERSION environment variable"
exit 1
fi
# note: I still do not know how to create different path maps for solc. TokenMarket contracts refer to Zeppelin contracts.
# However regardless where you run solc it assumes Zeppelin contracts are within the current working directory
# under zeppelin folder. This is a workaround if you want to invoke populus compile not under this path,
# but some other path and get Populus testrpc fixture working.
# This is mainly a workaround to get our internal test suite to complete. Before this could be maintained
# using a symbolic link, but Docker volume mounts ignore symbolic links.
docker run -i -a stdin -a stdout -a stderr -v `pwd`:`pwd` -v $ME/zeppelin:$ME/zeppelin -w `pwd` ethereum/solc:$VERSION "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment