MorphoV2 plugins #1291
Conversation
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
📝 WalkthroughWalkthroughAdds Morpho Vault V2 collateral support: extends token config/types and mainnet addresses, updates MetaMorpho docs, adds deployment and verification scripts (and wires them into pipelines), and expands test constants, helpers, and suites for V2 vaults. ChangesMorpho Vault V2 Collateral Integration
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
scripts/deployment/phase2-assets/collaterals/deploy_morpho_v2_vaults.ts (1)
33-49: ⚡ Quick winExtract shared Morpho V2 vault config to prevent deploy/verify drift.
VAULTShere is duplicated in the verification script and must stay constructor-arg aligned. A future one-sided edit can break verification while deployments still succeed. Please centralize this map/interface in a shared module and import it from both scripts.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@scripts/deployment/phase2-assets/collaterals/deploy_morpho_v2_vaults.ts` around lines 33 - 49, Extract the V2VaultDeployment interface and the VAULTS array into a new shared module and import them into both deploy_morpho_v2_vaults.ts and the verification script so the data stays single-sourced; specifically move the definitions for V2VaultDeployment and VAULTS (the array entries like 'steakUSDCPrime', feeds and oracleTimeout/oracleError constants) into a shared export, update deploy_morpho_v2_vaults.ts to import { V2VaultDeployment, VAULTS } from that module, and update the verification script to import the same symbols so constructor-arg alignment cannot drift.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@contracts/plugins/assets/meta-morpho/README.md`:
- Around line 55-64: Update the README table to use the same token identifiers
as in common/configuration.ts so operators aren't confused: replace symbols like
steakUSDC with steakUSDCPrime, senPYUSD with sentoraPYUSD (and any other
mismatched entries such as gtusdcf/gtusdcp, gUSDTq/gUSDTq etc.) to exactly match
the keys defined in common/configuration.ts; verify each Symbol column value
against the configuration file and make the README entries identical to those
identifiers.
In `@scripts/verification/collateral-plugins/verify_morpho_v2_vaults.ts`:
- Around line 65-72: Before calling verifyContract, add explicit checks that the
deployment address (deployments.collateral[v.tokenKey]) and the token address
(networkConfig[chainId].tokens[v.tokenKey]) are defined; if either is undefined
throw or log a clear error mentioning the specific v.tokenKey so failures are
actionable. Locate the loop handling each v (use symbols deployments.collateral,
v.tokenKey, networkConfig, chainId and the verifyContract call) and guard the
verify invocation by verifying those two addresses exist and include v.tokenKey
in the error message when they do not.
In `@test/plugins/individual-collateral/meta-morpho/mintCollateralTo.ts`:
- Around line 14-22: The mapping block in mintCollateralTo.ts (the computed keys
like networkConfig['31337'].tokens.gauntletUSDCFrontier, steakUSDCPrime,
sentoraPYUSD, etc.) has a lint/formatting violation; fix it by reformatting that
object literal so each computed property uses consistent spacing and trailing
commas, matching project Prettier/ESLint rules (e.g., ensure no stray whitespace
inside brackets, each entry ends with a comma, and alignment matches surrounding
mappings) — easiest fix: run the repo's formatter (prettier or eslint --fix) on
this file or manually adjust the entries to match the other mapping blocks.
---
Nitpick comments:
In `@scripts/deployment/phase2-assets/collaterals/deploy_morpho_v2_vaults.ts`:
- Around line 33-49: Extract the V2VaultDeployment interface and the VAULTS
array into a new shared module and import them into both
deploy_morpho_v2_vaults.ts and the verification script so the data stays
single-sourced; specifically move the definitions for V2VaultDeployment and
VAULTS (the array entries like 'steakUSDCPrime', feeds and
oracleTimeout/oracleError constants) into a shared export, update
deploy_morpho_v2_vaults.ts to import { V2VaultDeployment, VAULTS } from that
module, and update the verification script to import the same symbols so
constructor-arg alignment cannot drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 6af2ec08-9cc7-43a1-a8e1-266d2cd2aee4
📒 Files selected for processing (10)
common/configuration.tscontracts/plugins/assets/meta-morpho/MetaMorphoFiatCollateral.solcontracts/plugins/assets/meta-morpho/README.mdscripts/deploy.tsscripts/deployment/phase2-assets/collaterals/deploy_morpho_v2_vaults.tsscripts/verification/collateral-plugins/verify_morpho_v2_vaults.tsscripts/verify_etherscan.tstest/plugins/individual-collateral/meta-morpho/MetaMorphoFiatCollateral.test.tstest/plugins/individual-collateral/meta-morpho/constants.tstest/plugins/individual-collateral/meta-morpho/mintCollateralTo.ts
tbrent
left a comment
There was a problem hiding this comment.
Looks good. Only thing to mention, maybe intended
README symbols for Sentora and Sky do not exactly match on-chain metadata. Sentora returns senPYUSDPRIMEv2, not senPYUSD; Sky returns skyMoneyUsdtSavings, not skyMoneyUsdt.
No.. will put the real ones int he README I thought I had that covered |
MorphoV2FiatCollaterla.solextending the existingMetaMorphoFiatCollateralplugin for 8 mainnet Morpho Vault V2 vaults (steakUSDC Prime, Paypal PYUSD, Gauntlet USDC Frontier/Prime, Galaxy USDC/USDT Quality, Steakhouse USDT Prime,Sky USDT Savings)
Summary by CodeRabbit
New Features
Documentation
Tests
Chores