Skip to content

Commit

Permalink
add containerization, fix env, scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
FedokDL committed Oct 9, 2023
1 parent 8b4edbb commit d949772
Show file tree
Hide file tree
Showing 70 changed files with 377 additions and 40,059 deletions.
25 changes: 25 additions & 0 deletions .devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"build": { "dockerfile": "Dockerfile" },

"customizations": {
"vscode": {
"settings": {
"git.detectSubmodules": false,
"solidity.compileUsingRemoteVersion": "v0.8.20+commit.a1b79de6",
"terminal.integrated.defaultProfile.linux": "bash",
"terminal.integrated.profiles.linux": {
"bash": {
"path": "/bin/bash"
}
}
},
"extensions": [
"JuanBlanco.solidity",
"streetsidesoftware.code-spell-checker",
"tamasfe.even-better-toml",
"ms-vscode.makefile-tools",
"ryanluker.vscode-coverage-gutters"
]
}
}
}
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Deployer private key
PRIVATE_KEY=YOUR PRIVATE KEY
PRIVATE_KEY=YOUR_PRIVATE_KEY

# RPC Endpoints
INFURA_KEY=INFURA PROJECT ID
INFURA_KEY=INFURA_PROJECT_ID

# Additional keys
ETHERSCAN_KEY=ETHERSCAN API KEY
BSCSCAN_KEY=BSCSCAN API KEY
ETHERSCAN_KEY=ETHERSCAN_API_KEY
BSCSCAN_KEY=BSCSCAN_API_KEY

COINMARKETCAP_KEY=COINMARKETCAP API KEY
COINMARKETCAP_KEY=COINMARKETCAP_API_KEY
3 changes: 3 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ runs:
- name: Install packages
run: npm install
shell: bash
- name: Install libs
run: npm run forge-install
shell: bash
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
node_modules
lib
report
.env
.DS_Store

Expand All @@ -13,6 +15,8 @@ docs
coverage
coverage.json

lcov.info

# Typechain generated files
generated-types

Expand Down
12 changes: 0 additions & 12 deletions .gitmodules

This file was deleted.

18 changes: 18 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM ghcr.io/foundry-rs/foundry:latest as foundry

RUN apk update

FROM node:latest

COPY --from=foundry /usr/local/bin/forge /usr/local/bin/forge
COPY --from=foundry /usr/local/bin/cast /usr/local/bin/cast
COPY --from=foundry /usr/local/bin/anvil /usr/local/bin/anvil
COPY --from=foundry /usr/local/bin/chisel /usr/local/bin/chisel

RUN apt-get update && apt-get install -y \
make \
lcov

RUN npm install -g npm@latest

ENTRYPOINT ["/bin/bash", "-c", "tail -F 'Wait for commands'"]
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
forge-install:
rm -rfv lib \
&& forge install --no-git foundry-rs/[email protected] \
&& forge install --no-git OpenZeppelin/[email protected] \
&& forge install --no-git OpenZeppelin/[email protected] \
&& forge install --no-git dl-solarity/solidity-lib
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Third, use `npm` and `forge` to install the local dependencies
npm install && forge install
```

#### Or with Docker
It is recommended to use the VSCode Dev Container for development. You can do this by opening the Command Palette `(Ctrl+Shift+P)` and selecting the `Dev Containers: Rebuild and Reopen in Container command`.

### How to use

The template works out of the box. To clean up the repo, you may need to delete the mock contracts and tests.
Expand Down
2 changes: 2 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ optimizer = true
optimizer_runs = 200

remappings = [
"@contracts/=./contracts/",
"@tests/=./tests/",
"@openzeppelin/=lib/openzeppelin-contracts",
"@openzeppelin-upgradeable/=lib/openzeppelin-contracts-upgradeable",
"@solarity/=lib/solidity-lib",
Expand Down
134 changes: 0 additions & 134 deletions lib/forge-std/.github/workflows/ci.yml

This file was deleted.

29 changes: 0 additions & 29 deletions lib/forge-std/.github/workflows/sync.yml

This file was deleted.

4 changes: 0 additions & 4 deletions lib/forge-std/.gitignore

This file was deleted.

3 changes: 0 additions & 3 deletions lib/forge-std/.gitmodules

This file was deleted.

Loading

0 comments on commit d949772

Please sign in to comment.