Skip to content
This repository has been archived by the owner on Sep 28, 2022. It is now read-only.

allow to run on hardhat local network #317

Merged
merged 5 commits into from
Jan 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/dai-plugin-governance/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ type ContractAddresses = {
kovan: { [key: string]: string };
mainnet: { [key: string]: string };
testnet?: { [key: string]: string };
goerlifork?: { [key: string]: string };
goerli?: { [key: string]: string };
};

Expand All @@ -36,6 +37,7 @@ export default {
const contractAddresses: ContractAddresses = {
kovan: require('../contracts/addresses/kovan.json'),
goerli: require('../contracts/addresses/goerli.json'),
goerlifork: require('../contracts/addresses/goerli.json'),
mainnet: require('../contracts/addresses/mainnet.json')
};

Expand Down
8 changes: 8 additions & 0 deletions packages/dai-plugin-governance/src/utils/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ export const netIdToName = id => {
return 'kovan';
case 999:
return 'ganache';
case 1337:
return 'testnet';
case 31337:
return 'goerlifork';
default:
return '';
}
Expand All @@ -33,6 +37,8 @@ export const netIdtoSpockUrl = id => {
case 1:
return MAINNET_URL;
case 5:
case 1337:
case 31337:
return GOERLI_URL;
case 42:
return KOVAN_URL;
Expand All @@ -46,6 +52,8 @@ export const netIdtoSpockUrlStaging = id => {
case 1:
return STAGING_MAINNET_URL;
case 5:
case 1337:
case 31337:
return GOERLI_URL;
case 42:
return KOVAN_URL;
Expand Down
1 change: 1 addition & 0 deletions packages/dai-plugin-mcd/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ let addContracts = reduce(
abi,
address: {
testnet: testnetAddress,
goerlifork: goerliAddresses[name],
// kovan no longer actively supported
// kovan: kovanAddresses[name],
goerli: goerliAddresses[name],
Expand Down
1 change: 1 addition & 0 deletions packages/dai-plugin-mcd/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ test('addConfig outputs contract addresses for all networks', () => {
for (const token of erc20) {
expect(token.address).toEqual({
testnet: expect.any(String),
goerlifork: expect.any(String),
// kovan no longer actively supported
// kovan: expect.any(String),
goerli: expect.any(String),
Expand Down
6 changes: 6 additions & 0 deletions packages/dai/contracts/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const addressMapping = {
mainnet: mainnetAddresses,
kovan: kovanAddresses,
goerli: goerliAddresses,
goerlifork: goerliAddresses,
testnet: testnetAddresses
};

Expand Down Expand Up @@ -144,5 +145,10 @@ export default [
{ name: 'goerli', networkId: 5, contracts: contractInfo('goerli') },
{ name: 'kovan', networkId: 42, contracts: contractInfo('kovan') },
{ name: 'test', networkId: 1337, contracts: contractInfo('testnet') },
{
name: 'goerlifork',
networkId: 31337,
contracts: contractInfo('goerlifork')
},
{ name: 'test', networkId: TESTNET_ID, contracts: contractInfo('testnet') }
];