Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

morpho blue sepolia config + generic library resolution/deployment #1113

Merged
merged 10 commits into from
Jul 24, 2024
2 changes: 1 addition & 1 deletion contracts/src/libraries/Constants.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity 0.8.20;
address constant ETH = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;

/// @dev The version of the contracts.
string constant VERSION = "v1.0.15";
string constant VERSION = "v1.0.16";

/// @dev The number of targets that must be deployed for a full deployment.
uint256 constant NUM_TARGETS = 5;
Expand Down
172 changes: 171 additions & 1 deletion deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,106 @@
"contract": "StETHHyperdrive",
"address": "0x51C054F75b2c4b53E8E5114430C3ded4572473D8",
"timestamp": "2024-06-19T02:08:03.413Z"
},
"MORPHO_BLUE_COORDINATOR_MorphoBlueHyperdriveCoreDeployer": {
"contract": "MorphoBlueHyperdriveCoreDeployer",
"address": "0x942de6161dce6b216eab2b0fb07a4cab01e75b25",
"timestamp": "2024-07-19T22:01:41.154Z"
},
"MorphoBlueConversions": {
"contract": "MorphoBlueConversions",
"address": "0xcdb48bb065c12aea6aa7693b718fc2d1d8e95d36",
"timestamp": "2024-07-19T22:01:50.043Z"
},
"MORPHO_BLUE_COORDINATOR_MorphoBlueTarget0Deployer": {
"contract": "MorphoBlueTarget0Deployer",
"address": "0x340b785817ba1180a9b89eace04552dbd5a17f26",
"timestamp": "2024-07-19T22:02:03.051Z"
},
"MORPHO_BLUE_COORDINATOR_MorphoBlueTarget1Deployer": {
"contract": "MorphoBlueTarget1Deployer",
"address": "0x6b2e8de070c4aaa9abbb6153daceeb4ef5a7408d",
"timestamp": "2024-07-19T22:02:16.149Z"
},
"MORPHO_BLUE_COORDINATOR_MorphoBlueTarget2Deployer": {
"contract": "MorphoBlueTarget2Deployer",
"address": "0x7111675bed3a26025cc01b1fb780a0bd0aeda52a",
"timestamp": "2024-07-19T22:02:37.230Z"
},
"MORPHO_BLUE_COORDINATOR_MorphoBlueTarget3Deployer": {
"contract": "MorphoBlueTarget3Deployer",
"address": "0xe98e41c06764cc7338a3a2c32785666c4e4cb2eb",
"timestamp": "2024-07-19T22:02:50.227Z"
},
"MORPHO_BLUE_COORDINATOR_MorphoBlueTarget4Deployer": {
"contract": "MorphoBlueTarget4Deployer",
"address": "0x2e1f6df541c57c5f87e29af81be30de07182247e",
"timestamp": "2024-07-19T22:03:03.133Z"
},
"MORPHO_BLUE_COORDINATOR": {
"contract": "MorphoBlueHyperdriveDeployerCoordinator",
"address": "0xb8f9876f10524c7b5cbdbbfac0409a77a518d876",
"timestamp": "2024-07-19T22:03:16.138Z"
},
"MORPHO_BLUE_DAI_14_DAY_MorphoBlueTarget0": {
"contract": "MorphoBlueTarget0",
"address": "0x90598C248110CB0bf413883751392E5B97e22D49",
"timestamp": "2024-07-19T22:06:03.670Z"
},
"MORPHO_BLUE_DAI_14_DAY_MorphoBlueTarget1": {
"contract": "MorphoBlueTarget1",
"address": "0x29A09380BE010f9b4321cd09B640Fc2390c23754",
"timestamp": "2024-07-19T22:05:15.590Z"
},
"MORPHO_BLUE_DAI_14_DAY_MorphoBlueTarget2": {
"contract": "MorphoBlueTarget2",
"address": "0x2C1100Be8d1a00731feE91bb2672f3f9a9f52Acb",
"timestamp": "2024-07-19T22:05:28.618Z"
},
"MORPHO_BLUE_DAI_14_DAY_MorphoBlueTarget3": {
"contract": "MorphoBlueTarget3",
"address": "0xB2A1F3703ba511dCCF12445f161397eD7c437252",
"timestamp": "2024-07-19T22:05:37.484Z"
},
"MORPHO_BLUE_DAI_14_DAY_MorphoBlueTarget4": {
"contract": "MorphoBlueTarget4",
"address": "0xf17392948E48C45bd6664db0AEe397FB80C4A9F4",
"timestamp": "2024-07-19T22:05:50.558Z"
},
"MORPHO_BLUE_DAI_14_DAY": {
"contract": "MorphoBlueHyperdrive",
"address": "0xE352F4D16C7Ee4162d1aa54b77A15d4DA8f35f4b",
"timestamp": "2024-07-19T22:06:03.574Z"
},
"MORPHO_BLUE_DAI_30_DAY_MorphoBlueTarget0": {
"contract": "MorphoBlueTarget0",
"address": "0x7f90dc0Dd4258FeBA19122F8B24CF398d938F762",
"timestamp": "2024-07-19T22:08:12.937Z"
},
"MORPHO_BLUE_DAI_30_DAY_MorphoBlueTarget1": {
"contract": "MorphoBlueTarget1",
"address": "0xa95a24160b29925035c0e76c34caA1C177bbbA9D",
"timestamp": "2024-07-19T22:06:52.218Z"
},
"MORPHO_BLUE_DAI_30_DAY_MorphoBlueTarget2": {
"contract": "MorphoBlueTarget2",
"address": "0x63f5084182194E3C7477E6041681Ee75661a3fb6",
"timestamp": "2024-07-19T22:07:25.542Z"
},
"MORPHO_BLUE_DAI_30_DAY_MorphoBlueTarget3": {
"contract": "MorphoBlueTarget3",
"address": "0xB160a49c99c8e579F761b20654Ef6B490E32C3BB",
"timestamp": "2024-07-19T22:07:38.596Z"
},
"MORPHO_BLUE_DAI_30_DAY_MorphoBlueTarget4": {
"contract": "MorphoBlueTarget4",
"address": "0x6511a69918DAe90aFf82994B952C97c6FffEE0c9",
"timestamp": "2024-07-19T22:07:51.696Z"
},
"MORPHO_BLUE_DAI_30_DAY": {
"contract": "MorphoBlueHyperdrive",
"address": "0x82089FDfdbDEB89F208fEc03C1cA5122D6862bDc",
"timestamp": "2024-07-19T22:08:12.841Z"
}
},
"mainnet": {
Expand Down Expand Up @@ -636,6 +736,76 @@
"contract": "RETHHyperdrive",
"address": "0xca5dB9Bb25D09A9bF3b22360Be3763b5f2d13589",
"timestamp": "2024-07-16T23:41:53.768Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator_MorphoBlueHyperdriveCoreDeployer": {
"contract": "MorphoBlueHyperdriveCoreDeployer",
"address": "0x3efc73c09c53d0037db4a466fd2972b7d69dd548",
"timestamp": "2024-07-24T12:49:30.483Z"
},
"MorphoBlueConversions": {
"contract": "MorphoBlueConversions",
"address": "0xa5495ca17c93815c9684f8033a263740a2e7518d",
"timestamp": "2024-07-24T12:49:43.218Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator_MorphoBlueTarget0Deployer": {
"contract": "MorphoBlueTarget0Deployer",
"address": "0xf270d908971820d1662675babb6c880ca7c0e5d8",
"timestamp": "2024-07-24T12:49:50.735Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator_MorphoBlueTarget1Deployer": {
"contract": "MorphoBlueTarget1Deployer",
"address": "0x5e82951261d687d7b51580f9660909b055849c81",
"timestamp": "2024-07-24T12:50:04.028Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator_MorphoBlueTarget2Deployer": {
"contract": "MorphoBlueTarget2Deployer",
"address": "0x91321eabbfae5bc0022a6e09b82eaa5eacd3ad0a",
"timestamp": "2024-07-24T12:50:16.867Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator_MorphoBlueTarget3Deployer": {
"contract": "MorphoBlueTarget3Deployer",
"address": "0xdccdd954df14138e0533a5b737d0a546defdede7",
"timestamp": "2024-07-24T12:50:29.680Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator_MorphoBlueTarget4Deployer": {
"contract": "MorphoBlueTarget4Deployer",
"address": "0x7b873c4f1933812815d7f0a84d9d365dea51ca32",
"timestamp": "2024-07-24T12:50:42.389Z"
},
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator": {
"contract": "MorphoBlueHyperdriveDeployerCoordinator",
"address": "0xfe2f14fd4d64fbacc818e47e9390d878bcad9fc1",
"timestamp": "2024-07-24T12:50:55.415Z"
},
"ElementDAO 182 Day sUSDe/DAI Hyperdrive_MorphoBlueTarget0": {
"contract": "MorphoBlueTarget0",
"address": "0xeC789CfF5cB464459FAcF320988B27d4C197Ffe5",
"timestamp": "2024-07-24T12:53:03.303Z"
},
"ElementDAO 182 Day sUSDe/DAI Hyperdrive_MorphoBlueTarget1": {
"contract": "MorphoBlueTarget1",
"address": "0x39899AE100d7dcd4C8C95F1009CcfA9355Ad1f3a",
"timestamp": "2024-07-24T12:52:17.600Z"
},
"ElementDAO 182 Day sUSDe/DAI Hyperdrive_MorphoBlueTarget2": {
"contract": "MorphoBlueTarget2",
"address": "0x394DdAC293d5a351F7E3c8777117D45d3a727Cb0",
"timestamp": "2024-07-24T12:52:29.523Z"
},
"ElementDAO 182 Day sUSDe/DAI Hyperdrive_MorphoBlueTarget3": {
"contract": "MorphoBlueTarget3",
"address": "0x1AA48E249a702D8207e0F0B8B9f0f61c91Bc1A2e",
"timestamp": "2024-07-24T12:52:42.486Z"
},
"ElementDAO 182 Day sUSDe/DAI Hyperdrive_MorphoBlueTarget4": {
"contract": "MorphoBlueTarget4",
"address": "0x24E2F0Bfc840B10888BF30388fED740e2C4Dd976",
"timestamp": "2024-07-24T12:52:49.697Z"
},
"ElementDAO 182 Day sUSDe/DAI Hyperdrive": {
"contract": "MorphoBlueHyperdrive",
"address": "0x3F104Cd9C793d01AE450b8eC6F143c5924aFDfb9",
"timestamp": "2024-07-24T12:53:02.947Z"
}
}
}
}
1 change: 1 addition & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ cache_path = 'forge-cache'
remappings = [
'aave=lib/aave-v3-core/contracts',
'forge-std=lib/forge-std/src',
'morpho-blue=lib/morpho-blue',
'nomad=lib/ExcessivelySafeCall/src',
'openzeppelin=lib/openzeppelin-contracts/contracts',
'solmate=lib/solmate/src',
Expand Down
9 changes: 8 additions & 1 deletion hardhat.config.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ import {
MAINNET_EZETH_182DAY,
MAINNET_EZETH_COORDINATOR,
MAINNET_FACTORY,
MAINNET_MORPHO_BLUE_COORDINATOR,
MAINNET_MORPHO_BLUE_DAI_182DAY,
MAINNET_RETH_182DAY,
MAINNET_RETH_COORDINATOR,
} from "./tasks/deploy/config/mainnet";
Expand All @@ -28,8 +30,13 @@ const config: HardhatUserConfig = {
coordinators: [
MAINNET_EZETH_COORDINATOR,
MAINNET_RETH_COORDINATOR,
MAINNET_MORPHO_BLUE_COORDINATOR,
],
instances: [
MAINNET_EZETH_182DAY,
MAINNET_RETH_182DAY,
MAINNET_MORPHO_BLUE_DAI_182DAY,
],
instances: [MAINNET_EZETH_182DAY, MAINNET_RETH_182DAY],
checkpointRewarders: [],
checkpointSubrewarders: [],
},
Expand Down
8 changes: 6 additions & 2 deletions hardhat.config.sepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ import {
SEPOLIA_EZETH_30DAY,
SEPOLIA_EZETH_COORDINATOR,
SEPOLIA_FACTORY,
SEPOLIA_MORPHO_BLUE_COORDINATOR,
SEPOLIA_MORPHO_BLUE_DAI_14DAY,
SEPOLIA_MORPHO_BLUE_DAI_30DAY,
SEPOLIA_RETH_14DAY,
SEPOLIA_RETH_30DAY,
SEPOLIA_RETH_COORDINATOR,
Expand Down Expand Up @@ -51,18 +54,19 @@ const config: HardhatUserConfig = {
SEPOLIA_STETH_COORDINATOR,
SEPOLIA_RETH_COORDINATOR,
SEPOLIA_EZETH_COORDINATOR,
SEPOLIA_MORPHO_BLUE_COORDINATOR,
],
instances: [
SEPOLIA_DAI_14DAY,
SEPOLIA_DAI_30DAY,
SEPOLIA_EZETH_14DAY,
SEPOLIA_EZETH_30DAY,
// SEPOLIA_MORPHO_DAI_14DAY,
// SEPOLIA_MORPHO_DAI_30DAY,
SEPOLIA_RETH_14DAY,
SEPOLIA_RETH_30DAY,
SEPOLIA_STETH_14DAY,
SEPOLIA_STETH_30DAY,
SEPOLIA_MORPHO_BLUE_DAI_14DAY,
SEPOLIA_MORPHO_BLUE_DAI_30DAY,
],
},
},
Expand Down
53 changes: 1 addition & 52 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,6 @@ import "dotenv/config";
import "hardhat-deploy";
import { HardhatUserConfig } from "hardhat/config";
import "./tasks";
import {
SEPOLIA_CHECKPOINT_REWARDER,
SEPOLIA_CHECKPOINT_SUBREWARDER,
SEPOLIA_DAI_14DAY,
SEPOLIA_DAI_30DAY,
SEPOLIA_ERC4626_COORDINATOR,
SEPOLIA_EZETH_14DAY,
SEPOLIA_EZETH_30DAY,
SEPOLIA_EZETH_COORDINATOR,
SEPOLIA_FACTORY,
SEPOLIA_RETH_14DAY,
SEPOLIA_RETH_30DAY,
SEPOLIA_RETH_COORDINATOR,
SEPOLIA_STETH_14DAY,
SEPOLIA_STETH_30DAY,
SEPOLIA_STETH_COORDINATOR,
} from "./tasks/deploy/config/sepolia";

const { env } = process;
let DEFAULT_PK =
"0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80";

const config: HardhatUserConfig = {
solidity: {
Expand Down Expand Up @@ -53,37 +32,7 @@ const config: HardhatUserConfig = {
etherscan: {
apiKey: process.env.ETHERSCAN_API_KEY ?? "",
},
networks: {
hardhat: {
accounts: [
{
privateKey: env.PRIVATE_KEY ?? DEFAULT_PK,
balance: "1000000000000000000",
},
],
hyperdriveDeploy: {
checkpointRewarders: [SEPOLIA_CHECKPOINT_REWARDER],
checkpointSubrewarders: [SEPOLIA_CHECKPOINT_SUBREWARDER],
factories: [SEPOLIA_FACTORY],
coordinators: [
SEPOLIA_ERC4626_COORDINATOR,
SEPOLIA_STETH_COORDINATOR,
SEPOLIA_RETH_COORDINATOR,
SEPOLIA_EZETH_COORDINATOR,
],
instances: [
SEPOLIA_DAI_14DAY,
SEPOLIA_DAI_30DAY,
SEPOLIA_EZETH_14DAY,
SEPOLIA_EZETH_30DAY,
SEPOLIA_RETH_14DAY,
SEPOLIA_RETH_30DAY,
SEPOLIA_STETH_14DAY,
SEPOLIA_STETH_30DAY,
],
},
},
},
networks: {},
};

export default config;
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"@nomicfoundation/hardhat-network-helpers": "^1.0.0",
"@nomicfoundation/hardhat-toolbox-viem": "^3.0.0",
"@nomicfoundation/hardhat-verify": "^2.0.0",
"@nomicfoundation/hardhat-viem": "^2.0.1",
"@nomicfoundation/hardhat-viem": "^2.0.3",
"@nomicfoundation/ignition-core": "^0.15.1",
"@typechain/ethers-v6": "^0.5.1",
"@typechain/hardhat": "^9.1.0",
Expand Down
10 changes: 8 additions & 2 deletions scripts/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/sh

set -e

# Ensure that the network variable is defined
if [[ -z "${NETWORK}" ]]; then
echo 'Error: $NETWORK must be set'
Expand All @@ -20,5 +22,9 @@ if [[ "${NETWORK}" != "anvil" && "${NETWORK}" != "hardhat" && "${NETWORK}" != "m
fi
fi

npx hardhat deploy:hyperdrive --show-stack-traces --network ${NETWORK} --config hardhat.config.${NETWORK}.ts
npx hardhat deploy:verify --show-stack-traces --network ${NETWORK} --config hardhat.config.${NETWORK}.ts
config_filename="hardhat.config.${NETWORK}.ts"
if [[ "${NETWORK}" == "hardhat" ]]; then
config_filename="hardhat.config.ts"
jalextowle marked this conversation as resolved.
Show resolved Hide resolved
fi
npx hardhat deploy:hyperdrive --show-stack-traces --network ${NETWORK} --config "$config_filename"
npx hardhat deploy:verify --show-stack-traces --network ${NETWORK} --config "$config_filename"
2 changes: 2 additions & 0 deletions tasks/deploy/config/mainnet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ export * from "./erc4626-coordinator";
export * from "./ezeth-182day";
export * from "./ezeth-coordinator";
export * from "./factory";
export * from "./morpho-blue-coordinator";
export * from "./morpho-blue-susde-dai-182day";
export * from "./reth-182day";
export * from "./reth-coordinator";
export * from "./steth-182day";
Expand Down
15 changes: 15 additions & 0 deletions tasks/deploy/config/mainnet/morpho-blue-coordinator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { HyperdriveCoordinatorConfig } from "../../lib";
import { MAINNET_FACTORY_NAME } from "./factory";

export const MAINNET_MORPHO_BLUE_COORDINATOR_NAME =
"ElementDAO MorphoBlue Hyperdrive Deployer Coordinator";

export const MAINNET_MORPHO_BLUE_COORDINATOR: HyperdriveCoordinatorConfig<"MorphoBlue"> =
{
name: MAINNET_MORPHO_BLUE_COORDINATOR_NAME,
prefix: "MorphoBlue",
targetCount: 5,
factoryAddress: async (hre) =>
hre.hyperdriveDeploy.deployments.byName(MAINNET_FACTORY_NAME)
.address,
};
Loading
Loading