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

sGYD Integration + Deployment #1210

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
200 changes: 130 additions & 70 deletions deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -867,41 +867,6 @@
"address": "0x7548c4F665402BAb3a4298B88527824B7b18Fe27",
"timestamp": "2024-09-03T20:36:40.438Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626HyperdriveCoreDeployer": {
"contract": "ERC4626HyperdriveCoreDeployer",
"address": "0x1dcac79c73ca892d5872e5d8cb3ff43db0c81289",
"timestamp": "2024-09-03T21:44:28.498Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target0Deployer": {
"contract": "ERC4626Target0Deployer",
"address": "0x9e8af51810042156f4cdae3109523345cc768541",
"timestamp": "2024-09-03T21:44:41.585Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target1Deployer": {
"contract": "ERC4626Target1Deployer",
"address": "0xf19359677a2a0d5e3e43b7cc2bc73bac892d4c04",
"timestamp": "2024-09-03T21:44:50.642Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target2Deployer": {
"contract": "ERC4626Target2Deployer",
"address": "0x218077b6c774abe7f262f9f1fc0b995352a0b6f3",
"timestamp": "2024-09-03T21:45:03.729Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target3Deployer": {
"contract": "ERC4626Target3Deployer",
"address": "0xe275a81e0223688eb7da761169eb121b4ef7c3ef",
"timestamp": "2024-09-03T21:45:16.862Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target4Deployer": {
"contract": "ERC4626Target4Deployer",
"address": "0x0fb70c3de906eddab929b5d288b638adb5238ccb",
"timestamp": "2024-09-03T21:45:29.967Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator": {
"contract": "ERC4626HyperdriveDeployerCoordinator",
"address": "0x50ea16a4050e65748eeb82d94e0c84ac233225df",
"timestamp": "2024-09-03T21:45:39.060Z"
},
"ElementDAO 182 Day stUSD Hyperdrive_ERC4626Target0": {
"contract": "ERC4626Target0",
"address": "0x686ffbDd397De6B2fff855b1bed53947da673F4f",
Expand Down Expand Up @@ -991,6 +956,71 @@
"contract": "ERC4626Hyperdrive",
"address": "0x05b65FA90AD702e6Fd0C3Bd7c4c9C47BAB2BEa6b",
"timestamp": "2024-10-10T00:32:40.530Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626HyperdriveCoreDeployer": {
"contract": "ERC4626HyperdriveCoreDeployer",
"address": "0xa7f4fa98e61cca63130b66699620bd80ccdbe5b7",
"timestamp": "2024-11-03T23:31:16.861Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target0Deployer": {
"contract": "ERC4626Target0Deployer",
"address": "0x56568eb63e1b0dde1adccf60fa370d051bfdf89f",
"timestamp": "2024-11-03T23:31:26.412Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target1Deployer": {
"contract": "ERC4626Target1Deployer",
"address": "0x83cfd1fb412d0b4ab5c4852f3faf990d63cc760a",
"timestamp": "2024-11-03T23:31:40.184Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target2Deployer": {
"contract": "ERC4626Target2Deployer",
"address": "0x3837024d7b9d4a60514bb9f7cb9d9493e29656fd",
"timestamp": "2024-11-03T23:31:53.431Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target3Deployer": {
"contract": "ERC4626Target3Deployer",
"address": "0x01f06f23d684d2beacb4dc9dcb4bd27a3fe624b1",
"timestamp": "2024-11-03T23:32:02.705Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target4Deployer": {
"contract": "ERC4626Target4Deployer",
"address": "0x7b5ce2411fcf3d06e9e60bde66cc8ee869ff13b9",
"timestamp": "2024-11-03T23:32:16.194Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator": {
"contract": "ERC4626HyperdriveDeployerCoordinator",
"address": "0x0ebbb7e85337cf4ed496dd81a300c6c31ba633c9",
"timestamp": "2024-11-03T23:32:25.459Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target0": {
"contract": "ERC4626Target0",
"address": "0x12A860db0b8928da0C0b64b5ce51A524c3a40e13",
"timestamp": "2024-11-03T23:34:03.923Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target1": {
"contract": "ERC4626Target1",
"address": "0x05890fac1b957B48a4f74d6fE74cf76C92389B17",
"timestamp": "2024-11-03T23:33:14.380Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target2": {
"contract": "ERC4626Target2",
"address": "0x72f88Ba5DD6cF894A7367010C54Eddb5E208Ce45",
"timestamp": "2024-11-03T23:33:27.773Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target3": {
"contract": "ERC4626Target3",
"address": "0x9aA89A768E642a9d4Ce0c8d0ebFc2DC051F55289",
"timestamp": "2024-11-03T23:33:41.239Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target4": {
"contract": "ERC4626Target4",
"address": "0xe549BAc862A408294df78c6CA7B89D75e8582147",
"timestamp": "2024-11-03T23:33:50.414Z"
},
"ElementDAO 182 Day sGYD Hyperdrive": {
"contract": "ERC4626Hyperdrive",
"address": "0xf1232Dc21eADAf503D82f1e1361CfF2BBf40394D",
"timestamp": "2024-11-03T23:34:03.748Z"
}
},
"gnosis": {
Expand Down Expand Up @@ -1049,41 +1079,6 @@
"address": "0x0fb305a458b1008faee03147b700b3975bea03fd",
"timestamp": "2024-08-29T18:28:07.186Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626HyperdriveCoreDeployer": {
"contract": "ERC4626HyperdriveCoreDeployer",
"address": "0xb2f17302ed12fe72d883fcc2b66f1b844fbb7964",
"timestamp": "2024-08-29T18:28:26.929Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target0Deployer": {
"contract": "ERC4626Target0Deployer",
"address": "0xe441e793f7d6f7b0d633a770554d8924103a30b4",
"timestamp": "2024-08-29T18:28:32.385Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target1Deployer": {
"contract": "ERC4626Target1Deployer",
"address": "0xe8dc5073b02d062388db8e50762a8c9a1c823540",
"timestamp": "2024-08-29T18:28:37.783Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target2Deployer": {
"contract": "ERC4626Target2Deployer",
"address": "0xe0da47a1a6ceb80bb945652cb96a821fa5d91327",
"timestamp": "2024-08-29T18:28:47.370Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target3Deployer": {
"contract": "ERC4626Target3Deployer",
"address": "0x279c0504575639131be082923c21289d553d7c08",
"timestamp": "2024-08-29T18:28:57.080Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target4Deployer": {
"contract": "ERC4626Target4Deployer",
"address": "0xca76fd3033fa9f754c05844773d79c193ad784b5",
"timestamp": "2024-08-29T18:29:02.504Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator": {
"contract": "ERC4626HyperdriveDeployerCoordinator",
"address": "0xb274f4fcc2b391e0dfabfbe7b7c130447018f6ea",
"timestamp": "2024-08-29T18:29:12.102Z"
},
"ElementDAO 182 Day wstETH Hyperdrive_ChainlinkTarget0": {
"contract": "ChainlinkTarget0",
"address": "0x87f566edE278C328e9A3af3b6958e0F95fE80476",
Expand Down Expand Up @@ -1143,6 +1138,71 @@
"contract": "ERC4626Hyperdrive",
"address": "0xEe9BFf933aDD313C4289E98dA80fEfbF9d5Cd9Ba",
"timestamp": "2024-08-29T18:31:32.479Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626HyperdriveCoreDeployer": {
"contract": "ERC4626HyperdriveCoreDeployer",
"address": "0xd917235d89a58af93302e9a998d62735740c8117",
"timestamp": "2024-11-04T15:57:06.432Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target0Deployer": {
"contract": "ERC4626Target0Deployer",
"address": "0x77644b188a5d1d58246a233761273c74b0f9d88d",
"timestamp": "2024-11-04T15:57:15.554Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target1Deployer": {
"contract": "ERC4626Target1Deployer",
"address": "0xbaa863b62c69993143b013fe7b8af278fd52f76b",
"timestamp": "2024-11-04T15:57:24.581Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target2Deployer": {
"contract": "ERC4626Target2Deployer",
"address": "0x68ba944d89d7481f3a9d73dcb75b7e6c7db5562b",
"timestamp": "2024-11-04T15:57:43.579Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target3Deployer": {
"contract": "ERC4626Target3Deployer",
"address": "0xb7c320cef81f0f9abb726590ef5105f551816d76",
"timestamp": "2024-11-04T15:57:52.727Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator_ERC4626Target4Deployer": {
"contract": "ERC4626Target4Deployer",
"address": "0x8d6d5d48f881bcccd6c09256724692b3a971b87b",
"timestamp": "2024-11-04T15:58:01.648Z"
},
"ElementDAO ERC4626 Hyperdrive Deployer Coordinator": {
"contract": "ERC4626HyperdriveDeployerCoordinator",
"address": "0xe670f140dedcdf142e15ce198e1a99fecd67d21c",
"timestamp": "2024-11-04T15:58:06.455Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target0": {
"contract": "ERC4626Target0",
"address": "0xd35e6bFF0d1c3FE78F9d45b184BdbC9Fc7d5e455",
"timestamp": "2024-11-04T15:58:56.172Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target1": {
"contract": "ERC4626Target1",
"address": "0xAbC4622d505891648Ffa2bB649994F59f4B10f98",
"timestamp": "2024-11-04T15:58:36.874Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target2": {
"contract": "ERC4626Target2",
"address": "0x0da0ab9296f45CbD694875A6fDf8E14C16b79ce1",
"timestamp": "2024-11-04T15:58:41.717Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target3": {
"contract": "ERC4626Target3",
"address": "0x11505124Bd6b77Bee2bBcce19f2999055F953c87",
"timestamp": "2024-11-04T15:58:46.522Z"
},
"ElementDAO 182 Day sGYD Hyperdrive_ERC4626Target4": {
"contract": "ERC4626Target4",
"address": "0x70DfeF2aA019486a9E938888B67bf78E41F3B16b",
"timestamp": "2024-11-04T15:58:51.274Z"
},
"ElementDAO 182 Day sGYD Hyperdrive": {
"contract": "ERC4626Hyperdrive",
"address": "0x9248f874AaA2c53AD9324d7A2D033ea133443874",
"timestamp": "2024-11-04T15:58:56.075Z"
}
},
"linea": {
Expand Down
3 changes: 2 additions & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ remappings = [
gas_limit = "18446744073709551615"
# allows the ffi to be used
ffi = true
# the evm version
evm_version = "cancun"
# See more config options https://github.com/foundry-rs/foundry/tree/master/config

[profile.production]
Expand All @@ -39,7 +41,6 @@ optimizer_runs = 13000
via_ir = false
# Enable gas-reporting for all contracts
gas_reports = ["*"]
evm_version = "paris"
verbosity = 4

[profile.lite]
Expand Down
7 changes: 6 additions & 1 deletion hardhat.config.gnosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
GNOSIS_CHAINLINK_COORDINATOR,
GNOSIS_ERC4626_COORDINATOR,
GNOSIS_FACTORY,
GNOSIS_SGYD_182DAY,
GNOSIS_SXDAI_182DAY,
GNOSIS_WSTETH_182DAY,
} from "./tasks/deploy/config/gnosis";
Expand All @@ -30,7 +31,11 @@ const config: HardhatUserConfig = {
GNOSIS_CHAINLINK_COORDINATOR,
GNOSIS_ERC4626_COORDINATOR,
],
instances: [GNOSIS_WSTETH_182DAY, GNOSIS_SXDAI_182DAY],
instances: [
GNOSIS_WSTETH_182DAY,
GNOSIS_SXDAI_182DAY,
GNOSIS_SGYD_182DAY,
],
checkpointRewarders: [],
checkpointSubrewarders: [],
},
Expand Down
2 changes: 2 additions & 0 deletions hardhat.config.mainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
MAINNET_MORPHO_BLUE_WSTETH_USDA_182DAY,
MAINNET_RETH_182DAY,
MAINNET_RETH_COORDINATOR,
MAINNET_SGYD_182DAY,
MAINNET_STUSD_182DAY,
MAINNET_SUSDE_182DAY,
} from "./tasks/deploy/config/mainnet";
Expand Down Expand Up @@ -46,6 +47,7 @@ const config: HardhatUserConfig = {
MAINNET_MORPHO_BLUE_WSTETH_USDA_182DAY,
MAINNET_STUSD_182DAY,
MAINNET_SUSDE_182DAY,
MAINNET_SGYD_182DAY,
],
checkpointRewarders: [],
checkpointSubrewarders: [],
Expand Down
1 change: 1 addition & 0 deletions tasks/deploy/config/gnosis/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export * from "./chainlink-coordinator";
export * from "./erc4626-coordinator";
export * from "./factory";
export * from "./sgyd-182day";
export * from "./sxdai-182day";
export * from "./wsteth-182day";
89 changes: 89 additions & 0 deletions tasks/deploy/config/gnosis/sgyd-182day.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
import { Address, keccak256, parseEther, toBytes } from "viem";
import {
HyperdriveInstanceConfig,
getLinkerDetails,
normalizeFee,
parseDuration,
toBytes32,
} from "../../lib";
import {
GYD_ADDRESS_GNOSIS,
SGYD_ADDRESS_GNOSIS,
SIX_MONTHS,
} from "../../lib/constants";
import { GNOSIS_ERC4626_COORDINATOR_NAME } from "./erc4626-coordinator";
import { GNOSIS_FACTORY_NAME } from "./factory";

// The name of the pool.
export const GNOSIS_SGYD_182DAY_NAME = "ElementDAO 182 Day sGYD Hyperdrive";

// The initial contribution of the pool.
const CONTRIBUTION = parseEther("100");

export const GNOSIS_SGYD_182DAY: HyperdriveInstanceConfig<"ERC4626"> = {
name: GNOSIS_SGYD_182DAY_NAME,
prefix: "ERC4626",
coordinatorAddress: async (hre) =>
hre.hyperdriveDeploy.deployments.byName(GNOSIS_ERC4626_COORDINATOR_NAME)
.address,
deploymentId: keccak256(toBytes(GNOSIS_SGYD_182DAY_NAME)),
salt: toBytes32("0x69420"),
extraData: "0x",
contribution: CONTRIBUTION,
// The current fixed rate on sGYD is 11.85%, but our maximum is 10%:
// https://app.gyro.finance/sgyd/ethereum/
fixedAPR: parseEther("0.1"),
timestretchAPR: parseEther("0.075"),
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",
GYD_ADDRESS_GNOSIS,
);
let tx = await baseToken.write.approve([
hre.hyperdriveDeploy.deployments.byName(
GNOSIS_ERC4626_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(GNOSIS_FACTORY_NAME)
.address,
);
return {
baseToken: GYD_ADDRESS_GNOSIS,
vaultSharesToken: SGYD_ADDRESS_GNOSIS,
circuitBreakerDelta: parseEther("0.075"),
minimumShareReserves: parseEther("0.001"),
minimumTransactionAmount: parseEther("0.001"),
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(GNOSIS_FACTORY_NAME)
.address,
)),
fees: {
curve: parseEther("0.01"),
flat: normalizeFee(parseEther("0.0005"), SIX_MONTHS),
governanceLP: parseEther("0.15"),
governanceZombie: parseEther("0.03"),
},
};
},
};
1 change: 1 addition & 0 deletions tasks/deploy/config/mainnet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export * from "./morpho-blue-wsteth-usda-182day";
export * from "./morpho-blue-wsteth-usdc-182day";
export * from "./reth-182day";
export * from "./reth-coordinator";
export * from "./sgyd-182day";
export * from "./staking-usds-coordinator";
export * from "./staking-usds-sky-182day";
export * from "./steth-182day";
Expand Down
Loading
Loading