Skip to content

Commit

Permalink
Merge pull request #2 from aragon/bootstrap
Browse files Browse the repository at this point in the history
Bootstrap
  • Loading branch information
pythonpete32 authored Nov 21, 2023
2 parents f89cc1d + 82f0ada commit 27e02a9
Show file tree
Hide file tree
Showing 30 changed files with 1,221 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Profile
export FOUNDRY_PROFILE="default"

export API_KEY_INFURA="YOUR_API_KEY_INFURA"
export FOUNDRY_PROFILE="default"

# Forking
export FORKING_NETWORK="mainnet"
export FORK_BLOCK=18335949

# DAOFactory, RepoFactory
export MAINNET=0xA03C2182af8eC460D498108C92E8638a580b94d4,0x96E54098317631641703404C06A5afAD89da7373
export GOERLI=0x1E4350A3c9aFbDbd70FA30B9B2350B9E8182449a,0x477EB3b39C92c38B43778266b09471285e0F7808
export SEPOLIA=0x7a62da7B56fB3bfCdF70E900787010Bc4c9Ca42e,0x07f49c49Ce2A99CF7C28F66673d406386BDD8Ff4
export POLYGON=0x51Ead12DEcD31ea75e1046EdFAda14dd639789b8,0x6E924eA5864044D8642385683fFA5AD42FB687f2
export MUMBAI=0xc715336B5E7F10294F36CA09f19A0493070E2eFB,0x4E7c97ab08c046A8e43571f9839d768ae84492e4
export BASE_MAINNET=0x1B6632D1357D26055D6452E3b3BEBd1c1d982e86,0xE47C0B1Ea698F2914b6CC218cdC3A5Ca4FAcff18
export BASE_GOERLI=0x3E773BCb6a8C5ED2f23BF167284DF45D9A550fF6,0x1B6632D1357D26055D6452E3b3BEBd1c1d982e86
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lib/** linguist-vendored
27 changes: 27 additions & 0 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Lint and Format

on:
workflow_dispatch:
push:
branches: [main]

jobs:
lint-and-format:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install pnpm
run: npm install -g pnpm

- name: Install dependencies
run: pnpm install

- name: Run lint
run: pnpm run lint
32 changes: 32 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: test

on: workflow_dispatch

env:
FOUNDRY_PROFILE: ci

jobs:
check:
strategy:
fail-fast: true

name: Foundry project
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build

- name: Run Forge tests
run: |
forge test -vvv
id: test
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# directories
cache
coverage
node_modules
out

# files
*.env
*.log
.DS_Store
.pnp.*
lcov.info
yarn.lock

# broadcasts
!broadcast
broadcast/*
broadcast/*/31337/
18 changes: 18 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[submodule "lib/forge-std"]
branch = "v1"
path = "lib/forge-std"
url = "https://github.com/foundry-rs/forge-std"
[submodule "lib/prb-test"]
branch = "release-v0"
path = lib/prb-test
url = https://github.com/PaulRBerg/prb-test
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
[submodule "lib/osx"]
path = lib/osx
url = https://github.com/aragon/osx
[submodule "lib/openzeppelin-contracts-upgradeable"]
branch = "release-v4.9"
path = lib/openzeppelin-contracts-upgradeable
url = https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable
17 changes: 17 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# directories
broadcast
cache
coverage
lib
node_modules
out

# files
*.env
*.log
.DS_Store
.pnp.*
lcov.info
package-lock.json
pnpm-lock.yaml
yarn.lock
17 changes: 17 additions & 0 deletions .prettierrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
bracketSpacing: false
singleQuote: true
arrowParens: avoid

