diff --git a/README.md b/README.md index 310843f..cbc203b 100644 --- a/README.md +++ b/README.md @@ -57,10 +57,12 @@ cd gif-sandbox export SANDBOX=$PWD ``` -The next step is to build the Brownie docker image in the directory of the GIF sandbox repository. +Build the Brownie docker image. ```bash +cd docker docker build . -t brownie +cd $SANDBOX ``` ## Start a Local Ganache Chain diff --git a/brownie-config.yaml b/brownie-config.yaml index 83e0e13..7e14330 100644 --- a/brownie-config.yaml +++ b/brownie-config.yaml @@ -2,14 +2,14 @@ compiler: evm_version: null solc: - version: null + version: 0.8.2 optimizer: enabled: true runs: 200 # https://eth-brownie.readthedocs.io/en/stable/compile.html#compiler-settings remappings: - - "@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.6.0" - - "@gif-interface=etherisc/gif-interface@1.5.0-staging-i" + - "@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.7.0" + - "@gif-interface=etherisc/gif-interface@1.5.0-staging-j" vyper: version: null @@ -18,8 +18,8 @@ compiler: # to list the packages installed via the dependency list below dependencies: # github dependency format: /@ - - OpenZeppelin/openzeppelin-contracts@4.6.0 - - etherisc/gif-interface@1.5.0-staging-i + - OpenZeppelin/openzeppelin-contracts@4.7.0 + - etherisc/gif-interface@1.5.0-staging-j # exclude Ownable when calculating test coverage # https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths diff --git a/Dockerfile b/docker/Dockerfile similarity index 64% rename from Dockerfile rename to docker/Dockerfile index d1c1ffa..9fee60b 100644 --- a/Dockerfile +++ b/docker/Dockerfile @@ -2,7 +2,7 @@ FROM python:3.7 # Set up code directory -RUN mkdir -p /usr/src/app +RUN mkdir -p /usr/src/app/brownie-setup WORKDIR /usr/src/app # Install linux dependencies @@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y npm RUN npm install --global ganache-cli # Install Brownie +RUN echo force-brownie-upgrade-0 RUN wget https://raw.githubusercontent.com/eth-brownie/brownie/master/requirements.txt RUN pip install -r requirements.txt @@ -22,6 +23,16 @@ RUN pip install eth-brownie RUN pip install fastapi RUN pip install uvicorn +# force installation of solc in docker image +# solc version is defined in brownie-config.yaml +WORKDIR /usr/src/app/brownie-setup +RUN echo force-dependency-upgrade-0 + +RUN brownie init -f +COPY brownie-config.yaml /usr/src/app/brownie-setup +COPY Dummy.sol /usr/src/app/brownie-setup/contracts +RUN brownie compile --all + EXPOSE 8000 # Add some aliases diff --git a/docker/Dummy.sol b/docker/Dummy.sol new file mode 100644 index 0000000..5d7c503 --- /dev/null +++ b/docker/Dummy.sol @@ -0,0 +1,3 @@ +// SPDX-License-Identifier: Apache-2.0 +pragma solidity ^0.8.0; +contract Dummy {} \ No newline at end of file diff --git a/docker/brownie-config.yaml b/docker/brownie-config.yaml new file mode 100644 index 0000000..5777011 --- /dev/null +++ b/docker/brownie-config.yaml @@ -0,0 +1,16 @@ +# brownie default values made explicit +compiler: + evm_version: null + solc: + version: 0.8.2 + optimizer: + enabled: true + runs: 200 + remappings: + - "@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.7.0" + vyper: + version: null + +dependencies: + # github dependency format: /@ + - OpenZeppelin/openzeppelin-contracts@4.7.0