-
Notifications
You must be signed in to change notification settings - Fork 1
Add reproducible Foundry baseline #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
79560be
Add reproducible Foundry baseline
punk6529 740a02a
Record reproducible baseline PR state
punk6529 47a23d1
Harden baseline bootstrap tooling
punk6529 8944025
Harden CI action references
punk6529 a4faac0
Record reproducible baseline merge readiness
punk6529 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| root = true | ||
|
|
||
| [*] | ||
| charset = utf-8 | ||
| end_of_line = lf | ||
| insert_final_newline = true | ||
| indent_style = space | ||
| indent_size = 4 | ||
| trim_trailing_whitespace = true | ||
|
|
||
| [Makefile] | ||
| indent_style = tab | ||
|
|
||
| [*.md] | ||
| trim_trailing_whitespace = false | ||
|
|
||
| [*.ps1] | ||
| end_of_line = crlf | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| * text=auto | ||
|
|
||
| .editorconfig text eol=lf | ||
| .gitattributes text eol=lf | ||
| .gitignore text eol=lf | ||
|
|
||
| *.sol text eol=lf | ||
| *.md text eol=lf | ||
| *.toml text eol=lf | ||
| *.txt text eol=lf | ||
| *.yml text eol=lf | ||
| *.yaml text eol=lf | ||
| *.sh text eol=lf | ||
| Makefile text eol=lf | ||
|
|
||
| *.ps1 text eol=crlf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| foundry: | ||
| name: Foundry smoke | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 | ||
| with: | ||
| persist-credentials: false | ||
|
|
||
| - name: Install Foundry | ||
| uses: foundry-rs/foundry-toolchain@c7450ba673e133f5ee30098b3b54f444d3a2ca2d | ||
| with: | ||
| version: v1.7.1 | ||
|
|
||
| - name: Build | ||
| shell: bash | ||
| run: | | ||
| set -o pipefail | ||
| mkdir -p ci-logs | ||
| forge build 2>&1 | tee ci-logs/forge-build.log | ||
|
|
||
| - name: Test | ||
| shell: bash | ||
| run: | | ||
| set -o pipefail | ||
| mkdir -p ci-logs | ||
| forge test -vvv 2>&1 | tee ci-logs/forge-test.log | ||
|
|
||
| - name: Upload Foundry logs | ||
| if: always() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 | ||
| with: | ||
| name: foundry-smoke-logs | ||
| path: ci-logs/ | ||
| if-no-files-found: ignore | ||
| retention-days: 14 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,27 @@ | ||
| # Ignore node_modules directory | ||
| # Node / frontend artifacts | ||
| node_modules/ | ||
|
|
||
| # Ignore log files | ||
| # Logs | ||
| logs/ | ||
| *.log | ||
|
|
||
| # Ignore build directories | ||
| # Build outputs | ||
| dist/ | ||
| build/ | ||
| out/ | ||
| cache/ | ||
| broadcast/ | ||
|
|
||
| # Ignore environment variable files | ||
| # Local environments and secrets | ||
| .env | ||
| .env.* | ||
|
punk6529 marked this conversation as resolved.
|
||
| !.env.example | ||
| !.env.sample | ||
| !.env.template | ||
| .venv-tools/ | ||
|
|
||
| # Ignore IDE specific files | ||
| # Editors and OS files | ||
| .idea/ | ||
| .vscode/ | ||
|
|
||
| # Ignore OS generated files | ||
| .DS_Store | ||
| Thumbs.db | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| ifeq ($(OS),Windows_NT) | ||
| ifdef MSYSTEM | ||
| FOUNDRY_BIN := $(HOME)/.foundry/bin | ||
| REPO_ROOT := $(shell pwd) | ||
| PATH_SEPARATOR := : | ||
| RM_RF := rm -rf out cache broadcast | ||
| else | ||
| FOUNDRY_BIN := $(USERPROFILE)/.foundry/bin | ||
| REPO_ROOT := $(CURDIR) | ||
| PATH_SEPARATOR := ; | ||
| RM_RF := powershell -NoProfile -ExecutionPolicy Bypass -Command "Remove-Item -Recurse -Force out,cache,broadcast -ErrorAction SilentlyContinue" | ||
| endif | ||
| VENV_BIN := .venv-tools/Scripts | ||
| else | ||
| FOUNDRY_BIN := $(HOME)/.foundry/bin | ||
| REPO_ROOT := $(CURDIR) | ||
| PATH_SEPARATOR := : | ||
| VENV_BIN := .venv-tools/bin | ||
| RM_RF := rm -rf out cache broadcast | ||
| endif | ||
| PATH := $(FOUNDRY_BIN)$(PATH_SEPARATOR)$(REPO_ROOT)/$(VENV_BIN)$(PATH_SEPARATOR)$(PATH) | ||
|
|
||
| .PHONY: check build test fmt-check slither clean | ||
|
|
||
| check: build test | ||
|
|
||
| build: | ||
| forge build | ||
|
|
||
| test: | ||
| forge test -vvv | ||
|
|
||
| fmt-check: | ||
| forge fmt --check smart-contracts | ||
|
|
||
| slither: | ||
| slither . --foundry-compile-all | ||
|
punk6529 marked this conversation as resolved.
|
||
|
|
||
| clean: | ||
| $(RM_RF) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,84 @@ | ||
| # 6529Stream | ||
|
|
||
| 6529 stream consists of a set of smart contracts (NextGen-modified contracts) to allow the minting/auctioning of drops | ||
| 6529Stream is a set of Solidity smart contracts for 6529 NFT drops, including | ||
| fixed-price minting, auction flows, curator rewards, metadata generation, and | ||
| randomness adapters. | ||
|
|
||
| It has a TDH signer to act as an admin | ||
| ## Status | ||
|
|
||
| ## Process | ||
| This repository is pre-audit and not production-ready. | ||
|
|
||
| 1. TDH holders provide rep to drops | ||
| 2. If a Drop clears the hurdle for the network selected, it goes into a Pool | ||
| 3. Once the Drops is within a Pool, addresses that meet the requirements of the TDH signer contract can sign a minting transaction | ||
| 4. Once the TDH signer requirements are met anyone can mint the NFT to buy it or send it to an auction | ||
| The current CI and local smoke checks prove only that the contracts compile and | ||
| that the Foundry test command executes. They do not prove protocol correctness. | ||
| Known P0 blockers and the execution roadmap are tracked in | ||
| [`ops/ROADMAP.md`](ops/ROADMAP.md). | ||
|
|
||
| ## Drop Flow | ||
|
|
||
| 1. TDH holders provide reputation to drops. | ||
| 2. If a drop clears the selected network hurdle, it enters a pool. | ||
| 3. Once a drop is in a pool, addresses that meet TDH signer requirements can | ||
| sign a minting transaction. | ||
| 4. Once signer requirements are met, the NFT can be minted through fixed-price | ||
| purchase or sent to auction. | ||
|
|
||
| ## Quickstart | ||
|
|
||
| Install Foundry `v1.7.1`, then run: | ||
|
|
||
| ```bash | ||
| make check | ||
| ``` | ||
|
|
||
| The canonical smoke check runs: | ||
|
|
||
| ```bash | ||
| forge build | ||
| forge test -vvv | ||
| ``` | ||
|
|
||
| On Windows, install Python 3.8+ or the `py` launcher, then bootstrap and verify | ||
| with: | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File scripts\bootstrap-windows.ps1 | ||
| powershell -ExecutionPolicy Bypass -File scripts\check.ps1 | ||
| ``` | ||
|
|
||
| On Linux or EC2, bootstrap and verify with: | ||
|
|
||
| ```bash | ||
| bash scripts/bootstrap-ec2.sh | ||
| make check | ||
| ``` | ||
|
|
||
| ## Tooling | ||
|
|
||
| Tool versions and non-gating diagnostic commands are documented in | ||
| [`docs/tooling.md`](docs/tooling.md). | ||
|
|
||
| Current pinned versions: | ||
|
|
||
| | Tool | Version | | ||
| | --- | --- | | ||
| | Foundry | `v1.7.1` | | ||
| | Solidity compiler | `0.8.19` | | ||
| | Slither | `0.11.5` | | ||
|
|
||
| ## Repository Layout | ||
|
|
||
| | Path | Purpose | | ||
| | --- | --- | | ||
| | `smart-contracts/` | Solidity source | | ||
| | `test/` | Foundry tests | | ||
| | `script/` | Foundry scripts | | ||
| | `docs/` | Project, security, ADR, and operational docs | | ||
| | `ops/` | Roadmap and execution state | | ||
|
|
||
| ## Important Docs | ||
|
|
||
| - [`ops/ROADMAP.md`](ops/ROADMAP.md) | ||
| - [`ops/AUTONOMOUS_RUN.md`](ops/AUTONOMOUS_RUN.md) | ||
| - [`docs/status.md`](docs/status.md) | ||
| - [`docs/known-blockers.md`](docs/known-blockers.md) | ||
| - [`docs/tooling.md`](docs/tooling.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Architecture Decision Records | ||
|
|
||
| ADRs are required before unsafe P0 implementation work. | ||
|
|
||
| Expected ADRs are tracked in `ops/ROADMAP.md`: | ||
|
|
||
| - `0001-drop-authorization.md` | ||
| - `0002-auction-custody.md` | ||
| - `0003-payment-accounting.md` | ||
| - `0004-admin-governance.md` | ||
| - `0005-randomness.md` | ||
| - `0006-metadata-freeze.md` | ||
| - `0007-upgrade-redeployment.md` | ||
|
|
||
| Each ADR should include problem, current behavior, intended behavior, | ||
| alternatives, security impact, migration impact, test plan, rollout plan, | ||
| non-goals, and accepted risks. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Known Blockers | ||
|
|
||
| This file summarizes the high-level blockers from `ops/ROADMAP.md` for | ||
| contributors who start from the README. | ||
|
|
||
| - Drop execution currently needs typed, replay-safe authorization. | ||
| - `tx.origin` usage must be removed from drop execution. | ||
| - Auction custody and settlement need an accepted state-machine model. | ||
| - Push payments must move to pull-payment accounting before production use. | ||
| - Randomizer request and callback validation need production hardening. | ||
| - Slither high/medium findings need triage before audit readiness. | ||
| - Meaningful unit, integration, regression, and invariant tests are missing. | ||
| - Deployment scripts, manifests, and rehearsal runbooks are missing. | ||
|
|
||
| Do not treat the current build/test smoke baseline as a security claim. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # Project Status | ||
|
|
||
| 6529Stream is pre-audit and not production-ready. | ||
|
|
||
| The current Gate A smoke baseline proves: | ||
|
|
||
| - Foundry is configured to compile `smart-contracts`. | ||
| - `forge build` runs against Solidity `0.8.19`. | ||
| - `forge test -vvv` executes, even though meaningful tests are not yet present. | ||
| - CI can run the same build/test smoke commands and publish logs. | ||
|
|
||
| The current baseline does not prove protocol correctness. Known blockers remain | ||
| tracked in `ops/ROADMAP.md`, including authorization, auction custody, | ||
| pull-payment accounting, randomizer hardening, static-analysis triage, and | ||
| meaningful tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| # Tooling | ||
|
|
||
| 6529Stream currently uses a pinned Foundry smoke baseline. | ||
|
|
||
| ## Versions | ||
|
|
||
| | Tool | Version | | ||
| | --- | --- | | ||
| | Foundry | `v1.7.1` | | ||
| | Solidity compiler | `0.8.19` | | ||
| | Slither | `0.11.5` | | ||
| | solc-select | `1.2.0` | | ||
|
|
||
| ## Local Checks | ||
|
|
||
| Run the canonical Gate A smoke check: | ||
|
|
||
| ```bash | ||
| make check | ||
| ``` | ||
|
|
||
| This runs: | ||
|
|
||
| ```bash | ||
| forge build | ||
| forge test -vvv | ||
| ``` | ||
|
|
||
| Windows contributors can run: | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File scripts\check.ps1 | ||
| ``` | ||
|
|
||
| The Windows script prepends `%USERPROFILE%\.foundry\bin` to the current process | ||
| `PATH` so a fresh shell can find `forge` after bootstrap. | ||
|
|
||
| ## Bootstrap | ||
|
|
||
| Linux or EC2: | ||
|
|
||
| ```bash | ||
| bash scripts/bootstrap-ec2.sh | ||
| ``` | ||
|
|
||
| Windows PowerShell: | ||
|
|
||
| ```powershell | ||
| powershell -ExecutionPolicy Bypass -File scripts\bootstrap-windows.ps1 | ||
| ``` | ||
|
|
||
| Windows bootstrap requires Python 3.8+ or the `py` launcher for the local | ||
| Slither and `solc-select` tool environment. Foundry itself is downloaded from | ||
| the pinned release asset and verified with SHA256 before extraction. | ||
|
|
||
| ## Non-Gating Diagnostics | ||
|
|
||
| These commands are intentionally not part of `make check` yet: | ||
|
|
||
| ```bash | ||
| make fmt-check | ||
| make slither | ||
| ``` | ||
|
|
||
| Formatting and Slither have known baselines and should become gates only after | ||
| the roadmap items for formatting triage and Slither baseline acceptance land. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| [profile.default] | ||
| src = "smart-contracts" | ||
| test = "test" | ||
| script = "script" | ||
| out = "out" | ||
| cache_path = "cache" | ||
| libs = ["lib"] | ||
| solc_version = "0.8.19" | ||
| auto_detect_solc = false | ||
| evm_version = "paris" | ||
| optimizer = true | ||
| optimizer_runs = 200 | ||
|
|
||
| [fmt] | ||
| line_length = 100 | ||
| tab_width = 4 | ||
| bracket_spacing = true |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The new
.editorconfigsetsindent_size = 4under[*]with no overrides for YAML or shell, but the YAML and shell files added in this same PR —.github/workflows/ci.yml,scripts/bootstrap-ec2.sh,scripts/check.sh— all use 2-space indentation. Editors that honor.editorconfig(VS Code with the EditorConfig extension, JetBrains, vim-editorconfig) will auto-indent newly typed lines at 4 spaces in these files, producing mixed-indent diffs and — for YAML, where indentation is structurally significant — potentially breaking the document. One-line fix: add[*.{yml,yaml}]and[*.sh]blocks withindent_size = 2next to the existing[Makefile]/[*.md]/[*.ps1]overrides.Extended reasoning...
What the bug is.
.editorconfiglines 3-9 declare[*]withindent_style = spaceandindent_size = 4. The only overrides are[Makefile](tab),[*.md](whitespace), and[*.ps1](CRLF) — none of which setindent_sizefor YAML or shell. Yet the files this PR introduces under those globs use 2-space indentation:.github/workflows/ci.ymlis standard 2-space YAML, andscripts/bootstrap-ec2.sh/scripts/check.shuse 2-space throughout.Why existing config doesn't prevent it. There is no glob entry for
*.yml,*.yaml, or*.sh, so they all fall through to the[*]default of 4. The.editorconfigand the committed files therefore disagree about indent width for the very files the PR adds.Step-by-step proof. A contributor opens
.github/workflows/ci.ymlin VS Code with the EditorConfig extension (or JetBrains IDE / vim-editorconfig). They hit Enter inside the existingjobs.foundry.stepsblock, currently indented at 6 spaces (3 levels × 2 spaces). The editor reads.editorconfig, seesindent_size = 4applies to this file, and inserts 4 spaces for the next level instead of 2. The new line is now at 10 spaces instead of 8, which is invalid YAML structurally — YAML treats different indentation widths within the same block as a parse error or as a different scope. Forscripts/check.shandscripts/bootstrap-ec2.shthe consequence is less severe (bash doesn't care about indent width) but the file accumulates mixed 2/4-space blocks that produce noisy diffs.Impact. Low —
.editorconfigis editor-side guidance, not a CI gate, and the committed files themselves are well-formed today. The breakage is contributor-side and only manifests when a contributor edits one of these files in an EditorConfig-aware editor without manually overriding indent. However, the asymmetry is real: the PR explicitly establishes a reproducible-baseline formatting layer and goes to the trouble of overriding[Makefile],[*.md], and[*.ps1]— leaving YAML and shell out is an obvious gap in the same set of files.How to fix. One line per filetype:
Alternatively, invert the default to
indent_size = 2and add[*.sol] indent_size = 4for Solidity (which is 4-space in this repo). Either approach restores agreement between.editorconfigand the source-of-truth indentation used in the files the PR ships.