Skip to content

Mainnet deployment script and automated fork rehearsal#52

Draft
jordanschalm wants to merge 9 commits into
mainfrom
jord/deploy-script
Draft

Mainnet deployment script and automated fork rehearsal#52
jordanschalm wants to merge 9 commits into
mainfrom
jord/deploy-script

Conversation

@jordanschalm

@jordanschalm jordanschalm commented Jun 10, 2026

Copy link
Copy Markdown
Member

This PR adds deployment scripts for deploying FCMVault to Mainnet. It also includes a basic integration test script intended to run against a Mainnet deployment (it can also be run against a fork mainnet deployment using the "rehearse" script).

jordanschalm and others added 3 commits June 10, 2026 15:58
Adds a committed deployments/mainnet.json (pinning the existing Morpho
WETH/PYUSD0 market params and FlowSwap pools) and four forge scripts,
all chain-id-guarded and dry-runnable by dropping --broadcast:

- Status: read-only report on market, pools, oracle prices, balances;
  survives a reverting (stale) Pyth market oracle and reports it
- SeedMarket: supply PYUSD0 liquidity to the existing empty market
- DeployVault: deploy YieldTokenOracle (when not yet configured) and
  FCMVault, grant EARLY_ACCESS_ROLE, set MAX_TVL; aborts on missing
  market/liquidity/pool mismatches
- LiveCheck: real deposit -> redeem integration check with a
  round-trip tolerance, config-free (reads everything from the vault)

ConfiguredScript is the shared base (config load, market id, pool and
market pre-flight checks). Replaces the bare env-var FCMVault.s.sol.
foundry.toml gains deployments/ read permission and the flow_mainnet
RPC endpoint.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Make targets (manual only, never run from CI): mainnet-status,
mainnet-seed-market, mainnet-deploy, mainnet-check, each with a -dry
variant that fork-simulates without broadcasting, plus
mainnet-fork-test for the oracle fork tests. A labeled slot is left
for the Cadence VaultRebalancer (PR #38) once it merges.

solidity/README.md gains the full runbook (status -> seed -> deploy ->
check, always dry-run first), script/env reference, post-deploy
record-keeping steps, and key-handling guidance. Root README gains a
Deployment section with the deployed contracts table and market id.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Runs the entire production sequence -- SeedMarket -> DeployVault ->
LiveCheck -- against an anvil fork of live mainnet, with state carried
between steps, real Morpho/FlowSwap/Pyth contracts, zero real funds,
and no PRIVATE_KEY (uses anvil's public dev account, funded with
WETH/PYUSD0 via impersonated transfers from the FlowSwap pools).

If the Pyth WETH/USD market oracle is stale (it reverts with StalePrice
after 1h without a push, the current live state), the script posts a
fresh signed update from Hermes -- the same permissionless remedy an
operator would use on real mainnet.

Cleanup removes the rehearsal's broadcast/*/747/ records so they cannot
masquerade as real deployment records; the script refuses to start if
uncommitted broadcast records are already present.

Verified end-to-end: seed 50k PYUSD0, deploy oracle + vault, live check
round-trip 9997 bps.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jordanschalm jordanschalm mentioned this pull request Jun 10, 2026
@jordanschalm jordanschalm marked this pull request as draft June 11, 2026 00:00
Base automatically changed from jord/yield-oracle to main June 12, 2026 00:16
jordanschalm and others added 3 commits June 12, 2026 08:38
Should be vm.envOr; broke forge build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jordanschalm jordanschalm changed the title Mainnet deployment scripts, runbook, and automated fork rehearsal Mainnet deployment script and automated fork rehearsal Jun 12, 2026
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