overrides:
- files: '*.sol'
options:
printWidth: 100
tabWidth: 4
useTabs: false
singleQuote: false
- files: '*.md'
options:
printWidth: 100
tabWidth: 2
useTabs: false
singleQuote: true
14 changes: 14 additions & 0 deletions .solhint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"extends": "solhint:recommended",
"rules": {
"code-complexity": ["error", 8],
"compiler-version": ["error", ">=0.8.17"],
"func-name-mixedcase": "off",
"func-visibility": ["error", {"ignoreConstructors": true}],
"max-line-length": ["error", 120],
"named-parameters-mapping": "off",
"no-console": "off",
"not-rely-on-time": "off",
"one-contract-per-file": "off"
}
}
8 changes: 8 additions & 0 deletions .vscode/extentions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"recommendations": [
"esbenp.prettier-vscode",
"NomicFoundation.hardhat-solidity",
"KnisterPeter.vscode-commitizen",
"tintinweb.solidity-visual-auditor"
]
}
7 changes: 7 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"prettier.documentSelectors": ["**/*.sol"],
"solidity.formatter": "prettier",
"editor.tabSize": 4
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

## License

This project is licensed under AGPL-3.0-or-later.
This project is licensed under AGPL-3.0-or-later.
34 changes: 34 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Full reference https://github.com/foundry-rs/foundry/tree/master/config

[profile.default]
auto_detect_solc = false
block_timestamp = 1_680_220_800 # March 31, 2023 at 00:00 GMT
bytecode_hash = "none"
cbor_metadata = false
evm_version = "paris" # See https://www.evmdiff.com/features?name=PUSH0&kind=opcode
fuzz = { runs = 1_000 }
gas_reports = ["*"]
libs = ["lib"]
optimizer = true
optimizer_runs = 10_000
out = "out"
script = "script"
solc = "0.8.17"
src = "src"
test = "test"

[profile.ci]
fuzz = { runs = 10_000 }
verbosity = 4

[rpc_endpoints]
arbitrum_one = "https://arbitrum-mainnet.infura.io/v3/${API_KEY_INFURA}"
avalanche = "https://avalanche-mainnet.infura.io/v3/${API_KEY_INFURA}"
bnb_smart_chain = "https://bsc-dataseed.binance.org"
gnosis_chain = "https://rpc.gnosischain.com"
goerli = "https://goerli.infura.io/v3/${API_KEY_INFURA}"
localhost = "http://localhost:8545"
mainnet = "https://mainnet.infura.io/v3/${API_KEY_INFURA}"
optimism = "https://optimism-mainnet.infura.io/v3/${API_KEY_INFURA}"
polygon = "https://polygon-mainnet.infura.io/v3/${API_KEY_INFURA}"
sepolia = "https://sepolia.infura.io/v3/${API_KEY_INFURA}"
1 change: 1 addition & 0 deletions lib/ens-contracts
Submodule ens-contracts added at f5f2ed
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at f73c73
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at 045704
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts-upgradeable
1 change: 1 addition & 0 deletions lib/osx
Submodule osx added at 16aab7
1 change: 1 addition & 0 deletions lib/prb-test
Submodule prb-test added at 2ece87
39 changes: 39 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "@aragon/osx-plugin-template-foundry",
"description": "",
"version": "1.0.0",
"author": {
"name": "aragon",
"url": "https://github.com/Aragon"
},
"keywords": [
"blockchain",
"ethereum",
"forge",
"foundry",
"smart-contracts",
"solidity",
"aragon",
"osx",
"dao",
"daobox"
],
"private": true,
"scripts": {
"clean": "rm -rf cache out",
"build": "forge build",
"lint": "pnpm lint:sol && pnpm prettier:check",
"lint:sol": "solhint --max-warnings 0 \"{script,src,test}/**/*.sol\"",
"prettier:check": "prettier --check --plugin=prettier-plugin-solidity \"**/*.{js,json,md,sol,ts,yml}\"",
"prettier:write": "prettier --check --plugin=prettier-plugin-solidity \"**/*.{js,json,md,sol,ts,yml}\"",
"test": "forge test -vvv",
"test:coverage": "forge coverage",
"test:coverage:report": "forge coverage --report lcov && genhtml lcov.info --branch-coverage --output-dir coverage"
},
"devDependencies": {
"prettier": "^2.8.8",
"prettier-plugin-solidity": "^1.1.3",
"solhint": "^3.6.2",
"solhint-plugin-prettier": "^0.0.5"
}
}
Loading

0 comments on commit 27e02a9

Please sign in to comment.