feat: ETH Phase 2 — WETH Savings Vault + 4 New Markets deployment scripts & fork tests#200
feat: ETH Phase 2 — WETH Savings Vault + 4 New Markets deployment scripts & fork tests#200LuckyTian1725 wants to merge 5 commits into
Conversation
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment workflow via new Foundry scripts for creating four markets, deploying/configuring a WETH savings vault, setting liquidation whitelists, transferring vault roles, and generating calldata for USDT/USDC vault updates. It also adds a comprehensive mainnet-fork test suite that executes the real scripts end-to-end and validates market parameters, role transitions, oracle sanity, and basic supply/borrow behavior. Additionally, Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
0dd96b7 to
6415d3f
Compare
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment toolkit in Solidity scripts, covering creation of four new Moolah markets, deployment/configuration of a new WETH savings vault, liquidation whitelist setup, and post-deployment role handoff to timelocks/safes. It also adds a view-only script to generate timelock calldata for updating existing USDT/USDC vault queues and caps. A comprehensive fork test suite is included to execute and validate all steps end-to-end against mainnet state and SOP parameters. Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
- Step 2: deploy_createMarket.sol — create 4 new markets (wstETH/WETH, wBETH/WETH, WBTC_cbBTC/USDT, WBTC_cbBTC/USDC) - Step 3: deploy_moolahVault_weth.sol — deploy WETH Savings Vault (ERC1967 proxy) - Step 4: deploy_moolahVaultConfig_weth.sol — configure vault fee, caps, supply queue (env vars) - Step 5: deploy_liquidationWhitelist.sol — set liquidation whitelist with idempotent pre-checks - Step 6: deploy_moolahVault_transferRole_weth.sol — transfer vault roles to TimeLock - Step 7: deploy_vaultConfig_usdt_usdc.sol — generate calldata for USDT/USDC vault updates - Fork test: EthPhase2Fork.t.sol — full E2E test with SOP compliance verification
6415d3f to
ca7f587
Compare
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment pipeline via new Foundry scripts, covering market creation, WETH vault deployment/configuration, liquidation whitelisting, role transfer, and view-only calldata generation for USDT/USDC vault updates. It also introduces a comprehensive mainnet-fork test suite that executes the real scripts end-to-end and validates SOP-aligned market IDs/params, oracle sanity, and supply/borrow behavior. No existing core contract logic is modified; changes are operational scripts and tests. Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment workflow through new Foundry scripts for creating four markets, deploying/configuring a WETH savings vault, whitelisting liquidation actors/providers, transferring vault roles to timelocks/safes, and generating calldata for USDT/USDC vault updates. It also introduces a comprehensive mainnet-fork test suite that executes the scripts end-to-end and validates market params, oracle availability, vault config, whitelist state, and role handoff behavior. Overall, the changes are operational/deployment-oriented and do not modify existing on-chain contract logic. Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
…e logic into EthPhase2ForkTest
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment workflow as new Foundry scripts: creating four new markets, deploying/configuring a WETH savings vault proxy, transferring vault roles to timelocks/safes, and generating view-only calldata for USDT/USDC vault updates. It also introduces an extensive fork-test suite that executes the real scripts end-to-end and validates SOP compliance for market params, oracle setup, whitelist configuration, and post-deploy role handoff. No existing protocol contracts are modified; changes are limited to deployment/test tooling. Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
…ignment based on chain ID
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment workflow using new Foundry scripts to create four new markets, deploy and configure a WETH savings vault, transfer vault roles to timelocks/safes, and generate timelock calldata for USDT/USDC vault updates. It also introduces a comprehensive fork-test suite that executes the real deployment scripts end-to-end and validates SOP compliance (market params/IDs, vault config, whitelist setup, and role handoff). No protocol contract logic changes are included; the changes are operational scripts plus tests. Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Pull Request ReviewThis PR adds a full Ethereum Phase 2 deployment workflow via new Foundry scripts and a comprehensive mainnet-fork test suite. The scripts cover creating four new markets, deploying/configuring a WETH savings vault, transferring vault roles to timelocks/safes, and generating calldata for USDT/USDC vault updates, with a Sepolia-only setup script for mock infrastructure. The fork tests execute these scripts end-to-end and validate SOP alignment for market params, vault config, liquidation whitelists, role handoff, and functional supply/borrow behavior. Sensitive ContentBlockchain Address:
Private Key / Seed Phrase / Mnemonic / Secret Material:
Security IssuesNo serious security issues detected. Generated by Hashdit Bot. This tool can absolutely NOT replace manual audits. |
Summary
Complete deployment scripts and fork tests for ETH Phase 2: deploying the WETH Savings Vault and creating 4 new markets on Ethereum mainnet Moolah.
The deployment pipeline consists of 7 ordered steps:
Change Type
Contracts Changed
script/eth/phase2/deploy_createMarket.solscript/eth/phase2/deploy_moolahVault_weth.solscript/eth/phase2/deploy_moolahVaultConfig_weth.solscript/eth/phase2/deploy_liquidationWhitelist.solscript/eth/phase2/deploy_moolahVault_transferRole_weth.solscript/eth/phase2/deploy_vaultConfig_usdt_usdc.soltest/eth-phase2/EthPhase2Fork.t.solInterface Changes
No on-chain interface changes. All scripts use existing Moolah/MoolahVault/Liquidator interfaces.
Environment variables consumed by scripts:
PRIVATE_KEY— deployer EOA private key (read byDeployBase._deployerKey())WETH_VAULT— WETH vault proxy address (Step 4 and 6, set after Step 3 deployment)WSTETH_CAP— wstETH market cap in wei (Step 4)WBETH_CAP— wBETH market cap in wei (Step 4)Storage Layout
N/A — no contract modifications, only new deploy scripts.
Access Control
0x08aE...)0xd7e38...0xd7e38...0xd7e38...0xd7e38...0x8d38...)0x85CE...Risk Assessment
Deployment
0xd7e38800201D6a42C408Bf79d8723740C4E7f631(Steps 2-6, sequential in one session)Test Plan
Fork test suite:
test/eth-phase2/EthPhase2Fork.t.sol— forks ETH mainnet and calls real deploy scripts via.run().test_step0_rampAtest_step1_enableLltv80test_step2_createMarketstest_step3_deployVaulttest_step4_configVaulttest_step5_liquidationWhitelisttest_step6_transferRolestest_step7_calldataGenerationtest_e2e_fullDeploymenttest_e2e_supplyAndBorrow_wstETHtest_oracle_*(x3)Run command:
All 12 tests pass.