Skip to content

Commit af2772e

Browse files
V48 Gate 4 (impl-only): Track Foundry lockfile
npm-like deps: commit foundry.lock, ignore lib/, drop forge-std submodule, document forge install --no-git.
1 parent 7365db8 commit af2772e

7 files changed

Lines changed: 48 additions & 10 deletions

File tree

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,3 @@
1616
[submodule "contract/lib/solmate"]
1717
path = contract/lib/solmate
1818
url = https://github.com/transmissions11/solmate
19-
[submodule "packages/btd/contracts/lib/forge-std"]
20-
path = packages/btd/contracts/lib/forge-std
21-
url = https://github.com/foundry-rs/forge-std

packages/btd/contracts/.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
# Foundry
1+
# Foundry build / local artifacts (regenerable)
22
cache/
33
out/
44
broadcast/
5+
6+
# Installed deps (like node_modules) — restore from foundry.lock
57
lib/
68

79
# Local env / keys (never commit)
810
.env
911
.env.*
12+
13+
# Track the lockfile (like package-lock.json / pnpm-lock.yaml)
14+
# foundry.lock is NOT ignored

packages/btd/contracts/DEPLOY.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,12 @@
1616

1717
## 1. Compile & unit test
1818

19+
Deps are **not** vendored: `foundry.lock` is tracked; `lib/` is gitignored (like `node_modules`).
20+
1921
```bash
2022
cd packages/btd/contracts
21-
forge install foundry-rs/forge-std # once per clone
23+
# Restore forge-std to the pin in foundry.lock (currently v1.16.2)
24+
forge install foundry-rs/forge-std@v1.16.2 --no-git
2225
forge build
2326
forge test -vv
2427
```

packages/btd/contracts/README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,32 @@ DEPLOY.md
1919

2020
Dual-maintain TS: `packages/btd/src/erc1155/`.
2121

22-
## Setup (once per clone)
22+
## Dependencies (npm-like)
23+
24+
| Track in git | Do not track |
25+
| --- | --- |
26+
| `foundry.toml` | `lib/` (installed packages) |
27+
| **`foundry.lock`** (exact pins) | `out/`, `cache/`, `broadcast/` |
28+
29+
Current lock pins **forge-std @ v1.16.2** (`bf647bd…`).
30+
31+
### Install / restore deps
2332

2433
```bash
2534
cd packages/btd/contracts
26-
forge install foundry-rs/forge-std
35+
# --no-git: install into lib/ without creating a git submodule
36+
forge install foundry-rs/forge-std@v1.16.2 --no-git
2737
```
2838

29-
`lib/` is local (see `.gitignore`).
39+
Use the tag/rev recorded in `foundry.lock` if the pin changes. After upgrading a dependency, **commit the updated `foundry.lock`**.
40+
41+
Do **not** commit `lib/`.
3042

3143
## Build / test
3244

3345
```bash
3446
cd packages/btd/contracts
47+
forge install foundry-rs/forge-std@v1.16.2 --no-git # if lib/ missing
3548
forge build
3649
forge test -vv
3750
```
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.16.2",
5+
"rev": "bf647bd6046f2f7da30d0c2bf435e5c76a780c1b"
6+
}
7+
}
8+
}

packages/btd/contracts/foundry.toml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
# BitcodeERC1155 Foundry project
2+
#
3+
# Dependency hygiene (npm-like):
4+
# Track: foundry.toml, foundry.lock
5+
# Ignore: lib/ (install output), out/, cache/, broadcast/
6+
#
7+
# Restore deps after clone (pin must match foundry.lock):
8+
# forge install foundry-rs/forge-std@v1.16.2 --no-git
9+
#
10+
# Upgrade a dep:
11+
# forge install foundry-rs/forge-std@vX.Y.Z --no-git
12+
# # commit the updated foundry.lock
13+
114
[profile.default]
215
src = "src"
316
out = "out"
@@ -8,7 +21,7 @@ optimizer_runs = 200
821
# Quote hashing locals overflow stack without IR pipeline.
922
via_ir = true
1023

11-
# Remappings for forge-std
24+
# Remappings for forge-std (after forge install into lib/)
1225
remappings = ["forge-std/=lib/forge-std/src/"]
1326

1427
[rpc_endpoints]
Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)