Skip to content

Commit 9613f5a

Browse files
committed
init
1 parent 785964d commit 9613f5a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+29281
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
permissions: {}
4+
5+
on:
6+
push:
7+
pull_request:
8+
workflow_dispatch:
9+
10+
env:
11+
FOUNDRY_PROFILE: ci
12+
13+
jobs:
14+
check:
15+
name: Foundry project
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
steps:
20+
- uses: actions/checkout@v5
21+
with:
22+
persist-credentials: false
23+
submodules: recursive
24+
25+
- name: Install Foundry
26+
uses: foundry-rs/foundry-toolchain@v1
27+
28+
- name: Show Forge version
29+
run: forge --version
30+
31+
- name: Run Forge fmt
32+
run: forge fmt --check
33+
34+
- name: Run Forge build
35+
run: forge build --sizes
36+
37+
- name: Run Forge tests
38+
run: forge test -vvv
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Compiler files
2+
cache/
3+
out/
4+
5+
# Ignores development broadcast logs
6+
!/broadcast
7+
/broadcast/*/31337/
8+
/broadcast/**/dry-run/
9+
10+
# Docs
11+
docs/
12+
13+
# Dotenv file
14+
.env
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "lib/forge-std"]
2+
path = lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
## Foundry
2+
3+
**Foundry is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.**
4+
5+
Foundry consists of:
6+
7+
- **Forge**: Ethereum testing framework (like Truffle, Hardhat and DappTools).
8+
- **Cast**: Swiss army knife for interacting with EVM smart contracts, sending transactions and getting chain data.
9+
- **Anvil**: Local Ethereum node, akin to Ganache, Hardhat Network.
10+
- **Chisel**: Fast, utilitarian, and verbose solidity REPL.
11+
12+
## Documentation
13+
14+
https://book.getfoundry.sh/
15+
16+
## Usage
17+
18+
### Build
19+
20+
```shell
21+
$ forge build
22+
```
23+
24+
### Test
25+
26+
```shell
27+
$ forge test
28+
```
29+
30+
### Format
31+
32+
```shell
33+
$ forge fmt
34+
```
35+
36+
### Gas Snapshots
37+
38+
```shell
39+
$ forge snapshot
40+
```
41+
42+
### Anvil
43+
44+
```shell
45+
$ anvil
46+
```
47+
48+
### Deploy
49+
50+
```shell
51+
$ forge script script/Counter.s.sol:CounterScript --rpc-url <your_rpc_url> --private-key <your_private_key>
52+
```
53+
54+
### Cast
55+
56+
```shell
57+
$ cast <subcommand>
58+
```
59+
60+
### Help
61+
62+
```shell
63+
$ forge --help
64+
$ anvil --help
65+
$ cast --help
66+
```
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"lib/forge-std": {
3+
"tag": {
4+
"name": "v1.12.0",
5+
"rev": "7117c90c8cf6c68e5acce4f09a6b24715cea4de6"
6+
}
7+
}
8+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[profile.default]
2+
src = "src"
3+
out = "out"
4+
libs = ["lib"]
5+
6+
# See more config options https://github.com/foundry-rs/foundry/blob/master/crates/config/README.md#all-options
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/Vm.sol linguist-generated
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* @danipopes @klkvr @mattsse @grandizzy @yash-atreya @zerosnacks @onbjerg @0xrusowsky
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
name: CI
2+
3+
permissions: {}
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
push:
9+
branches:
10+
- master
11+
12+
jobs:
13+
build:
14+
name: build +${{ matrix.toolchain }} ${{ matrix.flags }}
15+
runs-on: ubuntu-latest
16+
timeout-minutes: 10
17+
permissions:
18+
contents: read
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
toolchain: [stable, nightly]
23+
flags:
24+
- ""
25+
- --via-ir
26+
- --use solc:0.8.17 --via-ir
27+
- --use solc:0.8.17
28+
- --use solc:0.8.0
29+
- --use solc:0.7.6
30+
- --use solc:0.7.0
31+
- --use solc:0.6.2
32+
- --use solc:0.6.12
33+
steps:
34+
- uses: actions/checkout@v6
35+
with:
36+
persist-credentials: false
37+
- uses: foundry-rs/foundry-toolchain@v1
38+
- run: forge --version
39+
- run: |
40+
case "${{ matrix.flags }}" in
41+
*"solc:0.8.0"* | *"solc:0.7"* | *"solc:0.6"*)
42+
forge build --skip test --skip Config --skip StdConfig --skip LibVariable --deny-warnings ${{ matrix.flags }}
43+
;;
44+
*)
45+
forge build --skip test --deny-warnings ${{ matrix.flags }}
46+
;;
47+
esac
48+
# via-ir compilation time checks.
49+
- if: contains(matrix.flags, '--via-ir')
50+
run: forge build --skip test --deny-warnings ${{ matrix.flags }} --contracts 'test/compilation/*'
51+
52+
test:
53+
runs-on: ubuntu-latest
54+
timeout-minutes: 10
55+
permissions:
56+
contents: read
57+
strategy:
58+
fail-fast: false
59+
matrix:
60+
toolchain: [stable, nightly]
61+
steps:
62+
- uses: actions/checkout@v6
63+
with:
64+
persist-credentials: false
65+
- uses: foundry-rs/foundry-toolchain@v1
66+
with:
67+
version: ${{ matrix.toolchain }}
68+
- run: forge --version
69+
- run: forge test -vvv
70+
71+
fmt:
72+
runs-on: ubuntu-latest
73+
timeout-minutes: 10
74+
permissions:
75+
contents: read
76+
steps:
77+
- uses: actions/checkout@v6
78+
with:
79+
persist-credentials: false
80+
- uses: foundry-rs/foundry-toolchain@v1
81+
- run: forge --version
82+
- run: forge fmt --check
83+
84+
typos:
85+
runs-on: ubuntu-latest
86+
timeout-minutes: 10
87+
permissions:
88+
contents: read
89+
steps:
90+
- uses: actions/checkout@v6
91+
with:
92+
persist-credentials: false
93+
- uses: crate-ci/typos@626c4bedb751ce0b7f03262ca97ddda9a076ae1c # v1
94+
95+
codeql:
96+
name: Analyze (${{ matrix.language }})
97+
runs-on: ubuntu-latest
98+
permissions:
99+
security-events: write
100+
actions: read
101+
contents: read
102+
strategy:
103+
fail-fast: false
104+
matrix:
105+
include:
106+
- language: actions
107+
build-mode: none
108+
steps:
109+
- name: Checkout repository
110+
uses: actions/checkout@v6
111+
with:
112+
persist-credentials: false
113+
- name: Initialize CodeQL
114+
uses: github/codeql-action/init@v4
115+
with:
116+
languages: ${{ matrix.language }}
117+
build-mode: ${{ matrix.build-mode }}
118+
- name: Perform CodeQL Analysis
119+
uses: github/codeql-action/analyze@v4
120+
with:
121+
category: "/language:${{matrix.language}}"
122+
123+
ci-success:
124+
runs-on: ubuntu-latest
125+
if: always()
126+
needs:
127+
- build
128+
- test
129+
- fmt
130+
- typos
131+
- codeql
132+
timeout-minutes: 10
133+
steps:
134+
- name: Decide whether the needed jobs succeeded or failed
135+
uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # release/v1
136+
with:
137+
jobs: ${{ toJSON(needs) }}

0 commit comments

Comments
 (0)