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

EzETH and RETH redeployments #1098

Merged
merged 11 commits into from
Jul 17, 2024
4 changes: 2 additions & 2 deletions contracts/src/external/HyperdriveTarget0.sol
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ abstract contract HyperdriveTarget0 is
function convertToBase(
uint256 _shareAmount
) external view returns (uint256) {
return _convertToBase(_shareAmount);
_revert(abi.encode(_convertToBase(_shareAmount)));
}

/// @notice Convert an amount of base to an amount of vault shares.
Expand All @@ -439,7 +439,7 @@ abstract contract HyperdriveTarget0 is
function convertToShares(
uint256 _baseAmount
) external view returns (uint256) {
return _convertToShares(_baseAmount);
_revert(abi.encode(_convertToShares(_baseAmount)));
}

/// @notice Gets an account's balance of a sub-token.
Expand Down
106 changes: 53 additions & 53 deletions deployments.json
Original file line number Diff line number Diff line change
Expand Up @@ -509,133 +509,133 @@
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator_EzETHHyperdriveCoreDeployer": {
"contract": "EzETHHyperdriveCoreDeployer",
"address": "0xbaa863b62c69993143b013fe7b8af278fd52f76b",
"timestamp": "2024-07-15T21:27:04.164Z"
"address": "0x82629da7b2c14933982e5de9ff97f505ff98a1f3",
"timestamp": "2024-07-16T23:33:52.996Z"
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator_EzETHTarget0Deployer": {
"contract": "EzETHTarget0Deployer",
"address": "0x68ba944d89d7481f3a9d73dcb75b7e6c7db5562b",
"timestamp": "2024-07-15T21:27:16.212Z"
"address": "0xe841b3f7864ba9d13726aa2ee2027a2e0e486b55",
"timestamp": "2024-07-16T23:34:02.482Z"
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator_EzETHTarget1Deployer": {
"contract": "EzETHTarget1Deployer",
"address": "0xb7c320cef81f0f9abb726590ef5105f551816d76",
"timestamp": "2024-07-15T21:27:31.131Z"
"address": "0xc81b84995414bdc462da45b9a16e3f71e1ed860d",
"timestamp": "2024-07-16T23:34:17.370Z"
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator_EzETHTarget2Deployer": {
"contract": "EzETHTarget2Deployer",
"address": "0x8d6d5d48f881bcccd6c09256724692b3a971b87b",
"timestamp": "2024-07-15T21:27:40.077Z"
"address": "0xfc91a2083ba5067165d5ecd632465a8b514b2b9c",
"timestamp": "2024-07-16T23:34:27.879Z"
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator_EzETHTarget3Deployer": {
"contract": "EzETHTarget3Deployer",
"address": "0xe670f140dedcdf142e15ce198e1a99fecd67d21c",
"timestamp": "2024-07-15T21:27:52.397Z"
"address": "0xc0dc10957777ba5aaeec5d1df351a5bea64f0fb3",
"timestamp": "2024-07-16T23:34:39.873Z"
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator_EzETHTarget4Deployer": {
"contract": "EzETHTarget4Deployer",
"address": "0xb8bd93848aa71887e447642299b1f2a5cf898a9b",
"timestamp": "2024-07-15T21:28:03.822Z"
"address": "0x6940c108b1bee27600e8bb46d9710b46f60ff3ac",
"timestamp": "2024-07-16T23:34:54.710Z"
},
"ElementDAO ezETH Hyperdrive Deployer Coordinator": {
"contract": "EzETHHyperdriveDeployerCoordinator",
"address": "0xf74085c4404fd08e7d636f151b734a580f44100f",
"timestamp": "2024-07-15T21:28:15.251Z"
"address": "0x95b379ad131412e702cc6c9a52bcaaf07785349b",
"timestamp": "2024-07-16T23:35:02.894Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator_RETHHyperdriveCoreDeployer": {
"contract": "RETHHyperdriveCoreDeployer",
"address": "0xea21fbc9eb872c025959d82383bc898540334484",
"timestamp": "2024-07-15T21:28:40.644Z"
"address": "0x3df8476a3fdf2636dcf47b1e066f7691f9ef931d",
"timestamp": "2024-07-16T23:35:25.821Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator_RETHTarget0Deployer": {
"contract": "RETHTarget0Deployer",
"address": "0x02d668b32fc23f223464f3daf9df6e518cf1e9ee",
"timestamp": "2024-07-15T21:28:51.918Z"
"address": "0xfd892a8581184288f32d71238c95fb95b6fdb5de",
"timestamp": "2024-07-16T23:35:40.603Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator_RETHTarget1Deployer": {
"contract": "RETHTarget1Deployer",
"address": "0x7d78ee16d314f14e01e222ee6dd839689bd294ca",
"timestamp": "2024-07-15T21:29:02.895Z"
"address": "0x5718e9228e4582076fc514ba329203518e4824ef",
"timestamp": "2024-07-16T23:35:55.587Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator_RETHTarget2Deployer": {
"contract": "RETHTarget2Deployer",
"address": "0xc6fe0b1a0d145c67ec87bffc1536a7b5da727662",
"timestamp": "2024-07-15T21:29:15.773Z"
"address": "0x8c6603500d8dfd110283db082e329d2165005aa7",
"timestamp": "2024-07-16T23:38:03.247Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator_RETHTarget3Deployer": {
"contract": "RETHTarget3Deployer",
"address": "0xe8307bcb57ea61981ad8c9da7931116863e5f4ab",
"timestamp": "2024-07-15T21:29:28.956Z"
"address": "0xd259875f89ca9db95974d06a6cd6d92195278bee",
"timestamp": "2024-07-16T23:38:18.066Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator_RETHTarget4Deployer": {
"contract": "RETHTarget4Deployer",
"address": "0x9a2f15a6941d13719abae15c03dde580098c1fbd",
"timestamp": "2024-07-15T21:29:38.468Z"
"address": "0xa62de3ff524502e3ac3d3bca4fea32defa3c37b0",
"timestamp": "2024-07-16T23:38:26.310Z"
},
"ElementDAO rETH Hyperdrive Deployer Coordinator": {
"contract": "RETHHyperdriveDeployerCoordinator",
"address": "0xac0e15075afeb2e130ac2cac24cbafdc236cdd1e",
"timestamp": "2024-07-15T21:29:51.448Z"
"address": "0x6027d51985cf01f5df8fb2bb56ea0e69a487ff2e",
"timestamp": "2024-07-16T23:38:41.134Z"
},
"ElementDAO 182 Day ezETH Hyperdrive_EzETHTarget0": {
"contract": "EzETHTarget0",
"address": "0x5fB355EFDb7d62C81AB17E77FBee5514946A8AB2",
"timestamp": "2024-07-15T21:35:04.561Z"
"address": "0x0E8d8c4ae326084cc9ddaCC2e65F28B31089bE2d",
"timestamp": "2024-07-16T23:40:14.926Z"
},
"ElementDAO 182 Day ezETH Hyperdrive_EzETHTarget1": {
"contract": "EzETHTarget1",
"address": "0x180031Bc954729846227DdD4D5768dAF92A0ca63",
"timestamp": "2024-07-15T21:34:20.055Z"
"address": "0xE0d88c12FBdE02bF2675eB27Da2aFE68E16A74D6",
"timestamp": "2024-07-16T23:39:28.278Z"
},
"ElementDAO 182 Day ezETH Hyperdrive_EzETHTarget2": {
"contract": "EzETHTarget2",
"address": "0xB2B0e423e714f07716D73d300eA1710933e1b89f",
"timestamp": "2024-07-15T21:34:28.492Z"
"address": "0xf129352F6A592becE51122bD5c2d087f286cD1Ec",
"timestamp": "2024-07-16T23:39:43.374Z"
},
"ElementDAO 182 Day ezETH Hyperdrive_EzETHTarget3": {
"contract": "EzETHTarget3",
"address": "0x48FB89CE982e8B2fa7441d0D41A9a02aAE32Bfca",
"timestamp": "2024-07-15T21:34:44.646Z"
"address": "0x0B854187370C558682dd56D97d3114ef8bcEE719",
"timestamp": "2024-07-16T23:39:51.670Z"
},
"ElementDAO 182 Day ezETH Hyperdrive_EzETHTarget4": {
"contract": "EzETHTarget4",
"address": "0x98944608ed92b9a21D8C3bCADFf46760b297112B",
"timestamp": "2024-07-15T21:34:49.430Z"
"address": "0xA74b93bB431F159fa3e2b624abB8Eaf0a2FBba56",
"timestamp": "2024-07-16T23:40:06.503Z"
},
"ElementDAO 182 Day ezETH Hyperdrive": {
"contract": "EzETHHyperdrive",
"address": "0x4b5ad00f6868295840f38e9e146233F14BD81342",
"timestamp": "2024-07-15T21:35:04.409Z"
"address": "0x4c3054e51b46BE3191be9A05e73D73F1a2147854",
"timestamp": "2024-07-16T23:40:14.792Z"
},
"ElementDAO 182 Day rETH Hyperdrive_RETHTarget0": {
"contract": "RETHTarget0",
"address": "0xA6769BD1C44d158bd89535A4dE1F8c93408AcF5d",
"timestamp": "2024-07-15T21:36:30.817Z"
"address": "0x463Ba5f41413b5F318fbf6256c8Aa78E5d382455",
"timestamp": "2024-07-16T23:41:53.903Z"
},
"ElementDAO 182 Day rETH Hyperdrive_RETHTarget1": {
"contract": "RETHTarget1",
"address": "0x3e86cD9Ec3dD09BF7d1c42AC8ACf1833b3C0825b",
"timestamp": "2024-07-15T21:35:43.385Z"
"address": "0x1dCAcD117101161D4BeB63F61443Fa03059aE9dC",
"timestamp": "2024-07-16T23:41:07.293Z"
},
"ElementDAO 182 Day rETH Hyperdrive_RETHTarget2": {
"contract": "RETHTarget2",
"address": "0xB005fA01E3Fec5B12f555388A03e6CAFcd8F4Ab7",
"timestamp": "2024-07-15T21:35:51.916Z"
"address": "0xB83c81797c7036479fe1beBafEFF1a7490126AF0",
"timestamp": "2024-07-16T23:41:15.618Z"
},
"ElementDAO 182 Day rETH Hyperdrive_RETHTarget3": {
"contract": "RETHTarget3",
"address": "0x7aA82daC89C01Bd2f7420703125D3142885af5a5",
"timestamp": "2024-07-15T21:36:07.125Z"
"address": "0x93ed390C959b561E98A2343A74BCcd7a77Ae5dC8",
"timestamp": "2024-07-16T23:41:30.411Z"
},
"ElementDAO 182 Day rETH Hyperdrive_RETHTarget4": {
"contract": "RETHTarget4",
"address": "0xC86B4a6fA9b2BE0295C03E0c3a89c7DFbDcb6542",
"timestamp": "2024-07-15T21:36:15.646Z"
"address": "0x00A3093d7F16c8CD58bB0bdC9F998b8389182B4F",
"timestamp": "2024-07-16T23:41:38.657Z"
},
"ElementDAO 182 Day rETH Hyperdrive": {
"contract": "RETHHyperdrive",
"address": "0x0eC94959365f682dD6d9fD382C421D4Ef7F9d998",
"timestamp": "2024-07-15T21:36:30.678Z"
"address": "0xca5dB9Bb25D09A9bF3b22360Be3763b5f2d13589",
"timestamp": "2024-07-16T23:41:53.768Z"
}
}
}
}
1 change: 1 addition & 0 deletions tasks/deploy/verify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ task(
await ihyperdrive.read.target1(),
await ihyperdrive.read.target2(),
await ihyperdrive.read.target3(),
await ihyperdrive.read.target4(),
];
console.log("args", ...args.slice(1));
console.log("targets", ...targets);
Expand Down
1 change: 1 addition & 0 deletions tasks/factory/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "./remove-coordinator";
50 changes: 50 additions & 0 deletions tasks/factory/remove-coordinator.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import { task } from "hardhat/config";
import { Address } from "viem";
import {
HyperdriveDeployNamedTask,
HyperdriveDeployNamedTaskParams,
} from "../deploy";

HyperdriveDeployNamedTask(
task(
"factory:remove-coordinator",
"adds the specified hyperdrive instance to the registry",
),
).setAction(
async (
{ name }: Required<HyperdriveDeployNamedTaskParams>,
{ viem, hyperdriveDeploy: { deployments }, network },
) => {
// Get the factory contract.
let deployment = deployments.byName(name);
if (!deployment.contract.endsWith("HyperdriveDeployerCoordinator"))
throw new Error("not a hyperdrive deployer coordinator");
console.log(
`removing ${name} ${deployment.contract} at ${deployment.address} from the factory ...`,
);
let factoryAddress = deployments.byName("ElementDAO Hyperdrive Factory")
.address as Address;
const factoryContract = await viem.getContractAt(
"IHyperdriveFactory",
factoryAddress,
);

// Find the index of the deployer coordinator to remove.
const coordinators =
await factoryContract.read.getDeployerCoordinatorsInRange([
0n,
await factoryContract.read.getNumberOfDeployerCoordinators(),
]);
const index = coordinators.findIndex(
(c) => c.toLowerCase() === deployment.address.toLowerCase(),
);

// Remove the deployer coordinator.
let tx = await factoryContract.write.removeDeployerCoordinator([
deployment.address as Address,
BigInt(index),
]);
let pc = await viem.getPublicClient();
await pc.waitForTransactionReceipt({ hash: tx });
},
);
1 change: 1 addition & 0 deletions tasks/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export * from "./deploy";
export * from "./factory";
export * from "./fork";
export * from "./market-state";
export * from "./registry";
Loading