@gooddollar/goodprotocol 2.0.7-beta.3 → 2.0.7

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 (191) hide show
  1. package/artifacts/abis/BuyGDClone.min.json +1 -1
  2. package/artifacts/abis/BuyGDCloneFactory.min.json +1 -1
  3. package/artifacts/abis/IStaticOracle.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/Faucet.sol/Faucet.json +2 -2
  35. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  36. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  37. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +2 -2
  38. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  39. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  43. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  44. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  45. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  46. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  47. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  48. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  49. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  50. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  51. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  52. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  94. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  95. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  96. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  97. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  98. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  99. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  100. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  101. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  102. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  103. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  104. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  105. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  106. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  107. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  108. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  109. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  110. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  111. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  112. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  113. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  114. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  115. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  116. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  117. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  118. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  119. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  120. package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
  121. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  127. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  129. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  130. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  131. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  132. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  133. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  134. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  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/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  141. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +68 -24
  142. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  143. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +7 -12
  144. package/artifacts/contracts/utils/BuyGDClone.sol/IStaticOracle.dbg.json +4 -0
  145. package/artifacts/contracts/utils/BuyGDClone.sol/IStaticOracle.json +79 -0
  146. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
  147. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  148. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  149. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  150. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  151. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  152. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  153. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  154. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  155. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  156. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  157. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  158. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  159. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  160. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  161. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  162. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  163. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  164. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  165. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  166. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  167. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  168. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  169. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  170. package/contracts/fuseFaucet/Faucet.sol +0 -1
  171. package/contracts/fuseFaucet/FuseFaucetV2.sol +0 -1
  172. package/contracts/utils/BuyGDClone.sol +162 -24
  173. package/hardhat.config.ts +2 -1
  174. package/package.json +1 -1
  175. package/releases/deploy-settings.json +3 -0
  176. package/releases/deployment.json +13 -0
  177. package/scripts/analytics/faucetStats.ts +61 -17
  178. package/scripts/multichain-deploy/1_basicdao-deploy.ts +20 -12
  179. package/scripts/multichain-deploy/3_gdSavings-deploy.ts +16 -88
  180. package/scripts/upgrades/multichain-temp-fix.ts +6 -3
  181. package/truffle-config.js +4 -0
  182. package/types/BuyGDClone.ts +104 -28
  183. package/types/BuyGDCloneFactory.ts +9 -40
  184. package/types/IStaticOracle.ts +170 -0
  185. package/types/factories/BuyGDCloneFactory__factory.ts +16 -12
  186. package/types/factories/BuyGDClone__factory.ts +76 -23
  187. package/types/factories/Faucet__factory.ts +1 -1
  188. package/types/factories/FuseFaucetV2__factory.ts +1 -1
  189. package/types/factories/IStaticOracle__factory.ts +91 -0
  190. package/types/hardhat.d.ts +9 -0
  191. package/types/index.ts +2 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddollar/goodprotocol",
3
- "version": "2.0.7-beta.3",
3
+ "version": "2.0.7",
4
4
  "description": "GoodDollar Protocol",
5
5
  "engines": {
6
6
  "node": "18.x"
@@ -207,6 +207,9 @@
207
207
  },
208
208
  "uniswapRouter": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
209
209
  },
210
+ "goerli": {
211
+ "superfluidHost": "0x22ff293e14F1EC3A09B137e9e06084AFd63adDF9"
212
+ },
210
213
  "development-goerli": {
211
214
  "superfluidHost": "0x22ff293e14F1EC3A09B137e9e06084AFd63adDF9"
212
215
  },
@@ -561,5 +561,18 @@
561
561
  "SuperFluidHost": "0x14764E92A63e73a2Dac1fF08F35A64647fB50C91",
562
562
  "UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4",
563
563
  "GDFaucet": "0x8986F9C6b3D0b9A8b92ef7f1eF7EB9e767D414e1"
