From c8daa8dea536d6bd681ab10ad52a12aa0b5dc8bc Mon Sep 17 00:00:00 2001 From: Lena Hierzi Date: Mon, 16 Oct 2023 10:56:44 +0100 Subject: [PATCH 1/2] refactor: update type namings to include interface, and move interfaces from path to addresses --- utils/addresses.ts | 28 ++++++++++++++++++++-------- utils/paths.ts | 24 +++++++----------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/utils/addresses.ts b/utils/addresses.ts index 85fc4da..3c20bbf 100644 --- a/utils/addresses.ts +++ b/utils/addresses.ts @@ -1,4 +1,4 @@ -interface IfcOneNetworkAddresses { +interface INetworkTokenAddresses { BCT: string; NCT: string; mcUSD?: string; @@ -8,14 +8,26 @@ interface IfcOneNetworkAddresses { USDC?: string; WMATIC?: string; } -interface IfcAddresses { - celo: IfcOneNetworkAddresses; - alfajores: IfcOneNetworkAddresses; - polygon: IfcOneNetworkAddresses; - mumbai: IfcOneNetworkAddresses; +interface INetworkAddresses { + celo: INetworkTokenAddresses; + alfajores: INetworkTokenAddresses; + polygon: INetworkTokenAddresses; + mumbai: INetworkTokenAddresses; } -const addresses: IfcAddresses = { +interface IPoolAddresses { + BCT: string; + NCT: string; +} + +interface INetworkPoolAddresses { + celo: IPoolAddresses; + alfajores: IPoolAddresses; + polygon: IPoolAddresses; + mumbai: IPoolAddresses; +} + +const addresses: INetworkAddresses = { celo: { BCT: "0x0CcB0071e8B8B716A2a5998aB4d97b83790873Fe", NCT: "0x02De4766C272abc10Bc88c220D214A26960a7e92", @@ -47,7 +59,7 @@ const addresses: IfcAddresses = { }, }; -export const poolAddresses: IfcNetworkPoolAddresses = { +export const poolAddresses: INetworkPoolAddresses = { celo: { BCT: "0x0CcB0071e8B8B716A2a5998aB4d97b83790873Fe", NCT: "0x02De4766C272abc10Bc88c220D214A26960a7e92", diff --git a/utils/paths.ts b/utils/paths.ts index 39b743f..d223680 100644 --- a/utils/paths.ts +++ b/utils/paths.ts @@ -1,8 +1,4 @@ -interface IfcPoolAddresses { - BCT: string; - NCT: string; -} -interface IfcTokenAddresses { +interface ITokenPaths { mcUSD?: string[]; cUSD?: string[]; CELO?: string[]; @@ -10,20 +6,14 @@ interface IfcTokenAddresses { USDC?: string[]; WMATIC?: string[]; } -interface IfcNetworkTokenAddresses { - celo: IfcTokenAddresses; - alfajores: IfcTokenAddresses; - polygon: IfcTokenAddresses; - mumbai: IfcTokenAddresses; -} -interface IfcNetworkPoolAddresses { - celo: IfcPoolAddresses; - alfajores: IfcPoolAddresses; - polygon: IfcPoolAddresses; - mumbai: IfcPoolAddresses; +interface INetworkTokenAddresses { + celo: ITokenPaths; + alfajores: ITokenPaths; + polygon: ITokenPaths; + mumbai: ITokenPaths; } -const paths: IfcNetworkTokenAddresses = { +const paths: INetworkTokenAddresses = { celo: { mcUSD: ["0x918146359264c492bd6934071c6bd31c854edbc3"], cUSD: [ From 90f52cc0d2516d6bcd87933532c1a51e531e0282 Mon Sep 17 00:00:00 2001 From: Lena Hierzi Date: Mon, 16 Oct 2023 10:57:26 +0100 Subject: [PATCH 2/2] fix: adding missing routerAddress type import --- tasks/verifyOffsetHelper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/verifyOffsetHelper.ts b/tasks/verifyOffsetHelper.ts index d7bc90a..d8ec540 100644 --- a/tasks/verifyOffsetHelper.ts +++ b/tasks/verifyOffsetHelper.ts @@ -1,7 +1,7 @@ import { task } from "hardhat/config"; import { HardhatRuntimeEnvironment } from "hardhat/types"; import paths from "../utils/paths"; -import { poolAddresses } from "../utils/addresses"; +import { poolAddresses, routerAddresses } from "../utils/addresses"; task("verify:offsetHelper", "Verifies the OffsetHelper") .addParam("address", "The OffsetHelper address")