@gooddollar/goodprotocol 2.0.5-beta.7 → 2.0.5-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/artifacts/abis/IdentityFix.min.json +1 -0
  2. package/artifacts/abis/IdentityV2.min.json +1 -1
  3. package/artifacts/abis/UBISchemeV2.min.json +1 -0
  4. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  9. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  33. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  34. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  35. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  36. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  37. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  38. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  39. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  43. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  44. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  45. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  46. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  47. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  48. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +20 -2
  49. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  50. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  51. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  93. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  94. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  95. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  96. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  97. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  98. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  99. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  100. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  101. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  102. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  103. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  104. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  105. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  106. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  107. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  108. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  109. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  110. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  111. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  112. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  113. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  114. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  115. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  116. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  117. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  118. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  119. package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
  120. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  121. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  127. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  129. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  130. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  131. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  132. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  133. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +4 -0
  134. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +789 -0
  135. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  136. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  137. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  138. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  139. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  140. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  141. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  142. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  143. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  144. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  145. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  146. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  147. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  148. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +4 -0
  149. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +60 -0
  150. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  151. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  152. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  153. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  154. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  155. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  156. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  157. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  158. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  159. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  160. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  161. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  162. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  163. package/contracts/identity/IdentityV2.sol +52 -61
  164. package/contracts/ubi/UBISchemeV2.sol +470 -0
  165. package/contracts/utils/IdentityFix.sol +31 -0
  166. package/package.json +6 -5
  167. package/scripts/analytics/activeUsersCount.ts +56 -18
  168. package/scripts/analytics/whitelistsyncIssue.ts +87 -0
  169. package/scripts/multichain-deploy/helpers.ts +8 -6
  170. package/scripts/proposals/gip-14_1.ts +5 -9
  171. package/types/IdentityFix.ts +141 -0
  172. package/types/IdentityV2.ts +39 -0
  173. package/types/UBISchemeV2.ts +1192 -0
  174. package/types/factories/IdentityFix__factory.ts +110 -0
  175. package/types/factories/IdentityV2__factory.ts +19 -1
  176. package/types/factories/UBISchemeV2__factory.ts +837 -0
  177. package/types/hardhat.d.ts +18 -0
  178. package/types/index.ts +4 -0
  179. package/yarn.lock +22498 -20326
