Skip to content

Commit

Permalink
feat: Add support for Goerli network
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelmtzinf committed Dec 22, 2022
1 parent 5c11a15 commit 4b5af27
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 6 deletions.
1 change: 1 addition & 0 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const config: HardhatUserConfig = {
tenderly: getCommonNetworkConfig(eEthereumNetwork.tenderly, 3030),
kovan: getCommonNetworkConfig(eEthereumNetwork.kovan, 42),
ropsten: getCommonNetworkConfig(eEthereumNetwork.ropsten, 3),
goerli: getCommonNetworkConfig(eEthereumNetwork.goerli, 5),
main: getCommonNetworkConfig(eEthereumNetwork.main, 1),
hardhat: {
hardfork: 'istanbul',
Expand Down
14 changes: 10 additions & 4 deletions helpers/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const getAaveTokenPerNetwork = (network: eEthereumNetwork): tEthereumAddr
[eEthereumNetwork.coverage]: ZERO_ADDRESS,
[eEthereumNetwork.hardhat]: ZERO_ADDRESS,
[eEthereumNetwork.kovan]: '0xe4483afcf0d612c011679C76B61F5b0d27bAF93C',
[eEthereumNetwork.goerli]: '0x0B7a69d978DdA361Db5356D4Bd0206496aFbDD96',
[eEthereumNetwork.ropsten]: '0x74dA004A1B81b4d0C79F5820f9FF22647cb1dD95',
[eEthereumNetwork.main]: '0x9c0435779F5E52CEC404D957C9bAa6f7d674C8bA',
},
Expand All @@ -64,6 +65,7 @@ export const getCooldownSecondsPerNetwork = (network: eEthereumNetwork): tEthere
[eEthereumNetwork.coverage]: COOLDOWN_SECONDS,
[eEthereumNetwork.hardhat]: COOLDOWN_SECONDS,
[eEthereumNetwork.kovan]: '21600', // 8h
[eEthereumNetwork.goerli]: '21600', // 8h
[eEthereumNetwork.ropsten]: '180', // 3m
[eEthereumNetwork.main]: '864000', // 10d
},
Expand All @@ -76,6 +78,7 @@ export const getUnstakeWindowPerNetwork = (network: eEthereumNetwork): tEthereum
[eEthereumNetwork.coverage]: UNSTAKE_WINDOW,
[eEthereumNetwork.hardhat]: UNSTAKE_WINDOW,
[eEthereumNetwork.kovan]: '10800', // 4h
[eEthereumNetwork.goerli]: '10800', // 4h
[eEthereumNetwork.ropsten]: '240', // 4m
[eEthereumNetwork.main]: '172800', // 2d
},
Expand All @@ -88,6 +91,7 @@ export const getAaveAdminPerNetwork = (network: eEthereumNetwork): tEthereumAddr
[eEthereumNetwork.coverage]: ZERO_ADDRESS,
[eEthereumNetwork.hardhat]: ZERO_ADDRESS,
[eEthereumNetwork.kovan]: '0x8134929c3dcb1b8b82f27f53424b959fb82182f2', // Aave Governance
[eEthereumNetwork.goerli]: ZERO_ADDRESS,
[eEthereumNetwork.ropsten]: '0xEd93e49A2d75beA505fD4D1A0Dff745f69F2E997', // Aave Governance
[eEthereumNetwork.main]: '0x8a2Efd9A790199F4c94c6effE210fce0B4724f52', // Aave Governance
},
Expand All @@ -100,6 +104,7 @@ export const getDistributionDurationPerNetwork = (network: eEthereumNetwork): tE
[eEthereumNetwork.coverage]: DISTRIBUTION_DURATION,
[eEthereumNetwork.hardhat]: DISTRIBUTION_DURATION,
[eEthereumNetwork.kovan]: '864000',
[eEthereumNetwork.goerli]: '864000',
[eEthereumNetwork.ropsten]: '864000',
[eEthereumNetwork.main]: '12960000', // 5 months (30 days) in seconds
},
Expand All @@ -109,10 +114,11 @@ export const getDistributionDurationPerNetwork = (network: eEthereumNetwork): tE
export const getAaveIncentivesVaultPerNetwork = (network: eEthereumNetwork): tEthereumAddress =>
getParamPerNetwork<tEthereumAddress>(
{
[eEthereumNetwork.coverage]: '',
[eEthereumNetwork.hardhat]: '',
[eEthereumNetwork.kovan]: '',
[eEthereumNetwork.ropsten]: '',
[eEthereumNetwork.coverage]: ZERO_ADDRESS,
[eEthereumNetwork.hardhat]: ZERO_ADDRESS,
[eEthereumNetwork.kovan]: ZERO_ADDRESS,
[eEthereumNetwork.goerli]: ZERO_ADDRESS,
[eEthereumNetwork.ropsten]: ZERO_ADDRESS,
[eEthereumNetwork.main]: '0x253f7b06c1d60c1fbbc9d82c301327eb86e3ba81',
},
network
Expand Down
2 changes: 1 addition & 1 deletion helpers/etherscan-verification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const okErrors = [`Contract source code already verified`];

const unableVerifyError = 'Fail - Unable to verify';

export const SUPPORTED_ETHERSCAN_NETWORKS = ['main', 'ropsten', 'kovan'];
export const SUPPORTED_ETHERSCAN_NETWORKS = ['main', 'ropsten', 'kovan', 'goerli'];

function delay(ms: number) {
return new Promise((resolve) => setTimeout(resolve, ms));
Expand Down
4 changes: 3 additions & 1 deletion helpers/misc-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ export const setDRE = (_DRE: HardhatRuntimeEnvironment) => {
};

export const getParamPerNetwork = <T>(
{ kovan, ropsten, main, hardhat }: iParamsPerNetwork<T>,
{ kovan, goerli, ropsten, main, hardhat }: iParamsPerNetwork<T>,
network: eEthereumNetwork
) => {
switch (network) {
case eEthereumNetwork.hardhat:
return hardhat;
case eEthereumNetwork.kovan:
return kovan;
case eEthereumNetwork.goerli:
return goerli;
case eEthereumNetwork.ropsten:
return ropsten;
case eEthereumNetwork.main:
Expand Down
2 changes: 2 additions & 0 deletions helpers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum eEthereumNetwork {
ropsten = 'ropsten',
main = 'main',
tenderly = 'tenderly',
goerli = 'goerli',
}

export enum eContractid {
Expand Down Expand Up @@ -45,6 +46,7 @@ export interface iParamsPerNetwork<T> {
[eEthereumNetwork.coverage]: T;
[eEthereumNetwork.hardhat]: T;
[eEthereumNetwork.kovan]: T;
[eEthereumNetwork.goerli]: T;
[eEthereumNetwork.ropsten]: T;
[eEthereumNetwork.main]: T;
}

0 comments on commit 4b5af27

Please sign in to comment.