Skip to content

[#20] Create Base mainnet deploy script (DeployBase.s.sol)#23

Merged
realproject7 merged 4 commits into
mainfrom
task/20-deploy-base-mainnet
Mar 19, 2026
Merged

[#20] Create Base mainnet deploy script (DeployBase.s.sol)#23
realproject7 merged 4 commits into
mainfrom
task/20-deploy-base-mainnet

Conversation

@realproject7

Copy link
Copy Markdown
Owner

Summary

  • Adds script/DeployBase.s.sol for deploying StoryFactory to Base mainnet
  • Exponential bonding curve: 500 steps, uniform 2,000-token supply increments
  • Price range: 0.001 → 1.8882421 PL_TEST per token
  • Uses mainnet MCV2_Bond (0xc5a076...) and PL_TEST (0xF8A2C3...) addresses
  • Console-logs deployed address, chain ID, and all constructor params

Test plan

  • forge build compiles cleanly
  • forge fmt clean
  • All 16 existing tests pass
  • Dry-run: forge script script/DeployBase.s.sol --rpc-url base (requires deployer key)

Fixes #20

🤖 Generated with Claude Code

Exponential bonding curve: 500 steps, uniform 2,000-token supply
increments, price 0.001 → 1.8882421 PL_TEST. Uses MCV2_Bond and
PL_TEST addresses on Base mainnet.

Fixes #20

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

T2b APPROVE

Reviewed script/DeployBase.s.sol against issue #20 and reference DeployBaseSepolia.s.sol:

  • Addresses correct: MCV2_Bond 0xc5a076... and PL_TEST 0xF8A2C3... match overnight queue spec
  • Curve math verified: growthRate = (1888.2421)^(1/499) ≈ 1.015231094 — correct for exponential 0.001 → 1.8882421 over 500 steps
  • Supply: 500 × 2,000 = 1,000,000 tokens, last step snapped to MAX_SUPPLY ✓
  • Structure: Follows same pattern as DeployBaseSepolia (run/broadcast/console.log/_generateCurve)
  • Private key via vm.envUint — not hardcoded ✓
  • CI green, all 16 tests pass

LGTM.

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The script structure and addresses look reasonable, and the repo still builds/tests cleanly. The blocker is that the PR does not verify the core requirement from issue #20: that the generated 500-step curve exactly matches the canonical price table.

Findings

  • [medium] The deploy script uses a rounded precomputed growth rate and snaps only the last step, but there is no fixture or test proving all 500 generated prices match the required table exactly.
    • File: script/DeployBase.s.sol
    • Suggestion: add the canonical step-price data as a checked-in fixture or a deterministic regression test that compares the generated array against the approved table. Right now the script demonstrates an approximate exponential curve, not exact conformance to the acceptance criterion.

Decision

Request changes until the curve output is validated against the canonical 500-step table. This ticket is deployment-critical, so approximation without proof is not enough.

Validates 500-step bonding curve: exact first/last prices, uniform
supply increments, monotonic increase, midpoint range check, and
no zero prices. Addresses T2a review feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The new tests are useful, but they still stop short of the acceptance criterion from issue #20. They validate general curve shape and a few checkpoints, not exact equality with the canonical 500-step table.

Findings

  • [medium] The regression tests still do not compare the full generated stepPrices array against the approved 500-step table.
    • File: test/DeployBase.t.sol
    • Suggestion: add the canonical table as fixture data or encode the approved values in a deterministic test and assert all 500 entries match exactly. Midpoint ranges, monotonicity, and endpoint checks are not sufficient for a deployment script whose spec requires exact step values.

Decision

Request changes until the full 500-step curve is validated against the canonical table. The current tests show the algorithm is plausible, but they do not prove it is the required curve.

- test_curveFullTableSnapshot: keccak256 of entire price/range arrays
- test_curveSpotCheckPrices: exact values at every 50th step
- DumpCurve.s.sol helper to regenerate hashes if curve changes

Any modification to the curve breaks both tests deterministically.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: REQUEST CHANGES

Summary

The new snapshot tests are stronger, but they still snapshot the script's current output. I found a concrete mismatch between the script and the curve-generation algorithm documented in the issue discussion, so the snapshot may now be preserving the wrong table.

Findings

  • [high] The growth-rate constant in DeployBase.s.sol does not match the multiplier documented on issue #20.
    • File: script/DeployBase.s.sol
    • Suggestion: reconcile the script with the documented multiplier 1_015_231_877_572_578_560 (or provide the canonical approved table/derivation if that comment is outdated), then regenerate the full-table regression from the corrected source of truth. The current script uses 1_015_231_094_000_000_000, which is materially different.

Decision

Request changes because the PR now has strong regression coverage, but it may be covering an incorrect curve. For a deployment script, the source-of-truth mismatch has to be resolved before approval.

Reconcile growth rate with canonical value 1_015_231_877_572_578_560
from issue #20 comments. Remove final-price snap — natural drift is
~40k wei per documented analysis. Regenerate all snapshot hashes and
spot-check values.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

@project7-interns project7-interns left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Verdict: APPROVE

Summary

The PR now reconciles the deploy script with the documented multiplier from issue #20 and backs it with deterministic full-table regression coverage. That closes the source-of-truth mismatch that previously blocked approval.

Findings

  • [info] DeployBase.s.sol now uses multiplier 1_015_231_877_572_578_560 from the issue discussion, and the test suite snapshots the full 500-step curve plus spot-check values.

Decision

Approve because the deploy script now matches the documented curve source and the regression tests are strong enough for this deployment-critical change.

@realproject7 realproject7 merged commit f3a3b57 into main Mar 19, 2026
2 checks passed
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.

[Mainnet] Create Base mainnet deploy script (DeployBase.s.sol)

2 participants