Skip to content

Commit

Permalink
fix target0 incorrect address
Browse files Browse the repository at this point in the history
  • Loading branch information
mcclurejt committed Jul 1, 2024
1 parent 6651509 commit 72727e6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tasks/deploy/config/sepolia/checkpoint-subrewarder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ export const SEPOLIA_CHECKPOINT_SUBREWARDER: HyperdriveCheckpointSubrewarderConf
SEPOLIA_CHECKPOINT_REWARDER_NAME,
).address,
(await hre.getNamedAccounts())["deployer"] as Address,
hre.hyperdriveDeploy.deployments.byName(
`${hre.network.name.toUpperCase()}_REGISTRY`,
).address,
hre.hyperdriveDeploy.deployments.byName(`DELV Hyperdrive Registry`)
.address,
hre.hyperdriveDeploy.deployments.byName("DAI").address,
parseEther("1"),
parseEther("1"),
Expand Down
9 changes: 9 additions & 0 deletions tasks/deploy/lib/environment-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,15 @@ extendEnvironment((hre) => {
console.log(` - Saving ${name}_${prefix}Hyperdrive`);
deployments.add(name, `${prefix}Hyperdrive`, address);

// NOTE: There's a bug in hardhat that results in receiving a garbage address for Target0.
// Because of this, we need to retrieve the correct address from the Hyperdrive instance once deployed.
await deployments.add(
`${name}_${prefix}Target0`,
`${prefix}Target0`,
await (
await hre.viem.getContractAt("IHyperdrive", address)
).read.target0(),
);
return hre.viem.getContractAt(`${prefix}Hyperdrive` as string, address);
};
hre.hyperdriveDeploy = {
Expand Down

0 comments on commit 72727e6

Please sign in to comment.