diff --git a/deployments.json b/deployments.json index a0904ed41..1200201fa 100644 --- a/deployments.json +++ b/deployments.json @@ -364,6 +364,56 @@ "contract": "EzETHHyperdrive", "address": "0x496c57E03B63911ED37cd1ffc95d49b60AA22107", "timestamp": "2024-05-14T21:42:16.404Z" + }, + "MORPHO_DAI_30_DAY_ERC4626Target0": { + "contract": "ERC4626Target0", + "address": "0x851006c831C9D6879766cA4266B754baB31693A8", + "timestamp": "2024-05-21T19:19:14.731Z" + }, + "MORPHO_DAI_30_DAY_ERC4626Target1": { + "contract": "ERC4626Target1", + "address": "0xE1C1dEB5bF2113135F2427084DFDb3FDd15E93a8", + "timestamp": "2024-05-21T19:19:28.354Z" + }, + "MORPHO_DAI_30_DAY_ERC4626Target2": { + "contract": "ERC4626Target2", + "address": "0xB7CEE78715a5aD33BB35162eE35a5C55F9cb2d4c", + "timestamp": "2024-05-21T19:19:53.731Z" + }, + "MORPHO_DAI_30_DAY_ERC4626Target3": { + "contract": "ERC4626Target3", + "address": "0xA9FeA91bF5521693303aCC4a6609FCA0b4a1B8a8", + "timestamp": "2024-05-21T19:20:02.724Z" + }, + "MORPHO_DAI_30_DAY": { + "contract": "ERC4626Hyperdrive", + "address": "0xb4E605E079B4D9ed50B7202Ca0d008EE473A8de4", + "timestamp": "2024-05-21T19:20:16.433Z" + }, + "MORPHO_DAI_14_DAY_ERC4626Target0": { + "contract": "ERC4626Target0", + "address": "0xe87cC1a506EFa99d19F627Acc60cfBc9d33701E8", + "timestamp": "2024-05-21T19:37:26.080Z" + }, + "MORPHO_DAI_14_DAY_ERC4626Target1": { + "contract": "ERC4626Target1", + "address": "0x84715AB45102D9AE879C2590685cB1F1b810fa1C", + "timestamp": "2024-05-21T19:37:39.534Z" + }, + "MORPHO_DAI_14_DAY_ERC4626Target2": { + "contract": "ERC4626Target2", + "address": "0x75865573011Cf1E46ff8B315e55cb2E5877f3245", + "timestamp": "2024-05-21T19:38:00.944Z" + }, + "MORPHO_DAI_14_DAY_ERC4626Target3": { + "contract": "ERC4626Target3", + "address": "0x4798bD70927AF3bf11455cf34F7fe33eC845c0D0", + "timestamp": "2024-05-21T19:38:26.489Z" + }, + "MORPHO_DAI_14_DAY": { + "contract": "ERC4626Hyperdrive", + "address": "0x2F8702a0f20Bd6C152381D59a39DBe8cA87db9c2", + "timestamp": "2024-05-21T19:39:37.982Z" } } } \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index 5ba0ca012..fcbf56c36 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -13,6 +13,8 @@ import { SEPOLIA_EZETH_30DAY, SEPOLIA_EZETH_COORDINATOR, SEPOLIA_FACTORY, + SEPOLIA_MORPHO_DAI_14DAY, + SEPOLIA_MORPHO_DAI_30DAY, SEPOLIA_RETH_14DAY, SEPOLIA_RETH_30DAY, SEPOLIA_RETH_COORDINATOR, @@ -64,12 +66,14 @@ const config: HardhatUserConfig = { instances: [ SEPOLIA_DAI_14DAY, SEPOLIA_DAI_30DAY, - SEPOLIA_STETH_14DAY, - SEPOLIA_STETH_30DAY, - SEPOLIA_RETH_14DAY, - SEPOLIA_RETH_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, ], }, }, @@ -95,12 +99,14 @@ const config: HardhatUserConfig = { instances: [ SEPOLIA_DAI_14DAY, SEPOLIA_DAI_30DAY, - SEPOLIA_STETH_14DAY, - SEPOLIA_STETH_30DAY, - SEPOLIA_RETH_14DAY, - SEPOLIA_RETH_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, ], }, }, @@ -125,12 +131,14 @@ const config: HardhatUserConfig = { instances: [ SEPOLIA_DAI_14DAY, SEPOLIA_DAI_30DAY, - SEPOLIA_STETH_14DAY, - SEPOLIA_STETH_30DAY, - SEPOLIA_RETH_14DAY, - SEPOLIA_RETH_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, ], }, }, diff --git a/scripts/deploy.sh b/scripts/deploy.sh index fe0562028..14db6454f 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -7,7 +7,7 @@ fi git remote update tag=$(git describe --tags --abbrev=0) -diff=$(git diff ${tag} --raw) +diff=$(git diff ${tag} --raw -- contracts lib) if [[ "${NETWORK}" != "localhost" && "${NETWORK}" != "hardhat" && ! -z "${diff}" ]]; then echo "$diff" diff --git a/tasks/deploy/config/sepolia/index.ts b/tasks/deploy/config/sepolia/index.ts index d68ec1a6f..21c7da8e4 100644 --- a/tasks/deploy/config/sepolia/index.ts +++ b/tasks/deploy/config/sepolia/index.ts @@ -5,6 +5,8 @@ export * from "./ezeth-14day"; export * from "./ezeth-30day"; export * from "./ezeth-coordinator"; export * from "./factory"; +export * from "./morpho-dai-14day"; +export * from "./morpho-dai-30day"; export * from "./reth-14day"; export * from "./reth-30day"; export * from "./reth-coordinator"; diff --git a/tasks/deploy/config/sepolia/morpho-dai-14day.ts b/tasks/deploy/config/sepolia/morpho-dai-14day.ts new file mode 100644 index 000000000..2da54e182 --- /dev/null +++ b/tasks/deploy/config/sepolia/morpho-dai-14day.ts @@ -0,0 +1,81 @@ +import { parseEther } from "viem"; +import { + HyperdriveInstanceConfig, + getLinkerDetails, + normalizeFee, + parseDuration, + toBytes32, +} from "../../lib"; + +const CONTRIBUTION = parseEther("10000"); + +export const SEPOLIA_MORPHO_DAI_14DAY: HyperdriveInstanceConfig<"ERC4626"> = { + name: "MORPHO_DAI_14_DAY", + prefix: "ERC4626", + coordinatorAddress: async (hre) => + hre.hyperdriveDeploy.deployments.byName("ERC4626_COORDINATOR").address, + deploymentId: toBytes32("MORPHO_DAI_14_DAY_2"), + salt: toBytes32("0x69420"), + extraData: "0x", + contribution: CONTRIBUTION, + fixedAPR: parseEther("0.10"), + timestretchAPR: parseEther("0.10"), + options: { + extraData: "0x", + asBase: true, + destination: "0xd94a3A0BfC798b98a700a785D5C610E8a2d5DBD8", + }, + prepare: async (hre, options) => { + let pc = await hre.viem.getPublicClient(); + let baseToken = await hre.hyperdriveDeploy.ensureDeployed( + "DAI", + "ERC20Mintable", + [ + "DAI", + "DAI", + 18, + "0xd94a3A0BfC798b98a700a785D5C610E8a2d5DBD8", + true, + parseEther("10000"), + ], + options, + ); + + // approve the coordinator for the contribution + let tx = await baseToken.write.approve([ + hre.hyperdriveDeploy.deployments.byName("ERC4626_COORDINATOR") + .address, + CONTRIBUTION, + ]); + await pc.waitForTransactionReceipt({ hash: tx }); + + // mint some tokens for the contribution + tx = await baseToken.write.mint([CONTRIBUTION]); + await pc.waitForTransactionReceipt({ hash: tx }); + }, + poolDeployConfig: async (hre) => { + return { + baseToken: hre.hyperdriveDeploy.deployments.byName("DAI").address, + vaultSharesToken: "0x80191B6a6A8E2026209fB5d1e4e9CC9A73029511", + circuitBreakerDelta: parseEther("0.6"), + minimumShareReserves: parseEther("10"), + minimumTransactionAmount: parseEther("0.001"), + positionDuration: parseDuration("14 days"), + checkpointDuration: parseDuration("1 day"), + timeStretch: 0n, + governance: "0xc187a246Ee5A4Fe4395a8f6C0f9F2AA3A5a06e9b", + feeCollector: "0xc187a246Ee5A4Fe4395a8f6C0f9F2AA3A5a06e9b", + sweepCollector: "0xc187a246Ee5A4Fe4395a8f6C0f9F2AA3A5a06e9b", + ...(await getLinkerDetails( + hre, + hre.hyperdriveDeploy.deployments.byName("FACTORY").address, + )), + fees: { + curve: parseEther("0.01"), + flat: normalizeFee(parseEther("0.0005"), "14 days"), + governanceLP: parseEther("0.15"), + governanceZombie: parseEther("0.03"), + }, + }; + }, +}; diff --git a/tasks/deploy/config/sepolia/morpho-dai-30day.ts b/tasks/deploy/config/sepolia/morpho-dai-30day.ts new file mode 100644 index 000000000..7238e16ca --- /dev/null +++ b/tasks/deploy/config/sepolia/morpho-dai-30day.ts @@ -0,0 +1,81 @@ +import { parseEther } from "viem"; +import { + HyperdriveInstanceConfig, + getLinkerDetails, + normalizeFee, + parseDuration, + toBytes32, +} from "../../lib"; + +const CONTRIBUTION = parseEther("10000"); + +export const SEPOLIA_MORPHO_DAI_30DAY: HyperdriveInstanceConfig<"ERC4626"> = { + name: "MORPHO_DAI_30_DAY", + prefix: "ERC4626", + coordinatorAddress: async (hre) => + hre.hyperdriveDeploy.deployments.byName("ERC4626_COORDINATOR").address, + deploymentId: toBytes32("MORPHO_DAI_30_DAY"), + salt: toBytes32("0x69420"), + extraData: "0x", + contribution: CONTRIBUTION, + fixedAPR: parseEther("0.10"), + timestretchAPR: parseEther("0.10"), + options: { + extraData: "0x", + asBase: true, + destination: "0xd94a3A0BfC798b98a700a785D5C610E8a2d5DBD8", + }, + prepare: async (hre, options) => { + let pc = await hre.viem.getPublicClient(); + let baseToken = await hre.hyperdriveDeploy.ensureDeployed( + "DAI", + "ERC20Mintable", + [ + "DAI", + "DAI", + 18, + "0xd94a3A0BfC798b98a700a785D5C610E8a2d5DBD8", + true, + parseEther("10000"), + ], + options, + ); + + // approve the coordinator for the contribution + let tx = await baseToken.write.approve([ + hre.hyperdriveDeploy.deployments.byName("ERC4626_COORDINATOR") + .address, + CONTRIBUTION, + ]); + await pc.waitForTransactionReceipt({ hash: tx }); + + // mint some tokens for the contribution + tx = await baseToken.write.mint([CONTRIBUTION]); + await pc.waitForTransactionReceipt({ hash: tx }); + }, + poolDeployConfig: async (hre) => { + return { + baseToken: hre.hyperdriveDeploy.deployments.byName("DAI").address, + vaultSharesToken: "0x80191B6a6A8E2026209fB5d1e4e9CC9A73029511", + circuitBreakerDelta: parseEther("0.6"), + minimumShareReserves: parseEther("10"), + minimumTransactionAmount: parseEther("0.001"), + positionDuration: parseDuration("30 days"), + checkpointDuration: parseDuration("1 day"), + timeStretch: 0n, + governance: "0xc187a246Ee5A4Fe4395a8f6C0f9F2AA3A5a06e9b", + feeCollector: "0xc187a246Ee5A4Fe4395a8f6C0f9F2AA3A5a06e9b", + sweepCollector: "0xc187a246Ee5A4Fe4395a8f6C0f9F2AA3A5a06e9b", + ...(await getLinkerDetails( + hre, + hre.hyperdriveDeploy.deployments.byName("FACTORY").address, + )), + fees: { + curve: parseEther("0.01"), + flat: normalizeFee(parseEther("0.0005"), "30 days"), + governanceLP: parseEther("0.15"), + governanceZombie: parseEther("0.03"), + }, + }; + }, +};