@gooddollar/goodprotocol 2.0.11 → 2.0.13

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 (178) hide show
  1. package/artifacts/abis/AdminWallet.min.json +1 -1
  2. package/artifacts/abis/AdminWalletFuse.min.json +1 -1
  3. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  9. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  32. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  33. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  34. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  35. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  36. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  37. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  38. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  39. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  43. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  44. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  45. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  46. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  47. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  48. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  49. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  50. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  91. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  92. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  93. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  94. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  95. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  96. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  97. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  98. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  99. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  100. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  101. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  102. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  103. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  104. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  105. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  106. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  107. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  108. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  109. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  110. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  111. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  112. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  113. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  114. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  115. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  116. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  117. package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
  118. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  119. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  120. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  121. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  127. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  129. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  130. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  131. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  132. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  133. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +41 -2
  134. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  135. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +35 -9
  136. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  137. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  138. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  139. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  140. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  141. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
  142. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  143. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  144. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  145. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  146. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  147. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  148. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  149. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  150. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  151. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  152. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  153. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  154. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  155. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  156. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  157. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  158. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  159. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  160. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  161. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  162. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  163. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  164. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  165. package/contracts/utils/AdminWallet.sol +21 -10
  166. package/contracts/utils/AdminWalletFuse.sol +19 -14
  167. package/hardhat.config.ts +4 -0
  168. package/package.json +1 -1
  169. package/releases/deployment.json +4 -2
  170. package/scripts/analytics/checkActiveWallets.ts +60 -0
  171. package/scripts/analytics/faucetStats.ts +21 -34
  172. package/scripts/multichain-deploy/helpers.ts +2 -2
  173. package/scripts/upgrades/upgradeAdminWallet.ts +29 -0
  174. package/test/utils/AdminWallet.test.ts +49 -101
  175. package/types/AdminWallet.ts +59 -0
  176. package/types/AdminWalletFuse.ts +41 -7
  177. package/types/factories/AdminWalletFuse__factory.ts +34 -8
  178. package/types/factories/AdminWallet__factory.ts +40 -1
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/d308c8e08310937e3b977036ce06818f.json"
3
+ "buildInfo": "../../../build-info/d1a1b9bacf6575ad55220ad8bb464f22.json"
4
4
  }
@@ -34,6 +34,9 @@ contract AdminWallet is
34
34
  uint64 public maxDailyNewWallets;
35
35
  uint64 public day;
36
36
 
37
+ ERC20 public gd;
38
+ mapping(address => uint256) public lastGdBalance; // only top non whitelisted if active G$ users
39
+
37
40
  event AdminsAdded(address payable[] indexed admins);
38
41
  event AdminsRemoved(address[] indexed admins);
39
42
  event WalletTopped(address indexed user, uint256 amount);
@@ -63,6 +66,7 @@ contract AdminWallet is
63
66
  addAdmins(_admins);
64
67
  }
65
68
  if (msg.sender != _owner) revokeRole(DEFAULT_ADMIN_ROLE, msg.sender);
69
+ gd = ERC20(nameService.getAddress("GOODDOLLAR"));
66
70
  }
67
71
 
68
72
  modifier onlyOwner() {
@@ -70,6 +74,10 @@ contract AdminWallet is
70
74
  _;
71
75
  }
72
76
 
77
+ function upgrade() public onlyOwner {
78
+ gd = ERC20(nameService.getAddress("GOODDOLLAR"));
79
+ }
80
+
73
81
  function getIdentity() public view returns (IIdentityV2) {
74
82
  return IIdentityV2(nameService.getAddress("IDENTITY"));
75
83
  }
@@ -95,11 +103,9 @@ contract AdminWallet is
95
103
  toppingTimes = _toppingTimes;
96
104
  }
97
105
 
98
- function _authorizeUpgrade(address newImplementation)
99
- internal
100
- override
101
- onlyOwner
102
- {}
106
+ function _authorizeUpgrade(
107
+ address newImplementation
108
+ ) internal override onlyOwner {}
103
109
 
104
110
  /* @dev Modifier that checks if caller is admin of wallet
105
111
  */