564
+ },
565
+ "goerli": {
566
+ "ProxyFactory": "0xeCC2b6423A833bFE556E520d55191c8daD31f1E0",
567
+ "Identity": "0x6dB189E677EEaB0833C6693DFeaa979e37447eee",
568
+ "DAOCreator": "0x16985787b2c032a68E24dE1D7DbCeFF10685Bc96",
569
+ "FeeFormula": "0x93B29D34f1FCBCED99509b31fF4557ad5a32798f",
570
+ "GoodDollar": "0x03d3daB843e6c03b3d271eff9178e6A96c28D25f",
571
+ "Avatar": "0x972F855bAa27B3E04b48f3868ffa1AB35405F79B",
572
+ "Controller": "0xe9868c10eED2B6832DfB84b708843e5D5F5E923f",
573
+ "NameService": "0x17611D613268A2A017f51c72df98B1dE0A5AB407",
574
+ "GReputation": "0x3647469733C01713A7d9bdf6834bd4aBd59D66fa",
575
+ "GoodDollarMintBurnWrapper": "0x69d9c8d240E282a4ec0058CF0AC4E9D8ac7a11ac",
576
+ "GoodDollarStaking": "0xC9a3DdadC753e6a7675Aa125991096623d06c437"
564
577
  }
565
578
  }
@@ -2,9 +2,8 @@ import { range, sortBy, toPairs } from "lodash";
2
2
  import PromisePool from "async-promise-pool";
3
3
  import fs from "fs";
4
4
  import { ethers } from "hardhat";
5
- import { start } from "repl";
6
5
  import { JsonRpcProvider } from "@ethersproject/providers";
7
- import { off } from "process";
6
+ import fetch from "node-fetch";
8
7
 
