Skip to content

Commit

Permalink
Added the deployment configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
jalextowle committed Sep 30, 2024
1 parent bff6800 commit e3edf08
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 1 deletion.
4 changes: 4 additions & 0 deletions hardhat.config.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ import {
MAINNET_MORPHO_BLUE_WSTETH_USDA_182DAY,
MAINNET_RETH_182DAY,
MAINNET_RETH_COORDINATOR,
MAINNET_STAKING_USDS_COORDINATOR,
MAINNET_STAKING_USDS_SKY_182DAY,
MAINNET_STUSD_182DAY,
} from "./tasks/deploy/config/mainnet";

Expand All @@ -40,6 +42,7 @@ const config: HardhatUserConfig = {
MAINNET_RETH_COORDINATOR,
MAINNET_MORPHO_BLUE_COORDINATOR,
MAINNET_CORN_COORDINATOR,
MAINNET_STAKING_USDS_COORDINATOR,
],
instances: [
MAINNET_EZETH_182DAY,
Expand All @@ -50,6 +53,7 @@ const config: HardhatUserConfig = {
MAINNET_STUSD_182DAY,
MAINNET_CORN_LBTC_91DAY,
MAINNET_CORN_SDAI_91DAY,
MAINNET_STAKING_USDS_SKY_182DAY,
],
checkpointRewarders: [],
checkpointSubrewarders: [],
Expand Down
4 changes: 3 additions & 1 deletion tasks/deploy/config/mainnet/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export * from "./corn-coordinator";
export * from "./corn-lbtc-91day";
export * from "./corn-sdai-91days";
export * from "./corn-sdai-91day";
export * from "./dai-182day";
export * from "./eeth-182day";
export * from "./eeth-coordinator";
Expand All @@ -15,6 +15,8 @@ export * from "./morpho-blue-wsteth-usda-182day";
export * from "./morpho-blue-wsteth-usdc-182day";
export * from "./reth-182day";
export * from "./reth-coordinator";
export * from "./staking-usds-coordinator";
export * from "./staking-usds-sky-182day";
export * from "./steth-182day";
export * from "./steth-coordinator";
export * from "./stusd-182day";
15 changes: 15 additions & 0 deletions tasks/deploy/config/mainnet/staking-usds-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_STAKING_USDS_COORDINATOR_NAME =
"ElementDAO Staking USDS Hyperdrive Deployer Coordinator";
export const MAINNET_STAKING_USDS_COORDINATOR: HyperdriveCoordinatorConfig<"StakingUSDS"> =
{
name: MAINNET_STAKING_USDS_COORDINATOR_NAME,
prefix: "StakingUSDS",
targetCount: 5,
extraConstructorArgs: [],
factoryAddress: async (hre) =>
hre.hyperdriveDeploy.deployments.byName(MAINNET_FACTORY_NAME)
.address,
};
87 changes: 87 additions & 0 deletions tasks/deploy/config/mainnet/staking-usds-sky-182day.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import { Address, keccak256, parseEther, toBytes, zeroAddress } from "viem";
import {
HyperdriveInstanceConfig,
getLinkerDetails,
normalizeFee,
parseDuration,
toBytes32,
} from "../../lib";
import { SIX_MONTHS, USDS_ADDRESS_MAINNET } from "../../lib/constants";
import { MAINNET_FACTORY_NAME } from "./factory";
import { MAINNET_STAKING_USDS_COORDINATOR_NAME } from "./staking-usds-coordinator";

// The name of the pool.
export const MAINNET_STAKING_USDS_SKY_182DAY_NAME =
"ElementDAO 182 Day Staking USDS Sky Hyperdrive";

const CONTRIBUTION = parseEther("100"); // 100e18

export const MAINNET_STAKING_USDS_SKY_182DAY: HyperdriveInstanceConfig<"StakingUSDS"> =
{
name: MAINNET_STAKING_USDS_SKY_182DAY_NAME,
prefix: "StakingUSDS",
coordinatorAddress: async (hre) =>
hre.hyperdriveDeploy.deployments.byName(
MAINNET_STAKING_USDS_COORDINATOR_NAME,
).address,
deploymentId: keccak256(toBytes(MAINNET_STAKING_USDS_SKY_182DAY_NAME)),
salt: toBytes32("0x69420"),
extraData: "0x",
contribution: CONTRIBUTION,
fixedAPR: parseEther("0.085"),
timestretchAPR: parseEther("0.05"),
options: async (hre) => ({
extraData: "0x",
asBase: true,
destination: (await hre.getNamedAccounts())["deployer"] as Address,
}),
// Prepare to deploy the contract by setting approvals.
prepare: async (hre) => {
let baseToken = await hre.viem.getContractAt(
"contracts/src/interfaces/IERC20.sol:IERC20",
USDS_ADDRESS_MAINNET,
);
let tx = await baseToken.write.approve([
hre.hyperdriveDeploy.deployments.byName(
MAINNET_STAKING_USDS_COORDINATOR_NAME,
).address,
CONTRIBUTION,
]);
let pc = await hre.viem.getPublicClient();
await pc.waitForTransactionReceipt({ hash: tx });
},
poolDeployConfig: async (hre) => {
let factoryContract = await hre.viem.getContractAt(
"HyperdriveFactory",
hre.hyperdriveDeploy.deployments.byName(MAINNET_FACTORY_NAME)
.address,
);
return {
baseToken: USDS_ADDRESS_MAINNET,
vaultSharesToken: zeroAddress,
circuitBreakerDelta: parseEther("0.05"),
minimumShareReserves: parseEther("0.001"), // 1e15
minimumTransactionAmount: parseEther("0.001"), // 1e15
positionDuration: parseDuration(SIX_MONTHS),
checkpointDuration: parseDuration("1 day"),
timeStretch: 0n,
governance: await factoryContract.read.hyperdriveGovernance(),
feeCollector: await factoryContract.read.feeCollector(),
sweepCollector: await factoryContract.read.sweepCollector(),
checkpointRewarder:
await factoryContract.read.checkpointRewarder(),
...(await getLinkerDetails(
hre,
hre.hyperdriveDeploy.deployments.byName(
MAINNET_FACTORY_NAME,
).address,
)),
fees: {
curve: parseEther("0.01"),
flat: normalizeFee(parseEther("0.0005"), SIX_MONTHS),
governanceLP: parseEther("0.15"),
governanceZombie: parseEther("0.03"),
},
};
},
};

0 comments on commit e3edf08

Please sign in to comment.