Skip to content

Commit

Permalink
adapt to gif-interface v1.5.0-staging-j, fix solc to 0.8.2 and oz to 4.7
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiaszimmermann committed Jun 30, 2022
1 parent 49e5ef9 commit c35b815
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions brownie-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]i"
- "@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.7.0"
- "@gif-interface=etherisc/[email protected]j"
vyper:
version: null

Expand All @@ -18,8 +18,8 @@ compiler:
# to list the packages installed via the dependency list below
dependencies:
# github dependency format: <owner>/<repository>@<release>
- OpenZeppelin/openzeppelin-contracts@4.6.0
- etherisc/[email protected]i
- OpenZeppelin/openzeppelin-contracts@4.7.0
- etherisc/[email protected]j

# exclude Ownable when calculating test coverage
# https://eth-brownie.readthedocs.io/en/v1.10.3/config.html#exclude_paths
Expand Down
13 changes: 12 additions & 1 deletion Dockerfile → docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions docker/Dummy.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// SPDX-License-Identifier: Apache-2.0
pragma solidity ^0.8.0;
contract Dummy {}
16 changes: 16 additions & 0 deletions docker/brownie-config.yaml
Original file line number Diff line number Diff line change
@@ -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/[email protected]"
vyper:
version: null

dependencies:
# github dependency format: <owner>/<repository>@<release>
- OpenZeppelin/[email protected]

0 comments on commit c35b815

Please sign in to comment.