Skip to content

feat: add deploy script for MorphoAllocator only#4

Merged
maxencerb merged 2 commits into
mainfrom
feat/deploy-morpho-allocator-only
Jul 9, 2026
Merged

feat: add deploy script for MorphoAllocator only#4
maxencerb merged 2 commits into
mainfrom
feat/deploy-morpho-allocator-only

Conversation

@maxencerb

@maxencerb maxencerb commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds script/DeployMorphoAllocator.s.sol, a variant of the existing DeployAllocators.s.sol that deploys only the MorphoAllocator behind an upgradeable ERC1967 proxy (via the Solady ERC1967Factory), initializing it in the same call.

Same addresses/config as the combined script; the CommitDeposit deployment is omitted.

Post-deploy (not done by the script)

  • Facility owner: grant FACILITATOR_ROLE to the proxy
  • Vault curator: setIsAllocator(morphoAllocator, true)

Test

  • forge build passes.

Summary by CodeRabbit

  • Chores
    • Added a deployment flow for setting up the Morpho allocator and initializing it in one step.
    • Logs the resulting deployment addresses and highlights the required follow-up setup steps after deployment.

@coderabbitai

coderabbitai Bot commented Jul 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@maxencerb, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: b8e1bc70-7365-456d-932f-96a076c892a1

📥 Commits

Reviewing files that changed from the base of the PR and between a7ba92f and 9ce82a3.

📒 Files selected for processing (2)
  • script/DeployAllocators.s.sol
  • script/DeployMorphoAllocator.s.sol
📝 Walkthrough

Walkthrough

Added a Foundry deployment script DeployMorphoAllocator.s.sol that deploys a MorphoAllocator implementation, creates an ERC1967 upgradeable proxy via a minimal IERC1967Factory interface, atomically initializes it with owner/executor/facility/vault parameters, broadcasts the transaction, and logs deployment addresses along with post-deploy reminders.

Changes

Deployment Script

Layer / File(s) Summary
Imports and interface setup
script/DeployMorphoAllocator.s.sol
Adds SPDX license, pragma, Foundry Script and logging imports, MorphoAllocator/IFacility/IVaultV2 imports, and a minimal inline IERC1967Factory interface with deployAndCall.
Script contract and deployment logic
script/DeployMorphoAllocator.s.sol
Defines fixed constants (factory address, facility, vault, role addresses, proxy admin) and implements run() to broadcast deployment of the MorphoAllocator implementation, deploy an ERC1967 proxy with atomic initialize call, then log implementation/proxy addresses and print post-deploy manual steps.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: adding a deploy script for MorphoAllocator only.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/deploy-morpho-allocator-only

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 805139b and a7ba92f.

📒 Files selected for processing (1)
  • script/DeployMorphoAllocator.s.sol

Comment on lines +39 to +56
/// @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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🗄️ 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:


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.

@maxencerb maxencerb merged commit 5cac897 into main Jul 9, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant