Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .editorconfig
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
Comment on lines +3 to +9

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 The new .editorconfig sets indent_size = 4 under [*] 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 with indent_size = 2 next to the existing [Makefile] / [*.md] / [*.ps1] overrides.

Extended reasoning...

What the bug is. .editorconfig lines 3-9 declare [*] with indent_style = space and indent_size = 4. The only overrides are [Makefile] (tab), [*.md] (whitespace), and [*.ps1] (CRLF) — none of which set indent_size for YAML or shell. Yet the files this PR introduces under those globs use 2-space indentation: .github/workflows/ci.yml is standard 2-space YAML, and scripts/bootstrap-ec2.sh / scripts/check.sh use 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 .editorconfig and 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.yml in VS Code with the EditorConfig extension (or JetBrains IDE / vim-editorconfig). They hit Enter inside the existing jobs.foundry.steps block, currently indented at 6 spaces (3 levels × 2 spaces). The editor reads .editorconfig, sees indent_size = 4 applies 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. For scripts/check.sh and scripts/bootstrap-ec2.sh the 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 — .editorconfig is 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:

[*.{yml,yaml}]
indent_size = 2

[*.sh]
indent_size = 2

Alternatively, invert the default to indent_size = 2 and add [*.sol] indent_size = 4 for Solidity (which is 4-space in this repo). Either approach restores agreement between .editorconfig and the source-of-truth indentation used in the files the PR ships.


[Makefile]
indent_style = tab

[*.md]
trim_trailing_whitespace = false

[*.ps1]
end_of_line = crlf
16 changes: 16 additions & 0 deletions .gitattributes
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
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
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
20 changes: 13 additions & 7 deletions .gitignore
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.*
Comment thread
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
40 changes: 40 additions & 0 deletions Makefile
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
Comment thread
punk6529 marked this conversation as resolved.

clean:
$(RM_RF)
86 changes: 79 additions & 7 deletions README.md
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)
17 changes: 17 additions & 0 deletions docs/adr/README.md
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.
15 changes: 15 additions & 0 deletions docs/known-blockers.md
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.
15 changes: 15 additions & 0 deletions docs/status.md
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.
66 changes: 66 additions & 0 deletions docs/tooling.md
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.
17 changes: 17 additions & 0 deletions foundry.toml
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
Loading
Loading