Mainnet deployment script and automated fork rehearsal#52
Draft
jordanschalm wants to merge 9 commits into
Draft
Conversation
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>
Closed
Should be vm.envOr; broke forge build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).