Skip to content

Commit

Permalink
Rename voucherHubFactoryUpgrade to newVoucherHubImplementationFactory…
Browse files Browse the repository at this point in the history
… in upgradeProxy function
  • Loading branch information
Le-Caignec committed Jan 9, 2025
1 parent 9199e1c commit 79628ba
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/voucherHubUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ export async function deployHub(

export async function upgradeProxy(
voucherHubAddress: string,
voucherHubFactoryUpgrade: ContractFactory,
newVoucherHubImplementationFactory: ContractFactory,
): Promise<VoucherHub> {
// Fetch proxy admin details
const voucherHub: unknown = voucherHubFactoryUpgrade.attach(voucherHubAddress);
const voucherHub: unknown = newVoucherHubImplementationFactory.attach(voucherHubAddress);
const voucherHubContract = voucherHub as VoucherHub;
const upgraderAddress = await voucherHubContract.defaultAdmin();
const upgrader = env.IS_LOCAL_FORK
? await ethers.getImpersonatedSigner(upgraderAddress)
: await ethers.getSigner(upgraderAddress);

const contractUpgrade: unknown = await upgrades
.upgradeProxy(voucherHubAddress, voucherHubFactoryUpgrade.connect(upgrader))
.upgradeProxy(voucherHubAddress, newVoucherHubImplementationFactory.connect(upgrader))
.then((contract) => contract.waitForDeployment());
return contractUpgrade as VoucherHub;
}
Expand Down

0 comments on commit 79628ba

Please sign in to comment.