@gooddollar/goodprotocol 2.1.3 → 2.2.0-beta.1

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 (318) hide show
  1. package/README.md +0 -2
  2. package/artifacts/abis/IdentityV4.min.json +1 -0
  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/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
  10. package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  36. package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
  37. package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
  38. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
  39. package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
  40. package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
  41. package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
  42. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  43. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  44. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  45. package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
  46. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  47. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  48. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  49. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  50. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
  51. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  52. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  53. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  54. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  55. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  56. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  57. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  58. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  59. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
  60. package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +2 -2
  61. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +4 -0
  62. package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +1162 -0
  63. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  64. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  65. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  66. package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
  78. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
  88. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
  95. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  97. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  100. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  101. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +2 -2
  102. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  103. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  104. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  105. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  106. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  107. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  108. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  109. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  110. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  111. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  112. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  113. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  114. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  115. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  116. package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
  117. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  118. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  119. package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
  120. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  121. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  122. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  123. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  124. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  125. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  126. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  127. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  128. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  129. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  130. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  131. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  132. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  133. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  134. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  135. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  136. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  137. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  138. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  139. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  140. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  141. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  142. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  143. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  144. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  145. package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
  146. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  147. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  148. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  149. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  150. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  151. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  152. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  153. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  154. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  155. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  156. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  157. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  158. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  159. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  160. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  161. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  162. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  163. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  164. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  165. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  166. package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
  167. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  168. package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
  169. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  170. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  171. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  172. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  173. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  174. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  175. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  176. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
  177. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
  178. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
  179. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
  180. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
  181. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
  182. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  183. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  184. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  185. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  186. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  187. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  188. package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
  189. package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.json +2 -2
  190. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  191. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  192. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  193. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  194. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  195. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
  196. package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
  197. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  198. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  199. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  200. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  201. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  202. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  203. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  204. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  205. package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
  206. package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.json +2 -2
  207. package/contracts/identity/IdentityV3.sol +0 -3
  208. package/contracts/identity/IdentityV4.sol +578 -0
  209. package/hardhat.config.ts +3 -4
  210. package/package.json +8 -4
  211. package/test/governance/ClaimersDistribution.test.ts +1 -1
  212. package/test/governance/CompoundVotingMachine.castvote.test.ts +30 -30
  213. package/test/helpers.ts +76 -195
  214. package/test/identity/IdentityV3.test.ts +53 -129
  215. package/test/identity/IdentityV4.test.ts +454 -0
  216. package/test/reserve/GenericDistributionHelper.e2e.test.ts +445 -0
  217. package/test/utils/AdminWallet.test.ts +14 -15
  218. package/types/contracts/identity/IdentityV4.ts +2001 -0
  219. package/types/contracts/identity/index.ts +1 -0
  220. package/types/contracts/utils/UpdateReserveRatio.sol/MentoExchange.ts +81 -0
  221. package/types/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.ts +134 -0
  222. package/types/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
  223. package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts +7 -2
  224. package/types/contracts/utils/index.ts +2 -2
  225. package/types/factories/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking__factory.ts +1 -1
  226. package/types/factories/contracts/identity/IdentityV3__factory.ts +1 -1
  227. package/types/factories/contracts/identity/IdentityV4__factory.ts +1213 -0
  228. package/types/factories/contracts/identity/index.ts +1 -0
  229. package/types/factories/contracts/mocks/DistributionBridgeMock__factory.ts +1 -1
  230. package/types/factories/contracts/mocks/GoodDollarStakingMock__factory.ts +1 -1
  231. package/types/factories/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock__factory.ts +1 -1
  232. package/types/factories/contracts/mocks/StakingMockFixedAPY__factory.ts +1 -1
  233. package/types/factories/contracts/utils/LastauthReduction__factory.ts +1 -1
  234. package/types/factories/contracts/utils/ReserveRestore__factory.ts +1 -1
  235. package/types/factories/contracts/utils/UpdateReserveRatio.sol/MentoExchange__factory.ts +39 -0
  236. package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +113 -0
  237. package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
  238. package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +9 -15
  239. package/types/factories/contracts/utils/index.ts +1 -1
  240. package/types/hardhat.d.ts +13 -4
  241. package/types/index.ts +4 -2
  242. package/scripts/ProxyFactory.json +0 -4425
  243. package/scripts/analytics/activeGDStakers.ts +0 -188
  244. package/scripts/analytics/activeStakers.ts +0 -25
  245. package/scripts/analytics/activeUsersCount.ts +0 -156
  246. package/scripts/analytics/activeWalletsStats.ts +0 -301
  247. package/scripts/analytics/checkActiveWallets.ts +0 -60
  248. package/scripts/analytics/checkBridgeBalances.ts +0 -442
  249. package/scripts/analytics/claimIncidentStats.ts +0 -98
  250. package/scripts/analytics/faucetStats.ts +0 -130
  251. package/scripts/analytics/gdinflow.ts +0 -57
  252. package/scripts/analytics/goodHolders.ts +0 -46
  253. package/scripts/analytics/goodgiveback.ts +0 -64
  254. package/scripts/analytics/p2pTxs.ts +0 -564
  255. package/scripts/analytics/stuckgd.ts +0 -70
  256. package/scripts/analytics/tokenInOutStats.ts +0 -48
  257. package/scripts/analytics/whitelistsyncIssue.ts +0 -87
  258. package/scripts/bulkProof.ts +0 -202
  259. package/scripts/bulkWhitelist.ts +0 -31
  260. package/scripts/deployGnosisSafe.ts +0 -111
  261. package/scripts/fetchOrDeployProxyFactory.ts +0 -46
  262. package/scripts/fv.ts +0 -263
  263. package/scripts/gdx/gdxAirdropCalculation.ts +0 -479
  264. package/scripts/getFounders.ts +0 -32
  265. package/scripts/governance/README.md +0 -70
  266. package/scripts/governance/airdropCalculation.ts +0 -1119
  267. package/scripts/governance/airdropCalculationRecover.ts +0 -416
  268. package/scripts/governance/airdropCalculationSorted.ts +0 -438
  269. package/scripts/governance/goodCheckpointSorted.ts +0 -300
  270. package/scripts/keeper/fishInactive.ts +0 -47
  271. package/scripts/minimize.sh +0 -17
  272. package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -131
  273. package/scripts/multichain-deploy/1_basicdao-deploy.ts +0 -294
  274. package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -152
  275. package/scripts/multichain-deploy/2b_otp-deploy.ts +0 -73
  276. package/scripts/multichain-deploy/3_gdSavings-deploy.ts +0 -190
  277. package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -129
  278. package/scripts/multichain-deploy/5_gov-deploy.ts +0 -179
  279. package/scripts/multichain-deploy/6_testnetFaucet.ts +0 -85
  280. package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +0 -123
  281. package/scripts/multichain-deploy/8_disthelper-deploy.ts +0 -152
  282. package/scripts/multichain-deploy/createUniswapTestPools.ts +0 -163
  283. package/scripts/multichain-deploy/flattened/Avatar.sol +0 -913
  284. package/scripts/multichain-deploy/flattened/Controller.sol +0 -1891
  285. package/scripts/multichain-deploy/flattened/FeeFormula.sol +0 -1290
  286. package/scripts/multichain-deploy/fulldeploy.sh +0 -26
  287. package/scripts/multichain-deploy/helpers.ts +0 -647
  288. package/scripts/multichain-deploy/multichainWrapper-deploy.ts +0 -59
  289. package/scripts/multichain-deploy/verifyEtherscan.ts +0 -177
  290. package/scripts/proposals/gip-14_1.ts +0 -251
  291. package/scripts/proposals/gip-15.ts +0 -427
  292. package/scripts/proposals/gip-25-xdc-upgrade-ubi.ts +0 -746
  293. package/scripts/proposals/gips-14_1.md +0 -29
  294. package/scripts/proposals/hack-ubi-recovery.ts +0 -414
  295. package/scripts/proposals/identityAuthPeriod.ts +0 -229
  296. package/scripts/proposals/reserveRestore.ts +0 -474
  297. package/scripts/proposals/updateDistHelper.ts +0 -180
  298. package/scripts/proposals/v4Upgrade.ts +0 -845
  299. package/scripts/releaser.js +0 -24
  300. package/scripts/staking/stakersGdRewardsCalculation.ts +0 -64
  301. package/scripts/upgradeScheme.ts +0 -97
  302. package/scripts/upgradeToV2/upgradeToV2.ts +0 -853
  303. package/scripts/upgradeToV2/upgradeToV2Recover.ts +0 -939
  304. package/scripts/upgradeToV3/v3-fix.ts +0 -120
  305. package/scripts/upgradeToV3/v3-fuse-multichain.ts +0 -117
  306. package/scripts/upgradeToV3/v3-upgrade.ts +0 -219
  307. package/scripts/upgrades/celo-defi-ubi-deploy.ts +0 -184
  308. package/scripts/upgrades/identity-upgrade.ts +0 -126
  309. package/scripts/upgrades/multichain-formula-upgrade.ts +0 -143
  310. package/scripts/upgrades/multichain-temp-fix.ts +0 -129
  311. package/scripts/upgrades/restoreFunds.ts +0 -91
  312. package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +0 -159
  313. package/scripts/upgrades/transferDaoToGuardians.ts +0 -80
  314. package/scripts/upgrades/upgradeAdminWallet.ts +0 -29
  315. package/scripts/upgrades/upgradeFaucet.ts +0 -46
  316. package/scripts/utils.ts +0 -50
  317. package/scripts/verify.ts +0 -67
  318. package/scripts/voltageswaps.ts +0 -46
