From 80a7f9e8cabdace19bd4db9c41878819af1eb088 Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Tue, 28 Sep 2021 10:23:57 +0200 Subject: [PATCH 1/7] dai-plugin-governance-v0.14.1-beta15 --- packages/dai-plugin-governance/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dai-plugin-governance/package.json b/packages/dai-plugin-governance/package.json index c9107022b..de5e3e0b1 100644 --- a/packages/dai-plugin-governance/package.json +++ b/packages/dai-plugin-governance/package.json @@ -1,7 +1,7 @@ { "name": "@makerdao/dai-plugin-governance", "description": "A dai.js plugin for adding MKR governance support to dapps.", - "version": "0.14.1-beta9", + "version": "0.14.1-beta15", "license": "MIT", "repository": { "type": "git", From c46436b915b7913986c9dfb9abedbba79252e50b Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Tue, 5 Oct 2021 17:02:09 +0200 Subject: [PATCH 2/7] Add goerli config and contracts --- .../contracts/addresses/goerli.json | 12 ++ .../contracts/contract-info.json | 8 +- packages/dai-plugin-governance/src/index.js | 1 + .../src/utils/constants.js | 1 + .../src/utils/helpers.js | 14 +- .../contracts/contract-info.json | 8 +- .../contracts/addresses/goerli.json | 162 ++++++++++++++++++ packages/dai-plugin-mcd/package.json | 1 + packages/dai-plugin-mcd/src/index.js | 2 + packages/dai-plugin-migrations/src/index.js | 2 + packages/dai/contracts/addresses/goerli.json | 4 + packages/dai/contracts/networks.js | 13 +- packages/dai/package.json | 1 + packages/dai/scripts/repl.js | 30 +++- packages/dai/src/Maker.js | 7 +- packages/dai/src/config/presets/goerli.json | 8 + packages/dai/test/helpers/serviceBuilders.js | 11 ++ 17 files changed, 259 insertions(+), 26 deletions(-) create mode 100644 packages/dai-plugin-governance/contracts/addresses/goerli.json create mode 100644 packages/dai-plugin-mcd/contracts/addresses/goerli.json create mode 100644 packages/dai/contracts/addresses/goerli.json create mode 100644 packages/dai/src/config/presets/goerli.json diff --git a/packages/dai-plugin-governance/contracts/addresses/goerli.json b/packages/dai-plugin-governance/contracts/addresses/goerli.json new file mode 100644 index 000000000..0cd5818fb --- /dev/null +++ b/packages/dai-plugin-governance/contracts/addresses/goerli.json @@ -0,0 +1,12 @@ +{ + "MCD_ADM": "0x33Ed584fc655b08b2bca45E1C5b5f07c98053bC1", + "VOTE_PROXY_FACTORY": "0x1a7c1ee5eE2A3B67778ff1eA8c719A3fA1b02b6f", + "VOTE_DELEGATE_FACTORY": "0xE2d249AE3c156b132C40D07bd4d34e73c1712947", + "POLLING": "0xdbE5d00b2D8C13a77Fb03Ee50C87317dbC1B15fb", + "BATCH_POLLING": "0xdbE5d00b2D8C13a77Fb03Ee50C87317dbC1B15fb", + "MCD_ESM": "0x105BF37e7D81917b6fEACd6171335B4838e53D5e", + "MCD_END": "0xDb1d3edb80d3faA1B7257Ab4018A609E327FA50D", + "GOV": "0xc5E4eaB513A7CD12b2335e8a0D57273e13D499f7", + "MCD_IOU": "0x651D1B91e4F657392a51Dba7A6A1A1a72eC6aD1c", + "MCD_PAUSE": "0xefcd235B1f13e7fC5eab1d05C910d3c390b3439F" +} diff --git a/packages/dai-plugin-governance/contracts/contract-info.json b/packages/dai-plugin-governance/contracts/contract-info.json index 8e448e08e..85fdc99fa 100644 --- a/packages/dai-plugin-governance/contracts/contract-info.json +++ b/packages/dai-plugin-governance/contracts/contract-info.json @@ -2,7 +2,8 @@ "chief": { "inception_block": { "mainnet": "0x487813", - "kovan": "0x649575" + "kovan": "0x649575", + "goerli": "0x649575" }, "events": { "etch": "0x4f0892983790f53eea39a7a496f6cb40e8811b313871337b6a761efc6c67bb1f", @@ -15,7 +16,8 @@ "pause": { "inception_block": { "mainnet": "8928171", - "kovan": "14764552" + "kovan": "14764552", + "goerli": "14764552" }, "events": { "exec": "0x168ccd6700000000000000000000000000000000000000000000000000000000", @@ -28,4 +30,4 @@ "send_mkr_gas": 46471, "total_link_gas": 1123568 } -} \ No newline at end of file +} diff --git a/packages/dai-plugin-governance/src/index.js b/packages/dai-plugin-governance/src/index.js index db4f2c8e9..9c9cc5314 100644 --- a/packages/dai-plugin-governance/src/index.js +++ b/packages/dai-plugin-governance/src/index.js @@ -27,6 +27,7 @@ export default { addConfig: function(config, { network = 'mainnet', staging = false }) { const contractAddresses = { kovan: require('../contracts/addresses/kovan.json'), + goerli: require('../contracts/addresses/goerli.json'), mainnet: require('../contracts/addresses/mainnet.json') }; diff --git a/packages/dai-plugin-governance/src/utils/constants.js b/packages/dai-plugin-governance/src/utils/constants.js index 5aa4c22ce..f9259f772 100644 --- a/packages/dai-plugin-governance/src/utils/constants.js +++ b/packages/dai-plugin-governance/src/utils/constants.js @@ -19,6 +19,7 @@ export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'; /* Spock URLs */ export const LOCAL_URL = 'http://localhost:3001/v1'; export const KOVAN_URL = 'https://staging-gov-db.makerfoundation.com/api/v1'; +export const GOERLI_URL = 'https://polling-db-goerli.makerdux.com/api/v1'; export const STAGING_MAINNET_URL = 'https://polling-db-staging.makerdux.com/api/v1'; export const MAINNET_URL = 'https://polling-db-prod.makerdux.com/api/v1'; diff --git a/packages/dai-plugin-governance/src/utils/helpers.js b/packages/dai-plugin-governance/src/utils/helpers.js index aa9a707e0..f3eb65bed 100644 --- a/packages/dai-plugin-governance/src/utils/helpers.js +++ b/packages/dai-plugin-governance/src/utils/helpers.js @@ -1,6 +1,12 @@ import { createGetCurrency } from '@makerdao/currency'; import BigNumber from 'bignumber.js'; -import { MKR, STAGING_MAINNET_URL, KOVAN_URL, MAINNET_URL } from './constants'; +import { + MKR, + STAGING_MAINNET_URL, + KOVAN_URL, + GOERLI_URL, + MAINNET_URL +} from './constants'; /** * @desc get network name @@ -11,6 +17,8 @@ export const netIdToName = id => { switch (parseInt(id, 10)) { case 1: return 'mainnet'; + case 5: + return 'goerli'; case 42: return 'kovan'; case 999: @@ -24,6 +32,8 @@ export const netIdtoSpockUrl = id => { switch (parseInt(id, 10)) { case 1: return MAINNET_URL; + case 5: + return GOERLI_URL; case 42: return KOVAN_URL; default: @@ -35,6 +45,8 @@ export const netIdtoSpockUrlStaging = id => { switch (parseInt(id, 10)) { case 1: return STAGING_MAINNET_URL; + case 5: + return GOERLI_URL; case 42: return KOVAN_URL; default: diff --git a/packages/dai-plugin-liquidations/contracts/contract-info.json b/packages/dai-plugin-liquidations/contracts/contract-info.json index 8e448e08e..85fdc99fa 100644 --- a/packages/dai-plugin-liquidations/contracts/contract-info.json +++ b/packages/dai-plugin-liquidations/contracts/contract-info.json @@ -2,7 +2,8 @@ "chief": { "inception_block": { "mainnet": "0x487813", - "kovan": "0x649575" + "kovan": "0x649575", + "goerli": "0x649575" }, "events": { "etch": "0x4f0892983790f53eea39a7a496f6cb40e8811b313871337b6a761efc6c67bb1f", @@ -15,7 +16,8 @@ "pause": { "inception_block": { "mainnet": "8928171", - "kovan": "14764552" + "kovan": "14764552", + "goerli": "14764552" }, "events": { "exec": "0x168ccd6700000000000000000000000000000000000000000000000000000000", @@ -28,4 +30,4 @@ "send_mkr_gas": 46471, "total_link_gas": 1123568 } -} \ No newline at end of file +} diff --git a/packages/dai-plugin-mcd/contracts/addresses/goerli.json b/packages/dai-plugin-mcd/contracts/addresses/goerli.json new file mode 100644 index 000000000..9d38515ae --- /dev/null +++ b/packages/dai-plugin-mcd/contracts/addresses/goerli.json @@ -0,0 +1,162 @@ +{ + "MULTICALL": "0xb8c864B60e9467398800Df34da39BF4f0c459461", + "FAUCET": "0xa473CdDD6E4FAc72481dc36f39A409D86980D187", + "MCD_DEPLOY": "0xc09880a0D6d06fa18C8bDC9dF2E203F0d0124fa1", + "MCD_GOV": "0xc5E4eaB513A7CD12b2335e8a0D57273e13D499f7", + "GOV_GUARD": "0xB9b861e8F9b29322815260B6883Bbe1DBC91dA8A", + "MCD_ADM": "0x33Ed584fc655b08b2bca45E1C5b5f07c98053bC1", + "MCD_VAT": "0xB966002DDAa2Baf48369f5015329750019736031", + "MCD_JUG": "0xC90C99FE9B5d5207A03b9F28A6E8A19C0e558916", + + "MCD_DOG": "0x5cf85A37Dbd28A239698B4F9aA9a03D55C04F292", + + "ILK_REGISTRY": "0x525FaC4CEc48a4eF2FBb0A72355B6255f8D5f79e", + "CLIPPER_MOM": "0xC67fFD490903521F778b2A3B2A13D0FC0Be96F98", + "MCD_CLIP_LINK_A": "0x42cbA983D2403003af554fec0e68dAC4920906CC", + "MCD_CLIP_CALC_LINK_A": "0xE3Cf29E132EFad92d604Fa5C86AA21b7c7fBB76e", + + "MCD_CAT": "0xd744377001FD3411d7d0018F66E2271CB215f6fd", + + "MCD_VOW": "0x23f78612769b9013b3145E43896Fa1578cAa2c2a", + "MCD_JOIN_DAI": "0x6a60b7070befb2bfc964F646efDF70388320f4E0", + "MCD_FLAP": "0x8E4B877d7eD4584b22e1508ffDAA8Ae4f6927397", + "MCD_FLOP": "0x742D041dFBA61110Bd886509CB299DF6A521B352", + "MCD_PAUSE": "0xefcd235B1f13e7fC5eab1d05C910d3c390b3439F", + "MCD_PAUSE_PROXY": "0x5DCdbD3cCF9B09EAAD03bc5f50fA2B3d3ACA0121", + "MCD_GOV_ACTIONS": "0x5857F3e0e6Fb75658037b3c3410b7446b985B353", + "MCD_DAI": "0x11fE4B6AE13d2a6055C8D9cF65c55bac32B5d844", + "MCD_SPOT": "0xACe2A9106ec175bd56ec05C9E38FE1FDa8a1d758", + "MCD_POT": "0x50672F0a14B40051B65958818a7AcA3D54Bd81Af", + "MCD_END": "0xDb1d3edb80d3faA1B7257Ab4018A609E327FA50D", + "MCD_ESM": "0x105BF37e7D81917b6fEACd6171335B4838e53D5e", + "PROXY_ACTIONS": "0x4023f89983Ece35e227c49806aFc13Bc0248d178", + "PROXY_ACTIONS_END": "0xBbA4aBF0a12738f093cFD2199C5497044bAa68A8", + "PROXY_ACTIONS_DSR": "0x15679CdbDb284fe07Eff3809150126697c6e3Dd6", + "CDP_MANAGER": "0xdcBf58c9640A7bd0e062f8092d70fb981Bb52032", + "GET_CDPS": "0x7843fd599F5382328DeBB45255deB3E2e0DEC876", + "OSM_MOM": "0xEdB6b497D2e18A33130CB0D2b70343E6Dcd9EE86", + "FLIPPER_MOM": "0x7ceCdf6b214a3eBA1589eB8B844fB6Cb12B67Bd7", + "PROXY_FACTORY": "0x84eFB9c18059394172D0d69A3E58B03320001871", + "PROXY_REGISTRY": "0x46759093D8158db8BB555aC7C6F98070c56169ce", + "PROXY_PAUSE_ACTIONS": "0x8D1187FCa9A104211bd25c689C08718AD8730C83", + "PROXY_DEPLOYER": "0xc9476Fd378de5b0de5C4280D4323f6F89f723c15", + + "ETH": "0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6", + "PIP_ETH": "0x94588e35fF4d2E99ffb8D5095F35d1E37d6dDf12", + "MCD_JOIN_ETH_A": "0x2372031bB0fC735722AA4009AeBf66E8BEAF4BA1", + "MCD_JOIN_ETH_B": "0x1710BB6dF1967679bb1f247135794692F7963B46", + "MCD_JOIN_ETH_C": "0x16e6490744d4B3728966f8e72416c005EB3dEa79", + + "BAT": "0x75645f86e90a1169e697707C813419977ea26779", + "PIP_BAT": "0x2BA78cb27044edCb715b03685D4bf74261170a70", + "MCD_JOIN_BAT_A": "0xfea8C23D32e4bA46d90AeD2445fBD099010eAdF5", + + "USDC": "0x6Fb5ef893d44F4f88026430d82d4ef269543cB23", + "PIP_USDC": "0x838212865E2c2f4F7226fCc0A3EFc3EB139eC661", + "MCD_JOIN_USDC_A": "0x33E88C8b3530e2f19050b24f44AcB78C7114AF46", + "MCD_JOIN_USDC_B": "0x0Dc70CC4505c1952e719C9C740608A75Ca9e299e", + + "WBTC": "0x7ccF0411c7932B99FC3704d68575250F032e3bB7", + "PIP_WBTC": "0xE7de200a3a29E9049E378b52BD36701A0Ce68C3b", + "MCD_JOIN_WBTC_A": "0x3cbE712a12e651eEAF430472c0C1BF1a2a18939D", + + "TUSD": "0xe0B3D300E2e09c1Fd01252287dDbC70A7730ffB0", + "PIP_TUSD": "0x0ce19eA2C568890e63083652f205554C927a0caa", + "MCD_JOIN_TUSD_A": "0x5BC597f00d74fAcEE53Be784f0B7Ace63b4e2EBe", + + "ZRX": "0x96E0C18524789ED3e62CD9F56aAEc7cEAC78725a", + "PIP_ZRX": "0xe9245D25F3265E9A36DcCDC72B0B5dE1eeACD4cD", + "MCD_JOIN_ZRX_A": "0xC279765B3f930742167dB91271f13353336B6C72", + + "KNC": "0x9A58801cf901486Df9323bcE83A7684915DBAE54", + "PIP_KNC": "0xCB772363E2DEc06942edbc5E697F4A9114B5989c", + "MCD_JOIN_KNC_A": "0xA48f0d5DA642928BC1F5dB9De5F5d3D466500075", + + "MANA": "0x347fceA8b4fD1a46e2c0DB8F79e22d293c2F8513", + "PIP_MANA": "0x001eDD66a5Cc9268159Cf24F3dC0AdcE456AAAAb", + "MCD_JOIN_MANA_A": "0xF4a1E7Dd685b4EaFBE5d0E70e20c153dee2E290b", + + "PAXUSD": "0x4547863912Fe2d17D3827704138957a8317E8dCD", + "PIP_PAXUSD": "0xdF8474337c9D3f66C0b71d31C7D3596E4F517457", + "MCD_JOIN_PAXUSD_A": "0x8Ef390647A74150a79EC73FE120EaaF8bE9eEdf0", + + "USDT": "0x5858f25cc225525A7494f76d90A6549749b3030B", + "PIP_USDT": "0x1fA3B8DAeE1BCEe33990f66F1a99993daD14D855", + "MCD_JOIN_USDT_A": "0xa8C62cC41AbF8A199FB484Ea363b90C3e9E01d86", + + "LRC": "0xe32aC5b19051728421A8F4A8a5757D0e127a14F6", + "PIP_LRC": "0x5AD3A560BB125d00db8E94915232BA8f6166967C", + "MCD_JOIN_LRC_A": "0x12af538aCf746c0BBe076E5eBAE678e022E1F5f6", + + "LINK": "0x4724A967A4F7E42474Be58AbdF64bF38603422FF", + "PIP_LINK": "0x75B4e743772D25a7998F4230cb016ddCF2c52629", + "MCD_JOIN_LINK_A": "0x4420FD4E5C414189708376F3fBAA4dCA6277369a", + + "COMP": "0x8032dce0b793C21B8F7B648C01224c3b557271ED", + "PIP_COMP": "0xc3d677a5451cAFED13f748d822418098593D3599", + "MCD_JOIN_COMP_A": "0x544EFa934f26cd6FdFD86883408538150Bdd6725", + + "YFI": "0xd9510EF268F8273C9b7514F0bfFe18Fe1EFC0d43", + "PIP_YFI": "0xAafF0066D05cEe0D6a38b4dac77e73d9E0a5Cf46", + "MCD_JOIN_YFI_A": "0xa318E65982E80F54486f71965A0C320858759299", + + "BAL": "0x8c6e73CA229AB3933426aDb5cc829c1E4928551d", + "PIP_BAL": "0xF15993A5C5BE496b8e1c9657Fd2233b579Cd3Bc6", + "MCD_JOIN_BAL_A": "0xb31cE33511c2CCEfBc1713A783042eE670Cf5930", + + "GUSD": "0x67aeF79654D8F6CF44FdC08949c308a4F6b3c45B", + "PIP_GUSD": "0x57A00620Ba1f5f81F20565ce72df4Ad695B389d7", + "MCD_JOIN_GUSD_A": "0x455451293100C5c5355db10512DEE81F75E45Edf", + + "UNI": "0x82D98aA89E391c6759012df39ccDA0d9d6b24143", + "PIP_UNI": "0xf1a5b808fbA8fF80982dACe88020d4a80c91aFe6", + "MCD_JOIN_UNI_A": "0x31aE6e37964f26f4112A8Fc70e0B680F18e4DC6A", + + "RENBTC": "0x30d0A215aef6DadA4771a2b30a59B842f969EfD4", + "PIP_RENBTC": "0xE7de200a3a29E9049E378b52BD36701A0Ce68C3b", + "MCD_JOIN_RENBTC_A": "0xb4576162aC5d1bC7C69bA85F39e8f694d44d09D0", + + "AAVE": "0x251661BB7C6869165eF35810E5e1D25Ed57be2Fe", + "PIP_AAVE": "0xC26E53eF1F71481DE53bfb77875Ffb3aCf4d91f0", + "MCD_JOIN_AAVE_A": "0x71Ae3e3ac4412865A4E556230b92aB58d895b497", + + "UNIV2DAIETH": "0x5dD9dec52a16d4d1Df10a66ac71d4731c9Dad984", + "PIP_UNIV2DAIETH": "0x044c9aeD56369aA3f696c898AEd0C38dC53c6C3D", + "MCD_JOIN_UNIV2DAIETH_A": "0x66931685b532CB4F31abfe804d2408dD34Cd419D", + + "UNIV2WBTCETH": "0x7883a92ac3e914F3400e8AE6a2FF05E6BA4Bd403", + "PIP_UNIV2WBTCETH": "0xD375daC26f7eF991878136b387ca959b9ac1DDaF", + "MCD_JOIN_UNIV2WBTCETH_A": "0x345a29Db10Aa5CF068D61Bb20F74771eC7DF66FE", + + "UNIV2USDCETH": "0xD90313b3E43D9a922c71d26a0fBCa75A01Bb3Aeb", + "PIP_UNIV2USDCETH": "0x54ADcaB9B99b1B548764dAB637db751eC66835F0", + "MCD_JOIN_UNIV2USDCETH_A": "0x46267d84dA4D6e7b2F5A999518Cf5DAF91E204E3", + + "UNIV2DAIUSDC": "0x260719B2ef507A86116FC24341ff0994F2097D42", + "PIP_UNIV2DAIUSDC": "0xEf22289E240cFcCCdCD2B98fdefF167da10f452d", + "MCD_JOIN_UNIV2DAIUSDC_A": "0x4CEEf4EB4988cb374B0b288D685AeBE4c6d4C41E", + + "UNIV2ETHUSDT": "0xfcB32e1C4A4F1C820c9304B5CFfEDfB91aE2321C", + "PIP_UNIV2ETHUSDT": "0x974f7f4dC6D91f144c87cc03749c98f85F997bc7", + "MCD_JOIN_UNIV2ETHUSDT_A": "0x46A8f8e2C0B62f5D7E4c95297bB26a457F358C82", + + "UNIV2LINKETH": "0x3361fB8f923D1Aa1A45B2d2eD4B8bdF313a3dA0c", + "PIP_UNIV2LINKETH": "0x11C884B3FEE1494A666Bb20b6F6144387beAf4A6", + "MCD_JOIN_UNIV2LINKETH_A": "0x98B7023Aced6D8B889Ad7D340243C3F9c81E8c5F", + + "UNIV2UNIETH": "0xB80A38E50B2990Ac83e46Fe16631fFBb94F2780b", + "PIP_UNIV2UNIETH": "0xB18BC24e52C23A77225E7cf088756581EE257Ad8", + "MCD_JOIN_UNIV2UNIETH_A": "0x52c31E3592352Cd0CBa20Fa73Da42584EC693283", + + "UNIV2WBTCDAI": "0x3f78Bd3980c49611E5FA885f25Ca3a5fCbf0d7A0", + "PIP_UNIV2WBTCDAI": "0x916fc346910fd25867c81874f7F982a1FB69aac7", + "MCD_JOIN_UNIV2WBTCDAI_A": "0x04d23e99504d61050CAF46B4ce2dcb9D4135a7fD", + + "UNIV2AAVEETH": "0xaF2CC6F46d1d0AB30dd45F59B562394c3E21e6f3", + "PIP_UNIV2AAVEETH": "0xFADF05B56E4b211877248cF11C0847e7F8924e10", + "MCD_JOIN_UNIV2AAVEETH_A": "0x73C4E5430768e24Fd704291699823f35953bbbA2", + + "UNIV2DAIUSDT": "0xBF2C9aBbEC9755A0b6144051E19c6AD4e6fd6D71", + "PIP_UNIV2DAIUSDT": "0x2fc2706C61Fba5b941381e8838bC646908845db6", + "MCD_JOIN_UNIV2DAIUSDT_A": "0xBF70Ca17ce5032CCa7cD55a946e96f0E72f79452" +} diff --git a/packages/dai-plugin-mcd/package.json b/packages/dai-plugin-mcd/package.json index 7b4cdb32c..09661ec03 100644 --- a/packages/dai-plugin-mcd/package.json +++ b/packages/dai-plugin-mcd/package.json @@ -17,6 +17,7 @@ "test": "yarn testchain --ci jest --runInBand", "test:debug": "yarn testchain --ci node --inspect-brk ../../node_modules/.bin/jest --runInBand", "test:kovan": "export NETWORK='kovan' && yarn test --config ./test/config/jestIntegrationConfig.json", + "test:goerli": "export NETWORK='goerli' && yarn test --config ./test/config/jestIntegrationConfig.json", "test:integration": "export NETWORK='test' && yarn test --config ./test/config/jestIntegrationConfig.json" }, "peerDependencies": { diff --git a/packages/dai-plugin-mcd/src/index.js b/packages/dai-plugin-mcd/src/index.js index 548b219da..57c9f8684 100644 --- a/packages/dai-plugin-mcd/src/index.js +++ b/packages/dai-plugin-mcd/src/index.js @@ -5,6 +5,7 @@ import uniqBy from 'lodash/uniqBy'; import { createCurrency, createCurrencyRatio } from '@makerdao/currency'; import testnetAddresses from '../contracts/addresses/testnet.json'; import kovanAddresses from '../contracts/addresses/kovan.json'; +import goerliAddresses from '../contracts/addresses/goerli.json'; import mainnetAddresses from '../contracts/addresses/mainnet.json'; import abiMap from '../contracts/abiMap'; import CdpManager from './CdpManager'; @@ -41,6 +42,7 @@ let addContracts = reduce( address: { testnet: testnetAddress, kovan: kovanAddresses[name], + goerli: goerliAddresses[name], mainnet: mainnetAddresses[name] } }; diff --git a/packages/dai-plugin-migrations/src/index.js b/packages/dai-plugin-migrations/src/index.js index 72bd46094..8fbbbcda4 100644 --- a/packages/dai-plugin-migrations/src/index.js +++ b/packages/dai-plugin-migrations/src/index.js @@ -1,6 +1,7 @@ import { createCurrency } from '@makerdao/currency'; import testnetAddresses from '../contracts/addresses/testnet.json'; import kovanAddresses from '../contracts/addresses/kovan.json'; +import goerliAddresses from '../contracts/addresses/goerli.json'; import mainnetAddresses from '../contracts/addresses/mainnet.json'; import abiMap from '../contracts/abiMap'; import MigrationService from './MigrationService'; @@ -19,6 +20,7 @@ const allContracts = Object.entries(testnetAddresses).reduce( address: { testnet: testnetAddress, kovan: kovanAddresses[name], + goerli: goerliAddresses[name], mainnet: mainnetAddresses[name] } }; diff --git a/packages/dai/contracts/addresses/goerli.json b/packages/dai/contracts/addresses/goerli.json new file mode 100644 index 000000000..665cb6edb --- /dev/null +++ b/packages/dai/contracts/addresses/goerli.json @@ -0,0 +1,4 @@ +{ + "PROXY_REGISTRY": "0x46759093D8158db8BB555aC7C6F98070c56169ce", + "MULTICALL": "0xb8c864B60e9467398800Df34da39BF4f0c459461" +} diff --git a/packages/dai/contracts/networks.js b/packages/dai/contracts/networks.js index 60f29117c..540dee5e8 100644 --- a/packages/dai/contracts/networks.js +++ b/packages/dai/contracts/networks.js @@ -2,12 +2,14 @@ import tokens from './tokens'; import contracts from './contracts'; import * as abis from './abis'; import kovanAddresses from './addresses/kovan.json'; +import goerliAddresses from './addresses/goerli.json'; import mainnetAddresses from './addresses/mainnet.json'; import testnetAddresses from './addresses/testnet.json'; const addressMapping = { mainnet: mainnetAddresses, kovan: kovanAddresses, + goerli: goerliAddresses, testnet: testnetAddresses }; @@ -138,15 +140,8 @@ export default [ { name: 'mainnet', networkId: 1, contracts: contractInfo('mainnet') }, { name: 'morden', networkId: 2 }, { name: 'ropsten', networkId: 3 }, - { - name: 'rinkeby', - networkId: 4 - }, - { - name: 'goerli', - networkId: 5 - }, - + { name: 'rinkeby', networkId: 4 }, + { name: 'goerli', networkId: 5 }, { name: 'kovan', networkId: 42, contracts: contractInfo('kovan') }, { name: 'test', networkId: 1337, contracts: contractInfo('testnet') }, { name: 'test', networkId: TESTNET_ID, contracts: contractInfo('testnet') } diff --git a/packages/dai/package.json b/packages/dai/package.json index 073c989b7..5f773c57f 100644 --- a/packages/dai/package.json +++ b/packages/dai/package.json @@ -50,6 +50,7 @@ "test:watch": "yarn test --watch", "test:mainnet": "export NETWORK='mainnet' && jest --runInBand --config ./test/config/jestIntegrationConfig.json", "test:kovan": "export NETWORK='kovan' && jest --runInBand --config ./test/config/jestIntegrationConfig.json", + "test:goerli": "export NETWORK='goerli' && jest --runInBand --config ./test/config/jestIntegrationConfig.json", "test:integration": "export NETWORK='test' && yarn test --config ./test/config/jestIntegrationConfig.json", "test:build": "yarn test --config ./test/config/jestBuildConfig.json", "repl": "../../node_modules/.bin/babel-node --experimental-repl-await scripts/repl.js" diff --git a/packages/dai/scripts/repl.js b/packages/dai/scripts/repl.js index ca9cc6476..ade7af6e8 100644 --- a/packages/dai/scripts/repl.js +++ b/packages/dai/scripts/repl.js @@ -53,6 +53,21 @@ const env = { } } }, + goerli: { + // TODO update for goerli + fromBlock: 4750000, + config: { + url: 'https://kovan.infura.io/v3/c3f0f26a4c1742e0949d8eedfc47be67', + privateKey: process.env.KOVAN_PRIVATE_KEY, + smartContract: { addressOverrides }, + token: { + addressOverrides: { + PETH: addressOverrides.SAI_SKR, + DAI: addressOverrides.SAI_SAI + } + } + } + }, mainnet: { config: { fromBlock: 4750000, @@ -76,14 +91,13 @@ const endedRcPollInfo = maker => async pollId => { return { ...poll, ...pollMetadata, - votes: votes.map(v => [ - v.ballot.filter(x => x !== 0), - parseFloat(v.mkrSupport) - ]).sort(([ballotA], [ballotB]) => { - if (ballotA.length < ballotB.length) return -1; - if (ballotB.length < ballotA.length) return 1; - return ballotA[0] - ballotB[0]; - }), + votes: votes + .map(v => [v.ballot.filter(x => x !== 0), parseFloat(v.mkrSupport)]) + .sort(([ballotA], [ballotB]) => { + if (ballotA.length < ballotB.length) return -1; + if (ballotB.length < ballotA.length) return 1; + return ballotA[0] - ballotB[0]; + }), tally: polls.runoff(votes) }; }; diff --git a/packages/dai/src/Maker.js b/packages/dai/src/Maker.js index e8b8d126a..639637e64 100644 --- a/packages/dai/src/Maker.js +++ b/packages/dai/src/Maker.js @@ -85,8 +85,10 @@ function delegateToServices(maker, services) { for (const methodName of services[serviceName]) { if (serviceName === 'cdp') { maker[methodName] = () => { - throw new Error(`"${methodName}" is no longer available here. Add @makerdao/dai-plugin-scd, then use maker.service('cdp').${methodName}`); - } + throw new Error( + `"${methodName}" is no longer available here. Add @makerdao/dai-plugin-scd, then use maker.service('cdp').${methodName}` + ); + }; } else { maker[methodName] = (...args) => maker.service(serviceName)[methodName](...args); @@ -108,6 +110,7 @@ function mergeOptions(object, source) { } Maker.create = async function(...args) { + console.log({ args }); const [preset, options = {}] = args; const { plugins, ...otherOptions } = options; diff --git a/packages/dai/src/config/presets/goerli.json b/packages/dai/src/config/presets/goerli.json new file mode 100644 index 000000000..c47f7ef44 --- /dev/null +++ b/packages/dai/src/config/presets/goerli.json @@ -0,0 +1,8 @@ +{ + "web3": { + "provider": { + "type": "INFURA", + "network": "goerli" + } + } +} diff --git a/packages/dai/test/helpers/serviceBuilders.js b/packages/dai/test/helpers/serviceBuilders.js index eb7138f49..ce14a0d84 100644 --- a/packages/dai/test/helpers/serviceBuilders.js +++ b/packages/dai/test/helpers/serviceBuilders.js @@ -15,6 +15,17 @@ export const kovanProviderConfig = { } } }; +export const goerliProviderConfig = { + // TODO update for goerli + web3: { + privateKey: process.env.KOVAN_PRIVATE_KEY, + provider: { + type: ProviderType.INFURA, + network: 'kovan', + infuraProjectId + } + } +}; export const websocketProviderConfig = { web3: { provider: { From e1abaa1047a3fcb0898fa3297503bd404cd1d35c Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Wed, 6 Oct 2021 12:49:34 +0200 Subject: [PATCH 3/7] Clean up --- .../contracts/contract-info.json | 6 ++---- packages/dai-plugin-migrations/src/index.js | 2 -- packages/dai/scripts/repl.js | 15 --------------- packages/dai/src/Maker.js | 1 - packages/dai/test/helpers/serviceBuilders.js | 2 +- 5 files changed, 3 insertions(+), 23 deletions(-) diff --git a/packages/dai-plugin-liquidations/contracts/contract-info.json b/packages/dai-plugin-liquidations/contracts/contract-info.json index 85fdc99fa..1669571bd 100644 --- a/packages/dai-plugin-liquidations/contracts/contract-info.json +++ b/packages/dai-plugin-liquidations/contracts/contract-info.json @@ -2,8 +2,7 @@ "chief": { "inception_block": { "mainnet": "0x487813", - "kovan": "0x649575", - "goerli": "0x649575" + "kovan": "0x649575" }, "events": { "etch": "0x4f0892983790f53eea39a7a496f6cb40e8811b313871337b6a761efc6c67bb1f", @@ -16,8 +15,7 @@ "pause": { "inception_block": { "mainnet": "8928171", - "kovan": "14764552", - "goerli": "14764552" + "kovan": "14764552" }, "events": { "exec": "0x168ccd6700000000000000000000000000000000000000000000000000000000", diff --git a/packages/dai-plugin-migrations/src/index.js b/packages/dai-plugin-migrations/src/index.js index 8fbbbcda4..72bd46094 100644 --- a/packages/dai-plugin-migrations/src/index.js +++ b/packages/dai-plugin-migrations/src/index.js @@ -1,7 +1,6 @@ import { createCurrency } from '@makerdao/currency'; import testnetAddresses from '../contracts/addresses/testnet.json'; import kovanAddresses from '../contracts/addresses/kovan.json'; -import goerliAddresses from '../contracts/addresses/goerli.json'; import mainnetAddresses from '../contracts/addresses/mainnet.json'; import abiMap from '../contracts/abiMap'; import MigrationService from './MigrationService'; @@ -20,7 +19,6 @@ const allContracts = Object.entries(testnetAddresses).reduce( address: { testnet: testnetAddress, kovan: kovanAddresses[name], - goerli: goerliAddresses[name], mainnet: mainnetAddresses[name] } }; diff --git a/packages/dai/scripts/repl.js b/packages/dai/scripts/repl.js index ade7af6e8..455e33823 100644 --- a/packages/dai/scripts/repl.js +++ b/packages/dai/scripts/repl.js @@ -53,21 +53,6 @@ const env = { } } }, - goerli: { - // TODO update for goerli - fromBlock: 4750000, - config: { - url: 'https://kovan.infura.io/v3/c3f0f26a4c1742e0949d8eedfc47be67', - privateKey: process.env.KOVAN_PRIVATE_KEY, - smartContract: { addressOverrides }, - token: { - addressOverrides: { - PETH: addressOverrides.SAI_SKR, - DAI: addressOverrides.SAI_SAI - } - } - } - }, mainnet: { config: { fromBlock: 4750000, diff --git a/packages/dai/src/Maker.js b/packages/dai/src/Maker.js index 639637e64..d651d97f7 100644 --- a/packages/dai/src/Maker.js +++ b/packages/dai/src/Maker.js @@ -110,7 +110,6 @@ function mergeOptions(object, source) { } Maker.create = async function(...args) { - console.log({ args }); const [preset, options = {}] = args; const { plugins, ...otherOptions } = options; diff --git a/packages/dai/test/helpers/serviceBuilders.js b/packages/dai/test/helpers/serviceBuilders.js index ce14a0d84..0f6f026b7 100644 --- a/packages/dai/test/helpers/serviceBuilders.js +++ b/packages/dai/test/helpers/serviceBuilders.js @@ -18,7 +18,7 @@ export const kovanProviderConfig = { export const goerliProviderConfig = { // TODO update for goerli web3: { - privateKey: process.env.KOVAN_PRIVATE_KEY, + privateKey: process.env.GOERLI_PRIVATE_KEY, provider: { type: ProviderType.INFURA, network: 'kovan', From bf34f1938e64151fa465760bb27aeacaa2406cae Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Wed, 6 Oct 2021 12:50:50 +0200 Subject: [PATCH 4/7] dai-v0.32.14-beta0 --- packages/dai/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dai/package.json b/packages/dai/package.json index 5f773c57f..3a27e9f42 100644 --- a/packages/dai/package.json +++ b/packages/dai/package.json @@ -1,6 +1,6 @@ { "name": "@makerdao/dai", - "version": "0.32.13", + "version": "0.32.14-beta0", "contributors": [ "Wouter Kampmann ", "Sean Brennan ", From 3e6682a18bb78c568afb8fbc22a31f774c1f1b0c Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Wed, 6 Oct 2021 12:52:59 +0200 Subject: [PATCH 5/7] dai-plugin-mcd-v1.6.36-beta0 --- packages/dai-plugin-mcd/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dai-plugin-mcd/package.json b/packages/dai-plugin-mcd/package.json index 09661ec03..346ae81d6 100644 --- a/packages/dai-plugin-mcd/package.json +++ b/packages/dai-plugin-mcd/package.json @@ -1,7 +1,7 @@ { "name": "@makerdao/dai-plugin-mcd", "description": "Plugin to add Multi-Collateral Dai support to dai.js", - "version": "1.6.35", + "version": "1.6.36-beta0", "license": "MIT", "main": "dist/index.js", "unpkg": "umd/index.js", From 42da87fd2ac5d98341347fc498551cb91bd54660 Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Wed, 6 Oct 2021 13:08:57 +0200 Subject: [PATCH 6/7] dai-plugin-governance-v0.14.2-beta0 --- packages/dai-plugin-governance/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/dai-plugin-governance/package.json b/packages/dai-plugin-governance/package.json index de5e3e0b1..51788c7bd 100644 --- a/packages/dai-plugin-governance/package.json +++ b/packages/dai-plugin-governance/package.json @@ -1,7 +1,7 @@ { "name": "@makerdao/dai-plugin-governance", "description": "A dai.js plugin for adding MKR governance support to dapps.", - "version": "0.14.1-beta15", + "version": "0.14.2-beta0", "license": "MIT", "repository": { "type": "git", From 1727891d00f57d38aeed1d515d2e96c2fae3ef23 Mon Sep 17 00:00:00 2001 From: Adam Goth Date: Wed, 6 Oct 2021 16:32:14 +0200 Subject: [PATCH 7/7] Update test --- packages/dai-plugin-mcd/test/index.spec.js | 1 + packages/dai/test/helpers/serviceBuilders.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/dai-plugin-mcd/test/index.spec.js b/packages/dai-plugin-mcd/test/index.spec.js index 33ea16070..78eec4620 100644 --- a/packages/dai-plugin-mcd/test/index.spec.js +++ b/packages/dai-plugin-mcd/test/index.spec.js @@ -27,6 +27,7 @@ test('addConfig outputs contract addresses for all networks', () => { expect(token.address).toEqual({ testnet: expect.any(String), kovan: expect.any(String), + goerli: expect.any(String), mainnet: expect.any(String) }); } diff --git a/packages/dai/test/helpers/serviceBuilders.js b/packages/dai/test/helpers/serviceBuilders.js index 0f6f026b7..7c4833554 100644 --- a/packages/dai/test/helpers/serviceBuilders.js +++ b/packages/dai/test/helpers/serviceBuilders.js @@ -21,7 +21,7 @@ export const goerliProviderConfig = { privateKey: process.env.GOERLI_PRIVATE_KEY, provider: { type: ProviderType.INFURA, - network: 'kovan', + network: 'goerli', infuraProjectId } }