From 38fe4d018d1b9ed5954a17501bdaa59b0aeec2f2 Mon Sep 17 00:00:00 2001 From: Leszek Stachowski Date: Wed, 23 Oct 2024 17:03:53 +0200 Subject: [PATCH] Remove deprecations (#400) --- .changeset/calm-sheep-tie.md | 5 + .changeset/smart-guests-refuse.md | 5 + .../contractkit/classes/kit.ContractKit.md | 68 +++++----- .../wrappers_BaseSlasher.BaseSlasher.md | 2 +- ...perForGoverning.BaseWrapperForGoverning.md | 2 +- ...ningSlasher.DoubleSigningSlasherWrapper.md | 2 +- ..._DowntimeSlasher.DowntimeSlasherWrapper.md | 14 +- .../wrappers_Election.ElectionWrapper.md | 4 +- ...appers_EpochManager.EpochManagerWrapper.md | 53 ++++++-- ...ppers_GoldTokenWrapper.GoldTokenWrapper.md | 2 +- .../wrappers_Governance.GovernanceWrapper.md | 4 +- .../wrappers_LockedGold.LockedGoldWrapper.md | 2 +- ...wrappers_ReleaseGold.ReleaseGoldWrapper.md | 2 +- ...appers_ScoreManager.ScoreManagerWrapper.md | 5 +- .../wrappers_Validators.ValidatorsWrapper.md | 4 +- .../modules/wrappers_DowntimeSlasher.md | 2 +- .../modules/wrappers_EpochManager.md | 2 +- .../commands/governance/approve-l2.test.ts | 10 +- .../src/commands/governance/approve.test.ts | 8 +- .../__snapshots__/contracts-l2.test.ts.snap | 128 +++++++++--------- .../__snapshots__/contracts.test.ts.snap | 128 +++++++++--------- packages/cli/src/commands/network/info.ts | 3 +- .../commands/network/parameters-l2.test.ts | 10 +- .../src/commands/network/parameters.test.ts | 4 +- .../src/commands/network/whitelist-l2.test.ts | 26 ++-- .../src/commands/network/whitelist.test.ts | 6 +- .../cli/src/commands/transfer/celo.test.ts | 6 +- packages/dev-utils/package.json | 2 +- packages/sdk/contractkit/package.json | 2 +- packages/sdk/contractkit/src/kit-l2.test.ts | 70 +++++++++- packages/sdk/contractkit/src/kit.test.ts | 15 ++ packages/sdk/contractkit/src/kit.ts | 65 ++++++--- .../src/wrappers/BaseWrapperForGoverning.ts | 2 + .../src/wrappers/DowntimeSlasher-l2.test.ts | 36 +++++ .../src/wrappers/DowntimeSlasher.test.ts | 23 ++++ .../src/wrappers/DowntimeSlasher.ts | 14 +- .../src/wrappers/EpochManager.test.ts | 13 +- .../contractkit/src/wrappers/EpochManager.ts | 9 +- .../FeeCurrencyDirectoryWrapper.test.ts | 30 ++-- .../FeeCurrencyWhitelistWrapper.test.ts | 14 +- .../src/wrappers/Governance-l2.test.ts | 6 +- .../src/wrappers/Governance.test.ts | 10 +- .../contractkit/src/wrappers/Governance.ts | 2 +- .../src/wrappers/ScoreManager.test.ts | 2 +- yarn.lock | 20 +-- 45 files changed, 532 insertions(+), 310 deletions(-) create mode 100644 .changeset/calm-sheep-tie.md create mode 100644 .changeset/smart-guests-refuse.md create mode 100644 packages/sdk/contractkit/src/wrappers/DowntimeSlasher-l2.test.ts create mode 100644 packages/sdk/contractkit/src/wrappers/DowntimeSlasher.test.ts diff --git a/.changeset/calm-sheep-tie.md b/.changeset/calm-sheep-tie.md new file mode 100644 index 000000000..f4c719d15 --- /dev/null +++ b/.changeset/calm-sheep-tie.md @@ -0,0 +1,5 @@ +--- +'@celo/dev-utils': patch +--- + +Upgrades to latest devchain diff --git a/.changeset/smart-guests-refuse.md b/.changeset/smart-guests-refuse.md new file mode 100644 index 000000000..64d3c76cc --- /dev/null +++ b/.changeset/smart-guests-refuse.md @@ -0,0 +1,5 @@ +--- +'@celo/contractkit': patch +--- + +Renames `getElected` and its usages to `getElectedAccounts` for `EpochManagerWrapper` diff --git a/docs/sdk/contractkit/classes/kit.ContractKit.md b/docs/sdk/contractkit/classes/kit.ContractKit.md index 1140719a7..b1a31bc57 100644 --- a/docs/sdk/contractkit/classes/kit.ContractKit.md +++ b/docs/sdk/contractkit/classes/kit.ContractKit.md @@ -65,7 +65,7 @@ #### Defined in -[packages/sdk/contractkit/src/kit.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L114) +[packages/sdk/contractkit/src/kit.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L115) ## Properties @@ -77,7 +77,7 @@ factory for core contract's native web3 wrappers #### Defined in -[packages/sdk/contractkit/src/kit.ts:105](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L105) +[packages/sdk/contractkit/src/kit.ts:106](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L106) ___ @@ -89,7 +89,7 @@ helper for interacting with CELO & stable tokens #### Defined in -[packages/sdk/contractkit/src/kit.ts:109](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L109) +[packages/sdk/contractkit/src/kit.ts:110](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L110) ___ @@ -99,7 +99,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:114](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L114) +[packages/sdk/contractkit/src/kit.ts:115](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L115) ___ @@ -111,7 +111,7 @@ factory for core contract's kit wrappers #### Defined in -[packages/sdk/contractkit/src/kit.ts:107](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L107) +[packages/sdk/contractkit/src/kit.ts:108](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L108) ___ @@ -125,7 +125,7 @@ no longer needed since gasPrice is available on node rpc #### Defined in -[packages/sdk/contractkit/src/kit.ts:112](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L112) +[packages/sdk/contractkit/src/kit.ts:113](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L113) ___ @@ -137,7 +137,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:103](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L103) +[packages/sdk/contractkit/src/kit.ts:104](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L104) ## Accessors @@ -151,7 +151,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:332](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L332) +[packages/sdk/contractkit/src/kit.ts:359](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L359) • `set` **defaultAccount**(`address`): `void` @@ -167,7 +167,7 @@ core contract's address registry #### Defined in -[packages/sdk/contractkit/src/kit.ts:328](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L328) +[packages/sdk/contractkit/src/kit.ts:355](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L355) ___ @@ -181,7 +181,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:348](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L348) +[packages/sdk/contractkit/src/kit.ts:375](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L375) • `set` **defaultFeeCurrency**(`address`): `void` @@ -197,7 +197,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:344](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L344) +[packages/sdk/contractkit/src/kit.ts:371](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L371) ___ @@ -211,7 +211,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:340](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L340) +[packages/sdk/contractkit/src/kit.ts:367](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L367) • `set` **gasInflationFactor**(`factor`): `void` @@ -227,7 +227,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:336](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L336) +[packages/sdk/contractkit/src/kit.ts:363](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L363) ___ @@ -241,7 +241,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:379](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L379) +[packages/sdk/contractkit/src/kit.ts:406](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L406) ## Methods @@ -261,7 +261,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:324](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L324) +[packages/sdk/contractkit/src/kit.ts:351](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L351) ___ @@ -291,7 +291,7 @@ https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0066.md #### Defined in -[packages/sdk/contractkit/src/kit.ts:298](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L298) +[packages/sdk/contractkit/src/kit.ts:325](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L325) ___ @@ -311,7 +311,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:244](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L244) +[packages/sdk/contractkit/src/kit.ts:260](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L260) ___ @@ -319,13 +319,17 @@ ___ ▸ **getEpochSize**(): `Promise`\<`number`\> +This method returns for: +- L1: epoch size (in blocks) +- L2: epoch duration (in seconds) + #### Returns `Promise`\<`number`\> #### Defined in -[packages/sdk/contractkit/src/kit.ts:220](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L220) +[packages/sdk/contractkit/src/kit.ts:224](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L224) ___ @@ -345,7 +349,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:228](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L228) +[packages/sdk/contractkit/src/kit.ts:236](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L236) ___ @@ -359,7 +363,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:204](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L204) +[packages/sdk/contractkit/src/kit.ts:205](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L205) ___ @@ -379,7 +383,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:236](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L236) +[packages/sdk/contractkit/src/kit.ts:248](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L248) ___ @@ -399,7 +403,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:142](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L142) +[packages/sdk/contractkit/src/kit.ts:143](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L143) ___ @@ -419,7 +423,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L125) +[packages/sdk/contractkit/src/kit.ts:126](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L126) ___ @@ -433,7 +437,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:121](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L121) +[packages/sdk/contractkit/src/kit.ts:122](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L122) ___ @@ -447,7 +451,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:352](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L352) +[packages/sdk/contractkit/src/kit.ts:379](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L379) ___ @@ -461,7 +465,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:356](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L356) +[packages/sdk/contractkit/src/kit.ts:383](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L383) ___ @@ -481,7 +485,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:261](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L261) +[packages/sdk/contractkit/src/kit.ts:288](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L288) ___ @@ -501,7 +505,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:360](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L360) +[packages/sdk/contractkit/src/kit.ts:387](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L387) ___ @@ -522,7 +526,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:364](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L364) +[packages/sdk/contractkit/src/kit.ts:391](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L391) ___ @@ -548,7 +552,7 @@ Throws if supplied address is not a valid hexadecimal address #### Defined in -[packages/sdk/contractkit/src/kit.ts:211](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L211) +[packages/sdk/contractkit/src/kit.ts:212](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L212) ___ @@ -569,7 +573,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:371](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L371) +[packages/sdk/contractkit/src/kit.ts:398](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L398) ___ @@ -583,4 +587,4 @@ ___ #### Defined in -[packages/sdk/contractkit/src/kit.ts:375](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L375) +[packages/sdk/contractkit/src/kit.ts:402](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/kit.ts#L402) diff --git a/docs/sdk/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md b/docs/sdk/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md index bde760a55..88f08e4a4 100644 --- a/docs/sdk/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md +++ b/docs/sdk/contractkit/classes/wrappers_BaseSlasher.BaseSlasher.md @@ -72,7 +72,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties diff --git a/docs/sdk/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md b/docs/sdk/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md index 7f817922f..e70a92e0a 100644 --- a/docs/sdk/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md +++ b/docs/sdk/contractkit/classes/wrappers_BaseWrapperForGoverning.BaseWrapperForGoverning.md @@ -81,7 +81,7 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties diff --git a/docs/sdk/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md b/docs/sdk/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md index 45052165c..881aa1e7b 100644 --- a/docs/sdk/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_DoubleSigningSlasher.DoubleSigningSlasherWrapper.md @@ -61,7 +61,7 @@ Contract handling slashing for Validator double-signing #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties diff --git a/docs/sdk/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md b/docs/sdk/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md index 56a824a74..371d073e3 100644 --- a/docs/sdk/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_DowntimeSlasher.DowntimeSlasherWrapper.md @@ -70,7 +70,7 @@ Contract handling slashing for Validator downtime using intervals. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties @@ -205,7 +205,7 @@ the specific interval. #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:126](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L126) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:132](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L132) ___ @@ -229,7 +229,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:140](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L140) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:146](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L146) ___ @@ -457,7 +457,7 @@ True if the user already called the `setBitmapForInterval` for intervals. #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:133](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L133) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:139](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L139) ___ @@ -481,7 +481,7 @@ intervals. #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:174](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L174) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:180](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L180) ___ @@ -551,7 +551,7 @@ Tests if the given validator or signer did not sign any blocks in the interval. #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:147](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L147) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:153](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L153) ___ @@ -577,4 +577,4 @@ True if the validator signature does not appear in any block within the window. #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:161](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L161) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:167](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L167) diff --git a/docs/sdk/contractkit/classes/wrappers_Election.ElectionWrapper.md b/docs/sdk/contractkit/classes/wrappers_Election.ElectionWrapper.md index cc5d410ce..bf293d8b1 100644 --- a/docs/sdk/contractkit/classes/wrappers_Election.ElectionWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_Election.ElectionWrapper.md @@ -91,7 +91,7 @@ Contract for voting for validators and managing validator groups. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties @@ -325,7 +325,7 @@ ___ ### methodIds -• **methodIds**: `Record`\<``"electableValidators"`` \| ``"electabilityThreshold"`` \| ``"maxNumGroupsVotedFor"`` \| ``"checkProofOfPossession"`` \| ``"fractionMulExp"`` \| ``"getBlockNumberFromHeader"`` \| ``"getEpochNumber"`` \| ``"getEpochNumberOfBlock"`` \| ``"getEpochSize"`` \| ``"getParentSealBitmap"`` \| ``"getVerifiedSealBitmapFromHeader"`` \| ``"hashHeader"`` \| ``"initialized"`` \| ``"isL2"`` \| ``"isOwner"`` \| ``"minQuorumSize"`` \| ``"minQuorumSizeInCurrentSet"`` \| ``"numberValidatorsInCurrentSet"`` \| ``"numberValidatorsInSet"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"validatorSignerAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromSet"`` \| ``"initialize"`` \| ``"vote"`` \| ``"getVersionNumber"`` \| ``"isBlocked"`` \| ``"allowedToVoteOverMaxNumberOfGroups"`` \| ``"cachedVotesByAccount"`` \| ``"getBlockedbyContract"`` \| ``"activate"`` \| ``"activateForAccount"`` \| ``"revokePending"`` \| ``"revokeAllActive"`` \| ``"revokeActive"`` \| ``"distributeEpochRewards"`` \| ``"markGroupIneligible"`` \| ``"markGroupEligible"`` \| ``"forceDecrementVotes"`` \| ``"setBlockedByContract"`` \| ``"getGroupsVotedForByAccount"`` \| ``"getNumVotesReceivable"`` \| ``"getEligibleValidatorGroups"`` \| ``"getTotalVotesForEligibleValidatorGroups"`` \| ``"electValidatorSigners"`` \| ``"electValidatorAccounts"`` \| ``"getTotalVotesByAccount"`` \| ``"getActiveVoteUnitsForGroupByAccount"`` \| ``"getActiveVoteUnitsForGroup"`` \| ``"getGroupEligibility"`` \| ``"getGroupEpochRewards"`` \| ``"getGroupEpochRewardsBasedOnScore"`` \| ``"hasActivatablePendingVotes"`` \| ``"getElectabilityThreshold"`` \| ``"getElectableValidators"`` \| ``"setElectableValidators"`` \| ``"setMaxNumGroupsVotedFor"`` \| ``"setElectabilityThreshold"`` \| ``"updateTotalVotesByAccountForGroup"`` \| ``"setAllowedToVoteOverMaxNumberOfGroups"`` \| ``"canReceiveVotes"`` \| ``"getTotalVotes"`` \| ``"getActiveVotes"`` \| ``"electNValidatorSigners"`` \| ``"electNValidatorAccounts"`` \| ``"getCurrentValidatorSigners"`` \| ``"getPendingVotesForGroupByAccount"`` \| ``"getActiveVotesForGroupByAccount"`` \| ``"getTotalVotesForGroupByAccount"`` \| ``"getTotalVotesForGroup"`` \| ``"getActiveVotesForGroup"`` \| ``"getPendingVotesForGroup"``, `string`\> +• **methodIds**: `Record`\<``"electableValidators"`` \| ``"electabilityThreshold"`` \| ``"maxNumGroupsVotedFor"`` \| ``"checkProofOfPossession"`` \| ``"fractionMulExp"`` \| ``"getBlockNumberFromHeader"`` \| ``"getEpochNumber"`` \| ``"getEpochNumberOfBlock"`` \| ``"getEpochSize"`` \| ``"getParentSealBitmap"`` \| ``"getVerifiedSealBitmapFromHeader"`` \| ``"hashHeader"`` \| ``"initialized"`` \| ``"isOwner"`` \| ``"minQuorumSize"`` \| ``"minQuorumSizeInCurrentSet"`` \| ``"numberValidatorsInCurrentSet"`` \| ``"numberValidatorsInSet"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"validatorAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromSet"`` \| ``"initialize"`` \| ``"vote"`` \| ``"getVersionNumber"`` \| ``"isBlocked"`` \| ``"allowedToVoteOverMaxNumberOfGroups"`` \| ``"cachedVotesByAccount"`` \| ``"getBlockedByContract"`` \| ``"activate"`` \| ``"activateForAccount"`` \| ``"revokePending"`` \| ``"revokeAllActive"`` \| ``"revokeActive"`` \| ``"distributeEpochRewards"`` \| ``"markGroupIneligible"`` \| ``"markGroupEligible"`` \| ``"forceDecrementVotes"`` \| ``"setBlockedByContract"`` \| ``"getGroupsVotedForByAccount"`` \| ``"getNumVotesReceivable"`` \| ``"getEligibleValidatorGroups"`` \| ``"getTotalVotesForEligibleValidatorGroups"`` \| ``"electValidatorSigners"`` \| ``"electValidatorAccounts"`` \| ``"getTotalVotesByAccount"`` \| ``"getActiveVoteUnitsForGroupByAccount"`` \| ``"getActiveVoteUnitsForGroup"`` \| ``"getGroupEligibility"`` \| ``"getGroupEpochRewards"`` \| ``"getGroupEpochRewardsBasedOnScore"`` \| ``"hasActivatablePendingVotes"`` \| ``"getElectabilityThreshold"`` \| ``"getElectableValidators"`` \| ``"setElectableValidators"`` \| ``"setMaxNumGroupsVotedFor"`` \| ``"setElectabilityThreshold"`` \| ``"updateTotalVotesByAccountForGroup"`` \| ``"setAllowedToVoteOverMaxNumberOfGroups"`` \| ``"canReceiveVotes"`` \| ``"getTotalVotes"`` \| ``"getActiveVotes"`` \| ``"electNValidatorSigners"`` \| ``"electNValidatorAccounts"`` \| ``"getCurrentValidatorSigners"`` \| ``"getPendingVotesForGroupByAccount"`` \| ``"getActiveVotesForGroupByAccount"`` \| ``"getTotalVotesForGroupByAccount"`` \| ``"getTotalVotesForGroup"`` \| ``"getActiveVotesForGroup"`` \| ``"getPendingVotesForGroup"``, `string`\> #### Inherited from diff --git a/docs/sdk/contractkit/classes/wrappers_EpochManager.EpochManagerWrapper.md b/docs/sdk/contractkit/classes/wrappers_EpochManager.EpochManagerWrapper.md index 0eeb96a0b..931f2b94e 100644 --- a/docs/sdk/contractkit/classes/wrappers_EpochManager.EpochManagerWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_EpochManager.EpochManagerWrapper.md @@ -26,7 +26,8 @@ Contract handling epoch management. - [finishNextEpochProcess](wrappers_EpochManager.EpochManagerWrapper.md#finishnextepochprocess) - [firstKnownEpoch](wrappers_EpochManager.EpochManagerWrapper.md#firstknownepoch) - [getCurrentEpochNumber](wrappers_EpochManager.EpochManagerWrapper.md#getcurrentepochnumber) -- [getElected](wrappers_EpochManager.EpochManagerWrapper.md#getelected) +- [getElectedAccounts](wrappers_EpochManager.EpochManagerWrapper.md#getelectedaccounts) +- [getEpochNumberOfBlock](wrappers_EpochManager.EpochManagerWrapper.md#getepochnumberofblock) - [getEpochProcessingStatus](wrappers_EpochManager.EpochManagerWrapper.md#getepochprocessingstatus) - [getFirstBlockAtEpoch](wrappers_EpochManager.EpochManagerWrapper.md#getfirstblockatepoch) - [getLastBlockAtEpoch](wrappers_EpochManager.EpochManagerWrapper.md#getlastblockatepoch) @@ -71,7 +72,7 @@ Contract handling epoch management. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties @@ -160,7 +161,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:61](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L61) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:66](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L66) ___ @@ -212,9 +213,9 @@ ___ ___ -### getElected +### getElectedAccounts -• **getElected**: (...`args`: []) => `Promise`\<`string`[]\> +• **getElectedAccounts**: (...`args`: []) => `Promise`\<`string`[]\> #### Type declaration @@ -232,7 +233,31 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:45](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L45) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:50](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L50) + +___ + +### getEpochNumberOfBlock + +• **getEpochNumberOfBlock**: (...`args`: [\_blockNumber: string \| number]) => `Promise`\<`number`\> + +#### Type declaration + +▸ (`...args`): `Promise`\<`number`\> + +##### Parameters + +| Name | Type | +| :------ | :------ | +| `...args` | [\_blockNumber: string \| number] | + +##### Returns + +`Promise`\<`number`\> + +#### Defined in + +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L43) ___ @@ -256,7 +281,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:46](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L46) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:51](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L51) ___ @@ -328,7 +353,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:43](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L43) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:48](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L48) ___ @@ -352,13 +377,13 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:44](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L44) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:49](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L49) ___ ### methodIds -• **methodIds**: `Record`\<``"epochDuration"`` \| ``"isTimeForNextEpoch"`` \| ``"initialized"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"initialize"`` \| ``"getVersionNumber"`` \| ``"elected"`` \| ``"epochProcessing"`` \| ``"firstKnownEpoch"`` \| ``"isSystemInitialized"`` \| ``"oracleAddress"`` \| ``"processedGroups"`` \| ``"validatorPendingPayments"`` \| ``"initializeSystem"`` \| ``"startNextEpochProcess"`` \| ``"finishNextEpochProcess"`` \| ``"sendValidatorPayment"`` \| ``"getCurrentEpoch"`` \| ``"getCurrentEpochNumber"`` \| ``"getEpochProcessingState"`` \| ``"isBlocked"`` \| ``"getElected"`` \| ``"getFirstBlockAtEpoch"`` \| ``"getLastBlockAtEpoch"`` \| ``"setEpochDuration"`` \| ``"setOracleAddress"`` \| ``"isOnEpochProcess"`` \| ``"systemAlreadyInitialized"``, `string`\> +• **methodIds**: `Record`\<``"epochDuration"`` \| ``"isTimeForNextEpoch"`` \| ``"getEpochNumberOfBlock"`` \| ``"initialized"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"initialize"`` \| ``"getVersionNumber"`` \| ``"electedAccounts"`` \| ``"electedSigners"`` \| ``"epochProcessing"`` \| ``"firstKnownEpoch"`` \| ``"isSystemInitialized"`` \| ``"oracleAddress"`` \| ``"processedGroups"`` \| ``"toProcessGroups"`` \| ``"validatorPendingPayments"`` \| ``"initializeSystem"`` \| ``"startNextEpochProcess"`` \| ``"setToProcessGroups"`` \| ``"processGroups"`` \| ``"processGroup"`` \| ``"finishNextEpochProcess"`` \| ``"sendValidatorPayment"`` \| ``"getCurrentEpoch"`` \| ``"getCurrentEpochNumber"`` \| ``"getEpochProcessingState"`` \| ``"isBlocked"`` \| ``"numberOfElectedInCurrentSet"`` \| ``"getElectedAccounts"`` \| ``"getElectedAccountByIndex"`` \| ``"getElectedSigners"`` \| ``"getElectedSignerByIndex"`` \| ``"getFirstBlockAtEpoch"`` \| ``"getLastBlockAtEpoch"`` \| ``"getEpochByBlockNumber"`` \| ``"setEpochDuration"`` \| ``"setOracleAddress"`` \| ``"isOnEpochProcess"`` \| ``"systemAlreadyInitialized"`` \| ``"getEpochByNumber"``, `string`\> #### Inherited from @@ -390,7 +415,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:60](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L60) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:65](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L65) ## Accessors @@ -424,7 +449,7 @@ BaseWrapperForGoverning.address #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:63](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L63) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:68](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L68) ___ @@ -438,7 +463,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:125](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L125) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:130](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L130) ___ @@ -458,7 +483,7 @@ ___ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:76](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L76) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:81](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L81) ___ diff --git a/docs/sdk/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md b/docs/sdk/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md index 5d2dd152b..6a4d12d5f 100644 --- a/docs/sdk/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_GoldTokenWrapper.GoldTokenWrapper.md @@ -307,7 +307,7 @@ ___ ### methodIds -• **methodIds**: `Record`\<``"symbol"`` \| ``"name"`` \| ``"decimals"`` \| ``"initialized"`` \| ``"isL2"`` \| ``"isOwner"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"initialize"`` \| ``"approve"`` \| ``"getVersionNumber"`` \| ``"transfer"`` \| ``"increaseAllowance"`` \| ``"decreaseAllowance"`` \| ``"mint"`` \| ``"transferWithComment"`` \| ``"burn"`` \| ``"transferFrom"`` \| ``"allowance"`` \| ``"balanceOf"`` \| ``"totalSupply"`` \| ``"increaseSupply"`` \| ``"circulatingSupply"`` \| ``"getBurnedAmount"`` \| ``"allocatedSupply"``, `string`\> +• **methodIds**: `Record`\<``"symbol"`` \| ``"name"`` \| ``"decimals"`` \| ``"initialized"`` \| ``"isOwner"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"initialize"`` \| ``"approve"`` \| ``"getVersionNumber"`` \| ``"transfer"`` \| ``"increaseAllowance"`` \| ``"decreaseAllowance"`` \| ``"mint"`` \| ``"transferWithComment"`` \| ``"burn"`` \| ``"transferFrom"`` \| ``"allowance"`` \| ``"balanceOf"`` \| ``"totalSupply"`` \| ``"increaseSupply"`` \| ``"circulatingSupply"`` \| ``"getBurnedAmount"`` \| ``"allocatedSupply"``, `string`\> #### Inherited from diff --git a/docs/sdk/contractkit/classes/wrappers_Governance.GovernanceWrapper.md b/docs/sdk/contractkit/classes/wrappers_Governance.GovernanceWrapper.md index 3d6f8409a..14a787fd0 100644 --- a/docs/sdk/contractkit/classes/wrappers_Governance.GovernanceWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_Governance.GovernanceWrapper.md @@ -123,7 +123,7 @@ Contract managing voting for governance proposals. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties @@ -988,7 +988,7 @@ ___ ### methodIds -• **methodIds**: `Record`\<``"propose"`` \| ``"executeHotfix"`` \| ``"concurrentProposals"`` \| ``"dequeueFrequency"`` \| ``"minDeposit"`` \| ``"queueExpiry"`` \| ``"stageDurations"`` \| ``"upvote"`` \| ``"refundedDeposits"`` \| ``"approver"`` \| ``"checkProofOfPossession"`` \| ``"dequeued"`` \| ``"emptyIndices"`` \| ``"fractionMulExp"`` \| ``"getBlockNumberFromHeader"`` \| ``"getEpochNumber"`` \| ``"getEpochNumberOfBlock"`` \| ``"getEpochSize"`` \| ``"getParentSealBitmap"`` \| ``"getVerifiedSealBitmapFromHeader"`` \| ``"hashHeader"`` \| ``"hotfixExecutionTimeWindow"`` \| ``"hotfixes"`` \| ``"initialized"`` \| ``"isL2"`` \| ``"isOwner"`` \| ``"lastDequeue"`` \| ``"minQuorumSize"`` \| ``"minQuorumSizeInCurrentSet"`` \| ``"numberValidatorsInCurrentSet"`` \| ``"numberValidatorsInSet"`` \| ``"owner"`` \| ``"proposalCount"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"securityCouncil"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"validatorSignerAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromSet"`` \| ``"initialize"`` \| ``"setConstitution"`` \| ``"setSecurityCouncil"`` \| ``"setHotfixExecutionTimeWindow"`` \| ``"revokeUpvote"`` \| ``"approve"`` \| ``"vote"`` \| ``"votePartially"`` \| ``"revokeVotes"`` \| ``"execute"`` \| ``"approveHotfix"`` \| ``"whitelistHotfix"`` \| ``"prepareHotfix"`` \| ``"withdraw"`` \| ``"isProposalPassing"`` \| ``"isDequeuedProposal"`` \| ``"isDequeuedProposalExpired"`` \| ``"getConstitution"`` \| ``"isVoting"`` \| ``"getReferendumStageDuration"`` \| ``"getExecutionStageDuration"`` \| ``"getParticipationParameters"`` \| ``"proposalExists"`` \| ``"getProposal"`` \| ``"getProposalTransaction"`` \| ``"isApproved"`` \| ``"getVoteTotals"`` \| ``"getVoteRecord"`` \| ``"getQueueLength"`` \| ``"getUpvotes"`` \| ``"getQueue"`` \| ``"getDequeue"`` \| ``"getUpvoteRecord"`` \| ``"getMostRecentReferendumProposal"`` \| ``"getProposalStage"`` \| ``"getVersionNumber"`` \| ``"getHotfixHash"`` \| ``"setApprover"`` \| ``"setConcurrentProposals"`` \| ``"setMinDeposit"`` \| ``"setQueueExpiry"`` \| ``"setDequeueFrequency"`` \| ``"setReferendumStageDuration"`` \| ``"setExecutionStageDuration"`` \| ``"setParticipationBaseline"`` \| ``"setParticipationFloor"`` \| ``"setBaselineUpdateFactor"`` \| ``"setBaselineQuorumFactor"`` \| ``"dequeueProposalsIfReady"`` \| ``"removeVotesWhenRevokingDelegatedVotes"`` \| ``"resetHotFixRecord"`` \| ``"hotfixWhitelistValidatorTally"`` \| ``"isHotfixPassing"`` \| ``"getL1HotfixRecord"`` \| ``"getL2HotfixRecord"`` \| ``"isQueued"`` \| ``"isHotfixWhitelistedBy"`` \| ``"isQueuedProposalExpired"`` \| ``"getAmountOfGoldUsedForVoting"``, `string`\> +• **methodIds**: `Record`\<``"propose"`` \| ``"executeHotfix"`` \| ``"concurrentProposals"`` \| ``"dequeueFrequency"`` \| ``"minDeposit"`` \| ``"queueExpiry"`` \| ``"stageDurations"`` \| ``"upvote"`` \| ``"refundedDeposits"`` \| ``"approver"`` \| ``"checkProofOfPossession"`` \| ``"dequeued"`` \| ``"emptyIndices"`` \| ``"fractionMulExp"`` \| ``"getBlockNumberFromHeader"`` \| ``"getEpochNumber"`` \| ``"getEpochNumberOfBlock"`` \| ``"getEpochSize"`` \| ``"getParentSealBitmap"`` \| ``"getVerifiedSealBitmapFromHeader"`` \| ``"hashHeader"`` \| ``"hotfixExecutionTimeWindow"`` \| ``"hotfixes"`` \| ``"initialized"`` \| ``"isOwner"`` \| ``"lastDequeue"`` \| ``"minQuorumSize"`` \| ``"minQuorumSizeInCurrentSet"`` \| ``"numberValidatorsInCurrentSet"`` \| ``"numberValidatorsInSet"`` \| ``"owner"`` \| ``"proposalCount"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"securityCouncil"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"validatorAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromSet"`` \| ``"initialize"`` \| ``"setConstitution"`` \| ``"setSecurityCouncil"`` \| ``"setHotfixExecutionTimeWindow"`` \| ``"revokeUpvote"`` \| ``"approve"`` \| ``"vote"`` \| ``"votePartially"`` \| ``"revokeVotes"`` \| ``"execute"`` \| ``"approveHotfix"`` \| ``"whitelistHotfix"`` \| ``"prepareHotfix"`` \| ``"withdraw"`` \| ``"isProposalPassing"`` \| ``"isDequeuedProposal"`` \| ``"isDequeuedProposalExpired"`` \| ``"getConstitution"`` \| ``"isVoting"`` \| ``"getReferendumStageDuration"`` \| ``"getExecutionStageDuration"`` \| ``"getParticipationParameters"`` \| ``"proposalExists"`` \| ``"getProposal"`` \| ``"getProposalTransaction"`` \| ``"isApproved"`` \| ``"getVoteTotals"`` \| ``"getVoteRecord"`` \| ``"getQueueLength"`` \| ``"getUpvotes"`` \| ``"getQueue"`` \| ``"getDequeue"`` \| ``"getUpvoteRecord"`` \| ``"getMostRecentReferendumProposal"`` \| ``"getProposalStage"`` \| ``"getVersionNumber"`` \| ``"getHotfixHash"`` \| ``"setApprover"`` \| ``"setConcurrentProposals"`` \| ``"setMinDeposit"`` \| ``"setQueueExpiry"`` \| ``"setDequeueFrequency"`` \| ``"setReferendumStageDuration"`` \| ``"setExecutionStageDuration"`` \| ``"setParticipationBaseline"`` \| ``"setParticipationFloor"`` \| ``"setBaselineUpdateFactor"`` \| ``"setBaselineQuorumFactor"`` \| ``"dequeueProposalsIfReady"`` \| ``"removeVotesWhenRevokingDelegatedVotes"`` \| ``"resetHotFixRecord"`` \| ``"hotfixWhitelistValidatorTally"`` \| ``"isHotfixPassing"`` \| ``"getL1HotfixRecord"`` \| ``"getHotfixRecord"`` \| ``"getL2HotfixRecord"`` \| ``"isQueued"`` \| ``"isHotfixWhitelistedBy"`` \| ``"isQueuedProposalExpired"`` \| ``"getAmountOfGoldUsedForVoting"``, `string`\> #### Inherited from diff --git a/docs/sdk/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md b/docs/sdk/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md index b1d745681..7c8031d19 100644 --- a/docs/sdk/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_LockedGold.LockedGoldWrapper.md @@ -82,7 +82,7 @@ Contract for handling deposits needed for voting. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties diff --git a/docs/sdk/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md b/docs/sdk/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md index e121b1457..6777a6e5f 100644 --- a/docs/sdk/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_ReleaseGold.ReleaseGoldWrapper.md @@ -112,7 +112,7 @@ Contract for handling an instance of a ReleaseGold contract. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties diff --git a/docs/sdk/contractkit/classes/wrappers_ScoreManager.ScoreManagerWrapper.md b/docs/sdk/contractkit/classes/wrappers_ScoreManager.ScoreManagerWrapper.md index 5a8afc818..ca34f6598 100644 --- a/docs/sdk/contractkit/classes/wrappers_ScoreManager.ScoreManagerWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_ScoreManager.ScoreManagerWrapper.md @@ -86,6 +86,7 @@ ___ | :------ | :------ | | `GroupScoreSet` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `group`: `string` ; `score`: `string` }\> | | `OwnershipTransferred` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `newOwner`: `string` ; `previousOwner`: `string` }\> | +| `ScoreManagerSetterSet` | `ContractEvent`\<`string`\> | | `ValidatorScoreSet` | `ContractEvent`\<\{ `0`: `string` ; `1`: `string` ; `score`: `string` ; `validator`: `string` }\> | | `allEvents` | (`options?`: `EventOptions`, `cb?`: `Callback`\<`EventLog`\>) => `EventEmitter` | @@ -149,7 +150,7 @@ ___ ### methodIds -• **methodIds**: `Record`\<``"initialized"`` \| ``"owner"`` \| ``"renounceOwnership"`` \| ``"transferOwnership"`` \| ``"initialize"`` \| ``"getVersionNumber"`` \| ``"groupScores"`` \| ``"validatorScores"`` \| ``"setGroupScore"`` \| ``"setValidatorScore"`` \| ``"getGroupScore"`` \| ``"getValidatorScore"``, `string`\> +• **methodIds**: `Record`\<``"initialized"`` \| ``"owner"`` \| ``"renounceOwnership"`` \| ``"transferOwnership"`` \| ``"initialize"`` \| ``"getVersionNumber"`` \| ``"ZERO_SCORE"`` \| ``"groupScores"`` \| ``"validatorScores"`` \| ``"setGroupScore"`` \| ``"setValidatorScore"`` \| ``"setScoreManagerSetter"`` \| ``"getGroupScore"`` \| ``"getValidatorScore"`` \| ``"getScoreManagerSetter"``, `string`\> #### Inherited from @@ -191,7 +192,7 @@ Contract getPastEvents | Name | Type | | :------ | :------ | -| `event` | ``"OwnershipTransferred"`` \| ``"allEvents"`` \| ``"GroupScoreSet"`` \| ``"ValidatorScoreSet"`` | +| `event` | ``"OwnershipTransferred"`` \| ``"allEvents"`` \| ``"GroupScoreSet"`` \| ``"ScoreManagerSetterSet"`` \| ``"ValidatorScoreSet"`` | | `options` | `PastEventOptions` | #### Returns diff --git a/docs/sdk/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md b/docs/sdk/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md index 9d9b069a4..fe4095f7c 100644 --- a/docs/sdk/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md +++ b/docs/sdk/contractkit/classes/wrappers_Validators.ValidatorsWrapper.md @@ -106,7 +106,7 @@ Contract for voting for validators and managing validator groups. #### Defined in -[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:23](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L23) +[packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts:25](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts#L25) ## Properties @@ -613,7 +613,7 @@ ___ ### methodIds -• **methodIds**: `Record`\<``"groupLockedGoldRequirements"`` \| ``"validatorLockedGoldRequirements"`` \| ``"maxGroupSize"`` \| ``"membershipHistoryLength"`` \| ``"slashingMultiplierResetPeriod"`` \| ``"commissionUpdateDelay"`` \| ``"downtimeGracePeriod"`` \| ``"checkProofOfPossession"`` \| ``"fractionMulExp"`` \| ``"getBlockNumberFromHeader"`` \| ``"getEpochNumber"`` \| ``"getEpochNumberOfBlock"`` \| ``"getEpochSize"`` \| ``"getParentSealBitmap"`` \| ``"getVerifiedSealBitmapFromHeader"`` \| ``"hashHeader"`` \| ``"initialized"`` \| ``"isL2"`` \| ``"minQuorumSize"`` \| ``"minQuorumSizeInCurrentSet"`` \| ``"numberValidatorsInCurrentSet"`` \| ``"numberValidatorsInSet"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"validatorSignerAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromSet"`` \| ``"initialize"`` \| ``"getVersionNumber"`` \| ``"updateValidatorScoreFromSigner"`` \| ``"distributeEpochPaymentsFromSigner"`` \| ``"registerValidator"`` \| ``"registerValidatorNoBls"`` \| ``"deregisterValidator"`` \| ``"affiliate"`` \| ``"deaffiliate"`` \| ``"updateBlsPublicKey"`` \| ``"updateEcdsaPublicKey"`` \| ``"deregisterValidatorGroup"`` \| ``"updatePublicKeys"`` \| ``"registerValidatorGroup"`` \| ``"addMember"`` \| ``"addFirstMember"`` \| ``"removeMember"`` \| ``"reorderMember"`` \| ``"setNextCommissionUpdate"`` \| ``"updateCommission"`` \| ``"forceDeaffiliateIfValidator"`` \| ``"resetSlashingMultiplier"`` \| ``"halveSlashingMultiplier"`` \| ``"mintStableToEpochManager"`` \| ``"getValidatorBlsPublicKeyFromSigner"`` \| ``"getMembershipHistoryLength"`` \| ``"getValidatorGroup"`` \| ``"getTopGroupValidators"`` \| ``"getTopGroupValidatorsAccounts"`` \| ``"getGroupsNumMembers"`` \| ``"getNumRegisteredValidators"`` \| ``"getValidatorLockedGoldRequirements"`` \| ``"getGroupLockedGoldRequirements"`` \| ``"getRegisteredValidators"`` \| ``"getRegisteredValidatorGroups"`` \| ``"getMembershipInLastEpochFromSigner"`` \| ``"getValidatorGroupSlashingMultiplier"`` \| ``"groupMembershipInEpoch"`` \| ``"getValidatorScoreParameters"`` \| ``"getMembershipHistory"`` \| ``"calculateGroupEpochScore"`` \| ``"getCommissionUpdateDelay"`` \| ``"computeEpochReward"`` \| ``"setCommissionUpdateDelay"`` \| ``"setMaxGroupSize"`` \| ``"setMembershipHistoryLength"`` \| ``"setValidatorScoreParameters"`` \| ``"setGroupLockedGoldRequirements"`` \| ``"setValidatorLockedGoldRequirements"`` \| ``"setSlashingMultiplierResetPeriod"`` \| ``"setDowntimeGracePeriod"`` \| ``"getAccountLockedGoldRequirement"`` \| ``"getMembershipInLastEpoch"`` \| ``"calculateEpochScore"`` \| ``"meetsAccountLockedGoldRequirements"`` \| ``"getValidator"`` \| ``"getValidatorsGroup"`` \| ``"getGroupNumMembers"`` \| ``"isValidatorGroup"`` \| ``"isValidator"``, `string`\> +• **methodIds**: `Record`\<``"groupLockedGoldRequirements"`` \| ``"validatorLockedGoldRequirements"`` \| ``"maxGroupSize"`` \| ``"membershipHistoryLength"`` \| ``"slashingMultiplierResetPeriod"`` \| ``"commissionUpdateDelay"`` \| ``"downtimeGracePeriod"`` \| ``"checkProofOfPossession"`` \| ``"fractionMulExp"`` \| ``"getBlockNumberFromHeader"`` \| ``"getEpochNumber"`` \| ``"getEpochNumberOfBlock"`` \| ``"getEpochSize"`` \| ``"getParentSealBitmap"`` \| ``"getVerifiedSealBitmapFromHeader"`` \| ``"hashHeader"`` \| ``"initialized"`` \| ``"minQuorumSize"`` \| ``"minQuorumSizeInCurrentSet"`` \| ``"numberValidatorsInCurrentSet"`` \| ``"numberValidatorsInSet"`` \| ``"owner"`` \| ``"registry"`` \| ``"renounceOwnership"`` \| ``"setRegistry"`` \| ``"transferOwnership"`` \| ``"validatorAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromCurrentSet"`` \| ``"validatorSignerAddressFromSet"`` \| ``"initialize"`` \| ``"getVersionNumber"`` \| ``"updateValidatorScoreFromSigner"`` \| ``"distributeEpochPaymentsFromSigner"`` \| ``"registerValidator"`` \| ``"registerValidatorNoBls"`` \| ``"deregisterValidator"`` \| ``"affiliate"`` \| ``"deaffiliate"`` \| ``"updateBlsPublicKey"`` \| ``"updateEcdsaPublicKey"`` \| ``"deregisterValidatorGroup"`` \| ``"updatePublicKeys"`` \| ``"registerValidatorGroup"`` \| ``"addMember"`` \| ``"addFirstMember"`` \| ``"removeMember"`` \| ``"reorderMember"`` \| ``"setNextCommissionUpdate"`` \| ``"updateCommission"`` \| ``"forceDeaffiliateIfValidator"`` \| ``"resetSlashingMultiplier"`` \| ``"halveSlashingMultiplier"`` \| ``"mintStableToEpochManager"`` \| ``"getValidatorBlsPublicKeyFromSigner"`` \| ``"getMembershipHistoryLength"`` \| ``"getValidatorGroup"`` \| ``"getTopGroupValidators"`` \| ``"getTopGroupValidatorsAccounts"`` \| ``"getGroupsNumMembers"`` \| ``"getNumRegisteredValidators"`` \| ``"getValidatorLockedGoldRequirements"`` \| ``"getGroupLockedGoldRequirements"`` \| ``"getRegisteredValidatorSigners"`` \| ``"getRegisteredValidators"`` \| ``"getRegisteredValidatorGroups"`` \| ``"getMembershipInLastEpochFromSigner"`` \| ``"getValidatorGroupSlashingMultiplier"`` \| ``"groupMembershipInEpoch"`` \| ``"getValidatorScoreParameters"`` \| ``"getMembershipHistory"`` \| ``"calculateGroupEpochScore"`` \| ``"getMaxGroupSize"`` \| ``"getCommissionUpdateDelay"`` \| ``"computeEpochReward"`` \| ``"setCommissionUpdateDelay"`` \| ``"setMaxGroupSize"`` \| ``"setMembershipHistoryLength"`` \| ``"setValidatorScoreParameters"`` \| ``"setGroupLockedGoldRequirements"`` \| ``"setValidatorLockedGoldRequirements"`` \| ``"setSlashingMultiplierResetPeriod"`` \| ``"setDowntimeGracePeriod"`` \| ``"getAccountLockedGoldRequirement"`` \| ``"getMembershipInLastEpoch"`` \| ``"calculateEpochScore"`` \| ``"meetsAccountLockedGoldRequirements"`` \| ``"getValidator"`` \| ``"getValidatorsGroup"`` \| ``"getGroupNumMembers"`` \| ``"isValidatorGroup"`` \| ``"isValidator"``, `string`\> #### Inherited from diff --git a/docs/sdk/contractkit/modules/wrappers_DowntimeSlasher.md b/docs/sdk/contractkit/modules/wrappers_DowntimeSlasher.md index 036e9a222..cc3b9479d 100644 --- a/docs/sdk/contractkit/modules/wrappers_DowntimeSlasher.md +++ b/docs/sdk/contractkit/modules/wrappers_DowntimeSlasher.md @@ -25,4 +25,4 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:223](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L223) +[packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts:229](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts#L229) diff --git a/docs/sdk/contractkit/modules/wrappers_EpochManager.md b/docs/sdk/contractkit/modules/wrappers_EpochManager.md index e1d6e774c..d87de8d9a 100644 --- a/docs/sdk/contractkit/modules/wrappers_EpochManager.md +++ b/docs/sdk/contractkit/modules/wrappers_EpochManager.md @@ -29,4 +29,4 @@ #### Defined in -[packages/sdk/contractkit/src/wrappers/EpochManager.ts:138](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L138) +[packages/sdk/contractkit/src/wrappers/EpochManager.ts:143](https://github.com/celo-org/developer-tooling/blob/master/packages/sdk/contractkit/src/wrappers/EpochManager.ts#L143) diff --git a/packages/cli/src/commands/governance/approve-l2.test.ts b/packages/cli/src/commands/governance/approve-l2.test.ts index b885a19f4..fc52bed75 100644 --- a/packages/cli/src/commands/governance/approve-l2.test.ts +++ b/packages/cli/src/commands/governance/approve-l2.test.ts @@ -80,7 +80,7 @@ testWithAnvilL2('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is security council address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is security council address ", ], [ " ✘ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is security council multisig signatory ", @@ -126,7 +126,7 @@ testWithAnvilL2('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is approver address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is approver address ", ], [ " ✘ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is approver multisig signatory ", @@ -490,7 +490,7 @@ testWithAnvilL2('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is security council address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is security council address ", ], [ " ✔ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is security council multisig signatory ", @@ -546,7 +546,7 @@ testWithAnvilL2('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is approver address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is approver address ", ], [ " ✔ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is approver multisig signatory ", @@ -634,7 +634,7 @@ testWithAnvilL2('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is security council address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is security council address ", ], [ " ✔ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is security council multisig signatory ", diff --git a/packages/cli/src/commands/governance/approve.test.ts b/packages/cli/src/commands/governance/approve.test.ts index a1dbaef2c..2c1c7b70b 100644 --- a/packages/cli/src/commands/governance/approve.test.ts +++ b/packages/cli/src/commands/governance/approve.test.ts @@ -64,7 +64,7 @@ testWithAnvilL1('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is approver address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is approver address ", ], [ " ✘ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is multisig signatory ", @@ -103,7 +103,7 @@ testWithAnvilL1('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is approver address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is approver address ", ], [ " ✔ 0x5409ED021D9299bf6814279A6A1411A7e866A631 is multisig signatory ", @@ -159,7 +159,7 @@ testWithAnvilL1('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is approver address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is approver address ", ], [ " ✔ 2 is an existing proposal ", @@ -198,7 +198,7 @@ testWithAnvilL1('governance:approve cmd', (web3: Web3) => { "Running Checks:", ], [ - " ✔ 0x0639DBA9CBD6586E665B2bB7b705C65d96aae4f7 is approver address ", + " ✔ 0xf750153fc4211e4Ef325A7fD87d8258222e0b510 is approver address ", ], [ " ✔ 2 is an existing proposal ", diff --git a/packages/cli/src/commands/network/__snapshots__/contracts-l2.test.ts.snap b/packages/cli/src/commands/network/__snapshots__/contracts-l2.test.ts.snap index 63f50bbed..70eb072f5 100644 --- a/packages/cli/src/commands/network/__snapshots__/contracts-l2.test.ts.snap +++ b/packages/cli/src/commands/network/__snapshots__/contracts-l2.test.ts.snap @@ -6,188 +6,188 @@ exports[`network:contracts runs 1`] = ` "[ { "contract": "Accounts", - "proxy": "0x3B4a625Ba01F298Fab94eda78e4e310704F9B658", - "implementation": "0x27f640a4f0C95Fd18432be400653113ce0b6a617", - "version": "1.1.5.0" + "proxy": "0x6e31AE4b9cC7A90ae038b8FBBEd2Eb95104BA8aE", + "implementation": "0x8b2172Dd4eEA915EFc7dCD186E1cC96B8D7E1632", + "version": "1.1.4.2" }, { "contract": "BlockchainParameters", - "proxy": "0xcb2921E8b22b3d5e8C034d5A1AaA594E24443587", - "implementation": "0xf604D0eDFd3Dc73Dc1DbC31ccf54b218cbF1862F", + "proxy": "0xff32a62a9f303e3cB4985CCbEA9122f320EcD154", + "implementation": "0x981E260e7a2d7a83C8F4bA78B40cc97AAB95EDF7", "version": "1.3.1.0" }, { "contract": "CeloUnreleasedTreasury", - "proxy": "0x7C9745752517812d2c7968741Fa8b1B578cFD441", - "implementation": "0xCcE3F693556cbed36759bC162E5e47705E0D7C2A", + "proxy": "0x621b99D7698395aD1A677d981a7F7Ae66cB4861f", + "implementation": "0x4657793c02091974B42d28aA46225A81c113C0C2", "version": "1.1.0.0" }, { "contract": "DoubleSigningSlasher", - "proxy": "0x031C3be2CC63d31226A0EA14FBfD83ae70A76fB1", - "implementation": "0x4e18F3711cDc6613ea630f1fDFB89a01500934c5", - "version": "1.1.2.0" + "proxy": "0x96402dEDCcA832F2874E0fD9626cba302B7495bB", + "implementation": "0x1e96753a534436d7D09bB5f0c9f2e7081A35bd4E", + "version": "1.1.1.1" }, { "contract": "DowntimeSlasher", - "proxy": "0x4c5160408DE5FFA4f4c25034D084c40aec3bA6fF", - "implementation": "0x60b6b1fAe1945ef53AAe72a3f7699708348298D6", - "version": "2.0.1.0" + "proxy": "0x1c82668A47EF53655fC7b473e39a6f8E46E8C154", + "implementation": "0xa1F0F1F2138007695f943872A502ae96ff1Ee9df", + "version": "2.0.0.1" }, { "contract": "Election", - "proxy": "0x947DB20Ef764841b4aD9335b0DdaB83B03AF25EC", - "implementation": "0x0dB1e9Ceb6627ac045a8D316E67b2638B31b4bBf", + "proxy": "0xcB4E4A207DC1C220bd54B2A983E32e923c32E544", + "implementation": "0x6710D9980C55D7963B4dA671A159523BB5b4F6d1", "version": "1.1.4.0" }, { "contract": "EpochManager", - "proxy": "0xbf13Ba354EeF22976Faf20b11E6dd5440514eE68", - "implementation": "0x2b1b73Ad62eFC51afE62D20b79B5e0bc41BBe333", + "proxy": "0x2E290D8c2D6b26985f2826A63Aa103963DbAca23", + "implementation": "0x3D70ab096AF8892b4C3CB652E9D7e1CceA6e25FC", "version": "1.1.0.0" }, { "contract": "EpochManagerEnabler", - "proxy": "0x8A6F9F2B407FD63a087D47b32A98A991d26298f0", - "implementation": "0x8b0D48E4CA18484aEDc3B50f28EEa342F68B3430", + "proxy": "0xeD2E802c08227c1b3DA3F502Ed9dcAA01616309B", + "implementation": "0x3fFcB4bf2D76C659Aea8AC6667C0C611576284aA", "version": "1.1.0.0" }, { "contract": "EpochRewards", - "proxy": "0x4573120f10c89671a0083d0361B6F3e535de6e6a", - "implementation": "0x5F5f8d61CC0a077CAFD24395a4876c80063c26BD", + "proxy": "0x535D5EbB846832A2d876380dBccCb84eE5521d3f", + "implementation": "0xB4C3e97Ee2acaeb7D840Fde692465903239f213E", "version": "1.1.2.0" }, { "contract": "Escrow", - "proxy": "0x37C08a3F428258e5B835a256b2FB69C52843989a", - "implementation": "0x4242e61cF23587b7d73da0b36b66CDCD6D6c9071", + "proxy": "0x69EeE27C1ace51A7a5306D41262D16B6838aDd88", + "implementation": "0xdc359C2E9586B93Ab41fC180079E6485Bc8963Fb", "version": "1.2.0.0" }, { "contract": "FederatedAttestations", - "proxy": "0x6470D27B61D39D4d430083C4D461b9deD5C36e19", - "implementation": "0xFE0393E974cd59c1000E50F1ae83289Ba3CD528B", + "proxy": "0x2972DF87DA881bf2E71ea8aF6dE6E8b2731e13e9", + "implementation": "0x6319822f850f649F23b6d2ABE6d3c68D26a11679", "version": "1.1.0.0" }, { "contract": "FeeCurrencyDirectory", - "proxy": "0x0eD091C4F1669B31A4C22408Ce44326a0914f8Ec", - "implementation": "0x06Ff7d743E523ac7743A37602b50cD16FD0921a3", + "proxy": "0x5a7D21C9255DAA32109c8136661D7e853Fc5BF63", + "implementation": "0xD1F6cdb1E576395076Eb1aF4E2b76037cbb59C95", "version": "1.1.0.0" }, { "contract": "FeeCurrencyWhitelist", - "proxy": "0xC4A33659f7cf6277bcE979E3Dbd968e19015472a", - "implementation": "0x6417714d1997497182DB4abcc5D17bB8efcd2055", + "proxy": "0xdc2aFCA04340Ff16Bf0ac722568F1F9832Cc6154", + "implementation": "0xcA4009932604dfe05A0bD453f31a55770016E681", "version": "NONE" }, { "contract": "FeeHandler", - "proxy": "0xC7Bbf9cF343A87B592aE9B0E9ee2c8E71D7f5387", - "implementation": "0x18bC41e7032e9e78A2b7D0232E91c0cD7a898121", - "version": "1.1.0.1" + "proxy": "0xeaEEC408eCbCdF9CDF21d0B1880419dF7290E2c9", + "implementation": "0x82106CcC8feAE0bEc797281ae4dDf5F77E3E6156", + "version": "1.2.0.0" }, { "contract": "Freezer", - "proxy": "0x72AFCee38f30f878468ef4B09784bab03Ebe7979", - "implementation": "0x3CDbA319Ea4ab399d3FD5281e0eE3443077fAffd", + "proxy": "0x1ab1c5cd627d5e51aD093FF6F9433309CD68597e", + "implementation": "0x5b782AF0BCFbA4a66b6441a9cE05A7954a6d9913", "version": "NONE" }, { "contract": "GasPriceMinimum", - "proxy": "0x50e744e3e818cBebB6251bB577E8D106E06C4D08", - "implementation": "0x64B7527B6fc6327403603FA5C9ADe48a6160808f", + "proxy": "0x9220E1A69bF1b9A26041ff582b7AdC4124D8364f", + "implementation": "0x541Cdf8Dd40cEC9bAF3824001776A0C4f842c08B", "version": "1.2.1.0" }, { "contract": "GoldToken", - "proxy": "0x53C4774Afa905093531dD7312a7171f78ba64e8E", - "implementation": "0x7B04141AB1EE8ECCd189015e7bF1294531785708", + "proxy": "0x84afC656f046C38D6022C2f02b9F667f028e1ef0", + "implementation": "0xd83c2018543B661B6e96810ca1B8b87a4B01e1a8", "version": "1.1.3.0" }, { "contract": "Governance", - "proxy": "0x1164B9e064bf1D8C3B70a70A4b6929d0488b6d0a", - "implementation": "0x4feBB2a68917ba1902EAA94934e67158Ef2E211C", - "version": "1.5.0.0" + "proxy": "0x2EB25B5eb9d5A4f61deb1e4F846343F862eB67D9", + "implementation": "0x063BDb2e9A86e8aD2ad9fc488e9E45Dc2a845c3a", + "version": "1.4.2.0" }, { "contract": "LockedGold", - "proxy": "0x08E6B8D57c7387364EbF5DD3bc34Ed96e97ff0bF", - "implementation": "0xFFdeBC16e42b199b8A8FC7f6D55Cc14da0b059A2", + "proxy": "0x619b4767f6A955E63ED7d334DF3384bc4eacFdB8", + "implementation": "0xaEeE10944B805Bda8Ef6d41645aDb36b24B3F9E1", "version": "1.1.5.0" }, { "contract": "MentoFeeHandlerSeller", - "proxy": "0x119e4B81Ea1E0cAb2222411216486d7B1e75f20C", - "implementation": "0x5b0605c44f4356b6F479f00fD5e3A1e6D22867Fc", - "version": "1.1.0.1" + "proxy": "0x4b08c6219147552F68A3D4CA0ab4737B531660e4", + "implementation": "0x5d301e716d607a0c43B8DfF4d6102a13c18FA961", + "version": "1.1.1.0" }, { "contract": "OdisPayments", - "proxy": "0xA538082B97D1059abd2B8Ea609517E4EF092C25f", - "implementation": "0x7c14920BF4319C81b6Ac73532e3a40eC794e548C", + "proxy": "0x8Cc7e63482Ca6Ee77E0D1820395289D07249de77", + "implementation": "0x5683019ff6BCEaaC2badD1d73F6Ff28500079b41", "version": "1.1.0.0" }, { "contract": "Random", - "proxy": "0x4e9E0C0C16d0bCb477bD819C626Fe2ad6C223C92", - "implementation": "0x854DeFc99Cc15b2deA3E2fdB69c4EDe9D8e111A7", + "proxy": "0xA9DB88ADd5d6910183F38D5d0A451868898C7C82", + "implementation": "0x93D3Af5d5aAb66fAeF41A9242E12307D1813d2B3", "version": "1.1.2.0" }, { "contract": "Registry", "proxy": "0x000000000000000000000000000000000000ce10", - "implementation": "0xd677807472E95cdC82CCbD79B84bAC8395187a8F", + "implementation": "0x67bd72d0101905B1928E56f3204058c8C2D53251", "version": "NONE" }, { "contract": "Reserve", - "proxy": "0x0080094aDe1b0D9337bE75c470d84aDC561Ac964", + "proxy": "0x153193d9b852Dd791565a2929110282976040e54", "implementation": "0x6DDBd2A88C55e28ac8283c43D1F7100C295283fb", "version": "1.1.2.2" }, { "contract": "ScoreManager", - "proxy": "0x150Cd14f6caeB9f9E16ca6B330B487822D4Ea00a", - "implementation": "0x154A296F3D0A618d85884D9F669309957D0cF63F", + "proxy": "0x26B262FbaB2E243a4CEFD2Dbde9e1C203BaCd732", + "implementation": "0x345E7101aa60eDe5864822FC3fb2E5d5f679C187", "version": "1.1.0.0" }, { "contract": "SortedOracles", - "proxy": "0xAa2b1051A90b6BCa493E844338307dCe6817F4d7", - "implementation": "0x8501aF1E5161026c363C46e025561DEFd007271E", + "proxy": "0xeA6aCD469A2C2F32E167a9Ce50db735B61e00A2a", + "implementation": "0x19f9025D0eF2Ea2025b51DCB7CEEC4845aaf2A5e", "version": "1.1.4.0" }, { "contract": "StableToken", - "proxy": "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7", + "proxy": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "implementation": "0xaD68bacb5A5BC14D3a919c260366cacF76884444", "version": "NONE" }, { "contract": "StableTokenBRL", - "proxy": "0xC458f5ab25a47741205722d465cDea9aB1E1154A", + "proxy": "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d", "implementation": "0x687E05F04d0499EDEDFe89d6aed42Cc69F354a8A", "version": "NONE" }, { "contract": "StableTokenEUR", - "proxy": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "proxy": "0x5930519559Ffa7528a00BE445734036471c443a2", "implementation": "0x8fAC402cAb89Ba28b244249319c093Abe75c4dED", "version": "NONE" }, { "contract": "UniswapFeeHandlerSeller", - "proxy": "0x3C9E3f84f95C1AEFbC8501aBcF882DA63F09DB78", - "implementation": "0xEF6022d615fE7B994edB74541E803E67414Da50e", - "version": "1.1.0.1" + "proxy": "0x33f9eFcF4d4834932D3958d6d1d5AE18F358406E", + "implementation": "0xfFcE963152Faf3e797a71582Ef6419a7E6204542", + "version": "2.0.0.0" }, { "contract": "Validators", - "proxy": "0x88a66D2608E66f82Bf445d8AFA13629a7c4ac718", - "implementation": "0x527edb2c6788b7D69b06E011E2F4Ac7deDfaFA3b", + "proxy": "0x0fEDbA6Ae0D2cD916FaB191aA822cf9fe41990Be", + "implementation": "0x2b8669A7f7066507a140CD4D60D1946ff864A0B0", "version": "1.3.0.0" } ] diff --git a/packages/cli/src/commands/network/__snapshots__/contracts.test.ts.snap b/packages/cli/src/commands/network/__snapshots__/contracts.test.ts.snap index 63f50bbed..70eb072f5 100644 --- a/packages/cli/src/commands/network/__snapshots__/contracts.test.ts.snap +++ b/packages/cli/src/commands/network/__snapshots__/contracts.test.ts.snap @@ -6,188 +6,188 @@ exports[`network:contracts runs 1`] = ` "[ { "contract": "Accounts", - "proxy": "0x3B4a625Ba01F298Fab94eda78e4e310704F9B658", - "implementation": "0x27f640a4f0C95Fd18432be400653113ce0b6a617", - "version": "1.1.5.0" + "proxy": "0x6e31AE4b9cC7A90ae038b8FBBEd2Eb95104BA8aE", + "implementation": "0x8b2172Dd4eEA915EFc7dCD186E1cC96B8D7E1632", + "version": "1.1.4.2" }, { "contract": "BlockchainParameters", - "proxy": "0xcb2921E8b22b3d5e8C034d5A1AaA594E24443587", - "implementation": "0xf604D0eDFd3Dc73Dc1DbC31ccf54b218cbF1862F", + "proxy": "0xff32a62a9f303e3cB4985CCbEA9122f320EcD154", + "implementation": "0x981E260e7a2d7a83C8F4bA78B40cc97AAB95EDF7", "version": "1.3.1.0" }, { "contract": "CeloUnreleasedTreasury", - "proxy": "0x7C9745752517812d2c7968741Fa8b1B578cFD441", - "implementation": "0xCcE3F693556cbed36759bC162E5e47705E0D7C2A", + "proxy": "0x621b99D7698395aD1A677d981a7F7Ae66cB4861f", + "implementation": "0x4657793c02091974B42d28aA46225A81c113C0C2", "version": "1.1.0.0" }, { "contract": "DoubleSigningSlasher", - "proxy": "0x031C3be2CC63d31226A0EA14FBfD83ae70A76fB1", - "implementation": "0x4e18F3711cDc6613ea630f1fDFB89a01500934c5", - "version": "1.1.2.0" + "proxy": "0x96402dEDCcA832F2874E0fD9626cba302B7495bB", + "implementation": "0x1e96753a534436d7D09bB5f0c9f2e7081A35bd4E", + "version": "1.1.1.1" }, { "contract": "DowntimeSlasher", - "proxy": "0x4c5160408DE5FFA4f4c25034D084c40aec3bA6fF", - "implementation": "0x60b6b1fAe1945ef53AAe72a3f7699708348298D6", - "version": "2.0.1.0" + "proxy": "0x1c82668A47EF53655fC7b473e39a6f8E46E8C154", + "implementation": "0xa1F0F1F2138007695f943872A502ae96ff1Ee9df", + "version": "2.0.0.1" }, { "contract": "Election", - "proxy": "0x947DB20Ef764841b4aD9335b0DdaB83B03AF25EC", - "implementation": "0x0dB1e9Ceb6627ac045a8D316E67b2638B31b4bBf", + "proxy": "0xcB4E4A207DC1C220bd54B2A983E32e923c32E544", + "implementation": "0x6710D9980C55D7963B4dA671A159523BB5b4F6d1", "version": "1.1.4.0" }, { "contract": "EpochManager", - "proxy": "0xbf13Ba354EeF22976Faf20b11E6dd5440514eE68", - "implementation": "0x2b1b73Ad62eFC51afE62D20b79B5e0bc41BBe333", + "proxy": "0x2E290D8c2D6b26985f2826A63Aa103963DbAca23", + "implementation": "0x3D70ab096AF8892b4C3CB652E9D7e1CceA6e25FC", "version": "1.1.0.0" }, { "contract": "EpochManagerEnabler", - "proxy": "0x8A6F9F2B407FD63a087D47b32A98A991d26298f0", - "implementation": "0x8b0D48E4CA18484aEDc3B50f28EEa342F68B3430", + "proxy": "0xeD2E802c08227c1b3DA3F502Ed9dcAA01616309B", + "implementation": "0x3fFcB4bf2D76C659Aea8AC6667C0C611576284aA", "version": "1.1.0.0" }, { "contract": "EpochRewards", - "proxy": "0x4573120f10c89671a0083d0361B6F3e535de6e6a", - "implementation": "0x5F5f8d61CC0a077CAFD24395a4876c80063c26BD", + "proxy": "0x535D5EbB846832A2d876380dBccCb84eE5521d3f", + "implementation": "0xB4C3e97Ee2acaeb7D840Fde692465903239f213E", "version": "1.1.2.0" }, { "contract": "Escrow", - "proxy": "0x37C08a3F428258e5B835a256b2FB69C52843989a", - "implementation": "0x4242e61cF23587b7d73da0b36b66CDCD6D6c9071", + "proxy": "0x69EeE27C1ace51A7a5306D41262D16B6838aDd88", + "implementation": "0xdc359C2E9586B93Ab41fC180079E6485Bc8963Fb", "version": "1.2.0.0" }, { "contract": "FederatedAttestations", - "proxy": "0x6470D27B61D39D4d430083C4D461b9deD5C36e19", - "implementation": "0xFE0393E974cd59c1000E50F1ae83289Ba3CD528B", + "proxy": "0x2972DF87DA881bf2E71ea8aF6dE6E8b2731e13e9", + "implementation": "0x6319822f850f649F23b6d2ABE6d3c68D26a11679", "version": "1.1.0.0" }, { "contract": "FeeCurrencyDirectory", - "proxy": "0x0eD091C4F1669B31A4C22408Ce44326a0914f8Ec", - "implementation": "0x06Ff7d743E523ac7743A37602b50cD16FD0921a3", + "proxy": "0x5a7D21C9255DAA32109c8136661D7e853Fc5BF63", + "implementation": "0xD1F6cdb1E576395076Eb1aF4E2b76037cbb59C95", "version": "1.1.0.0" }, { "contract": "FeeCurrencyWhitelist", - "proxy": "0xC4A33659f7cf6277bcE979E3Dbd968e19015472a", - "implementation": "0x6417714d1997497182DB4abcc5D17bB8efcd2055", + "proxy": "0xdc2aFCA04340Ff16Bf0ac722568F1F9832Cc6154", + "implementation": "0xcA4009932604dfe05A0bD453f31a55770016E681", "version": "NONE" }, { "contract": "FeeHandler", - "proxy": "0xC7Bbf9cF343A87B592aE9B0E9ee2c8E71D7f5387", - "implementation": "0x18bC41e7032e9e78A2b7D0232E91c0cD7a898121", - "version": "1.1.0.1" + "proxy": "0xeaEEC408eCbCdF9CDF21d0B1880419dF7290E2c9", + "implementation": "0x82106CcC8feAE0bEc797281ae4dDf5F77E3E6156", + "version": "1.2.0.0" }, { "contract": "Freezer", - "proxy": "0x72AFCee38f30f878468ef4B09784bab03Ebe7979", - "implementation": "0x3CDbA319Ea4ab399d3FD5281e0eE3443077fAffd", + "proxy": "0x1ab1c5cd627d5e51aD093FF6F9433309CD68597e", + "implementation": "0x5b782AF0BCFbA4a66b6441a9cE05A7954a6d9913", "version": "NONE" }, { "contract": "GasPriceMinimum", - "proxy": "0x50e744e3e818cBebB6251bB577E8D106E06C4D08", - "implementation": "0x64B7527B6fc6327403603FA5C9ADe48a6160808f", + "proxy": "0x9220E1A69bF1b9A26041ff582b7AdC4124D8364f", + "implementation": "0x541Cdf8Dd40cEC9bAF3824001776A0C4f842c08B", "version": "1.2.1.0" }, { "contract": "GoldToken", - "proxy": "0x53C4774Afa905093531dD7312a7171f78ba64e8E", - "implementation": "0x7B04141AB1EE8ECCd189015e7bF1294531785708", + "proxy": "0x84afC656f046C38D6022C2f02b9F667f028e1ef0", + "implementation": "0xd83c2018543B661B6e96810ca1B8b87a4B01e1a8", "version": "1.1.3.0" }, { "contract": "Governance", - "proxy": "0x1164B9e064bf1D8C3B70a70A4b6929d0488b6d0a", - "implementation": "0x4feBB2a68917ba1902EAA94934e67158Ef2E211C", - "version": "1.5.0.0" + "proxy": "0x2EB25B5eb9d5A4f61deb1e4F846343F862eB67D9", + "implementation": "0x063BDb2e9A86e8aD2ad9fc488e9E45Dc2a845c3a", + "version": "1.4.2.0" }, { "contract": "LockedGold", - "proxy": "0x08E6B8D57c7387364EbF5DD3bc34Ed96e97ff0bF", - "implementation": "0xFFdeBC16e42b199b8A8FC7f6D55Cc14da0b059A2", + "proxy": "0x619b4767f6A955E63ED7d334DF3384bc4eacFdB8", + "implementation": "0xaEeE10944B805Bda8Ef6d41645aDb36b24B3F9E1", "version": "1.1.5.0" }, { "contract": "MentoFeeHandlerSeller", - "proxy": "0x119e4B81Ea1E0cAb2222411216486d7B1e75f20C", - "implementation": "0x5b0605c44f4356b6F479f00fD5e3A1e6D22867Fc", - "version": "1.1.0.1" + "proxy": "0x4b08c6219147552F68A3D4CA0ab4737B531660e4", + "implementation": "0x5d301e716d607a0c43B8DfF4d6102a13c18FA961", + "version": "1.1.1.0" }, { "contract": "OdisPayments", - "proxy": "0xA538082B97D1059abd2B8Ea609517E4EF092C25f", - "implementation": "0x7c14920BF4319C81b6Ac73532e3a40eC794e548C", + "proxy": "0x8Cc7e63482Ca6Ee77E0D1820395289D07249de77", + "implementation": "0x5683019ff6BCEaaC2badD1d73F6Ff28500079b41", "version": "1.1.0.0" }, { "contract": "Random", - "proxy": "0x4e9E0C0C16d0bCb477bD819C626Fe2ad6C223C92", - "implementation": "0x854DeFc99Cc15b2deA3E2fdB69c4EDe9D8e111A7", + "proxy": "0xA9DB88ADd5d6910183F38D5d0A451868898C7C82", + "implementation": "0x93D3Af5d5aAb66fAeF41A9242E12307D1813d2B3", "version": "1.1.2.0" }, { "contract": "Registry", "proxy": "0x000000000000000000000000000000000000ce10", - "implementation": "0xd677807472E95cdC82CCbD79B84bAC8395187a8F", + "implementation": "0x67bd72d0101905B1928E56f3204058c8C2D53251", "version": "NONE" }, { "contract": "Reserve", - "proxy": "0x0080094aDe1b0D9337bE75c470d84aDC561Ac964", + "proxy": "0x153193d9b852Dd791565a2929110282976040e54", "implementation": "0x6DDBd2A88C55e28ac8283c43D1F7100C295283fb", "version": "1.1.2.2" }, { "contract": "ScoreManager", - "proxy": "0x150Cd14f6caeB9f9E16ca6B330B487822D4Ea00a", - "implementation": "0x154A296F3D0A618d85884D9F669309957D0cF63F", + "proxy": "0x26B262FbaB2E243a4CEFD2Dbde9e1C203BaCd732", + "implementation": "0x345E7101aa60eDe5864822FC3fb2E5d5f679C187", "version": "1.1.0.0" }, { "contract": "SortedOracles", - "proxy": "0xAa2b1051A90b6BCa493E844338307dCe6817F4d7", - "implementation": "0x8501aF1E5161026c363C46e025561DEFd007271E", + "proxy": "0xeA6aCD469A2C2F32E167a9Ce50db735B61e00A2a", + "implementation": "0x19f9025D0eF2Ea2025b51DCB7CEEC4845aaf2A5e", "version": "1.1.4.0" }, { "contract": "StableToken", - "proxy": "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7", + "proxy": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "implementation": "0xaD68bacb5A5BC14D3a919c260366cacF76884444", "version": "NONE" }, { "contract": "StableTokenBRL", - "proxy": "0xC458f5ab25a47741205722d465cDea9aB1E1154A", + "proxy": "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d", "implementation": "0x687E05F04d0499EDEDFe89d6aed42Cc69F354a8A", "version": "NONE" }, { "contract": "StableTokenEUR", - "proxy": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "proxy": "0x5930519559Ffa7528a00BE445734036471c443a2", "implementation": "0x8fAC402cAb89Ba28b244249319c093Abe75c4dED", "version": "NONE" }, { "contract": "UniswapFeeHandlerSeller", - "proxy": "0x3C9E3f84f95C1AEFbC8501aBcF882DA63F09DB78", - "implementation": "0xEF6022d615fE7B994edB74541E803E67414Da50e", - "version": "1.1.0.1" + "proxy": "0x33f9eFcF4d4834932D3958d6d1d5AE18F358406E", + "implementation": "0xfFcE963152Faf3e797a71582Ef6419a7E6204542", + "version": "2.0.0.0" }, { "contract": "Validators", - "proxy": "0x88a66D2608E66f82Bf445d8AFA13629a7c4ac718", - "implementation": "0x527edb2c6788b7D69b06E011E2F4Ac7deDfaFA3b", + "proxy": "0x0fEDbA6Ae0D2cD916FaB191aA822cf9fe41990Be", + "implementation": "0x2b8669A7f7066507a140CD4D60D1946ff864A0B0", "version": "1.3.0.0" } ] diff --git a/packages/cli/src/commands/network/info.ts b/packages/cli/src/commands/network/info.ts index 48b8d400c..fb440a228 100644 --- a/packages/cli/src/commands/network/info.ts +++ b/packages/cli/src/commands/network/info.ts @@ -1,4 +1,3 @@ -import { isCel2 } from '@celo/connect' import { Flags } from '@oclif/core' import { BaseCommand } from '../../base' import { printValueMapRecursive } from '../../utils/cli' @@ -19,7 +18,7 @@ export default class Info extends BaseCommand { async run() { const kit = await this.getKit() const res = await this.parse(Info) - const isL2 = await isCel2(kit.connection.web3) + const isL2 = await this.isCel2() let latestEpochNumber: number let epochSize: number diff --git a/packages/cli/src/commands/network/parameters-l2.test.ts b/packages/cli/src/commands/network/parameters-l2.test.ts index 097952116..7421ade84 100644 --- a/packages/cli/src/commands/network/parameters-l2.test.ts +++ b/packages/cli/src/commands/network/parameters-l2.test.ts @@ -20,7 +20,7 @@ testWithAnvilL2('network:parameters', (web3) => { currentThreshold: 60000000000000000000 (~6.000e+19) electabilityThreshold: 0.001 electableValidators: - max: 100 + max: 110 min: 1 maxNumGroupsVotedFor: 10 totalVotes: 60000000000000000000000 (~6.000e+22) @@ -30,9 +30,9 @@ testWithAnvilL2('network:parameters', (web3) => { isTimeForNextEpoch: false FeeCurrencyDirectory: intrinsicGasForAlternativeFeeCurrency: - 0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9: 21000 (~2.100e+4) - 0x9cA64d4663B4A623C3E9a7F9155451647592bEc7: 21000 (~2.100e+4) - 0xC458f5ab25a47741205722d465cDea9aB1E1154A: 21000 (~2.100e+4) + 0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1: 21000 (~2.100e+4) + 0x5930519559Ffa7528a00BE445734036471c443a2: 21000 (~2.100e+4) + 0xB2Fd9852Ca3D69678286A8635d661690906A3E9d: 21000 (~2.100e+4) Governance: concurrentProposals: 3 dequeueFrequency: 4 hours @@ -52,7 +52,7 @@ testWithAnvilL2('network:parameters', (web3) => { Reserve: frozenReserveGoldDays: 0 frozenReserveGoldStartBalance: 0 - frozenReserveGoldStartDay: 19991 (~1.999e+4) + frozenReserveGoldStartDay: 20013 (~2.001e+4) otherReserveAddresses: tobinTaxStalenessThreshold: 3153600000 (~3.154e+9) diff --git a/packages/cli/src/commands/network/parameters.test.ts b/packages/cli/src/commands/network/parameters.test.ts index 4e5b4875a..a6447058f 100644 --- a/packages/cli/src/commands/network/parameters.test.ts +++ b/packages/cli/src/commands/network/parameters.test.ts @@ -26,7 +26,7 @@ testWithAnvilL1('network:parameters', (web3: Web3) => { currentThreshold: 60000000000000000000 (~6.000e+19) electabilityThreshold: 0.001 electableValidators: - max: 100 + max: 110 min: 1 maxNumGroupsVotedFor: 10 totalVotes: 60000000000000000000000 (~6.000e+22) @@ -67,7 +67,7 @@ testWithAnvilL1('network:parameters', (web3: Web3) => { Reserve: frozenReserveGoldDays: 0 frozenReserveGoldStartBalance: 0 - frozenReserveGoldStartDay: 19991 (~1.999e+4) + frozenReserveGoldStartDay: 20013 (~2.001e+4) otherReserveAddresses: tobinTaxStalenessThreshold: 3153600000 (~3.154e+9) diff --git a/packages/cli/src/commands/network/whitelist-l2.test.ts b/packages/cli/src/commands/network/whitelist-l2.test.ts index deba74a35..e2adf6b29 100644 --- a/packages/cli/src/commands/network/whitelist-l2.test.ts +++ b/packages/cli/src/commands/network/whitelist-l2.test.ts @@ -27,15 +27,15 @@ testWithAnvilL2('network:whitelist cmd', (web3: Web3) => { ", ], [ - " Celo Euro cEUR 0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9 0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9 18 false + " Celo Dollar cUSD 0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1 0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1 18 false ", ], [ - " Celo Dollar cUSD 0x9cA64d4663B4A623C3E9a7F9155451647592bEc7 0x9cA64d4663B4A623C3E9a7F9155451647592bEc7 18 false + " Celo Euro cEUR 0x5930519559Ffa7528a00BE445734036471c443a2 0x5930519559Ffa7528a00BE445734036471c443a2 18 false ", ], [ - " Celo Brazilian Real cREAL 0xC458f5ab25a47741205722d465cDea9aB1E1154A 0xC458f5ab25a47741205722d465cDea9aB1E1154A 18 false + " Celo Brazilian Real cREAL 0xB2Fd9852Ca3D69678286A8635d661690906A3E9d 0xB2Fd9852Ca3D69678286A8635d661690906A3E9d 18 false ", ], ] @@ -49,26 +49,26 @@ testWithAnvilL2('network:whitelist cmd', (web3: Web3) => { [ "[ { - "name": "Celo Euro", - "symbol": "cEUR", - "whitelisted": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", - "token": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "name": "Celo Dollar", + "symbol": "cUSD", + "whitelisted": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", + "token": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "decimals": "18", "usesAdapter": "false" }, { - "name": "Celo Dollar", - "symbol": "cUSD", - "whitelisted": "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7", - "token": "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7", + "name": "Celo Euro", + "symbol": "cEUR", + "whitelisted": "0x5930519559Ffa7528a00BE445734036471c443a2", + "token": "0x5930519559Ffa7528a00BE445734036471c443a2", "decimals": "18", "usesAdapter": "false" }, { "name": "Celo Brazilian Real", "symbol": "cREAL", - "whitelisted": "0xC458f5ab25a47741205722d465cDea9aB1E1154A", - "token": "0xC458f5ab25a47741205722d465cDea9aB1E1154A", + "whitelisted": "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d", + "token": "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d", "decimals": "18", "usesAdapter": "false" } diff --git a/packages/cli/src/commands/network/whitelist.test.ts b/packages/cli/src/commands/network/whitelist.test.ts index 0dce6b180..19c577f6b 100644 --- a/packages/cli/src/commands/network/whitelist.test.ts +++ b/packages/cli/src/commands/network/whitelist.test.ts @@ -30,15 +30,15 @@ testWithAnvilL1('network:whitelist cmd', (web3: Web3) => { ", ], [ - " Celo Euro cEUR 0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9 0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9 18 false + " Celo Dollar cUSD 0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1 0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1 18 false ", ], [ - " Celo Dollar cUSD 0x9cA64d4663B4A623C3E9a7F9155451647592bEc7 0x9cA64d4663B4A623C3E9a7F9155451647592bEc7 18 false + " Celo Euro cEUR 0x5930519559Ffa7528a00BE445734036471c443a2 0x5930519559Ffa7528a00BE445734036471c443a2 18 false ", ], [ - " Celo Brazilian Real cREAL 0xC458f5ab25a47741205722d465cDea9aB1E1154A 0xC458f5ab25a47741205722d465cDea9aB1E1154A 18 false + " Celo Brazilian Real cREAL 0xB2Fd9852Ca3D69678286A8635d661690906A3E9d 0xB2Fd9852Ca3D69678286A8635d661690906A3E9d 18 false ", ], ] diff --git a/packages/cli/src/commands/transfer/celo.test.ts b/packages/cli/src/commands/transfer/celo.test.ts index 67493f144..022e42c87 100644 --- a/packages/cli/src/commands/transfer/celo.test.ts +++ b/packages/cli/src/commands/transfer/celo.test.ts @@ -196,9 +196,9 @@ testWithAnvilL1('transfer:celo cmd', (web3: Web3) => { ) ).rejects.toThrowErrorMatchingInlineSnapshot(` "0x1234567890123456789012345678901234567890 is not a valid fee currency. Available currencies: - 0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9 - Celo Euro (cEUR) - 0x9cA64d4663B4A623C3E9a7F9155451647592bEc7 - Celo Dollar (cUSD) - 0xC458f5ab25a47741205722d465cDea9aB1E1154A - Celo Brazilian Real (cREAL)" + 0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1 - Celo Dollar (cUSD) + 0x5930519559Ffa7528a00BE445734036471c443a2 - Celo Euro (cEUR) + 0xB2Fd9852Ca3D69678286A8635d661690906A3E9d - Celo Brazilian Real (cREAL)" `) }) }) diff --git a/packages/dev-utils/package.json b/packages/dev-utils/package.json index 360088739..7d2565516 100644 --- a/packages/dev-utils/package.json +++ b/packages/dev-utils/package.json @@ -32,7 +32,7 @@ "web3-core-helpers": "1.10.4" }, "devDependencies": { - "@celo/devchain-anvil": "12.0.0-canary.8", + "@celo/devchain-anvil": "12.0.0-canary.33", "@celo/typescript": "workspace:^", "@tsconfig/recommended": "^1.0.3", "@types/fs-extra": "^8.1.0", diff --git a/packages/sdk/contractkit/package.json b/packages/sdk/contractkit/package.json index 30455b6ff..71e5ccd55 100644 --- a/packages/sdk/contractkit/package.json +++ b/packages/sdk/contractkit/package.json @@ -27,7 +27,7 @@ }, "dependencies": { "@celo/abis": "11.0.0", - "@celo/abis-12": "npm:@celo/abis@12.0.0-canary.35", + "@celo/abis-12": "npm:@celo/abis@12.0.0-canary.60", "@celo/base": "^7.0.0-beta.0", "@celo/connect": "^6.0.3-beta.0", "@celo/utils": "^8.0.0-beta.0", diff --git a/packages/sdk/contractkit/src/kit-l2.test.ts b/packages/sdk/contractkit/src/kit-l2.test.ts index ad04c35d8..6c79af89a 100644 --- a/packages/sdk/contractkit/src/kit-l2.test.ts +++ b/packages/sdk/contractkit/src/kit-l2.test.ts @@ -1,7 +1,9 @@ import { StrongAddress } from '@celo/base' import { testWithAnvilL2 } from '@celo/dev-utils/lib/anvil-test' +import { timeTravel } from '@celo/dev-utils/lib/ganache-test' import Web3 from 'web3' import { ContractKit, newKitFromWeb3 } from './kit' +import { startAndFinishEpochProcess } from './test-utils/utils' testWithAnvilL2('kit', (web3: Web3) => { let kit: ContractKit @@ -10,8 +12,8 @@ testWithAnvilL2('kit', (web3: Web3) => { beforeAll(async () => { kit = newKitFromWeb3(web3) - const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyWhitelist() - const gasOptions = await feeCurrencyWhitelist.getWhitelist() + const feeCurrencyWhitelist = await kit.contracts.getFeeCurrencyDirectory() + const gasOptions = await feeCurrencyWhitelist.getAddresses() feeToken = gasOptions[0] }) @@ -24,7 +26,7 @@ testWithAnvilL2('kit', (web3: Web3) => { }) ).resolves.toMatchInlineSnapshot(` { - "feeCurrency": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "feeCurrency": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "gas": 53001, "maxFeeInFeeCurrency": "54061020000000", "maxFeePerGas": "1000000000", @@ -58,7 +60,7 @@ testWithAnvilL2('kit', (web3: Web3) => { }) ).resolves.toMatchInlineSnapshot(` { - "feeCurrency": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "feeCurrency": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "gas": "102864710371401736267367367", "maxFeeInFeeCurrency": "104922004578829770992714714340000000", "maxFeePerGas": "1000000000", @@ -68,4 +70,64 @@ testWithAnvilL2('kit', (web3: Web3) => { }) }) }) + + describe('epochs', () => { + let epochDuration: number + + beforeEach(async () => { + const epochManagerWrapper = await kit.contracts.getEpochManager() + epochDuration = await epochManagerWrapper.epochDuration() + + // Go 3 epochs ahead + for (let i = 0; i < 3; i++) { + await timeTravel(epochDuration * 2, web3) + await startAndFinishEpochProcess(kit) + } + + await timeTravel(epochDuration * 2, web3) + + const accounts = await kit.web3.eth.getAccounts() + + await epochManagerWrapper.startNextEpochProcess().sendAndWaitForReceipt({ + from: accounts[0], + }) + + await ( + await epochManagerWrapper.finishNextEpochProcessTx() + ).sendAndWaitForReceipt({ + from: accounts[0], + }) + }) + + it('gets the current epoch size', async () => { + expect(await kit.getEpochSize()).toEqual(epochDuration) + }) + + it('gets first and last block number of an epoch', async () => { + expect(await kit.getFirstBlockNumberForEpoch(4)).toEqual(300) + expect(await kit.getLastBlockNumberForEpoch(4)).toEqual(352) + + expect(await kit.getFirstBlockNumberForEpoch(5)).toEqual(353) + expect(await kit.getLastBlockNumberForEpoch(5)).toEqual(355) + + expect(await kit.getFirstBlockNumberForEpoch(6)).toEqual(356) + expect(await kit.getLastBlockNumberForEpoch(6)).toEqual(358) + + expect(await kit.getFirstBlockNumberForEpoch(7)).toEqual(359) + expect(await kit.getLastBlockNumberForEpoch(7)).toEqual(361) + + expect(await kit.getFirstBlockNumberForEpoch(8)).toEqual(362) + }) + + it('gets the current epoch number', async () => { + expect(await kit.getEpochNumberOfBlock(300)).toEqual(4) + expect(await kit.getEpochNumberOfBlock(357)).toEqual(6) + expect(await kit.getEpochNumberOfBlock(361)).toEqual(7) + expect(await kit.getEpochNumberOfBlock(362)).toEqual(8) + }) + + it('throws when block number is out of range for L2', async () => { + await expect(kit.getEpochNumberOfBlock(363)).rejects.toThrow() + }) + }) }) diff --git a/packages/sdk/contractkit/src/kit.test.ts b/packages/sdk/contractkit/src/kit.test.ts index eee10e56f..362d74550 100644 --- a/packages/sdk/contractkit/src/kit.test.ts +++ b/packages/sdk/contractkit/src/kit.test.ts @@ -272,4 +272,19 @@ testWithAnvilL1('kit', (web3: Web3) => { ).resolves.toEqual(BigInt(51)) }) }) + + describe('epochs', () => { + it('gets the current epoch size', async () => { + expect(await kit.getEpochSize()).toEqual(100) + }) + + it('gets first and last block number of an epoch', async () => { + expect(await kit.getFirstBlockNumberForEpoch(2)).toEqual(101) + expect(await kit.getLastBlockNumberForEpoch(2)).toEqual(200) + }) + + it('gets the current epoch number', async () => { + expect(await kit.getEpochNumberOfBlock(300)).toEqual(3) + }) + }) }) diff --git a/packages/sdk/contractkit/src/kit.ts b/packages/sdk/contractkit/src/kit.ts index 0d98611bb..2cb0b0d92 100644 --- a/packages/sdk/contractkit/src/kit.ts +++ b/packages/sdk/contractkit/src/kit.ts @@ -86,6 +86,7 @@ interface AccountBalance extends EachCeloToken { lockedCELO: BigNumber pending: BigNumber } + /* * ContractKit provides a convenient interface for All Celo Contracts * @@ -214,36 +215,62 @@ export class ContractKit { } this.connection.defaultFeeCurrency = address } - /* - * @deprecated - epoch related methods will be removed from contractkit + + /** + * This method returns for: + * - L1: epoch size (in blocks) + * - L2: epoch duration (in seconds) */ async getEpochSize(): Promise { - const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() - return blockchainParamsWrapper.getEpochSizeNumber() + if (!(await isCel2(this.web3))) { + const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() + + return blockchainParamsWrapper.getEpochSizeNumber() + } + + const epochManagerWrapper = await this.contracts.getEpochManager() + + return epochManagerWrapper.epochDuration() } - /* - * @deprecated - epoch related methods will be removed from contractkit - */ async getFirstBlockNumberForEpoch(epochNumber: number): Promise { - const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() - return blockchainParamsWrapper.getFirstBlockNumberForEpoch(epochNumber) + if (!(await isCel2(this.web3))) { + const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() + + return blockchainParamsWrapper.getFirstBlockNumberForEpoch(epochNumber) + } + + const epochManagerWrapper = await this.contracts.getEpochManager() + + return await epochManagerWrapper.getFirstBlockAtEpoch(epochNumber) } - /* - * @deprecated - epoch related methods will be removed from contractkit - */ async getLastBlockNumberForEpoch(epochNumber: number): Promise { - const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() - return blockchainParamsWrapper.getLastBlockNumberForEpoch(epochNumber) + if (!(await isCel2(this.web3))) { + const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() + + return blockchainParamsWrapper.getLastBlockNumberForEpoch(epochNumber) + } + + const epochManagerWrapper = await this.contracts.getEpochManager() + + return await epochManagerWrapper.getLastBlockAtEpoch(epochNumber) } - /* - * @deprecated - epoch related methods will be removed from contractkit - */ async getEpochNumberOfBlock(blockNumber: number): Promise { - const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() - return blockchainParamsWrapper.getEpochNumberOfBlock(blockNumber) + if (!(await isCel2(this.web3))) { + const blockchainParamsWrapper = await this.contracts.getBlockchainParameters() + + return blockchainParamsWrapper.getEpochNumberOfBlock(blockNumber) + } + + const epochManagerWrapper = await this.contracts.getEpochManager() + + try { + return epochManagerWrapper.getEpochNumberOfBlock(blockNumber) + } catch (_) { + throw new Error(`Block number ${blockNumber} is not in any known L2 epoch`) + } } /* diff --git a/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts b/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts index d669191c2..2e5022e42 100644 --- a/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts +++ b/packages/sdk/contractkit/src/wrappers/BaseWrapperForGoverning.ts @@ -3,6 +3,7 @@ import { AccountsWrapper } from './Accounts' import { BaseWrapper } from './BaseWrapper' import { BlockchainParametersWrapper } from './BlockchainParameters' import { ElectionWrapper } from './Election' +import { EpochManagerWrapper } from './EpochManager' import { LockedGoldWrapper } from './LockedGold' import { MultiSigWrapper } from './MultiSig' import { ScoreManagerWrapper } from './ScoreManager' @@ -16,6 +17,7 @@ interface ContractWrappersForVotingAndRules { getScoreManager: () => Promise getMultiSig: (address: string) => Promise getBlockchainParameters: () => Promise + getEpochManager: () => Promise } /** @internal */ diff --git a/packages/sdk/contractkit/src/wrappers/DowntimeSlasher-l2.test.ts b/packages/sdk/contractkit/src/wrappers/DowntimeSlasher-l2.test.ts new file mode 100644 index 000000000..9193cd938 --- /dev/null +++ b/packages/sdk/contractkit/src/wrappers/DowntimeSlasher-l2.test.ts @@ -0,0 +1,36 @@ +import { testWithAnvilL2 } from '@celo/dev-utils/lib/anvil-test' +import { mineBlocks, timeTravel } from '@celo/dev-utils/lib/ganache-test' +import Web3 from 'web3' +import { ContractKit, newKitFromWeb3 } from '../kit' +import { startAndFinishEpochProcess } from '../test-utils/utils' + +testWithAnvilL2('DowntimeSlasherWrapper', (web3: Web3) => { + let kit: ContractKit + + beforeEach(async () => { + kit = newKitFromWeb3(web3) + const epochManagerWrapper = await kit.contracts.getEpochManager() + const epochDuration = await epochManagerWrapper.epochDuration() + const downtimeSlasherWrapper = await kit.contracts.getDowntimeSlasher() + + // Go 3 epochs ahead + for (let i = 0; i < 3; i++) { + await timeTravel(epochDuration * 2, web3) + await mineBlocks(await downtimeSlasherWrapper.slashableDowntime(), web3) + await startAndFinishEpochProcess(kit) + } + }) + + it('calculates slashable downtime intervals', async () => { + const wrapper = await kit.contracts.getDowntimeSlasher() + + expect(await wrapper.slashableDowntimeIntervalsBefore()).toMatchInlineSnapshot(` + [ + { + "end": 537, + "start": 478, + }, + ] + `) + }) +}) diff --git a/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.test.ts b/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.test.ts new file mode 100644 index 000000000..2e075ed5a --- /dev/null +++ b/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.test.ts @@ -0,0 +1,23 @@ +import { testWithAnvilL1 } from '@celo/dev-utils/lib/anvil-test' +import Web3 from 'web3' +import { newKitFromWeb3 } from '../kit' + +testWithAnvilL1('DowntimeSlasherWrapper', (web3: Web3) => { + it('calculates slashable downtime intervals', async () => { + const kit = newKitFromWeb3(web3) + const wrapper = await kit.contracts.getDowntimeSlasher() + + expect(await wrapper.slashableDowntimeIntervalsBefore()).toMatchInlineSnapshot(` + [ + { + "end": 300, + "start": 288, + }, + { + "end": 347, + "start": 301, + }, + ] + `) + }) +}) diff --git a/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts b/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts index d3ad94baf..8e821b0b0 100644 --- a/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts +++ b/packages/sdk/contractkit/src/wrappers/DowntimeSlasher.ts @@ -1,5 +1,5 @@ import { DowntimeSlasher } from '@celo/abis/web3/DowntimeSlasher' -import { Address } from '@celo/connect' +import { Address, isCel2 } from '@celo/connect' import BigNumber from 'bignumber.js' import { BaseSlasher } from './BaseSlasher' import { @@ -99,16 +99,22 @@ export class DowntimeSlasherWrapper extends BaseSlasher { block?: number, maximumLength = 4000 ): Promise { - const [window, blockchainParamsWrapper] = await Promise.all([ + const [window, blockchainParamsWrapper, epochManagerWrapper] = await Promise.all([ this.getSlashableDowntimeWindow(undefined, block), this.contracts.getBlockchainParameters(), + this.contracts.getEpochManager(), ]) let end = window.end const intervals: Interval[] = [] + const isL2 = await isCel2(this.connection.web3) while (end > window.start) { - const epochNumber = await blockchainParamsWrapper.getEpochNumberOfBlock(end) - const firstBlock = await blockchainParamsWrapper.getFirstBlockNumberForEpoch(epochNumber) + const epochNumber = isL2 + ? await epochManagerWrapper.getEpochNumberOfBlock(end) + : await blockchainParamsWrapper.getEpochNumberOfBlock(end) + const firstBlock = isL2 + ? await epochManagerWrapper.getFirstBlockAtEpoch(epochNumber) + : await blockchainParamsWrapper.getFirstBlockNumberForEpoch(epochNumber) const start = Math.max(window.start, end - maximumLength, firstBlock) intervals.push({ start, end }) end = start - 1 diff --git a/packages/sdk/contractkit/src/wrappers/EpochManager.test.ts b/packages/sdk/contractkit/src/wrappers/EpochManager.test.ts index bc1e574e2..97875c197 100644 --- a/packages/sdk/contractkit/src/wrappers/EpochManager.test.ts +++ b/packages/sdk/contractkit/src/wrappers/EpochManager.test.ts @@ -19,7 +19,7 @@ testWithAnvilL2('EpochManagerWrapper', (web3: Web3) => { const epochManagerWrapper = await kit.contracts.getEpochManager() expect(epochManagerWrapper.address).toMatchInlineSnapshot( - `"0xbf13Ba354EeF22976Faf20b11E6dd5440514eE68"` + `"0x2E290D8c2D6b26985f2826A63Aa103963DbAca23"` ) }) @@ -38,7 +38,7 @@ testWithAnvilL2('EpochManagerWrapper', (web3: Web3) => { it('gets elected validators', async () => { const epochManagerWrapper = await kit.contracts.getEpochManager() - expect(await epochManagerWrapper.getElected()).toMatchInlineSnapshot(` + expect(await epochManagerWrapper.getElectedAccounts()).toMatchInlineSnapshot(` [ "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65", "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc", @@ -119,6 +119,7 @@ testWithAnvilL2('EpochManagerWrapper', (web3: Web3) => { } it('starts and finishes a number of epochs', async () => { + const accounts = await kit.web3.eth.getAccounts() const epochManagerWrapper = await kit.contracts.getEpochManager() const EPOCH_COUNT = 5 @@ -137,10 +138,16 @@ testWithAnvilL2('EpochManagerWrapper', (web3: Web3) => { } expect(await epochManagerWrapper.getCurrentEpochNumber()).toEqual(10) + expect((await epochManagerWrapper.getEpochProcessingStatus()).status).toEqual(0) + + // Start a new epoch process, but not finish it, so we can check the amounts + await timeTravel(EPOCH_DURATION + 1, web3) + await epochManagerWrapper.startNextEpochProcess().sendAndWaitForReceipt({ + from: accounts[0], + }) const status = await epochManagerWrapper.getEpochProcessingStatus() - expect(status.status).toEqual(0) expect(status.totalRewardsVoter.toNumber()).toBeGreaterThan(0) expect(status.perValidatorReward.toNumber()).toBeGreaterThan(0) expect(status.totalRewardsCommunity.toNumber()).toBeGreaterThan(0) diff --git a/packages/sdk/contractkit/src/wrappers/EpochManager.ts b/packages/sdk/contractkit/src/wrappers/EpochManager.ts index 2f4b032ed..3dd3f14b7 100644 --- a/packages/sdk/contractkit/src/wrappers/EpochManager.ts +++ b/packages/sdk/contractkit/src/wrappers/EpochManager.ts @@ -40,9 +40,14 @@ export class EpochManagerWrapper extends BaseWrapperForGoverning { valueToInt ) getLastBlockAtEpoch = proxyCall(this.contract.methods.getLastBlockAtEpoch, undefined, valueToInt) + getEpochNumberOfBlock = proxyCall( + this.contract.methods.getEpochNumberOfBlock, + undefined, + valueToInt + ) isOnEpochProcess = proxyCall(this.contract.methods.isOnEpochProcess) isTimeForNextEpoch = proxyCall(this.contract.methods.isTimeForNextEpoch) - getElected = proxyCall(this.contract.methods.getElected) + getElectedAccounts = proxyCall(this.contract.methods.getElectedAccounts) getEpochProcessingStatus = proxyCall( this.contract.methods.epochProcessing, undefined, @@ -61,7 +66,7 @@ export class EpochManagerWrapper extends BaseWrapperForGoverning { finishNextEpochProcess = proxySend(this.connection, this.contract.methods.finishNextEpochProcess) finishNextEpochProcessTx = async () => { - const elected = await this.getElected() + const elected = await this.getElectedAccounts() const validators = await this.contracts.getValidators() const electedGroups = new Set( diff --git a/packages/sdk/contractkit/src/wrappers/FeeCurrencyDirectoryWrapper.test.ts b/packages/sdk/contractkit/src/wrappers/FeeCurrencyDirectoryWrapper.test.ts index f4a946c6b..557457736 100644 --- a/packages/sdk/contractkit/src/wrappers/FeeCurrencyDirectoryWrapper.test.ts +++ b/packages/sdk/contractkit/src/wrappers/FeeCurrencyDirectoryWrapper.test.ts @@ -12,21 +12,21 @@ testWithAnvilL1('FeeCurrencyDirectory', (web3) => { [ { "adaptedToken": undefined, - "address": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "address": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "decimals": 18, - "name": "Celo Euro", - "symbol": "cEUR", + "name": "Celo Dollar", + "symbol": "cUSD", }, { "adaptedToken": undefined, - "address": "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7", + "address": "0x5930519559Ffa7528a00BE445734036471c443a2", "decimals": 18, - "name": "Celo Dollar", - "symbol": "cUSD", + "name": "Celo Euro", + "symbol": "cEUR", }, { "adaptedToken": undefined, - "address": "0xC458f5ab25a47741205722d465cDea9aB1E1154A", + "address": "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d", "decimals": 18, "name": "Celo Brazilian Real", "symbol": "cREAL", @@ -37,7 +37,8 @@ testWithAnvilL1('FeeCurrencyDirectory', (web3) => { it('fetches exchange rate', async () => { const wrapper = await kit.contracts.getFeeCurrencyDirectory() - const exchangeRate = await wrapper.getExchangeRate('0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9') + const addresses = await wrapper.getAddresses() + const exchangeRate = await wrapper.getExchangeRate(addresses[0]) expect(exchangeRate.denominator).toEqual(new BigNumber('1000000000000000000000000')) expect(exchangeRate.numerator).toEqual(new BigNumber('1000000000000000000000000')) @@ -45,13 +46,12 @@ testWithAnvilL1('FeeCurrencyDirectory', (web3) => { it('fetches currency config', async () => { const wrapper = await kit.contracts.getFeeCurrencyDirectory() - const currencyConfig = await wrapper.getCurrencyConfig( - '0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9' - ) + const addresses = await wrapper.getAddresses() + const currencyConfig = await wrapper.getCurrencyConfig(addresses[0]) expect(currencyConfig).toMatchInlineSnapshot(` { "intrinsicGas": "21000", - "oracle": "0xAa2b1051A90b6BCa493E844338307dCe6817F4d7", + "oracle": "0xeA6aCD469A2C2F32E167a9Ce50db735B61e00A2a", } `) }) @@ -63,9 +63,9 @@ testWithAnvilL1('FeeCurrencyDirectory', (web3) => { expect(config).toMatchInlineSnapshot(` { "intrinsicGasForAlternativeFeeCurrency": { - "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9": "21000", - "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7": "21000", - "0xC458f5ab25a47741205722d465cDea9aB1E1154A": "21000", + "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1": "21000", + "0x5930519559Ffa7528a00BE445734036471c443a2": "21000", + "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d": "21000", }, } `) diff --git a/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.test.ts b/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.test.ts index be76aead1..34c29049c 100644 --- a/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.test.ts +++ b/packages/sdk/contractkit/src/wrappers/FeeCurrencyWhitelistWrapper.test.ts @@ -11,21 +11,21 @@ testWithAnvilL1('FeeCurrencyWhitelist', (web3) => { [ { "adaptedToken": undefined, - "address": "0x06f60E083aDf016a98E3c7A1aFfa1c097B617aB9", + "address": "0x20FE3FD86C231fb8E28255452CEA7851f9C5f9c1", "decimals": 18, - "name": "Celo Euro", - "symbol": "cEUR", + "name": "Celo Dollar", + "symbol": "cUSD", }, { "adaptedToken": undefined, - "address": "0x9cA64d4663B4A623C3E9a7F9155451647592bEc7", + "address": "0x5930519559Ffa7528a00BE445734036471c443a2", "decimals": 18, - "name": "Celo Dollar", - "symbol": "cUSD", + "name": "Celo Euro", + "symbol": "cEUR", }, { "adaptedToken": undefined, - "address": "0xC458f5ab25a47741205722d465cDea9aB1E1154A", + "address": "0xB2Fd9852Ca3D69678286A8635d661690906A3E9d", "decimals": 18, "name": "Celo Brazilian Real", "symbol": "cREAL", diff --git a/packages/sdk/contractkit/src/wrappers/Governance-l2.test.ts b/packages/sdk/contractkit/src/wrappers/Governance-l2.test.ts index 701471aaf..61ea9694a 100644 --- a/packages/sdk/contractkit/src/wrappers/Governance-l2.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Governance-l2.test.ts @@ -5,13 +5,13 @@ import { ContractVersion } from '../versions' testWithAnvilL2('GovernanceWrapper', (web3: Web3) => { describe('Hotfixes', () => { - it('gets L2 hotfix record for version >= 1.5.0.0', async () => { + it('gets L2 hotfix record for version >= 1.4.2.0', async () => { const kit = newKitFromWeb3(web3) const governance = await kit.contracts.getGovernance() const hotfixHash = Buffer.from('0x', 'hex') - // Sanity check to make sure we're on at least 1.5.0.0 version - expect((await governance.version()).isAtLeast(new ContractVersion(1, 5, 0, 0))) + // Sanity check to make sure we're on at least 1.4.2.0 version + expect((await governance.version()).isAtLeast(new ContractVersion(1, 4, 2, 0))).toBeTruthy() const hotfixRecordL2 = await governance.getHotfixRecord(hotfixHash) expect(hotfixRecordL2).toMatchInlineSnapshot(` diff --git a/packages/sdk/contractkit/src/wrappers/Governance.test.ts b/packages/sdk/contractkit/src/wrappers/Governance.test.ts index ed5200404..f5289ab25 100644 --- a/packages/sdk/contractkit/src/wrappers/Governance.test.ts +++ b/packages/sdk/contractkit/src/wrappers/Governance.test.ts @@ -15,10 +15,10 @@ import { MultiSigWrapper } from './MultiSig' // Only on ganache we can test 1.4.1.0 version testWithGanache('Governance Wrapper', (web3: Web3) => { describe('Hotfixes', () => { - it('gets L1 hotfix record pre 1.5.0.0', async () => { + it('gets L1 hotfix record pre 1.4.2.0', async () => { const kit = newKitFromWeb3(web3) const governance = await kit.contracts.getGovernance() - // Sanity check to make sure we're pre 1.5.0.0 + // Sanity check to make sure we're pre 1.4.2.0 expect((await governance.version()).toString()).toBe('1.4.1.0') const hotfixRecord = await governance.getHotfixRecord(Buffer.from('0x', 'hex')) @@ -296,13 +296,13 @@ testWithAnvilL1('Governance Wrapper', (web3: Web3) => { }) describe('Hotfixes', () => { - it('gets L1 hotfix record for version >= 1.5.0.0', async () => { + it('gets L1 hotfix record for version >= 1.4.2.0', async () => { const kit = newKitFromWeb3(web3) const governance = await kit.contracts.getGovernance() const hotfixHash = Buffer.from('0x', 'hex') - // Sanity check to make sure we're on at least 1.5.0.0 version - expect((await governance.version()).isAtLeast(new ContractVersion(1, 5, 0, 0))) + // Sanity check to make sure we're on at least 1.4.2.0 version + expect((await governance.version()).isAtLeast(new ContractVersion(1, 4, 2, 0))).toBeTruthy() // Test L1 context const hotfixRecordL1 = await governance.getHotfixRecord(hotfixHash) diff --git a/packages/sdk/contractkit/src/wrappers/Governance.ts b/packages/sdk/contractkit/src/wrappers/Governance.ts index ff1df7bd1..da997f253 100644 --- a/packages/sdk/contractkit/src/wrappers/Governance.ts +++ b/packages/sdk/contractkit/src/wrappers/Governance.ts @@ -904,7 +904,7 @@ export class GovernanceWrapper extends BaseWrapperForGoverning { async getHotfixRecord(hash: Buffer): Promise { const version = await this.version() - if (version.isAtLeast(new ContractVersion(1, 5, 0, 0))) { + if (version.isAtLeast(new ContractVersion(1, 4, 2, 0))) { if (await isCel2(this.connection.web3)) { // is L2 const res = await this.contract.methods.getL2HotfixRecord(bufferToHex(hash)).call() diff --git a/packages/sdk/contractkit/src/wrappers/ScoreManager.test.ts b/packages/sdk/contractkit/src/wrappers/ScoreManager.test.ts index 8539b7f35..cbc419ed7 100644 --- a/packages/sdk/contractkit/src/wrappers/ScoreManager.test.ts +++ b/packages/sdk/contractkit/src/wrappers/ScoreManager.test.ts @@ -13,7 +13,7 @@ testWithAnvilL2('ScoreManager Wrapper', (web3) => { it('gets validator score', async () => { const epochManagerWrapper = await kit.contracts.getEpochManager() const scoreManagerWrapper = await kit.contracts.getScoreManager() - const electedValidatorAddresses = await epochManagerWrapper.getElected() + const electedValidatorAddresses = await epochManagerWrapper.getElectedAccounts() // default score is 1 expect( diff --git a/yarn.lock b/yarn.lock index 09a02fee2..322d24a68 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1624,10 +1624,10 @@ __metadata: languageName: node linkType: hard -"@celo/abis-12@npm:@celo/abis@12.0.0-canary.35": - version: 12.0.0-canary.35 - resolution: "@celo/abis@npm:12.0.0-canary.35" - checksum: 0735d278d056a7b688bddd1d670fa595446efea0d71086ccef627dd37ff9d70c02435854c2b60bd2967bc9f1a7a790fc8b6a42f3d0ab8c352357b1d42e65e4e0 +"@celo/abis-12@npm:@celo/abis@12.0.0-canary.60": + version: 12.0.0-canary.60 + resolution: "@celo/abis@npm:12.0.0-canary.60" + checksum: 605aa68b6d7e2cd43b6a0d8115a44e3ace8416c49401c6559f173461c873ce2a8a1867c0a5dab5be05549f6a7e1d2249c57506a4633643a90694c0a011cf638d languageName: node linkType: hard @@ -1826,7 +1826,7 @@ __metadata: resolution: "@celo/contractkit@workspace:packages/sdk/contractkit" dependencies: "@celo/abis": "npm:11.0.0" - "@celo/abis-12": "npm:@celo/abis@12.0.0-canary.35" + "@celo/abis-12": "npm:@celo/abis@12.0.0-canary.60" "@celo/base": "npm:^7.0.0-beta.0" "@celo/celo-devchain": "npm:^7.0.0" "@celo/connect": "npm:^6.0.3-beta.0" @@ -1879,7 +1879,7 @@ __metadata: dependencies: "@celo/abis": "npm:^11.0.0" "@celo/connect": "npm:^6.0.3-beta.0" - "@celo/devchain-anvil": "npm:12.0.0-canary.8" + "@celo/devchain-anvil": "npm:12.0.0-canary.33" "@celo/typescript": "workspace:^" "@tsconfig/recommended": "npm:^1.0.3" "@types/fs-extra": "npm:^8.1.0" @@ -1895,10 +1895,10 @@ __metadata: languageName: unknown linkType: soft -"@celo/devchain-anvil@npm:12.0.0-canary.8": - version: 12.0.0-canary.8 - resolution: "@celo/devchain-anvil@npm:12.0.0-canary.8" - checksum: 128d1b4a0d841b171df6b4d02aedb0e1b1f29d9ce3c0f1d6e86e7451b3945d9ca3fd0745c2504f4e78a72b1d8bf762198d5a563dc7c6cdab640e8ce1c7fba1fd +"@celo/devchain-anvil@npm:12.0.0-canary.33": + version: 12.0.0-canary.33 + resolution: "@celo/devchain-anvil@npm:12.0.0-canary.33" + checksum: 010b061f3c43b959f201b7aaf56e0d8c1d7558d341e4b5f905a1d445cefc8f8acc1f667d536aa2de40f7f1d850d5af611184e9740c31ff32a8c76266946834f3 languageName: node linkType: hard