@@ -1,188 +0,0 @@
1
- import { ethers } from "ethers";
2
- import "dotenv/config";
3
-
4
- // --- CONFIGURATION ---
5
- // For better performance and reliability, use a private RPC endpoint.
6
- const FUSE_RPC_URL = process.env.FUSE_RPC_URL || "https://rpc.fuse.io";
7
- const GOVERNANCE_STAKING_ADDRESS = "0xB7C3e738224625289C573c54d402E9Be46205546";
8
- const GREPUTATION_STAKING_ADDRESS = "0x603B8C0F110E037b51A381CBCacAbb8d6c6E4543";
9
- // This is the standard Multicall3 contract address, available on Fuse and many other EVM chains.
10
- const MULTICALL_ADDRESS = "0xcA11bde05977b3631167028862bE2a173976CA11";
11
-
12
- // Contract deployment block. We start scanning from here to find all historical events.
13
- const START_BLOCK = 15900000; //15900000
14
-
15
- // Chunk sizes to avoid overwhelming the RPC endpoint. Adjust if you get timeout errors.
16
- const BLOCK_CHUNK_SIZE = 50000;
17
- const MULTICALL_CHUNK_SIZE = 100; // Number of stakers to query per multicall batch.
18
-
19
- // --- ABIs (derived from GovernanceStaking.sol) ---
20
- const GOVERNANCE_STAKING_ABI = [
21
- "event Staked(address indexed who,uint256 amount)",
22
- "function balanceOf(address staker) view returns (uint256)",
23
- "function getUserPendingReward(address staker) view returns (uint256)"
24
- ];
25
-
26
- const MULTICALL_ABI = [
27
- "function aggregate(tuple(address target, bytes callData)[] calls) view returns (uint256 blockNumber, bytes[] returnData)"
28
- ];
29
-
30
- // --- TYPES ---
31
- interface StakerData {
32
- address: string;
33
- stakeAmount: bigint;
34
- pendingGood: bigint;
35
- goodBalance: bigint;
36
- }
37
-
38
- /**
39
- * Fetches all unique staker addresses by scanning Staked events in block chunks.
40
- * @param contract The GovernanceStaking contract instance.
41
- * @param startBlock The block to start scanning from.
42
- * @param endBlock The block to scan until (usually the latest block).
43
- * @returns A promise that resolves to an array of unique staker addresses.
44
- */
45
- async function getAllStakers(contract: ethers.Contract, startBlock: number, endBlock: number): Promise<string[]> {
46
- console.log(`Fetching all historical stakers from block ${startBlock} to ${endBlock}...`);
47
- const stakers = new Set<string>();
48
-
49
- for (let fromBlock = startBlock; fromBlock <= endBlock; fromBlock += BLOCK_CHUNK_SIZE) {
50
- const toBlock = Math.min(fromBlock + BLOCK_CHUNK_SIZE - 1, endBlock);
51
- console.log(` - Scanning blocks ${fromBlock} to ${toBlock} for Staked events...`);
52
-
53
- try {
54
- const events = await contract.queryFilter(contract.filters.Staked(), fromBlock, toBlock);
55
- console.log(` Found ${events.length} Staked events in this block range.`);
56
- for (const event of events) {
57
- // The 'who' argument from the event is the staker's address
58
- if (event.args && event.args.who) {
59
- stakers.add(event.args.who);
60
- }
61
- }
62
- } catch (error) {
63
- console.error(`Error fetching events in block range ${fromBlock}-${toBlock}:`, error);
64
- // Optionally, you could add retry logic here.
65
- }
66
- }
67
-
68
- console.log(`Found ${stakers.size} unique historical stakers.`);
69
- return Array.from(stakers);
70
- }
71
-
72
- /**
73
- * Fetches stake and entitlement data for a list of stakers using multicall.
74
- * @param provider An ethers provider instance.
75
- * @param stakerAddresses An array of staker addresses to query.
76
- * @returns A promise that resolves to an array of StakerData objects.
77
- */
78
- async function fetchStakersData(
79
- provider: ethers.providers.JsonRpcProvider,
80
- stakerAddresses: string[]
81
- ): Promise<StakerData[]> {
82
- console.log(`\nFetching current stake and pending GOOD for ${stakerAddresses.length} stakers using multicall...`);
83
- const allStakerData: StakerData[] = [];
84
- const govStakingInterface = new ethers.Contract(ethers.constants.AddressZero, GOVERNANCE_STAKING_ABI);
85
- const multicall = new ethers.Contract(MULTICALL_ADDRESS, MULTICALL_ABI, provider);
86
-
87
- for (let i = 0; i < stakerAddresses.length; i += MULTICALL_CHUNK_SIZE) {
88
- const chunk = stakerAddresses.slice(i, i + MULTICALL_CHUNK_SIZE);
89
- console.log(` - Processing multicall batch ${i / MULTICALL_CHUNK_SIZE + 1} for ${chunk.length} stakers...`);
90
-
91
- const calls = chunk.flatMap(address => [
92
- // Call 1: Get current G$ stake amount
93
- {
94
- target: GOVERNANCE_STAKING_ADDRESS,
95
- callData: govStakingInterface.interface.encodeFunctionData("balanceOf", [address])
96
- },
97
- // Call 2: Get pending GOOD tokens
98
- {
99
- target: GOVERNANCE_STAKING_ADDRESS,
100
- callData: govStakingInterface.interface.encodeFunctionData("getUserPendingReward", [address])
101
- },
102
- {
103
- target: GREPUTATION_STAKING_ADDRESS,
104
- callData: govStakingInterface.interface.encodeFunctionData("balanceOf", [address])
105
- }
106
- ]);
107
-
108
- try {
109
- const [, returnData] = await multicall.aggregate(calls);
110
-
111
- for (let j = 0; j < chunk.length; j++) {
112
- const address = chunk[j];
113
- // Each staker has two return values in the flat array
114
- const stakeResult = returnData[j * 3];
115
- const entitlementResult = returnData[j * 3 + 1];
116
- const goodResult = returnData[j * 3 + 2];
117
-
118
- const stakeAmount = govStakingInterface.interface.decodeFunctionResult("balanceOf", stakeResult)[0];
119
- const pendingGood = govStakingInterface.interface.decodeFunctionResult(
120
- "getUserPendingReward",
121
- entitlementResult
122
- )[0];
123
- const goodBalance = govStakingInterface.interface.decodeFunctionResult("balanceOf", goodResult)[0];
124
-
125
- allStakerData.push({
126
- address,
127
- stakeAmount,
128
- pendingGood,
129
- goodBalance
130
- });
131
- }
132
- } catch (error) {
133
- console.error(`Error during multicall batch ${i / MULTICALL_CHUNK_SIZE + 1}:`, error);
134
- }
135
- }
136
-
137
- return allStakerData;
138
- }
139
-
140
- /**
141
- * Main execution function.
142
- */
143
- async function main() {
144
- console.log("--- Fuse GovernanceStaking Analysis ---");
145
- const provider = new ethers.providers.JsonRpcProvider(FUSE_RPC_URL);
146
- const governanceStaking = new ethers.Contract(GOVERNANCE_STAKING_ADDRESS, GOVERNANCE_STAKING_ABI, provider);
147
-
148
- const latestBlock = await provider.getBlockNumber();
149
- console.log(`Connected to Fuse Network. Latest block: ${latestBlock}`);
150
-
151
- // Step 1: Get all unique addresses that have ever staked.
152
- const allHistoricalStakers = await getAllStakers(governanceStaking, START_BLOCK, latestBlock);
153
- if (allHistoricalStakers.length === 0) {
154
- console.log("No stakers found. Exiting.");
155
- return;
156
- }
157
-
158
- // Step 2: Use multicall to get current data for all historical stakers.
159
- const allStakerData = await fetchStakersData(provider, allHistoricalStakers);
160
-
161
- // Step 3: Filter for active stakers (stake > 0) and present the results.
162
- const activeStakers = allStakerData.filter(data => data.stakeAmount > 0n);
163
-
164
- console.log("\n--- Analysis Complete ---");
165
- console.log(`Total unique historical stakers: ${allHistoricalStakers.length}`);
166
- console.log(`Total active stakers (current stake > 0): ${activeStakers.length}`);
167
- console.log("-------------------------\n");
168
-
169
- // Optional: Print details for the top 5 active stakers by stake amount
170
- // activeStakers.sort((a, b) => (Number(b.stakeAmount) > Number(a.stakeAmount) ? 1 : -1));
171
- activeStakers.sort((a, b) =>
172
- BigInt(b.goodBalance) + BigInt(b.pendingGood) > BigInt(a.goodBalance) + BigInt(a.pendingGood) ? 1 : -1
173
- );
174
- console.log("Top 100 Active Stakers by G$ Stake:");
175
- activeStakers.slice(0, 100).forEach((staker, index) => {
176
- console.log(` ${index + 1}. Address: ${staker.address}`);
177
- console.log(` Stake: ${ethers.utils.formatUnits(staker.stakeAmount, 2)} G$`);
178
- console.log(` Pending: ${ethers.utils.formatEther(staker.pendingGood)} GOOD`);
179
- console.log(
180
- ` Total Good: ${ethers.utils.formatEther(BigInt(staker.goodBalance) + BigInt(staker.pendingGood))} GOOD`
181
- );
182
- });
183
- }
184
-
185
- main().catch(error => {
186
- console.error("An unexpected error occurred:", error);
187
- process.exit(1);
188
- });
@@ -1,25 +0,0 @@
1
- import { uniq } from "lodash";
2
- import fs from "fs";
3
- import { network, ethers } from "hardhat";
4
- import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
5
- import release from "../../releases/deployment.json"
6
- import { SimpleStakingV2 } from "../../types";
7
-
8
- setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
9
-
10
- setMulticallAddress(42220, "0x188C1bf697B66474dC3eaa119Ae691a8352537e3");
11
-
12
- const main = async () => {
13
-
14
- const c1 = await ethers.getContractAt("SimpleStakingV2", release["production-mainnet"].StakingContractsV3[0][0]) as SimpleStakingV2
15
- const c2 = await ethers.getContractAt("SimpleStakingV2", release["production-mainnet"].StakingContractsV3[1][0]) as SimpleStakingV2
16
- const f = c1.filters.Staked()
17
- const events = await c1.queryFilter(f, 14338550)
18
- const events2 = await c2.queryFilter(f, 14338550)
19
- const stakers = uniq(events.concat(events2).map(_ => _.args[0]))
20
- console.log(stakers)
21
- const res = (await Promise.all(stakers.map(async s => [s, await c1.balanceOf(s), await c2.balanceOf(s)]))).filter(_ => _[1].gt(0) || _[2].gt(0))
22
- console.log(events.length)
23
- console.log(res)
24
- }
25
- main()
@@ -1,156 +0,0 @@
1
- import { range, chunk, uniq, mapValues, groupBy } from "lodash";
2
- import { ethers, ethers as Ethers } from "hardhat";
3
- import fs from "fs";
4
- import { bulkGetLastAuth } from "../utils";
5
-
6
- const ONE_DAY = 24 * 60 * 60;
7
- const ONE_HOUR = 60 * 60;
8
-
9
- const main = async () => {
10
- const signer = (await Ethers.getSigners())[0];
11
- console.log("signer:", signer.address);
12
- const ubiScheme = new Ethers.Contract("0xD7aC544F8A570C4d8764c3AAbCF6870CBD960D0D", [
13
- "function fishMulti(address[] tofish)"
14
- ]).connect(signer);
15
- const twoWeeksAgo = parseInt((Date.now() / 1000).toFixed(0)); //
16
- //parseInt((Date.now() / 1000).toFixed(0)) - 24 * 60 * 60 * 14;
17
-
18
- const daysAgo: number[] = range(0, 180, 1);
19
- let curDay = twoWeeksAgo;
20
- const allActive = [];
21
- for (let day of daysAgo) {
22
- const query = `
23
- {
24
- walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${curDay - ONE_DAY
25
- } isActiveUser: true }) {
26
- id
27
- }
28
- }
29
- `;
30
-
31
- console.log("fetching inactive users since:", { curDay, day }, JSON.stringify({ query }));
32
- const result = await fetch("https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse", {
33
- method: "post",
34
- body: JSON.stringify({ query }),
35
- headers: { "Content-Type": "application/json" }
36
- }).then(_ => _.json());
37
-
38
-
39
- console.log("got inactive wallets:", result);
40
- // if (walletStats) {
41
- // const accounts = walletStats.map(_ => _.id);
42
- // allActive.push(...accounts);
43
- // }
44
-
45
- // for (let tofish of chunk(accounts, 50)) {
46
- // const tx = await ubiScheme.fishMulti(tofish, { gasLimit: 2000000 });
47
- // console.log("fishing tx:", tx, tofish);
48
- // const res = await tx.wait();
49
- // console.log("fishing tx result:", res);
50
- // }
51
-
52
- curDay = curDay - ONE_DAY;
53
- }
54
- const unique = uniq(allActive);
55
- console.log("active claimers:", unique.length);
56
- };
57
-
58
- const countClaimersUsingExplorer = async () => {
59
- let claimers = [] //JSON.parse(fs.readFileSync("claimers.json").toString())
60
- const curBlock = await ethers.provider.getBlockNumber()
61
- const DAYS = 1
62
- let fromBlock = curBlock - 60 * 60 * 24 * DAYS / 5 //roughly DAYS of blocks
63
- const querySize = 90// 15 min of blocks
64
- const blockRanges = range(fromBlock, curBlock, querySize)
65
- const chunks = chunk(blockRanges, 10)
66
- for (let idx in chunks) {
67
- const toFetch = chunks[idx]
68
- const ps = toFetch.map(async fromBlock => {
69
- let toBlock = fromBlock + querySize
70
- toBlock = toBlock > curBlock ? curBlock : toBlock
71
- const result = await fetch(`https://explorer.celo.org/mainnet/api?module=logs&action=getLogs&fromBlock=${fromBlock}&toBlock=${toBlock}&address=0x43d72ff17701b2da814620735c39c620ce0ea4a1&topic0=0x89ed24731df6b066e4c5186901fffdba18cd9a10f07494aff900bdee260d1304`).then(_ => _.json())
72
- fromBlock = toBlock
73
- const addrs = result.result.map(_ => ethers.utils.defaultAbiCoder.decode(["address"], _.topics[1])[0])
74
- claimers.push(...addrs);
75
- console.log("claimers:", addrs.length, "block range:", { fromBlock, toBlock }, addrs[0])
76
- })
77
- await Promise.all(ps)
78
- console.log(`${idx} out of ${chunks.length}`)
79
- }
80
-
81
- claimers = uniq(claimers)
82
- fs.writeFileSync("claimers.json", JSON.stringify(claimers))
83
- }
84
-
85
- const countLastWhitelisted = async () => {
86
- const claimers = JSON.parse(fs.readFileSync("claimers.json").toString())
87
- const DAY = 60 * 60 * 24
88
- let total = 0
89
- let howOld = []
90
- console.log("unique claimers:", claimers.length)
91
- for (let bulk of chunk(claimers, 1000)) {
92
- const results = await bulkGetLastAuth(bulk)
93
- const older = results.filter(_ => _.toNumber() < Date.now() / 1000 - DAY * 180).length
94
- bulk.forEach((_, i) => howOld.push([_, Math.ceil((Date.now() / 1000 - DAY * 180 - results[i].toNumber()) / (30 * DAY)).toFixed(0)]))
95
- console.log(older, "out of", results.length)
96
- total += older
97
- }
98
-
99
- howOld = howOld.filter(_ => Number(_[1]) > 0)
100
- console.log({ total })
101
- howOld = mapValues(groupBy(howOld, _ => _[1]), _ => _.length)
102
- console.log(howOld)
103
- }
104
-
105
- const countActive = async () => {
106
-
107
- const hoursAgo: number[] = range(0, 24 * 30, 1);
108
- let curDay = parseInt((Date.now() / 1000).toFixed(0));
109
- const allActive = [];
110
- for (let hour of hoursAgo) {
111
- const query = `
112
- {
113
- walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${curDay - ONE_HOUR
114
- } isActiveUser: true }) {
115
- id
116
- }
117
- }
118
- `;
119
-
120
- console.log("fetching active users since:", { curDay, hour }, JSON.stringify({ query }));
121
- const result =
122
-
123
- await fetch("https://gateway-arbitrum.network.thegraph.com/api/3c409250a317ce7b0c6a7a8b9a409ef8/subgraphs/id/F7314rxGdcpKPC1nN5KCoFW84EGRoUyzseY2sAT9PEkw", {
124
- // await fetch("https://gateway.thegraph.com/api/3c409250a317ce7b0c6a7a8b9a409ef8/subgraphs/id/5cAhhzm7LSqGiFibV1odbbgZWiRmZsYjYrmaoj87UxFd", {
125
- method: "post",
126
- body: JSON.stringify({ query }),
127
- headers: { "Content-Type": "application/json", "origin": "https://wallet.gooddollar.org" }
128
-
129
- }).then(_ => _.json());
130
-
131
- console.log(result)
132
- const {
133
- data: { walletStats }
134
- } = result
135
- console.log("got active wallets:", walletStats.length);
136
- if (walletStats) {
137
- const accounts = walletStats.map(_ => _.id);
138
- allActive.push(...accounts);
139
- }
140
- // for (let tofish of chunk(accounts, 50)) {
141
- // const tx = await ubiScheme.fishMulti(tofish, { gasLimit: 2000000 });
142
- // console.log("fishing tx:", tx, tofish);
143
- // const res = await tx.wait();
144
- // console.log("fishing tx result:", res);
145
- // }
146
-
147
- curDay = curDay - ONE_HOUR;
148
- }
149
- const unique = uniq(allActive);
150
- console.log("active claimers:", unique.length);
151
- };
152
-
153
- //main();
154
- // countActive();
155
- // countClaimersUsingExplorer()
156
- countLastWhitelisted()
@@ -1,301 +0,0 @@
1
- import { maxBy, range, sortBy, flatten } from "lodash";
2
- import PromisePool from "async-promise-pool";
3
- import fs from "fs";
4
- import { ethers } from "hardhat";
5
-
6
- const today = new Date().toLocaleDateString().replace(/\//g, "");
7
- console.log({ today });
8
- /****
9
- * Fetch token holders and their last activity date
10
- * can be used to create stats about active users and how much G$ isnt active
11
- */
12
- const main = async (chain = "fuse") => {
13
- let result = [];
14
- let balances = {};
15
- let curPage = 1;
16
- let maxResult;
17
- const fuseExplorer = "https://explorer.fuse.io/api";
18
- const celoExplorer = "https://explorer.celo.org/mainnet/api";
19
- const fuseSubgraph =
20
- "https://gateway.thegraph.com/api/9048669a7632776aae01a191c4939445/subgraphs/id/5cAhhzm7LSqGiFibV1odbbgZWiRmZsYjYrmaoj87UxFd";
21
- const celoSubgraph =
22
- "https://gateway.thegraph.com/api/9048669a7632776aae01a191c4939445/subgraphs/id/F7314rxGdcpKPC1nN5KCoFW84EGRoUyzseY2sAT9PEkw";
23
- do {
24
- const pages = range(curPage, curPage + 5, 1);
25
- curPage += 5;
26
- const ps = pages.map(p =>
27
- fetch(
28
- `${fuseExplorer}?module=token&action=getTokenHolders&contractaddress=0x495d133B938596C9984d462F007B676bDc57eCEC&page=${p}&offset=10000`
29
- )
30
- .then(_ => _.json())
31
- .then(_ => _.result)
32
- );
33
- const results = await Promise.all(ps);
34
- result = result.concat(...results);
35
- maxResult = maxBy(results, "length");
36
- console.log(maxResult.length, result.length);
37
- } while (maxResult.length === 10000);
38
- result.forEach(
39
- r =>
40
- (balances[r.address.toLowerCase()] = {
41
- balance: Number(r.value) / 100,
42
- fuseBalance: Number(r.value) / 100,
43
- lastSeen: 0
44
- })
45
- );
46
-
47
- console.log("fetching celo balances....");
48
- curPage = 1;
49
- result = [];
50
- do {
51
- const pages = range(curPage, curPage + 3, 1);
52
- curPage += 3;
53
- const ps = pages.map(p =>
54
- fetch(
55
- `${celoExplorer}?module=token&action=getTokenHolders&contractaddress=0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A&page=${p}&offset=10000`
56
- )
57
- .then(_ => _.json())
58
- .then(_ => _.result)
59
- );
60
- const results = await Promise.all(ps);
61
- result = result.concat(...results);
62
- maxResult = maxBy(results, "length");
63
- console.log(maxResult.length, result.length);
64
- } while (maxResult.length === 10000);
65
-
66
- result.forEach(
67
- r =>
68
- (balances[r.address.toLowerCase()] = {
69
- ...balances[r.address.toLowerCase()],
70
- celoBalance: Number(r.value) / 1e18,
71
- balance: Number(balances[r.address.toLowerCase()]?.fuseBalance || 0) + Number(r.value) / 1e18,
72
- lastSeen: 0
73
- })
74
- );
75
-
76
- fs.writeFileSync(`activeWalletsBalances-${today}.json`, JSON.stringify(balances));
77
-
78
- balances = JSON.parse(fs.readFileSync(`activeWalletsBalances-${today}.json`).toString());
79
-
80
- const EPOCH = 60 * 60 * 6;
81
- const pool = new PromisePool({ concurrency: 10 });
82
- const lastUsed = {};
83
- const epochs = range(1596045730, (Date.now() / 1000).toFixed(0), EPOCH);
84
-
85
- const graphQuery = async (start, skip, subgraph, retry = 3) => {
86
- const query = `{
87
- walletStats(first: 1000 skip:${skip} where: { dateAppeared_gte: ${start} dateAppeared_lt:${start + EPOCH} }) {
88
- id
89
- dateAppeared
90
- balance
91
- lastTransactionTo
92
- lastTransactionFrom
93
- lastClaimed
94
- }
95
- }`;
96
- // console.log({ query });
97
- try {
98
- const { data = {}, errors } = await fetch(subgraph, {
99
- method: "POST",
100
- headers: {
101
- "Content-Type": "application/json"
102
- },
103
- body: JSON.stringify({ query })
104
- }).then(_ => _.json());
105
- errors && console.log({ errors });
106
- if (errors) {
107
- console.log("query failed:", { subgraph, start, skip, retrying: retry > 0 });
108
- if (retry > 0) {
109
- return graphQuery(start, skip, subgraph, retry - 1);
110
- }
111
- return [];
112
- }
113
- // console.log("query ok:", { subgraph, start, skip, records: data.walletStats.length })
114
- if (data?.walletStats?.length === 1000) {
115
- return data.walletStats.concat(await graphQuery(start, skip + 1000, subgraph));
116
- }
117
- return data.walletStats || [];
118
- } catch (error) {
119
- console.log({ query, error, subgraph });
120
- return [];
121
- }
122
- };
123
- epochs.forEach(e => {
124
- pool.add(async () => {
125
- const walletStats = flatten(await Promise.all([graphQuery(e, 0, fuseSubgraph), graphQuery(e, 0, celoSubgraph)]));
126
- walletStats.forEach(w => {
127
- balances[w.id.toLowerCase()] = {
128
- ...balances[w.id.toLowerCase()],
129
- lastSeen: Math.max(
130
- balances[w.id.toLowerCase()]?.lastSeen,
131
- Number(w.lastClaimed),
132
- Number(w.lastTransactionFrom),
133
- Number(w.lastTransactionTo),
134
- Number(w.dateAppeared)
135
- )
136
- };
137
- });
138
- console.log({ curDate: e, records: walletStats.length });
139
- });
140
- });
141
-
142
- await pool.all();
143
- fs.writeFileSync(`activeWalletsLastUsed-${today}.json`, JSON.stringify(balances));
144
- // console.log({ lastUsed });
145
- };
146
-
147
- /** Convert a 2D array into a CSV string
148
- */
149
- function arrayToCsv(data) {
150
- return data
151
- .map(
152
- row =>
153
- row
154
- .map(String) // convert every value to String
155
- .map(v => v.replaceAll('"', '""')) // escape double colons
156
- .map(v => `"${v}"`) // quote it
157
- .join(",") // comma-separated
158
- )
159
- .join("\r\n"); // rows starting on new lines
160
- }
161
-
162
- const fix = async () => {
163
- const balances = JSON.parse(fs.readFileSync(`activeWalletsLastUsed-${today}.json`).toString());
164
-
165
- let result = [];
166
-
167
- let missing = 0;
168
- for (let addr in balances) {
169
- const r = balances[addr];
170
- if (!r.fuseBalance && !r.celoBalance) {
171
- console.log("missing:", addr);
172
- missing += 1;
173
- continue;
174
- }
175
- r.celoBalance = (r.celoBalance || 0) * 100;
176
- r.balance = r.celoBalance + r.fuseBalance;
177
- }
178
-
179
- console.log("missing balance", missing);
180
- console.log(sortBy(Object.entries(balances), _ => -_.balance).slice(0, 10));
181
-
182
- fs.writeFileSync(`activeWalletsLastUsed-${today}.json`, JSON.stringify(balances));
183
- };
184
- const etl = async () => {
185
- /** Convert a 2D array into a CSV string
186
- */
187
- function arrayToCsv(data) {
188
- return data
189
- .map(
190
- row =>
191
- row
192
- .map(String) // convert every value to String
193
- .map(v => v.replaceAll('"', '""')) // escape double colons
194
- .map(v => `"${v}"`) // quote it
195
- .join(",") // comma-separated
196
- )
197
- .join("\r\n"); // rows starting on new lines
198
- }
199
-
200
- const balances = JSON.parse(fs.readFileSync(`activeWalletsLastUsed-${today}.json`).toString());
201
-
202
- let result = [];
203
-
204
- for (let addr in balances) {
205
- const r = balances[addr];
206
- if (!r.balance) {
207
- continue;
208
- }
209
- result.push([addr, r.balance, r.lastSeen, false, r.fuseBalance, r.celoBalance]);
210
- }
211
- result = sortBy(result, _ => -_[1]);
212
- const top100 = result.slice(0, 100);
213
- const pool = new PromisePool({ concurrency: 30 });
214
- const provider = new ethers.providers.JsonRpcBatchProvider("https://rpc.fuse.io");
215
- const celoprovider = new ethers.providers.JsonRpcBatchProvider("https://forno.celo.org");
216
-
217
- for (let idx in top100) {
218
- pool.add(async () => {
219
- const record = top100[idx];
220
- let isContract =
221
- (
222
- await Promise.all([
223
- provider.getCode(record[0]).catch(e => "0x"),
224
- celoprovider.getCode(record[0]).catch(e => "0x")
225
- ])
226
- ).find(_ => _ !== "0x") !== undefined;
227
- record[3] = isContract;
228
- });
229
- }
230
- await pool.all();
231
- console.log({ top100 });
232
- fs.writeFileSync(`activeWalletsLastUsed-${today}.csv`, arrayToCsv(result));
233
- };
234
-
235
- const getFuseBalances = async (refetch = true) => {
236
- if (refetch === false) {
237
- const balances = JSON.parse(fs.readFileSync("activeWalletsBalances.json").toString());
238
- const rows = Object.entries(balances).filter(_ => Number(_[1].balance) > 10000000);
239
- const sorted = sortBy(rows, _ => -Number(_[1].balance));
240
- sorted.forEach(_ => (_[1].balance = Number(_[1].balance) / 100));
241
- console.log(arrayToCsv(sorted.slice(0, 20).map(_ => [_[0], _[1].balance])));
242
- return balances;
243
- }
244
- let result = [];
245
- let balances = {};
246
- let curPage = 1;
247
- let maxResult;
248
-
249
- do {
250
- const pages = range(curPage, curPage + 5, 1);
251
- curPage += 5;
252
- const ps = pages.map(p =>
253
- fetch(
254
- `https://explorer.fuse.io/api?module=token&action=getTokenHolders&contractaddress=0x495d133B938596C9984d462F007B676bDc57eCEC&page=${p}&offset=10000`
255
- )
256
- .then(_ => _.json())
257
- .then(_ => _.result)
258
- );
259
- const results = await Promise.all(ps);
260
- result = result.concat(...results);
261
- maxResult = maxBy(results, "length");
262
- console.log(maxResult.length, result.length);
263
- } while (maxResult.length === 10000);
264
- result.forEach(r => (balances[r.address.toLowerCase()] = { balance: r.value, lastSeen: 0 }));
265
- fs.writeFileSync("activeWalletsBalances.json", JSON.stringify(balances));
266
- return balances;
267
- };
268
-
269
- const fundsByLastSeen = async () => {
270
- const balances = JSON.parse(fs.readFileSync("activeWalletsLastUsed.json").toString());
271
- let total1Year = 0;
272
- let total2Year = 0;
273
- let total = 0;
274
- for (let addr in balances) {
275
- const r = balances[addr];
276
- if (Number(r.balance) < 0) {
277
- console.log(addr, r.balance);
278
- }
279
- if (!Number(r.balance) || Number(r.balance) < 0) {
280
- continue;
281
- }
282
-
283
- const yearAgo = new Date(Date.now() - 365 * 24 * 60 * 60 * 1000).valueOf() / 1000;
284
- const twoYearAgo = new Date(Date.now() - 2 * 365 * 24 * 60 * 60 * 1000).valueOf() / 1000;
285
- if (Number(r.lastSeen) < yearAgo) {
286
- total1Year += Number(r.balance / 100);
287
- }
288
- if (Number(r.lastSeen) < twoYearAgo) {
289
- total2Year += Number(r.balance / 100);
290
- }
291
-
292
- total += Number(r.balance / 100);
293
- }
294
-
295
- console.log({ total, total1Year, total2Year });
296
- };
297
- getFuseBalances(false).catch(e => console.log(e));
298
- // main().catch(e => console.log(e));
299
- // fix();
300
- etl();
301
- // fundsByLastSeen();