Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1

- name: Run Linter
run: forge fmt --check
6 changes: 3 additions & 3 deletions .github/workflows/foundry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
uses: foundry-rs/foundry-toolchain@908c540300062bd5a7e473851cdb4282204cee09 # v1

- name: Install node
uses: actions/setup-node@v3
uses: actions/setup-node@3235b876344d2a9aa001b8d1453c930bba69e610 # v3
with:
node-version: 18
cache: yarn
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
[submodule "lib/metamorpho-v1.1"]
path = lib/metamorpho-v1.1
url = git@github.com:berachain/contracts-metamorpho-v1.1.git
branch = feat/split-fee
branch = main
[submodule "lib/morpho-blue"]
path = lib/morpho-blue
url = git@github.com:berachain/morpho-blue.git
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"deploy:morpho": "yarn build:blue && yarn build:irm && yarn script script/morpho/DeployMorpho.sol --sig \"run(string memory)\"",
"deploy:bundler3": "yarn build:bundler3 && yarn script script/bundler3/DeployBundler3.sol --sig \"run(string memory)\"",
"deploy:metamorpho-factory-v1.1": "yarn build:metamorpho-v1.1 && yarn script script/metamorpho-factory-v1.1/DeployMetaMorphoFactoryV1_1.sol --sig \"run(string memory)\"",
"deploy:metamorpho-factory-v1.1-existing-fee-partitioner": "yarn build:metamorpho-v1.1 && yarn script script/metamorpho-factory-v1.1/DeployMetaMorphoFactoryV1_1WithExistingFeePartitioner.sol --sig \"run(string memory)\"",
"deploy:oracle-factory": "yarn build:oracles && yarn script script/oracle-factory/DeployOracleFactory.sol --sig \"run(string memory)\"",
"deploy:urd-factory": "yarn build:urd && yarn script script/urd-factory/DeployUrdFactory.sol --sig \"run(string memory)\"",
"deploy:public-allocator": "yarn build:public-allocator && yarn script script/public-allocator/DeployPublicAllocator.sol --sig \"run(string memory)\"",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// SPDX-License-Identifier: GPL-2.0-or-later
pragma solidity ^0.8.0;

import {IMetaMorphoV1_1Factory} from "../../lib/metamorpho-v1.1/src/interfaces/IMetaMorphoV1_1Factory.sol";
import "../ConfiguredScript.sol";

/// @dev Warning: keys must be ordered alphabetically.
struct DeployMetaMorphoFactoryWithExistingFeePartitionerConfig {
address metaFeePartitioner;
bytes32 metaFeePartitionerSalt;
bytes32 salt;
}

contract DeployMetaMorphoFactoryWithExistingFeePartitioner is ConfiguredScript {
IMetaMorphoV1_1Factory internal metaMorphoFactory;

function _scriptDir() internal pure override returns (string memory) {
return "metamorpho-factory-v1.1";
}

function run(string memory network)
public
returns (DeployMetaMorphoFactoryWithExistingFeePartitionerConfig memory config)
{
config = abi.decode(_init(network, true), (DeployMetaMorphoFactoryWithExistingFeePartitionerConfig));

require(config.metaFeePartitioner != address(0), "metaFeePartitioner must be set in the config");
require(config.metaFeePartitioner.code.length != 0, "metaFeePartitioner is not a contract on this network");

console2.log("Reusing MetaFeePartitioner at: ", config.metaFeePartitioner);

bytes memory constructorArgs = abi.encode(address(morpho), config.metaFeePartitioner);

metaMorphoFactory = IMetaMorphoV1_1Factory(
_deployCreate2Code("metamorpho-v1.1", "MetaMorphoV1_1Factory", constructorArgs, config.salt)
);
}
}
3 changes: 2 additions & 1 deletion script/metamorpho-factory-v1.1/config/berachain.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"metaFeePartitionerSalt": "0x000000000000000000000000000000000000000000000000000000000000009",
"salt": "0x000000000000000000000000000000000000000000000000000000000000009"
"salt": "0x0000000000000000000000000000000000000000000000000000000000000010",
"metaFeePartitioner": "0x80108Ee81A92091Db6B8B2326B1875ce9388f461"
}
Loading