9
8
  function arrayToCsv(data) {
10
9
  return data
@@ -19,48 +18,88 @@ function arrayToCsv(data) {
19
18
  .join("\r\n"); // rows starting on new lines
20
19
  }
21
20
 
22
- const main = async () => {
23
- const archive = new JsonRpcProvider("https://explorer-node.fuse.io");
21
+ const celoStats = async () => {};
22
+ const main = async (isCelo = true) => {
23
+ const archive = new JsonRpcProvider(
24
+ isCelo
25
+ ? "https://celo-mainnet-archive.allthatnode.com"
26
+ : "https://explorer-node.fuse.io"
27
+ );
28
+ const faucetAddr = isCelo
29
+ ? "0x4F93Fa058b03953C851eFaA2e4FC5C34afDFAb84"
30
+ : "0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9";
31
+
32
+ const adminAddr = "0x7119CD89D4792aF90277d84cDffa3F2Ab22a0022";
24
33
  const blockStep = 10000;
25
- const pool = new PromisePool({ concurrency: 10 });
34
+ const pool = new PromisePool({ concurrency: 5 });
26
35
 
27
36
  let faucet = await ethers.getContractAt(
28
- ["event WalletTopped(address indexed user, uint256 amount)"],
29
- "0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9"
37
+ [
38
+ "event WalletTopped(address indexed account, uint256 amount,address whitelistedRoot,address indexed relayerOrWhitelisted)"
39
+ ],
40
+ faucetAddr
30
41
  );
31
42
  const endBlock = Number(await ethers.provider.getBlockNumber());
32
- const daysBack = 30;
43
+ const daysBack = 60;
33
44
  const dayBlocks = 12 * 60 * 24;
34
45
  const startBlock = endBlock - dayBlocks * daysBack;
35
46
  const days = range(startBlock, endBlock, dayBlocks);
36
47
  const dailyBalance = [];
48
+ const dailyAdminBalance = [];
37
49
  for (let day of days) {
38
50
  dailyBalance.push(
39
- (await archive.getBalance("0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9", day)).div(1e10).toNumber() / 1e8
51
+ (await archive.getBalance(faucetAddr, day)).div(1e10).toNumber() / 1e8
52
+ // isCelo
53
+ // ?
54
+ // await fetch(
55
+ // `https://api.celoscan.io/api?module=account&action=balance&address=${faucetAddr}&tag=${day}&apikey=${process.env.CELOSCAN_KEY}`
56
+ // )
57
+ // .then(_ => _.json())
58
+ // .then(_ => _.result)
59
+ // : (await archive.getBalance(faucetAddr, day)).div(1e10).toNumber() / 1e8
40
60
  );
41
61
  }
42
- let curBlock = startBlock;
43
62
 
63
+ for (let day of days) {
64
+ dailyAdminBalance.push(
65
+ (await archive.getBalance(adminAddr, day)).div(1e10).toNumber() / 1e8
66
+ );
67
+ }
68
+ let curBlock = startBlock;
44
69
  const toppingsByAddress = {};
45
70
  const toppingsByAmount = {};
71
+ const toppingsByRelayer = {};
46
72
  let totalToppings = 0;
47
73
  let totalAmount = 0;
48
- console.log({ dailyBalance });
74
+ const dailyUsage = dailyBalance.map((v, i) =>
75
+ i < dailyBalance.length - 1 ? v - dailyBalance[i + 1] : 0
76
+ );
77
+ const dailyAdminUsage = dailyAdminBalance.map((v, i) =>
78
+ i < dailyAdminBalance.length - 1 ? v - dailyAdminBalance[i + 1] : 0
79
+ );
80
+ console.log({ dailyUsage, dailyAdminUsage });
49
81
  console.log({ startBlock, endBlock });
50
82
  while (curBlock <= endBlock) {
51
83
  const fromBlock = curBlock;
52
84
  const toBlock = Math.min(fromBlock + blockStep, endBlock);
53
85
  pool.add(async () => {
54
86
  const f = faucet.filters.WalletTopped();
55
- const events = await faucet.queryFilter(f, fromBlock, toBlock).catch(e => {
56
- console.log("failed", { fromBlock, toBlock });
57
- return [];
58
- });
87
+ const events = await faucet
88
+ .queryFilter(f, fromBlock, toBlock)
89
+ .catch(e => {
90
+ console.log("failed", { fromBlock, toBlock });
91
+ return [];
92
+ });
59
93
  events.forEach(e => {
60
94
  totalToppings += 1;
61
95
  totalAmount += Number(e.args.amount);
62
- toppingsByAddress[e.args.user] = (toppingsByAddress[e.args.user] || 0) + 1;
63
- toppingsByAmount[e.args.amount] = (toppingsByAmount[e.args.amount] || 0) + 1;
96
+ toppingsByAddress[e.args.whitelistedRoot] =
97
+ (toppingsByAddress[e.args.whitelistedRoot] || 0) + 1;
98
+ if (e.args.account !== e.args.relayerOrWhitelisted)
99
+ toppingsByRelayer[e.args.relayerOrWhitelisted] =
100
+ (toppingsByRelayer[e.args.relayerOrWhitelisted] || 0) + 1;
101
+ toppingsByAmount[e.args.amount] =
102
+ (toppingsByAmount[e.args.amount] || 0) + 1;
64
103
  });
65
104
  console.log("fetched events", {
66
105
  fromBlock,
@@ -74,13 +113,18 @@ const main = async () => {
74
113
 
75
114
  const topToppers = sortBy(toPairs(toppingsByAddress), "1").reverse();
76
115
  const topAmounts = sortBy(toPairs(toppingsByAmount), "1").reverse();
116
+ const topRelayers = sortBy(toPairs(toppingsByRelayer), "1").reverse();
117
+
77
118
  const totalWallets = topToppers.length;
78
119
 
79
120
  const avgToppingsPerWallet = totalToppings / totalWallets;
80
121
  const avgToppingAmount = totalAmount / totalToppings;
81
122
 
123
+ console.log(topRelayers.slice(0, 50));
82
124
  fs.writeFileSync("topToppers.csv", arrayToCsv(topToppers));
83
125
  fs.writeFileSync("topAmounts.csv", arrayToCsv(topAmounts));
126
+ fs.writeFileSync("topRelayers.csv", arrayToCsv(topRelayers));
127
+
84
128
  console.log({
85
129
  totalAmount,
86
130
  totalToppings,
@@ -56,20 +56,28 @@ export const createDAO = async () => {
56
56
  const salt = ethers.BigNumber.from(ethers.utils.keccak256(ethers.utils.toUtf8Bytes("NameService")));
57
57
  const nameserviceFutureAddress = await proxyFactory["getDeploymentAddress(uint256,address)"](salt, root.address);
58
58
  console.log("deploying identity", { nameserviceFutureAddress });
59
- const Identity = (await deployDeterministic(
60
- {
61
- name: "IdentityV2",
62
- salt: "Identity",
63
- isUpgradeable: true
64
- },
65
- [root.address, ethers.constants.AddressZero]
66
- ).then(printDeploy)) as Contract;
59
+ let Identity;
60
+ if (release.Identity) Identity = await ethers.getContractAt("IdentityV2", release.Identity);
61
+ else
62
+ Identity = (await deployDeterministic(
63
+ {
64
+ name: "IdentityV2",
65
+ salt: "Identity",
66
+ isUpgradeable: true
67
+ },
68
+ [root.address, ethers.constants.AddressZero]
69
+ ).then(printDeploy)) as Contract;
67
70
 
68
- const daoCreator = (await DAOCreatorFactory.deploy().then(printDeploy)) as Contract;
71
+ let daoCreator;
72
+ if (release.DAOCreator) daoCreator = await DAOCreatorFactory.attach(release.DAOCreator);
73
+ else daoCreator = (await DAOCreatorFactory.deploy().then(printDeploy)) as Contract;
69
74
 
70
- const FeeFormula = (await deployDeterministic({ name: "FeeFormula", factory: FeeFormulaFactory }, [0]).then(
71
- printDeploy
72
- )) as Contract;
75
+ let FeeFormula;
76
+ if (release.FeeFormula) FeeFormula = await FeeFormulaFactory.attach(release.FeeFormula);
77
+ else
78
+ FeeFormula = (await deployDeterministic({ name: "FeeFormula", factory: FeeFormulaFactory }, [0]).then(
79
+ printDeploy
80
+ )) as Contract;
73
81
 
74
82
  let GoodDollar;
75
83
  if (protocolSettings.superfluidHost) {
@@ -32,11 +32,7 @@ import releaser from "../../scripts/releaser";
32
32
  import ProtocolSettings from "../../releases/deploy-settings.json";
33
33
  import dao from "../../releases/deployment.json";
34
34
  import { deployWrapper } from "./multichainWrapper-deploy";
35
- import {
36
- GoodDollarMintBurnWrapper,
37
- Controller,
38
- NameService
39
- } from "../../types";
35
+ import { GoodDollarMintBurnWrapper, Controller, NameService } from "../../types";
40
36
  const { name: networkName } = network;
41
37
 
42
38
  export const deploySidechain = async () => {
@@ -46,30 +42,18 @@ export const deploySidechain = async () => {
46
42
  if (isProduction) verifyProductionSigner(root);
47
43
 
48
44
  let release: { [key: string]: any } = dao[networkName];
49
- let settings = defaultsDeep(
50
- {},
51
- ProtocolSettings[networkName],
52
- ProtocolSettings["default"]
53
- );
45
+ let settings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
54
46
 
55
47
  console.log("got signers:", {
56
48
  networkName,
57
49
  root: root.address,
58
- balance: await ethers.provider
59
- .getBalance(root.address)
60
- .then(_ => _.toString())
50
+ balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
61
51
  });
62
52
 
63
53
  let Wrapper;
64
- if (!release.GoodDollarMintBurnWrapper)
65
- Wrapper = (await deployWrapper(
66
- release.Avatar
67
- )) as GoodDollarMintBurnWrapper;
54
+ if (!release.GoodDollarMintBurnWrapper) Wrapper = (await deployWrapper(release.Avatar)) as GoodDollarMintBurnWrapper;
68
55
  else {
69
- Wrapper = await ethers.getContractAt(
70
- "GoodDollarMintBurnWrapper",
71
- release.GoodDollarMintBurnWrapper
72
- );
56
+ Wrapper = await ethers.getContractAt("GoodDollarMintBurnWrapper", release.GoodDollarMintBurnWrapper);
73
57
  }
74
58
 
75
59
  console.log("deploying savings...");
@@ -95,28 +79,15 @@ export const deploySidechain = async () => {
95
79
 
96
80
  await releaser(torelease, networkName, "deployment", false);
97
81
  } else {
98
- GDSavings = await ethers.getContractAt(
99
- "GoodDollarStaking",
100
- release.GoodDollarStaking
101
- );
82
+ GDSavings = await ethers.getContractAt("GoodDollarStaking", release.GoodDollarStaking);
102
83
  }
103
84
  if (networkName.includes("production"))
104
- return console.log(
105
- "Skipping proposal/upgrade for production, need to perform manually"
106
- );
85
+ return console.log("Skipping proposal/upgrade for production, need to perform manually");
107
86
 
108
- await executeProposal(
109
- GDSavings.address,
110
- Wrapper.address,
111
- settings.guardiansSafe
112
- );
87
+ await executeProposal(GDSavings.address, Wrapper.address, settings.guardiansSafe);
113
88
  };
114
89
 
115
- const executeProposal = async (
116
- savingsAddress: string,
117
- wrapperAddress: string,
118
- guardiansSafe: string
119
- ) => {
90
+ const executeProposal = async (savingsAddress: string, wrapperAddress: string, guardiansSafe: string) => {
120
91
  console.log("executing savings + wrapper proposal");
121
92
  const isProduction = networkName.includes("production");
122
93
  const viaGuardians = false;
@@ -134,15 +105,9 @@ const executeProposal = async (
134
105
  // ? new ethers.Wallet(process.env.PROPOSER_KEY, ethers.provider)
135
106
  // : root; //need proposer with 0.3% of GOOD tokens
136
107
 
137
- const ctrl = (await ethers.getContractAt(
138
- "Controller",
139
- release.Controller
140
- )) as Controller;
108
+ const ctrl = (await ethers.getContractAt("Controller", release.Controller)) as Controller;
141
109
 
142
- const ns = (await ethers.getContractAt(
143
- "NameService",
144
- release.NameService
145
- )) as NameService;
110
+ const ns = (await ethers.getContractAt("NameService", release.NameService)) as NameService;
146
111
 
147
112
  const proposalContracts = [
148
113
  wrapperAddress, //MinterWrapper -> add GDSavings
@@ -162,16 +127,7 @@ const executeProposal = async (
162
127
 
163
128
  const proposalFunctionInputs = [
164
129
  ethers.utils.defaultAbiCoder.encode(
165
- [
166
- "address",
167
- "uint256",
168
- "uint256",
169
- "uint32",
170
- "uint256",
171
- "uint256",
172
- "uint32",
173
- "bool"
174
- ],
130
+ ["address", "uint256", "uint256", "uint32", "uint256", "uint256", "uint32", "bool"],
175
131
  [savingsAddress, 0, 0, 30, 0, 0, 0, true]
176
132
  ), //function addMinter(
177
133
  ethers.utils.defaultAbiCoder.encode(
@@ -192,10 +148,7 @@ const executeProposal = async (
192
148
  release.Avatar
193
149
  ]
194
150
  ),
195
- ethers.utils.defaultAbiCoder.encode(
196
- ["string", "address"],
197
- ["MINTBURN_WRAPPER", wrapperAddress]
198
- )
151
+ ethers.utils.defaultAbiCoder.encode(["string", "address"], ["MINTBURN_WRAPPER", wrapperAddress])
199
152
  ];
200
153
 
201
154
  if (!viaGuardians) {
@@ -218,36 +171,11 @@ const executeProposal = async (
218
171
  proposalFunctionInputs,
219
172
  guardiansSafe
220
173
  );
221
-
222
- // const vm = (await ethers.getContractAt(
223
- // "CompoundVotingMachine",
224
- // release.CompoundVotingMachine
225
- // )) as CompoundVotingMachine;
226
-
227
- // await vm
228
- // .connect(proposer)
229
- // ["propose(address[],uint256[],string[],bytes[],string)"](
230
- // proposalContracts,
231
- // proposalEthValues,
232
- // proposalFunctionSignatures,
233
- // proposalFunctionInputs,
234
- // "https://discourse.gooddollar.org/t/gip-5-allocating-part-of-ubi-inflation-towards-g-savings-account/114/20"
235
- // )
236
- // .then(printDeploy);
237
174
  }
238
175
 
239
- const Controller = await ethers.getContractAt(
240
- "Controller",
241
- release.Controller
242
- );
243
- const wrapperDaoPermissions = await Controller.getSchemePermissions(
244
- wrapperAddress,
245
- release.Avatar
246
- );
247
- const savingsDaoPermissions = await Controller.getSchemePermissions(
248
- savingsAddress,
249
- release.Avatar
250
- );
176
+ const Controller = await ethers.getContractAt("Controller", release.Controller);
177
+ const wrapperDaoPermissions = await Controller.getSchemePermissions(wrapperAddress, release.Avatar);
178
+ const savingsDaoPermissions = await Controller.getSchemePermissions(savingsAddress, release.Avatar);
251
179
 
252
180
  console.log({
253
181
  wrapperDaoPermissions,
@@ -9,7 +9,6 @@
9
9
  import { network, ethers } from "hardhat";
10
10
  import { Contract } from "ethers";
11
11
  import { defaultsDeep } from "lodash";
12
-
13
12
  import { printDeploy, executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
14
13
 
15
14
  import ProtocolSettings from "../../releases/deploy-settings.json";
@@ -54,8 +53,12 @@ export const upgrade = async () => {
54
53
 
55
54
  let f = await ethers.getContractFactory("GoodFundManager");
56
55
  console.log("bytecode", f.bytecode.length);
57
- let newDistHelper = (await ethers.deployContract("DistributionHelper").then(printDeploy)) as Contract;
58
-
56
+ // let newDistHelper = (await ethers
57
+ // .deployContract("DistributionHelper", { maxFeePerGas: 22e9, nonce: 118 })
58
+ // .then(printDeploy)) as Contract;
59
+ let newDistHelper = (await (await ethers.getContractFactory("DistributionHelper"))
60
+ .deploy({ maxFeePerGas: 15e9, maxPriorityFeePerGas: 1e9 })
61
+ .then(printDeploy)) as Contract;
59
62
  if (isProduction) await verifyContract(newDistHelper, "GoodReserveCDai", networkName);
60
63
 
61
64
  const proposalContracts = [
package/truffle-config.js CHANGED
@@ -58,6 +58,10 @@ module.exports = {
58
58
  // },
59
59
  // Useful for deploying to a public network.
60
60
  // NB: It's important to wrap the provider as a function.
61
+ "production-mainnet": {
62
+ provider: () => new Web3.providers.HttpProvider(`https://cloudflare-eth.com`),
63
+ network_id: 1
64
+ },
61
65
  kovan: {
62
66
  provider: () => new Web3.providers.HttpProvider(`https://ropsten.infura.io/v3/YOUR-PROJECT-ID`),
63
67
  network_id: 42, // Ropsten's id