@@ -180,11 +186,10 @@ contract AdminWallet is
180
186
  /* @dev Function to add given address to whitelist of identity contract
181
187
  * can only be done by admins of wallet and if wallet is an IdentityAdmin
182
188
  */
183
- function whitelist(address _user, string memory _did)
184
- public
185
- onlyAdmin
186
- reimburseGas
187
- {
189
+ function whitelist(
190
+ address _user,
191
+ string memory _did
192
+ ) public onlyAdmin reimburseGas {
188
193
  getIdentity().addWhitelistedWithDID(_user, _did);
189
194
  }
190
195
 
@@ -231,10 +236,16 @@ contract AdminWallet is
231
236
  * @param _user The address to transfer to
232
237
  */
233
238
  function topWallet(address payable _user) public onlyAdmin reimburseGas {
239
+ uint256 gdBalance = gd.balanceOf(_user);
240
+ require(
241
+ getIdentity().isWhitelisted(_user) || gdBalance != lastGdBalance[_user],
242
+ "User has not used G$"
243
+ );
234
244
  require(
235
245
  toppings[currentDay()][_user] < toppingTimes,
236
246
  "User wallet has been topped too many times today"
237
247
  );
248
+ lastGdBalance[_user] = gdBalance;
238
249
  if (address(_user).balance >= toppingAmount / 4) return;
239
250
 
240
251
  _topWallet(_user);
@@ -39,6 +39,9 @@ contract AdminWalletFuse is
39
39
 
40
40
  uint32 public version;
41
41
 
42
+ ERC20 public gd;
43
+ mapping(address => uint256) public lastGdBalance; // only top non whitelisted if active G$ users
44
+
42
45
  event AdminsAdded(address payable[] indexed admins);
43
46
  event AdminsRemoved(address[] indexed admins);
44
47
  event WalletTopped(address indexed user, uint256 amount);
@@ -68,12 +71,11 @@ contract AdminWalletFuse is
68
71
  if (_admins.length > 0) {
69
72
  addAdmins(_admins);
70
73
  }
74
+ gd = ERC20(nameService.getAddress("GOODDOLLAR"));
71
75
  }
72
76
 
73
- function upgrade(NameService _ns) public {
74
- require(version == 0, "already upgraded");
75
- version++;
76
- nameService = _ns;
77
+ function upgrade() public onlyOwner {
78
+ gd = ERC20(nameService.getAddress("GOODDOLLAR"));
77
79
  }
78
80
 
79
81
  function getIdentity() public view returns (IIdentityV2) {
@@ -101,11 +103,9 @@ contract AdminWalletFuse is
101
103
  toppingTimes = _toppingTimes;
102
104
  }
103
105
 
104
- function _authorizeUpgrade(address newImplementation)
105
- internal
106
- override
107
- onlyOwner
108
- {}
106
+ function _authorizeUpgrade(
107
+ address newImplementation
108
+ ) internal override onlyOwner {}
109
109
 
110
110
  /* @dev Modifier that checks if caller is admin of wallet
111
111
  */
@@ -186,11 +186,10 @@ contract AdminWalletFuse is
186
186
  /* @dev Function to add given address to whitelist of identity contract
187
187
  * can only be done by admins of wallet and if wallet is an IdentityAdmin
188
188
  */
189
- function whitelist(address _user, string memory _did)
190
- public
191
- onlyAdmin
192
- reimburseGas
193
- {
189
+ function whitelist(
190
+ address _user,
191
+ string memory _did
192
+ ) public onlyAdmin reimburseGas {
194
193
  getIdentity().addWhitelistedWithDID(_user, _did);
195
194
  }
196
195
 
@@ -237,10 +236,16 @@ contract AdminWalletFuse is
237
236
  * @param _user The address to transfer to
238
237
  */
239
238
  function topWallet(address payable _user) public onlyAdmin reimburseGas {
239
+ uint256 gdBalance = gd.balanceOf(_user);
240
+ require(
241
+ getIdentity().isWhitelisted(_user) || gdBalance != lastGdBalance[_user],
242
+ "User has not used G$"
243
+ );
240
244
  require(
241
245
  toppings[currentDay()][_user] < toppingTimes,
242
246
  "User wallet has been topped too many times today"
243
247
  );
248
+ lastGdBalance[_user] = gdBalance;
244
249
  if (address(_user).balance >= toppingAmount / 4) return;
245
250
 
246
251
  _topWallet(_user);
package/hardhat.config.ts CHANGED
@@ -100,6 +100,10 @@ const hhconfig: HardhatUserConfig = {
100
100
  url: "https://eth-mainnet.alchemyapi.io/v2/" + process.env.ALCHEMY_KEY
101
101
  }
102
102
  },
103
+ fork: {
104
+ chainId: 1,
105
+ url: "https://rpc.vnet.tenderly.co/devnet/reserve-ujpgrade/9f79f839-996c-495a-b470-c0237eede293"
106
+ },
103
107
  test: {
104
108
  allowUnlimitedContractSize: true,
105
109
  url: "http://127.0.0.1:8545/"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddollar/goodprotocol",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "GoodDollar Protocol",
5
5
  "engines": {
6
6
  "node": "18.x"
@@ -482,7 +482,7 @@
482
482
  "SwapHelper": "0xE45CaB86609a16dFaDec112FDd61E4EA80EdaA8D",
483
483
  "UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4",
484
484
  "StaticOracle": "0x00851A91a3c4E9a4c1B48df827Bacc1f884bdE28",
485
- "BuyGDFactory": "0x85188b32a2322a54f5fD6204013A7b0dAA3EBFef"
485
+ "BuyGDFactory": "0x00e533B7d6255D05b7f15034B1c989c21F51b91C"
486
486
  },
487
487
  "gnosis": {
488
488
  "GuardiansSafe": "0x84c10b45fe51bfb4f86c19a47fdbc187d4572fb8"
@@ -547,7 +547,9 @@
547
547
  "GReputation": "0x0abF3D20fCb33FC03bdF25b042E77edfAeDBBDD3",
548
548
  "FeeFormula": "0x5fAA779cF74a1Ba51909DEeaA0e8900474DA77Cf",
549
549
  "DAOCreator": "0xc66c970a6d99da587a7d7fa7d5383b401c3e87f4",
550
- "OneTimePaymentsV2": "0x4E8112430974b4CE87283221a11BDC52097e7e2e"
550
+ "OneTimePaymentsV2": "0x4E8112430974b4CE87283221a11BDC52097e7e2e",
551
+ "network": "development-goerli",
552
+ "networkId": 5
551
553
  },
552
554
  "alfajores": {
553
555
  "network": "alfajores",
@@ -0,0 +1,60 @@
1
+ import { countBy, chunk, difference, flatten, sortBy } from "lodash";
2
+ import fs from "fs";
3
+ import { network, ethers, upgrades } from "hardhat";
4
+ import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
5
+ import Identity from "../../artifacts/contracts/Interfaces.sol/IIdentity.json";
6
+
7
+ setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
8
+
9
+ setMulticallAddress(42220, "0x188C1bf697B66474dC3eaa119Ae691a8352537e3");
10
+
11
+ const fuseProvider = new ethers.providers.JsonRpcBatchProvider(
12
+ "https://explorer-node.fuse.io/"
13
+ // "https://rpc.fuse.io"
14
+ );
15
+ const celoProvider = new ethers.providers.JsonRpcBatchProvider(
16
+ "https://forno.celo.org"
17
+ // "https://rpc.fuse.io"
18
+ );
19
+ const ethcallProvider = new Provider(fuseProvider, 122);
20
+ const ethcallProviderCelo = new Provider(celoProvider, 42220);
21
+
22
+ const GD_FUSE = "0x495d133b938596c9984d462f007b676bdc57ecec";
23
+ const GD_CELO = "0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A";
24
+
25
+ const gdMulti = new Contract(GD_FUSE, [
26
+ "event Transfer(address indexed from, address indexed to, uint amount)",
27
+ "function balanceOf(address) view returns(uint256)"
28
+ ]);
29
+ const gdMultiCelo = new Contract(GD_CELO, [
30
+ "event Transfer(address indexed from, address indexed to, uint amount)",
31
+ "function balanceOf(address) view returns(uint256)"
32
+ ]);
33
+
34
+ const hasBalance = async wallets => {
35
+ console.log("checking balances for:", wallets.length);
36
+ const chunks = chunk(wallets, 100);
37
+ let balances = {};
38
+ let users = [];
39
+ for (let batch of chunks) {
40
+ const calls = batch.map(a => gdMultiCelo.balanceOf(a));
41
+ const result = await ethcallProviderCelo.all(calls);
42
+ const found = batch.filter((d, i) => result[i] > 0);
43
+ console.log("batch:", batch.length, calls.length, result.length, found.length);
44
+ users = users.concat(found);
45
+ }
46
+ console.log("got balances for:", Object.entries(balances).length, "found users:", users.length);
47
+ console.log(users);
48
+ };
49
+
50
+ const main = async () => {
51
+ const wallets = fs
52
+ .readFileSync("accounts.csv")
53
+ .toString()
54
+ .split("\n")
55
+ .map(l => l.split(",")[0])
56
+ .filter(a => a.startsWith("0x"));
57
+
58
+ const refunded = await hasBalance(wallets);
59
+ };
60
+ main().catch(e => console.log(e));
@@ -21,9 +21,7 @@ function arrayToCsv(data) {
21
21
  const celoStats = async () => {};
22
22
  const main = async (isCelo = true) => {
23
23
  const archive = new JsonRpcProvider(
24
- isCelo
25
- ? "https://celo-mainnet-archive.allthatnode.com"
26
- : "https://explorer-node.fuse.io"
24
+ isCelo ? "https://celo-mainnet-archive.allthatnode.com" : "https://explorer-node.fuse.io"
27
25
  );
28
26
  const faucetAddr = isCelo
29
27
  ? "0x4F93Fa058b03953C851eFaA2e4FC5C34afDFAb84"
@@ -39,31 +37,24 @@ const main = async (isCelo = true) => {
39
37
  ],
40
38
  faucetAddr
41
39
  );
42
- const endBlock = Number(await ethers.provider.getBlockNumber());
43
- const daysBack = 60;
40
+ const endBlock = Number(await archive.getBlockNumber());
41
+ const daysBack = 90;
44
42
  const dayBlocks = 12 * 60 * 24;
45
43
  const startBlock = endBlock - dayBlocks * daysBack;
46
44
  const days = range(startBlock, endBlock, dayBlocks);
45
+ console.log({ startBlock, endBlock });
47
46
  const dailyBalance = [];
48
47
  const dailyAdminBalance = [];
49
48
  for (let day of days) {
50
- dailyBalance.push(
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
60
- );
49
+ dailyBalance.push([
50
+ (await archive.getBalance("0x4F93Fa058b03953C851eFaA2e4FC5C34afDFAb84", day)).div(1e10).toNumber() / 1e8,
51
+ (await archive.getBalance("0x7119CD89D4792aF90277d84cDffa3F2Ab22a0022", day)).div(1e10).toNumber() / 1e8
52
+ ]);
53
+ console.log({ day });
61
54
  }
62
55
 
63
56
  for (let day of days) {
64
- dailyAdminBalance.push(
65
- (await archive.getBalance(adminAddr, day)).div(1e10).toNumber() / 1e8
66
- );
57
+ dailyAdminBalance.push((await archive.getBalance(adminAddr, day)).div(1e10).toNumber() / 1e8);
67
58
  }
68
59
  let curBlock = startBlock;
69
60
  const toppingsByAddress = {};
@@ -71,35 +62,31 @@ const main = async (isCelo = true) => {
71
62
  const toppingsByRelayer = {};
72
63
  let totalToppings = 0;
73
64
  let totalAmount = 0;
74
- const dailyUsage = dailyBalance.map((v, i) =>
75
- i < dailyBalance.length - 1 ? v - dailyBalance[i + 1] : 0
76
- );
65
+ const dailyUsage = dailyBalance.map((v, i) => (i < dailyBalance.length - 1 ? v - dailyBalance[i + 1] : 0));
77
66
  const dailyAdminUsage = dailyAdminBalance.map((v, i) =>
78
67
  i < dailyAdminBalance.length - 1 ? v - dailyAdminBalance[i + 1] : 0
79
68
  );
80
69
  console.log({ dailyUsage, dailyAdminUsage });
70
+ fs.writeFileSync("celospend.csv", arrayToCsv(dailyBalance));
71
+ console.log(arrayToCsv(dailyBalance));
72
+ return;
81
73
  console.log({ startBlock, endBlock });
82
74
  while (curBlock <= endBlock) {
83
75
  const fromBlock = curBlock;
84
76
  const toBlock = Math.min(fromBlock + blockStep, endBlock);
85
77
  pool.add(async () => {
86
78
  const f = faucet.filters.WalletTopped();
87
- const events = await faucet
88
- .queryFilter(f, fromBlock, toBlock)
89
- .catch(e => {
90
- console.log("failed", { fromBlock, toBlock });
91
- return [];
92
- });
79
+ const events = await faucet.queryFilter(f, fromBlock, toBlock).catch(e => {
80
+ console.log("failed", { fromBlock, toBlock });
81
+ return [];
82
+ });
93
83
  events.forEach(e => {
94
84
  totalToppings += 1;
95
85
  totalAmount += Number(e.args.amount);
96
- toppingsByAddress[e.args.whitelistedRoot] =
97
- (toppingsByAddress[e.args.whitelistedRoot] || 0) + 1;
86
+ toppingsByAddress[e.args.whitelistedRoot] = (toppingsByAddress[e.args.whitelistedRoot] || 0) + 1;
98
87
  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;
88
+ toppingsByRelayer[e.args.relayerOrWhitelisted] = (toppingsByRelayer[e.args.relayerOrWhitelisted] || 0) + 1;
89
+ toppingsByAmount[e.args.amount] = (toppingsByAmount[e.args.amount] || 0) + 1;
103
90
  });
104
91
  console.log("fetched events", {
105
92
  fromBlock,
@@ -328,11 +328,11 @@ export const executeViaSafe = async (
328
328
  export const verifyContract = async (
329
329
  address,
330
330
  contractName,
331
- networkName,
331
+ networkName = network.name,
332
332
  proxyName?: string,
333
333
  forcedConstructorArguments?: string
334
334
  ) => {
335
- let networkProvider = network.name.includes("-") ? network.name.split("-")[1] : network.name;
335
+ let networkProvider = networkName.includes("-") ? networkName.split("-")[1] : "fuse";
336
336
  networkProvider = networkProvider === "mainnet" ? "ethereum" : networkProvider;
337
337
  console.log("truffle compile...");
338
338
  await exec("npx truffle compile");
@@ -0,0 +1,29 @@
1
+ import { network, ethers } from "hardhat";
2
+ import { Contract } from "ethers";
3
+
4
+ import { printDeploy, verifyProductionSigner } from "../multichain-deploy/helpers";
5
+
6
+ import dao from "../../releases/deployment.json";
7
+ import { verifyContract } from "../multichain-deploy/helpers";
8
+
9
+ let { name: networkName } = network;
10
+
11
+ export const upgrade = async () => {
12
+ const isProduction = networkName.includes("production");
13
+ let [root, ...signers] = await ethers.getSigners();
14
+
15
+ if (isProduction) verifyProductionSigner(root);
16
+
17
+ let guardian = root;
18
+ const isCelo = networkName.includes("celo");
19
+ let release: { [key: string]: any } = dao[networkName];
20
+
21
+ const deployed = await ethers.deployContract(isCelo ? "AdminWallet" : "AdminWalletFuse");
22
+ console.log("new impl:", deployed.address);
23
+ await verifyContract(deployed.address, isCelo ? "AdminWallet" : "AdminWalletFuse", networkName);
24
+ const old = await ethers.getContractAt("AdminWallet", release.AdminWallet);
25
+ await old.upgradeTo(deployed.address).then(printDeploy);
26
+ await deployed.attach(release.AdminWallet).upgrade().then(printDeploy);
27
+ };
28
+
29
+ upgrade().catch(console.log);