feat: add deploy script for MorphoAllocator only#4
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdded a Foundry deployment script ChangesDeployment Script
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant Deployer
participant DeployMorphoAllocatorScript
participant MorphoAllocator
participant IERC1967Factory
Deployer->>DeployMorphoAllocatorScript: run()
DeployMorphoAllocatorScript->>MorphoAllocator: deploy implementation
DeployMorphoAllocatorScript->>IERC1967Factory: deployAndCall(implementation, admin, initData)
IERC1967Factory->>MorphoAllocator: initialize(OWNER, EXECUTOR, FACILITY, MORPHO_VAULT)
IERC1967Factory-->>DeployMorphoAllocatorScript: proxy address
DeployMorphoAllocatorScript-->>Deployer: log implementation/proxy addresses
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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: 1
🤖 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 `@script/DeployMorphoAllocator.s.sol`:
- Around line 39-56: The ERC1967 factory constant in DeployMorphoAllocator.s.sol
is using the wrong address; update the FACTORY value to Solady’s canonical
mainnet ERC1967Factory address and apply the same change in
DeployAllocators.s.sol since both scripts share this deployment constant. Keep
the existing IERC1967Factory FACTORY symbol and adjust only the address literal
so the proxy deployment path uses the correct factory everywhere.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 8e674597-7f9a-4678-851a-0e4a04a6af48
📒 Files selected for processing (1)
script/DeployMorphoAllocator.s.sol
| /// @notice Solady ERC1967Factory used to deploy the upgradeable proxy. | ||
| IERC1967Factory internal constant FACTORY = IERC1967Factory(0x54F862fa0612A8709F6Dec4A7B39AF015CD4E82E); | ||
|
|
||
| /// @notice Grunt Facility proxy the allocator coordinates (`facility_`). | ||
| address internal constant FACILITY = 0x4e013ca8fF612a58F53C822904cDD0eC538a4A4F; | ||
|
|
||
| /// @notice Morpho Vault V2 the MorphoAllocator allocates through (`morphoVault_`). | ||
| address internal constant MORPHO_VAULT = 0xBEEf3f3A04e28895f3D5163d910474901981183D; | ||
|
|
||
| /// @notice Owner granted on the allocator (3F_OWNER); controls EXECUTOR_ROLE. | ||
| address internal constant OWNER = 0xC82003FC812F8eFE93cdA63d9f8Ee8c0A3EF5d60; | ||
|
|
||
| /// @notice Address granted EXECUTOR_ROLE on the allocator (the only role allowed to call `run`). | ||
| address internal constant EXECUTOR = 0x95026A338084241E739250f4F9d2F5745dE81bDd; | ||
|
|
||
| /// @notice ERC1967 proxy upgrade admin (3F_ADMIN_PROTECTED); the only address allowed to upgrade | ||
| /// the proxy through the factory. | ||
| address internal constant PROXY_ADMIN = 0xA9F5262c1aa97C6E519D6f8837658C8f9979bA24; |
There was a problem hiding this comment.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Description: Cross-check hardcoded addresses against DeployAllocators.s.sol if it exists.
# Find the sibling deployment script
fd -i "DeployAllocators" --type f
# If found, extract constant address definitions for comparison
fd -i "DeployAllocators.s.sol" --type f --exec rg -n '0x[0-9a-fA-F]{40}' {} \;Repository: 3FLabs/facilitators
Length of output: 731
🌐 Web query:
"0x54F862fa0612A8709F6Dec4A7B39AF015CD4E82E Solady ERC1967Factory mainnet"
💡 Result:
The Ethereum address 0x54F862fa0612A8709F6Dec4A7B39AF015CD4E82E is not associated with the official Solady ERC1967Factory [1][2]. The canonical contract address for the Solady ERC1967Factory on Ethereum mainnet is 0x0000000000006396FF2a80c067f99B3d2Ab4Df24 [1][2]. This address is vanity-generated to include leading zero bytes [1]. If you are interacting with any contract address other than the verified canonical one, please exercise caution, as it is likely not part of the official Solady deployment [1][2][3].
Citations:
- 1: https://www.gmhacker.com/solady-erc1967factory-deep-dive/
- 2: https://vscode.blockscan.com/ethereum/0x0000000000006396ff2a80c067f99b3d2ab4df24
- 3: https://vectorized.github.io/solady/
Use Solady’s canonical ERC1967Factory address
0x54F862fa0612A8709F6Dec4A7B39AF015CD4E82E is not the Solady mainnet factory. Replace it with 0x0000000000006396FF2a80c067f99B3d2Ab4Df24 in this script, and mirror the change in script/DeployAllocators.s.sol since both files share the same constant.
🤖 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 `@script/DeployMorphoAllocator.s.sol` around lines 39 - 56, The ERC1967 factory
constant in DeployMorphoAllocator.s.sol is using the wrong address; update the
FACTORY value to Solady’s canonical mainnet ERC1967Factory address and apply the
same change in DeployAllocators.s.sol since both scripts share this deployment
constant. Keep the existing IERC1967Factory FACTORY symbol and adjust only the
address literal so the proxy deployment path uses the correct factory
everywhere.
Summary
Adds
script/DeployMorphoAllocator.s.sol, a variant of the existingDeployAllocators.s.solthat deploys only theMorphoAllocatorbehind an upgradeable ERC1967 proxy (via the SoladyERC1967Factory), initializing it in the same call.Same addresses/config as the combined script; the
CommitDepositdeployment is omitted.Post-deploy (not done by the script)
FACILITATOR_ROLEto the proxysetIsAllocator(morphoAllocator, true)Test
forge buildpasses.Summary by CodeRabbit