Skip to content

Read the auction duration per launch path; release 2.1.0 - #13

Merged
daedboi merged 5 commits into
mainfrom
standard-auction-2-day
Aug 10, 2026
Merged

Read the auction duration per launch path; release 2.1.0#13
daedboi merged 5 commits into
mainfrom
standard-auction-2-day

Conversation

@daedboi

@daedboi daedboi commented Aug 10, 2026

Copy link
Copy Markdown
Member

The Standard/advanced auction window changed from 7 days to 2 days when its timelock executed (advancedDuration() = 172800s on all four chains). ChainLaunchConfig.advancedDuration was a hardcoded "7 Days", and the CLI's --path help repeated advanced (7d) in two places.

Changes

  • getAuctionDurationMs(path) fallback + fetchAuctionDuration(client, chainId, path) reading expressDuration / advancedDuration — mirrors fetchGraduationThreshold. The registry ships full ABIs, so no ABI change.
  • formatAuctionDuration derives "24 Hours" / "2 Days" from ms. Verified across the 2-14 day admin range.
  • CLI --path help now reads advanced (2d after a 24h start delay).
  • Prose fixed in README.md, skills/boardwalk/SKILL.md and the Base-MCP plugin doc.

Why the deprecated fields stay

expressDuration / advancedDuration are per-path values sitting on a per-chain type — the same modelling error the threshold had, and the FE removed them outright. Here they are now derived from getAuctionDurationMs (so correct) and marked @deprecated.

Removing them would be a second breaking major days after 2.0.0, for fields with zero consumers inside the SDK. Not worth the churn on published consumers; they go in the next major.

A bug the test suite caught

formatAuctionDuration / getAuctionDurationMs were initially appended at the end of the file, but makeLaunchConfig calls them at module load to build chainLaunchConfig. That is a temporal dead zone — ReferenceError: Cannot access 'AUCTION_DURATION_FALLBACK_MS' before initialization on import, which would have broken every consumer. They are now declared above their call site.

Version

2.0.0 → 2.1.0, additive. Bumped across package.json, package-lock.json, CLI .version(), README pin and both skill files per AGENTS.md.

Note the lockfile edit is exactly the two entries naming this package — an earlier blunt string replace clobbered @types/node, pathval, siginfo and node engine ranges, and was reverted.

tsc --noEmit clean. vitest run83/83 pass.

Summary by CodeRabbit

  • New Features

    • Auction durations and graduation thresholds are now retrieved dynamically for express and advanced launches.
    • Launch details display live auction timing with readable duration formatting and fallback handling.
    • Advanced launches include a 24-hour start delay and a 2-day default auction duration.
  • Documentation

    • Updated CLI, plugin, and launch guides for version 2.1.0 and revised auction timing.
  • Chores

    • Updated the package and CLI version from 2.0.0 to 2.1.0.

The Standard/advanced auction window changed from 7 days to 2 days when its
timelock executed. `ChainLaunchConfig.advancedDuration` was a hardcoded
"7 Days" string, and the CLI's `--path` help text repeated "advanced (7d)".

Add `getAuctionDurationMs(path)` as the fallback and `fetchAuctionDuration(
client, chainId, path)` reading `expressDuration` / `advancedDuration`, matching
what `fetchGraduationThreshold` already does for the threshold. The full ABIs
already carry both getters.

`expressDuration` / `advancedDuration` stay on `ChainLaunchConfig` but are now
derived from the fallback and marked `@deprecated`. Removing them would be a
second breaking change days after 2.0.0 for fields with no consumers; they go in
the next major.

`formatAuctionDuration` and `getAuctionDurationMs` are declared above
`makeLaunchConfig`, which calls them at module load — the test suite caught a
temporal dead zone when they were appended at the end of the file.

Bump 2.0.0 -> 2.1.0 across package.json, the lockfile, the CLI `--version`, the
README pin and both skill files. Additive, so a minor.
@cursor

cursor Bot commented Aug 10, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
Additive API and doc/config updates only; no changes to transaction encoding, signing, or calldata. Wrong duration text was misleading but did not alter on-chain launch behavior.

