Deployment Script#50
Closed
jordanschalm wants to merge 4 commits into
Closed
Conversation
Implements the missing yieldOracle dependency for FCMVault. FUSDEV is itself an ERC4626 vault whose underlying asset is PYUSD0, so its convertToAssets exchange rate IS the yield token price in loan-token terms, with both tokens' decimals already embedded. The oracle is a thin adapter scaling that rate to Morpho's IOracle 1e36 convention -- the same shape as Morpho's own ERC4626 oracle adapters. NAV pricing cannot be moved by trading against the thin FlowSwap pool (no TWAP machinery needed); it is only as trustworthy as FUSDEV's own share accounting, and reflects redemption value rather than the pool's executable swap price -- documented in the contract NatSpec. Unit tests cover rate scaling across decimal regimes and constructor validation; fork tests against the live FUSDEV vault run when FLOW_MAINNET_RPC_URL is set and skip otherwise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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>
5f3a1c8 to
f18b6bc
Compare
Member
Author
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.
No description provided.