Skip to content

Commit c538f16

Browse files
committed
feat: project scaffolding
0 parents  commit c538f16

14 files changed

Lines changed: 208 additions & 0 deletions

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
env:
9+
FOUNDRY_PROFILE: ci
10+
11+
jobs:
12+
check:
13+
name: Foundry project
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
20+
- name: Install Foundry
21+
uses: foundry-rs/foundry-toolchain@v1
22+
23+
- name: Show Forge version
24+
run: |
25+
forge --version
26+
27+
- name: Run Forge fmt
28+
run: |
29+
forge fmt --check
30+
id: fmt
31+
32+
- name: Run Forge build
33+
run: |
34+
forge build --sizes
35+
id: build
36+
37+
- name: Run Forge tests
38+
run: |
39+
forge test -vvv
40+
id: test

.gitignore

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

.gitmodules

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[submodule "lib/forge-std"]
2+
path = lib/forge-std
3+
url = https://github.com/foundry-rs/forge-std
4+
[submodule "lib/v4-core"]
5+
path = lib/v4-core
6+
url = https://github.com/uniswap/v4-core
7+
[submodule "lib/v4-periphery"]
8+
path = lib/v4-periphery
9+
url = https://github.com/uniswap/v4-periphery
10+
[submodule "lib/prb-math"]
11+
path = lib/prb-math
12+
url = https://github.com/PaulRBerg/prb-math
13+
[submodule "lib/openzeppelin-contracts"]
14+
path = lib/openzeppelin-contracts
15+
url = https://github.com/OpenZeppelin/openzeppelin-contracts
16+
[submodule "lib/v4-hooks-public"]
17+
path = lib/v4-hooks-public
18+
url = https://github.com/Uniswap/v4-hooks-public

README.md

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+
```

foundry.lock

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"lib/forge-std": {
3+
"tag": {
4+
"name": "v1.15.0",
5+
"rev": "0844d7e1fc5e60d77b68e469bff60265f236c398"
6+
}
7+
},
8+
"lib/openzeppelin-contracts": {
9+
"tag": {
10+
"name": "v5.6.1",
11+
"rev": "5fd1781b1454fd1ef8e722282f86f9293cacf256"
12+
}
13+
},
14+
"lib/prb-math": {
15+
"tag": {
16+
"name": "v4.1.1",
17+
"rev": "b51e8631ed28d3cc917c491dd47cd6c3ff652edc"
18+
}
19+
},
20+
"lib/v4-core": {
21+
"tag": {
22+
"name": "v4.0.0",
23+
"rev": "e50237c43811bd9b526eff40f26772152a42daba"
24+
}
25+
},
26+
"lib/v4-periphery": {
27+
"rev": "5da22e609fd78c01fb7ddf2a6abb1f2ec7dc2b87"
28+
}
29+
}

foundry.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[profile.default]
2+
src = "src"
3+
out = "out"
4+
libs = ["lib"]
5+
solc_version = "0.8.26"
6+
evm_version = "cancun"
7+
optimizer = true
8+
optimizer_runs = 1000
9+
via_ir = true
10+
ffi = false
11+
12+
[profile.default.fuzz]
13+
runs = 1000
14+
15+
[profile.ci.fuzz]
16+
runs = 10000

lib/forge-std

Submodule forge-std added at 0844d7e

lib/openzeppelin-contracts

Submodule openzeppelin-contracts added at 5fd1781

lib/prb-math

Submodule prb-math added at b51e863

lib/v4-core

Submodule v4-core added at e50237c

0 commit comments

Comments
 (0)