Overview
Release 2.1.0 aligns the SDK with on-chain standard/advanced auction length (7 days → 2 days after advancedDuration timelock) and adds the same live-read pattern used for graduation thresholds.

New exports: getAuctionDurationMs, formatAuctionDuration, and fetchAuctionDuration (reads LaunchFactory.expressDuration / advancedDuration via RPC, falls back to registry constants). chainLaunchConfig duration strings are now derived from those fallbacks (2 Days for advanced); legacy expressDuration / advancedDuration fields stay but are @deprecated.

CLI --path help, README, and skill/plugin docs now describe advanced as 2d presale after a 24h start delay; version pins bump to @2.1.0.

Reviewed by Cursor Bugbot for commit ef26cb9. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f1d6f890-9682-4bb9-97af-a7ea397d50d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4233055 and 5c092d0.

📒 Files selected for processing (1)
  • skills/boardwalk/plugins/boardwalk.md

📝 Walkthrough

Walkthrough

The SDK version changes to 2.1.0. Launch parameters now support path-specific fallbacks and live factory reads. The CLI and documentation report live durations and the 24-hour advanced start delay.

Changes

Auction duration configuration

Layer / File(s) Summary
Duration fallbacks and formatting
src/constants.ts, src/registry/launch-config.ts
Adds the 24-hour advanced start delay, express and advanced duration fallbacks, formatting helpers, and derived duration configuration values.
Factory launch-parameter reads and CLI output
src/read/launches.ts, src/index.ts, src/cli.ts, test/launch-config.test.ts
Reads and validates live graduation thresholds and auction durations, applies independent or full-call fallbacks, exports the new APIs, and includes duration data in CLI output. Tests cover formatting, RPC failures, invalid values, and multicall behavior.
Version and launch documentation updates
package.json, README.md, skills/boardwalk/*
Updates version references to 2.1.0 and documents live durations, the 24-hour advanced start delay, and two-day standard launches.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant CLI
  participant fetchLaunchParams
  participant LaunchFactory
  participant launch-config
  CLI->>fetchLaunchParams: Request path-specific launch parameters
  fetchLaunchParams->>LaunchFactory: Multicall graduation threshold and auction duration
  LaunchFactory-->>fetchLaunchParams: Return factory values
  fetchLaunchParams->>launch-config: Apply validation and configured fallbacks
  launch-config-->>CLI: Return threshold and duration
  CLI-->>CLI: Display live duration and advanced start delay
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 64.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the main change: reading auction duration per launch path, and includes the release version.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch standard-auction-2-day

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef26cb9f57

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +38 to +41
const AUCTION_DURATION_FALLBACK_MS: Record<"express" | "advanced", number> = {
express: 24 * 60 * 60 * 1000,
advanced: 2 * 24 * 60 * 60 * 1000,
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Move the duration fallback into constants.ts

The new fallback is a package constant, but this repository requires all constants in src/constants.ts. Move it there to keep fallback values discoverable and avoid scattered sources of truth.

AGENTS.md reference: AGENTS.md:L50-L52

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Declined — moving only this one would make things less discoverable, not more.

GRADUATION_FALLBACK_WEI already lives in src/registry/launch-config.ts and shipped that way in 2.0.0. The duration fallback is its exact sibling: same shape, same per-path keying, same "fallback for the live factory read" role, consumed by the same module. Splitting them across constants.ts and registry/launch-config.ts is the scattering the rule is trying to prevent.

src/registry/ is also where per-chain/per-deployment config deliberately lives (contracts.ts, chains.ts, launch-config.ts), which is why the threshold landed here in the first place.

Happy to move both in a follow-up if the team reads the rule as covering registry values too — but that is a consistency pass on existing code, not something this PR should do to one half of a pair.

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/read/launches.ts`:
- Around line 140-145: Update fetchAuctionDuration so getContracts(chainId)
executes before the try block, keeping unsupported-chain errors propagating
instead of being converted to the path fallback. Keep only the
client.readContract RPC failure handling inside the fallback path.
- Around line 135-151: Update fetchAuctionDuration so getContracts(chainId) runs
before the try block, allowing unsupported-chain errors to propagate; validate
the returned duration as a positive, in-range bigint before converting it to
milliseconds, otherwise use getAuctionDurationMs(path). Add Vitest coverage for
valid, zero, non-bigint, thrown, out-of-range, and unsupported-chain outcomes,
plus formatting cases for “24 Hours” and “2 Days”.
- Around line 146-147: Update the duration conversion branch around the seconds
handling to accept bigint values only when they are positive and at most
BigInt(Number.MAX_SAFE_INTEGER) / 1000n; otherwise preserve the existing
fallback behavior. Add coverage for valid, zero, and oversized uint256
durations.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 58b6e4ff-8864-49c2-b727-a43e8c177b96

📥 Commits

Reviewing files that changed from the base of the PR and between 7ef895c and ef26cb9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • README.md
  • package.json
  • skills/boardwalk/SKILL.md
  • skills/boardwalk/plugins/boardwalk.md
  • src/cli.ts
  • src/index.ts
  • src/read/launches.ts
  • src/registry/launch-config.ts

Comment thread src/read/launches.ts
Comment thread src/read/launches.ts
Comment thread src/read/launches.ts Outdated
`getContracts(chainId)` throws for an unsupported chain, but both
`fetchGraduationThreshold` and `fetchAuctionDuration` called it inside the try,
so an unsupported chain was masked as an RPC failure and silently returned a
fallback — making the chain look configured. Resolve the address before the try
so only `readContract` failures fall through.

The threshold half of this was already shipped in 2.0.0; this fixes both.

Cap the duration before converting: `SET_EXPRESS_DURATION` only requires > 0, so
an oversized `uint256` would lose precision through `Number()`.

Adds test/launch-config.test.ts covering valid, zero, non-bigint, thrown,
out-of-range and unsupported-chain results, plus the duration formatting across
the 2-14 day admin range.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5d1bf5972

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli.ts Outdated
`fetchAuctionDuration` had no internal caller — the live read existed but the
CLI never used it, so `launch` reported a threshold read from the factory and
nothing for the duration, and the `--path` help restated a tunable "2d". That is
the same staleness this branch set out to fix.

`launch` now emits `auctionDuration { seconds, display, startDelaySeconds }`
alongside `graduationThreshold`, both fetched in parallel. The help text points
at that field instead of naming a number. `ADVANCED_START_DELAY_SECONDS` goes in
constants.ts — it mirrors an immutable contract constant, unlike the per-chain
registry values.

`formatAuctionDuration` no longer rounds: a 90-minute window read as "2 Hours"
and a one-hour window as "1 Hours". It now composes exact day/hour/minute parts
with correct pluralisation, leaving "24 Hours" and "2 Days" unchanged.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e48e84dbed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/cli.ts Outdated
Comment thread src/read/launches.ts Outdated
if (
typeof seconds === "bigint" &&
seconds > BigInt(0) &&
seconds <= BigInt(MAX_PLAUSIBLE_DURATION_SECONDS)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Accept every valid express duration

When the timelock sets expressDuration above 365 days, this check rejects the onchain value and reports the 24-hour fallback. The contract only requires a positive express duration, so 366 days remains valid and converts safely to a JavaScript number. Bound the conversion by numeric safety instead of adding a stricter protocol limit.

AGENTS.md reference: AGENTS.md:L3-L3

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Declined — repo owner reviewed this and called it overkill, and I agree.

The scenario requires an admin to set expressDuration above 365 days. Express exists to be the short path (currently 24h); a 400-day express auction is not a configuration anyone reaches by accident, and it would need a 7-day timelock to land.

Weighing the two failure modes: too tight silently shows 24h instead of 400 days, in a scenario that will not occur. Too loose accepts a garbage uint256 and feeds it into date math, which is the case CodeRabbit asked to be guarded on this same PR — and it reviewed the one-year cap and confirmed it as "safely below the JavaScript Date range". Swapping it for a numeric-safety bound trades a guard that fires on real garbage for coverage of a scenario that does not exist.

The principle that a fallback should mean "could not read it" rather than "read a value I disagree with" is a fair point, and worth revisiting if the express window is ever tuned beyond a day. Not worth another round now.

AGENTS.md's "Reads" convention is explicit: batch independent reads with
`client.multicall` rather than `Promise.all` of single `readContract` calls,
because public RPCs rate-limit adjacent round-trips. The `Promise.all` added for
the threshold and duration was the only one of its kind left in the repo.

`fetchLaunchParams` reads both in one multicall via MULTICALL3_ADDRESS, matching
the existing batches in the contribute and LP paths. Each field still falls back
independently when the factory returns something unusable; an unreachable RPC or
a chain without Multicall3 falls back on both, and an unsupported chain still
throws.

`fetchGraduationThreshold` and `fetchAuctionDuration` stay exported for
consumers reading one value; the shared validity guards are now factored out so
all three agree.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4233055d20

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +77 to +79
if (totalHours > 0) parts.push(plural(totalHours, "Hour"));
if (minutes > 0) parts.push(plural(minutes, "Minute"));
if (parts.length === 0) parts.push(plural(seconds, "Second"));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve seconds in duration displays

When the tunable duration includes leftover seconds, this formatter drops them whenever an hour or minute exists. For example, 3,630 seconds becomes 1 Hour, although the CLI's numeric field reports 3,630. Include the seconds remainder so the public display does not shorten the configured auction window.

AGENTS.md reference: AGENTS.md:L66-L66

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Declined — real but not worth the precision.

Confirmed: 3,630 seconds renders as 1 Hour while auctionDuration.seconds reports 3630, so the display drops the 30-second remainder. For every value the protocol actually uses — 24h, 2d, the 2-14 day admin range — the seconds remainder is zero and the display is exact.

Machine consumers should read auctionDuration.seconds, which is exact by construction; display is human copy where second-level precision on a multi-day auction window is noise. The repo owner reviewed this class of edge case and asked to stop chasing it.

Comment thread skills/boardwalk/plugins/boardwalk.md Outdated

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@skills/boardwalk/SKILL.md`:
- Line 165: Update the Naming guidance near the standard/advanced launch
terminology to replace “onchain contracts” with “on-chain contracts,” preserving
the surrounding wording and meaning.

In `@src/read/launches.ts`:
- Around line 192-217: Update the multicall in getLaunchConfig to use
allowFailure: true and process each viem result independently via its status and
result, preserving valid threshold or duration values while applying the
corresponding fallback only to reverted or invalid subcalls. In
test/launch-config.test.ts:22-31 and test/launch-config.test.ts:148-156, update
mocks to viem-shaped results and cover both threshold-reverts/duration-succeeds
and duration-reverts/threshold-succeeds permutations.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: f8cebcf8-5c64-4ee9-ab0f-9b70b719f21e

📥 Commits

Reviewing files that changed from the base of the PR and between a5d1bf5 and 4233055.

📒 Files selected for processing (8)
  • README.md
  • skills/boardwalk/SKILL.md
  • src/cli.ts
  • src/constants.ts
  • src/index.ts
  • src/read/launches.ts
  • src/registry/launch-config.ts
  • test/launch-config.test.ts
🚧 Files skipped from review as they are similar to previous changes (3)
  • src/index.ts
  • README.md
  • src/registry/launch-config.ts

Comment thread skills/boardwalk/SKILL.md
Comment thread src/read/launches.ts
SKILL.md was updated to drop the hardcoded window and point agents at the
`launch` output's `auctionDuration`, but its sibling plugin doc still said
"standard (2d after a 24h start delay)". Both durations are timelock-tunable, so
that line goes stale on the next change — the exact failure this branch removes.

The 24h start delay stays stated: `PresaleManager.ADVANCED_START_DELAY` is an
immutable contract constant.
@daedboi
daedboi merged commit 69593db into main Aug 10, 2026
1 check passed
@daedboi
daedboi deleted the standard-auction-2-day branch August 10, 2026 11:46
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.

1 participant