@@ -0,0 +1,87 @@
1
+ import { range, chunk, uniq } from "lodash";
2
+ import { ethers } from "hardhat";
3
+ import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
4
+ import fs from "fs";
5
+ import { Retrier } from "@jsier/retrier";
6
+
7
+ setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
8
+ setMulticallAddress(42220, "0x75F59534dd892c1f8a7B172D639FA854D529ada3");
9
+ const celoProvider = new ethers.providers.JsonRpcBatchProvider("https://forno.celo.org");
10
+ const ethcallProvider = new Provider(celoProvider, 42220);
11
+ const ethcallFuseProvider = new Provider(new ethers.providers.JsonRpcProvider("https://rpc.fuse.io"), 122);
12
+
13
+ const ONE_DAY = 24 * 60 * 60;
14
+ /**
15
+ * find accounts that where whitelisted on celo with diff authentication date than on fuse
16
+ */
17
+ const main = async () => {
18
+ const identity = await ethers.getContractAt("IdentityV2", "0xC361A6E67822a0EDc17D899227dd9FC50BD62F42");
19
+ const abi = identity.interface.format(ethers.utils.FormatTypes.full);
20
+ const multiIdentity = new Contract(identity.address, abi as string[]);
21
+ const multiIdentityFuse = new Contract("0x2F9C28de9e6d44b71B91b8BA337A5D82e308E7BE", abi as string[]);
22
+
23
+ const celoStartBlock = 18003118;
24
+ const step = 10000;
25
+ const celoLastBlock = await ethers.provider.getBlockNumber();
26
+ const notFuse = [],
27
+ notCelo = [],
28
+ toFixCelo = [],
29
+ toFixFuse = [],
30
+ notBoth = [];
31
+ for (let i = 0; celoStartBlock + step * i < celoLastBlock; i++) {
32
+ try {
33
+ const options = { limit: 3, delay: 2000 };
34
+ const retrier = new Retrier(options);
35
+
36
+ const lastBlock = celoStartBlock + step * (i + 1) + 1;
37
+ await retrier.resolve(async attempt => {
38
+ const events = await identity
39
+ .connect(celoProvider)
40
+ .queryFilter(
41
+ identity.filters["WhitelistedAdded"](),
42
+ celoStartBlock + step * i,
43
+ Math.min(celoLastBlock, lastBlock)
44
+ );
45
+ console.log("found events:", events.length);
46
+ const whitelisted = events.map(_ => _.args?.account);
47
+ let found = 0;
48
+ const ps = chunk(whitelisted, 400).map(async addrChunk => {
49
+ const results = await ethcallProvider.all(addrChunk.map(addr => multiIdentity.lastAuthenticated(addr)));
50
+ const resultsFuse = await ethcallFuseProvider.all(
51
+ addrChunk.map(addr => multiIdentityFuse.lastAuthenticated(addr))
52
+ );
53
+ results.forEach((v, i) => {
54
+ const diff = v.toNumber() - resultsFuse[i].toNumber();
55
+ if (v.eq(0) || diff > 3600) {
56
+ found++;
57
+ // console.log("diff:", { i, addr: whitelisted[i], celo: v, fuse: resultsFuse[i] });
58
+ if (v.eq(0) && resultsFuse[i].eq(0)) {
59
+ // notBoth.push(addrChunk[i]);
60
+ } else if (v.eq(0)) {
61
+ notCelo.push(addrChunk[i]);
62
+ } else if (resultsFuse[i].eq(0)) {
63
+ notFuse.push([addrChunk[i], v.toNumber()]);
64
+ } else if (diff > 0) {
65
+ // console.log("mismatch:", addrChunk[i], { diff });
66
+ toFixCelo.push([addrChunk[i], resultsFuse[i].toNumber()]);
67
+ } else {
68
+ toFixFuse.push([addrChunk[i], v.toNumber()]);
69
+ }
70
+ }
71
+ });
72
+ });
73
+ await Promise.all(ps);
74
+ console.log("done day:", { i, attempt, found });
75
+ });
76
+ } catch (e) {
77
+ console.log("failed day:", i, e.message.slice(0, 100));
78
+ }
79
+ }
80
+ fs.writeFileSync("whitelistissue.json", JSON.stringify({ toFixCelo, toFixFuse, notCelo, notFuse }));
81
+ console.log({ toFixFuse: toFixFuse.length, toFixCelo: toFixCelo.length, notCelo, notFuse });
82
+ };
83
+
84
+ const fix = async () => {
85
+ const { toFix, notFuse } = JSON.parse(fs.readFileSync("whitelistissue.json").toString());
86
+ };
87
+ main();
@@ -159,7 +159,8 @@ export const executeViaGuardian = async (
159
159
  results.push(tx);
160
160
  } else {
161
161
  const simulationResult = await ctrl.callStatic.genericCall(contract, encoded, release.Avatar, ethValues[i], {
162
- from: await guardian.getAddress()
162
+ from: await guardian.getAddress(),
163
+ value: ethValues[i]
163
164
  });
164
165
  console.log("executing genericCall:", {
165
166
  sigHash,
@@ -211,7 +212,7 @@ export const executeViaSafe = async (
211
212
  safeSigner = safeSignerOrNetwork as any;
212
213
  }
213
214
  const chainId = await safeSigner.getChainId();
214
- console.log("safeSigner:", safeSigner.address, { chainId });
215
+ console.log("safeSigner:", safeSigner.address, { chainId, safeAddress });
215
216
  let txServiceUrl;
216
217
  switch (chainId) {
217
218
  case 1:
@@ -251,7 +252,7 @@ export const executeViaSafe = async (
251
252
  const encoded = ethers.utils.solidityPack(["bytes4", "bytes"], [sigHash, functionInputs[i]]);
252
253
  if (contract === ctrl.address) {
253
254
  const simulationResult =
254
- isSimulation === false &&
255
+ isSimulation === true &&
255
256
  (await ctrl.callStatic[functionSigs[i]](...functionInputs[i], {
256
257
  from: safeAddress,
257
258
  value: ethValues[i]
@@ -276,15 +277,16 @@ export const executeViaSafe = async (
276
277
  });
277
278
 
278
279
  const simulationResult =
279
- isSimulation === false &&
280
+ isSimulation === true &&
280
281
  (await ctrl.callStatic.genericCall(contract, encoded, release.Avatar, ethValues[i], {
281
- from: safeAddress
282
+ from: safeAddress,
283
+ value: ethValues[i]
282
284
  }));
283
285
  console.log("executing genericCall simulation result:", {
284
286
  sigHash,
285
287
  simulationResult
286
288
  });
287
- if (isSimulation === false && simulationResult[0] === false) throw new Error("simulation failed:" + contract);
289
+ if (isSimulation === true && simulationResult[0] === false) throw new Error("simulation failed:" + contract);
288
290
  const genericEncode = ctrl.interface.encodeFunctionData("genericCall", [
289
291
  contract,
290
292
  encoded,
@@ -15,21 +15,19 @@ import ProtocolSettings from "../../releases/deploy-settings.json";
15
15
  import dao from "../../releases/deployment.json";
16
16
 
17
17
  const { name: networkName } = network;
18
+ const isForkSimulation = networkName === "localhost";
18
19
 
19
20
  export const step1 = async () => {
20
21
  const isProduction = networkName.includes("production");
21
22
  let [root, ...signers] = await ethers.getSigners();
22
23
 
23
- if (isProduction) verifyProductionSigner(root);
24
-
25
24
  let networkEnv = networkName.split("-")[0];
26
- const isForkSimulation = networkName === "localhost";
27
25
  if (isForkSimulation) networkEnv = "production";
28
26
  const fuseNetwork = networkEnv;
29
27
 
30
28
  if (networkEnv === "fuse") networkEnv = "development";
31
29
  const celoNetwork = networkEnv + "-celo";
32
- const mainnetNetwork = `${networkName === "localhost" ? "production" : networkName}-mainnet`; //simulate production on localhost requires running hardhat node in fork mode
30
+ const mainnetNetwork = `${networkName === "localhost" ? "production" : networkName.split("-")[0]}-mainnet`; //simulate production on localhost requires running hardhat node in fork mode
33
31
 
34
32
  let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
35
33
 
@@ -133,8 +131,6 @@ export const step2 = async () => {
133
131
  const isProduction = networkName.includes("production");
134
132
  let [root, ...signers] = await ethers.getSigners();
135
133
 
136
- if (isProduction) verifyProductionSigner(root);
137
-
138
134
  let networkEnv = networkName.split("-")[0];
139
135
  const isForkSimulation = networkName === "localhost";
140
136
  if (isForkSimulation) networkEnv = "production";
@@ -208,7 +204,7 @@ export const step2 = async () => {
208
204
  fuseProposalEthValues,
209
205
  fuseProposalFunctionSignatures,
210
206
  fuseProposalFunctionInputs,
211
- protocolSettings.guardiansSafe,
207
+ dao[fuseNetwork].GuardiansSafe,
212
208
  "fuse"
213
209
  );
214
210
  } else {
@@ -237,7 +233,7 @@ export const main = async () => {
237
233
  console.log("running step:", { stepNumber });
238
234
  switch (stepNumber) {
239
235
  case "1":
240
- await reset("https://cloudflare-eth.com");
236
+ isForkSimulation && (await reset("https://cloudflare-eth.com"));
241
237
  await step1();
242
238
  break;
243
239
 
@@ -245,7 +241,7 @@ export const main = async () => {
245
241
  //npx hardhat node --fork https://rpc.fuse.io
246
242
  //then run npx hardhat run scripts/proposals/gip-14_1.ts --network localhost
247
243
  case "2":
248
- await reset("https://rpc.fuse.io");
244
+ isForkSimulation && (await reset("https://rpc.fuse.io"));
249
245
  await step2();
250
246
  break;
251
247
  }
@@ -0,0 +1,141 @@
1
+ /* Autogenerated file. Do not edit manually. */
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+
5
+ import {
6
+ ethers,
7
+ EventFilter,
8
+ Signer,
9
+ BigNumber,
10
+ BigNumberish,
11
+ PopulatedTransaction,
12
+ BaseContract,
13
+ ContractTransaction,
14
+ Overrides,
15
+ CallOverrides,
16
+ } from "ethers";
17
+ import { BytesLike } from "@ethersproject/bytes";
18
+ import { Listener, Provider } from "@ethersproject/providers";
19
+ import { FunctionFragment, EventFragment, Result } from "@ethersproject/abi";
20
+ import type {
21
+ TypedEventFilter,
22
+ TypedEvent,
23
+ TypedListener,
24
+ OnEvent,
25
+ } from "./common";
26
+
27
+ export interface IdentityFixInterface extends ethers.utils.Interface {
28
+ functions: {
29
+ "end()": FunctionFragment;
30
+ "fix(address[],uint256[])": FunctionFragment;
31
+ "identity()": FunctionFragment;
32
+ };
33
+
34
+ encodeFunctionData(functionFragment: "end", values?: undefined): string;
35
+ encodeFunctionData(
36
+ functionFragment: "fix",
37
+ values: [string[], BigNumberish[]]
38
+ ): string;
39
+ encodeFunctionData(functionFragment: "identity", values?: undefined): string;
40
+
41
+ decodeFunctionResult(functionFragment: "end", data: BytesLike): Result;
42
+ decodeFunctionResult(functionFragment: "fix", data: BytesLike): Result;
43
+ decodeFunctionResult(functionFragment: "identity", data: BytesLike): Result;
44
+
45
+ events: {};
46
+ }
47
+
48
+ export interface IdentityFix extends BaseContract {
49
+ connect(signerOrProvider: Signer | Provider | string): this;
50
+ attach(addressOrName: string): this;
51
+ deployed(): Promise<this>;
52
+
53
+ interface: IdentityFixInterface;
54
+
55
+ queryFilter<TEvent extends TypedEvent>(
56
+ event: TypedEventFilter<TEvent>,
57
+ fromBlockOrBlockhash?: string | number | undefined,
58
+ toBlock?: string | number | undefined
59
+ ): Promise<Array<TEvent>>;
60
+
61
+ listeners<TEvent extends TypedEvent>(
62
+ eventFilter?: TypedEventFilter<TEvent>
63
+ ): Array<TypedListener<TEvent>>;
64
+ listeners(eventName?: string): Array<Listener>;
65
+ removeAllListeners<TEvent extends TypedEvent>(
66
+ eventFilter: TypedEventFilter<TEvent>
67
+ ): this;
68
+ removeAllListeners(eventName?: string): this;
69
+ off: OnEvent<this>;
70
+ on: OnEvent<this>;
71
+ once: OnEvent<this>;
72
+ removeListener: OnEvent<this>;
73
+
74
+ functions: {
75
+ end(
76
+ overrides?: Overrides & { from?: string | Promise<string> }
77
+ ): Promise<ContractTransaction>;
78
+
79
+ fix(
80
+ addrs: string[],
81
+ timestamps: BigNumberish[],
82
+ overrides?: Overrides & { from?: string | Promise<string> }
83
+ ): Promise<ContractTransaction>;
84
+
85
+ identity(overrides?: CallOverrides): Promise<[string]>;
86
+ };
87
+
88
+ end(
89
+ overrides?: Overrides & { from?: string | Promise<string> }
90
+ ): Promise<ContractTransaction>;
91
+
92
+ fix(
93
+ addrs: string[],
94
+ timestamps: BigNumberish[],
95
+ overrides?: Overrides & { from?: string | Promise<string> }
96
+ ): Promise<ContractTransaction>;
97
+
98
+ identity(overrides?: CallOverrides): Promise<string>;
99
+
100
+ callStatic: {
101
+ end(overrides?: CallOverrides): Promise<void>;
102
+
103
+ fix(
104
+ addrs: string[],
105
+ timestamps: BigNumberish[],
106
+ overrides?: CallOverrides
107
+ ): Promise<void>;
108
+
109
+ identity(overrides?: CallOverrides): Promise<string>;
110
+ };
111
+
112
+ filters: {};
113
+
114
+ estimateGas: {
115
+ end(
116
+ overrides?: Overrides & { from?: string | Promise<string> }
117
+ ): Promise<BigNumber>;
118
+
119
+ fix(
120
+ addrs: string[],
121
+ timestamps: BigNumberish[],
122
+ overrides?: Overrides & { from?: string | Promise<string> }
123
+ ): Promise<BigNumber>;
124
+
125
+ identity(overrides?: CallOverrides): Promise<BigNumber>;
126
+ };
127
+
128
+ populateTransaction: {
129
+ end(
130
+ overrides?: Overrides & { from?: string | Promise<string> }
131
+ ): Promise<PopulatedTransaction>;
132
+
133
+ fix(
134
+ addrs: string[],
135
+ timestamps: BigNumberish[],
136
+ overrides?: Overrides & { from?: string | Promise<string> }
137
+ ): Promise<PopulatedTransaction>;
138
+
139
+ identity(overrides?: CallOverrides): Promise<PopulatedTransaction>;
140
+ };
141
+ }
@@ -38,6 +38,7 @@ export interface IdentityV2Interface extends ethers.utils.Interface {
38
38
  "addWhitelistedWithDIDAndChain(address,string,uint256,uint256)": FunctionFragment;
39
39
  "addrToDID(address)": FunctionFragment;
40
40
  "authenticate(address)": FunctionFragment;
41
+ "authenticateWithTimestamp(address,uint256)": FunctionFragment;
41
42
  "authenticationPeriod()": FunctionFragment;
42
43
  "avatar()": FunctionFragment;
43
44
  "connectAccount(address,bytes,uint256)": FunctionFragment;
@@ -118,6 +119,10 @@ export interface IdentityV2Interface extends ethers.utils.Interface {
118
119
  functionFragment: "authenticate",
119
120
  values: [string]
120
121
  ): string;
122
+ encodeFunctionData(
123
+ functionFragment: "authenticateWithTimestamp",
124
+ values: [string, BigNumberish]
125
+ ): string;
121
126
  encodeFunctionData(
122
127
  functionFragment: "authenticationPeriod",
123
128
  values?: undefined
@@ -299,6 +304,10 @@ export interface IdentityV2Interface extends ethers.utils.Interface {
299
304
  functionFragment: "authenticate",
300
305
  data: BytesLike
301
306
  ): Result;
307
+ decodeFunctionResult(
308
+ functionFragment: "authenticateWithTimestamp",
309
+ data: BytesLike
310
+ ): Result;
302
311
  decodeFunctionResult(
303
312
  functionFragment: "authenticationPeriod",
304
313
  data: BytesLike
@@ -619,6 +628,12 @@ export interface IdentityV2 extends BaseContract {
619
628
  overrides?: Overrides & { from?: string | Promise<string> }
620
629
  ): Promise<ContractTransaction>;
621
630
 
631
+ authenticateWithTimestamp(
632
+ account: string,
633
+ timestamp: BigNumberish,
634
+ overrides?: Overrides & { from?: string | Promise<string> }
635
+ ): Promise<ContractTransaction>;
636
+
622
637
  authenticationPeriod(overrides?: CallOverrides): Promise<[BigNumber]>;
623
638
 
624
639
  avatar(overrides?: CallOverrides): Promise<[string]>;
@@ -843,6 +858,12 @@ export interface IdentityV2 extends BaseContract {
843
858
  overrides?: Overrides & { from?: string | Promise<string> }
844
859
  ): Promise<ContractTransaction>;
845
860
 
861
+ authenticateWithTimestamp(
862
+ account: string,
863
+ timestamp: BigNumberish,
864
+ overrides?: Overrides & { from?: string | Promise<string> }
865
+ ): Promise<ContractTransaction>;
866
+
846
867
  authenticationPeriod(overrides?: CallOverrides): Promise<BigNumber>;
847
868
 
848
869
  avatar(overrides?: CallOverrides): Promise<string>;
@@ -1040,6 +1061,12 @@ export interface IdentityV2 extends BaseContract {
1040
1061
 
1041
1062
  authenticate(account: string, overrides?: CallOverrides): Promise<void>;
1042
1063
 
1064
+ authenticateWithTimestamp(
1065
+ account: string,
1066
+ timestamp: BigNumberish,
1067
+ overrides?: CallOverrides
1068
+ ): Promise<void>;
1069
+
1043
1070
  authenticationPeriod(overrides?: CallOverrides): Promise<BigNumber>;
1044
1071
 
1045
1072
  avatar(overrides?: CallOverrides): Promise<string>;
@@ -1338,6 +1365,12 @@ export interface IdentityV2 extends BaseContract {
1338
1365
  overrides?: Overrides & { from?: string | Promise<string> }
1339
1366
  ): Promise<BigNumber>;
1340
1367
 
1368
+ authenticateWithTimestamp(
1369
+ account: string,
1370
+ timestamp: BigNumberish,
1371
+ overrides?: Overrides & { from?: string | Promise<string> }
1372
+ ): Promise<BigNumber>;
1373
+
1341
1374
  authenticationPeriod(overrides?: CallOverrides): Promise<BigNumber>;
1342
1375
 
1343
1376
  avatar(overrides?: CallOverrides): Promise<BigNumber>;
@@ -1562,6 +1595,12 @@ export interface IdentityV2 extends BaseContract {
1562
1595
  overrides?: Overrides & { from?: string | Promise<string> }
1563
1596
  ): Promise<PopulatedTransaction>;
1564
1597
 
1598
+ authenticateWithTimestamp(
1599
+ account: string,
1600
+ timestamp: BigNumberish,
1601
+ overrides?: Overrides & { from?: string | Promise<string> }
1602
+ ): Promise<PopulatedTransaction>;
1603
+
1565
1604
  authenticationPeriod(
1566
1605
  overrides?: CallOverrides
1567
1606
  ): Promise<PopulatedTransaction>;