Skip to content

Modernize toolchain and check deployed bytecode - #20

Merged
ryanio merged 5 commits into
mainfrom
ryan/modernize-toolchain
Nov 10, 2026
Merged

ryanio merged 5 commits into
mainfrom
ryan/modernize-toolchain

Conversation

@ryanio

@ryanio ryanio commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Brings seaport-core's tooling in line with seaport's modernized main and adds a CI check that the build still matches canonical Seaport 1.6. No file under src/, the lib/seaport-types pin, and no compiler setting changes.

Deployed bytecode check

scripts/check-deployed-bytecode.sh builds with foundry.toml as it is on main and hashes the Seaport creation code plus the abi-encoded ConduitController (0x00000000F9490004C11Cef243f5400493c00Ad63). The result must equal the canonical init code hash 0xde057106...902d94. It also checks that this hash and salt 0x...d738b7f0bb99901b1c83f249 derive 0x0000000000000068F116a894984e2DB1123eB395 through the ImmutableCreate2Factory. It uses only forge, cast, and jq, so the repo still has no forge-std.

Main's own settings (solc 0.8.24, via_ir, cancun, bytecode_hash = "none", optimizer_runs = 4_294_967_295) reproduce the hash with Foundry 1.9.0. With FOUNDRY_OPTIMIZER_RUNS=200 the script fails as expected.

Lint tooling

  • scripts/install-tools.sh, scripts/lint.sh, lefthook.yml, biome.json, .taplo.toml, and .editorconfig come from seaport, trimmed to this repo. The tools are pinned binaries checked by SHA-256 and installed into .tools/bin, which is gitignored.
  • src/** is excluded from forge fmt and forge lint in foundry.toml and in lefthook's exclude list. lint_on_build is off, so forge build no longer prints lint notes for the frozen source.
  • scripts/frozen-src.sha256 records a hash of every file in src/. Lint fails if one changes.

CI

  • test.yml now runs on pushes to main and on pull requests (it was workflow_dispatch only, on Foundry nightly). It has a build job (build plus the bytecode check) and a lint job, with Foundry pinned to v1.9.0, least-privilege permissions, and concurrency.
  • publish.yml keeps its trigger and the NPM_TOKEN secret. It now uses Node 26 (current LTS, from .nvmrc), yarn install --frozen-lockfile, and npm publish --provenance --access public with id-token: write. package.json spells out repository in the git+https form that provenance checks against.
  • tag.yml keeps its triggers and behavior. It replaces the deprecated ::set-output with $GITHUB_OUTPUT, passes the tag through env, and force-pushes only the new tag instead of every local tag.
  • Every action is pinned by commit SHA with a version comment.

npm package

yarn.lock still pinned seaport-types@^0.0.1 while package.json asks for 1.6.3, so --frozen-lockfile would have failed. It is regenerated and now resolves seaport-types@1.6.3, whose gitHead matches the lib/seaport-types pin. npm pack --dry-run lists the same 28 files as the published 1.6.6 tarball. npm never packs node_modules, even when files lists it, so seaport-types reaches consumers as a normal dependency. The only package.json change is the repository field.

Docs

Adds a short AGENTS.md, refreshes the README with links to seaport's docs and deployments, and adds seaport's pull request template.

Verification

  • scripts/lint.sh check is clean with Foundry 1.9.0, and fails after a one-byte edit to src/Seaport.sol.
  • scripts/check-deployed-bytecode.sh passes.
  • git diff origin/main -- src/ lib/ is empty.

🤖 Generated with Claude Code

ryanio and others added 4 commits November 10, 2026 11:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

The development and release tooling changes have no active review issues.

No open issues 🎉

What changed in this PR

Modernizes seaport-core’s development and release tooling while preserving the source and compiler settings used for canonical Seaport 1.6.

Changes:

  • Adds canonical init-code hash and deployment-address checks, plus frozen-source checksums.
  • Introduces pinned lint tools, formatting configuration, and automated build and lint CI.
  • Updates npm publishing, corrects the dependency lockfile, and refreshes contributor documentation.
File Description
yarn.lock Aligns seaport-types resolution with the declared 1.6.3 dependency.
scripts/​lint.sh Adds shared lint, formatting, and source-freeze commands.
scripts/​install-tools.sh Installs pinned lint tools with checksum verification.
scripts/​frozen-src.sha256 Records checksums for frozen Solidity sources.
scripts/​check-deployed-bytecode.sh Checks canonical init-code hash and derived deployment address.
README.md Refreshes installation, development, and documentation guidance.
lefthook.yml Adds formatting hooks that exclude frozen Solidity sources.
foundry.toml Excludes frozen sources from formatting and linting without changing compiler settings.
biome.json Configures formatting, linting, and generated-directory exclusions.
AGENTS.md Documents source-preservation rules and contributor commands.
.taplo.toml Configures TOML formatting.
.nvmrc Selects Node 26 for publishing.
.gitignore Excludes npm dependencies and installed lint tools.
.github/​workflows/​test.yml Automates build, bytecode verification, and lint checks.
.github/​workflows/​tag.yml Modernizes output handling and adds branch-level concurrency.
.github/​workflows/​publish.yml Updates Node setup and adds frozen installs and npm provenance.
.github/​pull_request_template.md Adds motivation and solution prompts for contributors.
.github/​actions/​setup-foundry/​action.yml Centralizes pinned Foundry installation and caching.
.editorconfig Defines shared whitespace and indentation settings.

Review effort: Balanced

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ryanio
ryanio merged commit 489e5fd into main Nov 10, 2026
4 checks passed
@ryanio
ryanio deleted the ryan/modernize-toolchain branch November 10, 2026 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants