@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,479 +0,0 @@
1
- import { get, range, chunk, flatten, mergeWith, sortBy } from "lodash";
2
- import fs from "fs";
3
- import MerkleTree from "merkletreejs";
4
- import stakingContracts from "@gooddollar/goodcontracts/stakingModel/releases/deployment.json";
5
- import { ethers as Ethers } from "hardhat";
6
- import { BigNumber } from "ethers";
7
- import { keccak256 } from "ethers/lib/utils";
8
-
9
- type Tree = {
10
- [key: string]: {
11
- hash: string;
12
- gdx: number;
13
- };
14
- };
15
-
16
- const quantile = (sorted, q) => {
17
- const pos = (sorted.length - 1) * q;
18
- const base = Math.floor(pos);
19
-
20
- let sum = 0;
21
- for (let i = 0; i < base; i++) sum += sorted[i];
22
-
23
- return sum;
24
- };
25
-
26
- const quantileBN = (sorted, q) => {
27
- const pos = (sorted.length - 1) * q;
28
- const base = Math.floor(pos);
29
-
30
- let sum = BigNumber.from("0");
31
- for (let i = 0; i < base; i++)
32
- sum = BigNumber.from(sum).add(BigNumber.from(sorted[i]));
33
-
34
- return sum.toString();
35
- };
36
-
37
- let ETH_SNAPSHOT_BLOCK = 13320531; //first blocka after 12pm Sep-29-2021 12:00:20 PM +UTC
38
-
39
- export const airdrop = (ethers: typeof Ethers, ethSnapshotBlock) => {
40
- const getBuyingAddresses = async (addresses = {}, isContracts = {}) => {
41
- const provider = new ethers.providers.InfuraProvider();
42
-
43
- let reserve = await ethers.getContractAt(
44
- [
45
- "event TokenPurchased(address indexed caller,address indexed reserveToken,uint256 reserveAmount,uint256 minReturn,uint256 actualReturn)"
46
- ],
47
- stakingContracts["production-mainnet"].Reserve
48
- );
49
-
50
- let swaphelper = await ethers.getContractAt(
51
- [
52
- "event GDTraded(string protocol, string action, address from, uint256 value, uint256[] uniswap, uint256 gd)"
53
- ],
54
- "0xe28dbcce95764dc379f45e61d609356010595fd1"
55
- );
56
-
57
- reserve = reserve.connect(provider);
58
- swaphelper = swaphelper.connect(provider);
59
-
60
- const step = 100000;
61
- const snapshotBlock = parseInt(ethSnapshotBlock || ETH_SNAPSHOT_BLOCK);
62
- // const blocks = range(startBlock, endBlock, step);
63
- const blocks = range(10575670, snapshotBlock, step);
64
- const filter = reserve.filters.TokenPurchased();
65
- const swapFilter = swaphelper.filters.GDTraded();
66
- console.log({ snapshotBlock });
67
- for (let blockChunk of chunk(blocks, 10)) {
68
- // Get the filter (the second null could be omitted)
69
- const ps = blockChunk.map(async bc => {
70
- // Query the filter (the latest could be omitted)
71
- const logs = await reserve
72
- .queryFilter(filter, bc, Math.min(bc + step - 1, snapshotBlock))
73
- .catch(e => {
74
- console.log("block transfer logs failed retrying...", bc);
75
- return reserve.queryFilter(
76
- filter,
77
- bc,
78
- Math.min(bc + step - 1, snapshotBlock)
79
- );
80
- });
81
-
82
- const swapLogs = await swaphelper
83
- .queryFilter(swapFilter, bc, Math.min(bc + step - 1, snapshotBlock))
84
- .catch(e => {
85
- console.log("block swaphelper logs failed retrying...", bc);
86
- return swaphelper.queryFilter(
87
- swapFilter,
88
- bc,
89
- Math.min(bc + step - 1, snapshotBlock)
90
- );
91
- });
92
-
93
- console.log(
94
- "found transfer logs in block:",
95
- { bc },
96
- { reserve: logs.length, swaphelper: swapLogs.length }
97
- );
98
- // Print out all the values:
99
- const ps = logs.map(async log => {
100
- let isContract =
101
- (await reserve.provider
102
- .getCode(log.args.caller)
103
- .catch(e => "0x")) !== "0x";
104
- let balance = addresses[log.args.caller] || 0;
105
- addresses[log.args.caller] =
106
- balance + log.args.actualReturn.toNumber();
107
- isContracts[log.args.caller] = isContract;
108
- });
109
- const swapps = swapLogs
110
- .filter(_ => _.args.action == "buy")
111
- .map(async log => {
112
- let isContract =
113
- (await reserve.provider
114
- .getCode(log.args.caller)
115
- .catch(e => "0x")) !== "0x";
116
- let balance = addresses[log.args.from] || 0;
117
- addresses[log.args.from] = balance + log.args.gd.toNumber();
118
- isContracts[log.args.from] = isContract;
119
- });
120
-
121
- await Promise.all([...ps, ...swapps]);
122
- });
123
- await Promise.all(ps);
124
- }
125
-
126
- delete addresses["0xE28dBcCE95764dC379f45e61D609356010595fd1"]; //delete swaphelper
127
- console.log({ addresses, isContracts });
128
- return { addresses, isContracts: isContracts };
129
- };
130
-
131
- const collectAirdropData = async () => {
132
- return getBuyingAddresses().then(r =>
133
- fs.writeFileSync("airdrop/buyBalances.json", JSON.stringify(r))
134
- );
135
- };
136
-
137
- const buildMerkleTree = () => {
138
- const { addresses, isContracts } = JSON.parse(
139
- fs.readFileSync("airdrop/buyBalances.json").toString()
140
- // fs.readFileSync("test/gdx_airdrop_test.json").toString()
141
- );
142
- let toTree: Array<[string, number]> = Object.entries(addresses).map(
143
- ([addr, gdx]) => {
144
- return [addr, gdx as number];
145
- }
146
- );
147
-
148
- toTree = sortBy(toTree, "1").reverse();
149
- const totalGDX = toTree.reduce((acc, v) => acc + v[1], 0);
150
- console.log({
151
- isContracts,
152
- toTree,
153
- numberOfAccounts: toTree.length,
154
- totalGDX
155
- });
156
-
157
- const sorted = toTree.map(_ => _[1]);
158
- console.log("GDX Distribution\n");
159
- [0.001, 0.01, 0.1, 0.5].forEach(q =>
160
- console.log({
161
- precentile: q * 100 + "%",
162
- gdx: quantile(sorted, q)
163
- })
164
- );
165
-
166
- const treeData = {};
167
- const elements = toTree.map(e => {
168
- const hash = ethers.utils.keccak256(
169
- ethers.utils.defaultAbiCoder.encode(
170
- ["address", "uint256"],
171
- [e[0], e[1]]
172
- )
173
- );
174
- treeData[e[0]] = {
175
- gdx: e[1],
176
- hash
177
- };
178
- return Buffer.from(hash.slice(2), "hex");
179
- });
180
-
181
- console.log(elements);
182
- const merkleTree = new MerkleTree(elements, keccak256);
183
- // get the merkle root
184
- // returns 32 byte buffer
185
- const merkleRoot = merkleTree.getHexRoot();
186
- // generate merkle proof
187
- // returns array of 32 byte buffers
188
- const proof = merkleTree.getPositionalHexProof();
189
- console.log({ merkleRoot, proof, sampleProofFor: toTree[0] });
190
- fs.writeFileSync(
191
- "airdrop/gdxairdrop.json",
192
- JSON.stringify({ treeData, merkleRoot })
193
- );
194
- };
195
-
196
- const getProof = addr => {
197
- const { treeData, merkleRoot } = JSON.parse(
198
- fs.readFileSync("airdrop/gdxairdrop.json").toString()
199
- );
200
-
201
- const elements = Object.entries(treeData as Tree).map(e =>
202
- Buffer.from(e[1].hash.slice(2), "hex")
203
- );
204
-
205
- const merkleTree = new MerkleTree(elements, keccak256);
206
- const proof = merkleTree.getPositionalHexProof(treeData[addr].hash);
207
- console.log({ proof, [addr]: treeData[addr] });
208
- };
209
-
210
- return { buildMerkleTree, collectAirdropData, getProof };
211
- };
212
-
213
- export const airdropRecover = (ethers: typeof Ethers) => {
214
- const ZERO = ethers.BigNumber.from("0");
215
-
216
- const getHoldersInformation = async (
217
- newAddresses = {},
218
- newIsContracts = {}
219
- ) => {
220
- const provider = new ethers.providers.InfuraProvider();
221
-
222
- let newReserve = await ethers.getContractAt(
223
- "GoodReserveCDai",
224
- "0x6C35677206ae7FF1bf753877649cF57cC30D1c42"
225
- );
226
-
227
- let recoveredReserve = await ethers.getContractAt(
228
- "GoodReserveCDai",
229
- "0xa150a825d425B36329D8294eeF8bD0fE68f8F6E0"
230
- );
231
-
232
- // let exchangeHelper = await ethers.getContractAt(
233
- // eventsABI,
234
- // "0x0a8c6bB832801454F6CC21761D0A293Caa003296"
235
- // );
236
-
237
- // exchangeHelper = exchangeHelper.connect(provider);
238
- newReserve = newReserve.connect(provider);
239
-
240
- const step = 100000;
241
- const START_BLOCK = 13683748; // Reserve was created
242
- // const END_BLOCK = 14296271; // Following reserve created
243
- const END_BLOCK = await ethers.provider.getBlockNumber();
244
- const blocks = range(START_BLOCK, END_BLOCK, step);
245
-
246
- const reserveTokenPurchasedFilter = newReserve.filters.Transfer(
247
- ethers.constants.AddressZero
248
- );
249
- const reserveTokenSoldFilter = newReserve.filters.Transfer(
250
- undefined,
251
- ethers.constants.AddressZero
252
- );
253
-
254
- // const exchangeHelperTokenPurchasedFilter = exchangeHelper.filters.TokenPurchased();
255
- // const exchangeHelperTokenSoldFilter = exchangeHelper.filters.TokenSold();
256
-
257
- const populateListOfAddressesAndBalances = async (
258
- contractInstance,
259
- purchaseFilter,
260
- soldFilter
261
- ) => {
262
- for (let blockChunk of chunk(blocks, 10)) {
263
- // Get the filter (the second null could be omitted)
264
- const processedChunks = blockChunk.map(async bc => {
265
- // Query the filter (the latest could be omitted)
266
- const purchaseEvents = await contractInstance
267
- .queryFilter(purchaseFilter, bc, Math.min(bc + step - 1, END_BLOCK))
268
- .catch(e => {
269
- console.log("block transfer logs failed retrying...", bc);
270
- return contractInstance.queryFilter(
271
- purchaseFilter,
272
- bc,
273
- Math.min(bc + step - 1, END_BLOCK)
274
- );
275
- });
276
-
277
- // console.log({ purchaseEvents });
278
-
279
- const soldEvents = await contractInstance
280
- .queryFilter(soldFilter, bc, Math.min(bc + step - 1, END_BLOCK))
281
- .catch(e => {
282
- console.log("block swaphelper logs failed retrying...", bc);
283
- return contractInstance.queryFilter(
284
- soldFilter,
285
- bc,
286
- Math.min(bc + step - 1, END_BLOCK)
287
- );
288
- });
289
-
290
- // console.log(
291
- // "found transfer logs in block:",
292
- // { bc },
293
- // { purchaseEvents: purchaseEvents.length, soldEvents: soldEvents.length }
294
- // );
295
-
296
- const isContract = async (log, role) => {
297
- const possibleCodeStateOfAddress = await contractInstance.provider
298
- .getCode(log.args[role])
299
- .catch(e => "0x");
300
- return possibleCodeStateOfAddress !== "0x";
301
- };
302
-
303
- // Print out all the values:
304
- const purchasedEventsMapped = purchaseEvents.map(async log => {
305
- let balance = newAddresses[log.args.to] || ZERO;
306
- // console.log(log.blockNumber);
307
- // console.log(`actualReturn: ${log.args.actualReturn.toString()}`);
308
- newAddresses[log.args.to] =
309
- log.blockNumber === 14358516 //airdrop reimburse
310
- ? balance.sub(log.args.value)
311
- : balance.add(log.args.value);
312
- newIsContracts[log.args.to] = await isContract(log, "to");
313
- });
314
- const soldEventsMapped = soldEvents.map(async log => {
315
- let balance = newAddresses[log.args.from] || ZERO;
316
- newAddresses[log.args.from] = balance.sub(log.args.value);
317
- newIsContracts[log.args.from] = await isContract(log, "from");
318
- });
319
-
320
- await Promise.all([...purchasedEventsMapped, ...soldEventsMapped]);
321
- });
322
- await Promise.all(processedChunks);
323
- }
324
- };
325
-
326
- await populateListOfAddressesAndBalances(
327
- newReserve,
328
- reserveTokenPurchasedFilter,
329
- reserveTokenSoldFilter
330
- );
331
- await populateListOfAddressesAndBalances(
332
- recoveredReserve,
333
- reserveTokenPurchasedFilter,
334
- reserveTokenSoldFilter
335
- );
336
- // await populateListOfAddressesAndBalances(exchangeHelper, exchangeHelperTokenPurchasedFilter, exchangeHelperTokenSoldFilter);
337
-
338
- // console.log({ newAddresses, newIsContracts });
339
- return { newAddresses, newIsContracts };
340
- };
341
-
342
- const buildMerkleTree = () => {
343
- const { addressesCombined } = JSON.parse(
344
- fs.readFileSync("airdrop/buyBalancesCombined.json").toString()
345
- );
346
-
347
- let toTree: Array<[string, BigNumber]> = Object.entries(
348
- addressesCombined
349
- ).map(([addr, gdx]) => {
350
- return [addr, gdx as BigNumber];
351
- });
352
-
353
- // console.log(`Before sorting`);
354
- // toTree.forEach((a,_) => { console.log(`${a[0].toString()}:${ethers.BigNumber.from(a[1]).toString()}\n`)});
355
-
356
- toTree.sort((a, b) => (BigNumber.from(b[1]).gt(a[1]) ? 0 : -1));
357
-
358
- // console.log(`After sorting`);
359
- // toTree.forEach((a,_) => { console.log(`${a[0].toString()}:${ethers.BigNumber.from(a[1]).toString()}\n`)});
360
-
361
- let totalGDX = ZERO;
362
- toTree.forEach((a, _) => (totalGDX = totalGDX.add(a[1])));
363
- console.log({
364
- toTree: toTree.forEach((a, _) =>
365
- console.log({
366
- address: a[0].toString(),
367
- balance: BigNumber.from(a[1]).toString()
368
- })
369
- ),
370
- numberOfAccounts: toTree.length,
371
- TotalGDX: totalGDX.toString()
372
- });
373
-
374
- // Print statistics
375
- const sorted = toTree.map(_ => _[1]);
376
- console.log("GDX Distribution\n");
377
- [0.001, 0.01, 0.1, 0.5].forEach(q =>
378
- console.log({
379
- precentile: q * 100 + "%",
380
- gdx: quantileBN(sorted, q)
381
- })
382
- );
383
-
384
- const treeData = {};
385
- const elements = toTree.map(e => {
386
- const hash = ethers.utils.keccak256(
387
- ethers.utils.defaultAbiCoder.encode(
388
- ["address", "uint256"],
389
- [e[0], e[1]]
390
- )
391
- );
392
- treeData[e[0]] = {
393
- gdx: e[1],
394
- hash
395
- };
396
- return Buffer.from(hash.slice(2), "hex");
397
- });
398
-
399
- console.log(elements);
400
- const merkleTree = new MerkleTree(elements, keccak256);
401
- // get the merkle root
402
- // returns 32 byte buffer
403
- const merkleRoot = merkleTree.getHexRoot();
404
- // generate merkle proof
405
- // returns array of 32 byte buffers
406
- const proof = merkleTree.getPositionalHexProof(elements[0]);
407
- console.log({ merkleRoot, proof, sampleProofFor: toTree[0] });
408
- fs.writeFileSync(
409
- "airdrop/gdxAirdropRecovery.json",
410
- JSON.stringify({ treeData, merkleRoot })
411
- );
412
- };
413
-
414
- const addCalculationsToPreviousData = async () => {
415
- // get previous airdrop and turn it into BigNumbers
416
- const gdxAirdropData = JSON.parse(
417
- fs.readFileSync("airdrop/gdxairdrop.json").toString()
418
- );
419
- const addressesCombined = {};
420
- for (const [address, balance] of Object.entries(gdxAirdropData.treeData)) {
421
- addressesCombined[address] = BigNumber.from(balance["gdx"]).toString();
422
- }
423
-
424
- // get new holders info and turn into array
425
- const { newAddresses } = await getHoldersInformation();
426
-
427
- let newAddressesArray: Array<[string, BigNumber]> = Object.entries(
428
- newAddresses
429
- ).map(([addr, gdx]) => {
430
- return [addr, gdx as BigNumber];
431
- });
432
-
433
- // Unite previous airdrop with current information
434
- for (const newAddressEntry of newAddressesArray) {
435
- const address = newAddressEntry[0];
436
- const addition = newAddressEntry[1];
437
-
438
- if (addition <= ZERO) continue;
439
-
440
- // console.log({address})
441
- // console.log({before: BigNumber.from(addressesCombined[address] || "0").toString() })
442
- // console.log({addition: addition.toString()})
443
- addressesCombined[address] = ethers.BigNumber.from(
444
- addressesCombined[address] || 0
445
- )
446
- .add(addition.toString())
447
- .toString();
448
- // console.log({total: addressesCombined[address].toString()})
449
- // console.log(`\n`);
450
- }
451
-
452
- let newReserve = await ethers.getContractAt(
453
- "GoodReserveCDai",
454
- "0xa150a825d425B36329D8294eeF8bD0fE68f8F6E0"
455
- );
456
-
457
- const ps = Object.entries(addressesCombined).map(async ([addr, amount]) => {
458
- console.log(addr, amount);
459
- const balance = await newReserve.balanceOf(addr);
460
- const diff = balance.sub(amount);
461
- if (diff.lt(0)) {
462
- console.log({
463
- addr,
464
- balance: balance.toString(),
465
- amount,
466
- diff: diff.toString()
467
- });
468
- }
469
- });
470
-
471
- await Promise.all(ps);
472
- fs.writeFileSync(
473
- "airdrop/buyBalancesCombined.json",
474
- JSON.stringify({ addressesCombined })
475
- );
476
- };
477
-
478
- return { buildMerkleTree, addCalculationsToPreviousData };
479
- };
@@ -1,32 +0,0 @@
1
- //update a contract's web3 to work with accounts read from keystore in production
2
- import { ethers } from "hardhat";
3
- export const getFounders = async (network) => {
4
- const accounts = await ethers.getSigners();
5
- let founders = accounts.slice(0, 3);
6
- if (network.indexOf("production") >= 0) {
7
- const keystore = JSON.parse(process.env.FOUNDERS_KEYSTORE);
8
- founders = keystore.map((key) => {
9
- return ethers.Wallet.fromEncryptedJsonSync(
10
- JSON.stringify(key),
11
- process.env.FOUNDERS_PASSWORD
12
- ).connect(ethers.provider);
13
- });
14
- }
15
-
16
- await Promise.all(
17
- founders.map(async (f) => {
18
- const b = await ethers.provider.getBalance(f.address);
19
- console.log("founder balance:", { f: f.address, bal: b.toString() });
20
- if (b.lt(ethers.utils.parseEther("0.004"))) {
21
- const toTop = ethers.utils.parseEther("0.009").sub(b);
22
-
23
- const receipt = await founders[0].sendTransaction({
24
- to: f.address,
25
- value: toTop,
26
- });
27
- console.log("topped founder,", { f, receipt });
28
- }
29
- })
30
- );
31
- return founders;
32
- };
@@ -1,70 +0,0 @@
1
- ## GOOD Airdrop
2
-
3
- ### How is it calculated
4
-
5
- Initial GOOD airdrop is distributed 50% to claimers, 25% to supporters/donators and 25% to G$ hodlers.
6
-
7
- - Claimers: The method `getClaimsPerAddress` aggregates `UBIClaimed` events on the Fuse blockchain, each account will get his relative share calculated as `number of claims divided by total number of claims`
8
- - Supporters and donators: The method `getStakersBalance` will perform the following
9
- - Read `DAIStaked` and `DAIWithdrawStake` events from the SimpleDAIStaking smart contract on ethereum. For each staker it will calculate the $ value staked multiplied by time, to get the staker share.
10
- - Read eth transfers to the DonationStaking smart contract and the `Transfer` events of DAI to this contract. Multiply the $ value by the time since the donation, to get the donator share.
11
- - Each address share is calculated as `share/total shares` where share is `time*$ value`.
12
- - G$ Hodlers:
13
- - The method `getEthPlorerHolders` will get G\$ balances on ethereum and the method `getFuseHolders` will get G$ balances on fuse.
14
- - The method `getFuseSwapBalances` will get the G$ balances of addresses supplying liquidity on fuseswap (including those staking in the yield farming rewards)
15
- - The method `getUniswapBalances` will get the G$ balances of addresses supplying liquidity on uniswap
16
- - Each address share is calculated as `G$ balance/total G$ balances`
17
-
18
- ### How to run the calculation and generate the merklehash
19
-
20
- ##### Notice: fetching all the data to create the merklehash can take >60 minutes
21
-
22
- - clone the project
23
-
24
- ```
25
- git clone https://github.com/GoodDollar/GoodProtocol.git
26
- ```
27
-
28
- - run `yarn && yarn compile`
29
- - meanwhile get an Ethplorer + Etherscan free API key and create a .env file
30
-
31
- ```
32
- ETHERSCAN_KEY=yourkey
33
- ETHPLORER_KEY=yourkey
34
- INFURA_API= #leave empty
35
- MNEMONIC= #leave empty
36
- ```
37
-
38
- - in the root project folder run
39
-
40
- ```
41
- npx hardhat repAirdrop --action calculate --fusesnapshotblock <number> --ethsnapshotblock <number>
42
- # output will be 6 files claimBalances.json, ethBalances.json, fuseBalances.json, uniswapBalances.json, fuseswapBalances.json, stakersBalances.json
43
-
44
- npx hardhat airdrop tree
45
- # output will be repTree.json - the final balances/stakes/claims data used to create the tree and airdrop.json which is the final merkleroot and elements of tree
46
- # each element is keccak(address,repInWei)
47
- ```
48
-
49
- ### How to generate proof & claim
50
-
51
- - either perform the previous step or download the set of published snapshot files (TBD)
52
- - make sure you have `airdrop.json` in the project root folder
53
- - run
54
-
55
- ```
56
- npx hardhat repAirdrop --action proof <address>
57
- ```
58
-
59
- - on **Fuse** call `GReputation` contract method `proveBalanceOfAtBlockchain(_id,_user,_balance,_proof)` with the following params:
60
-
61
- - \_id: 'rootState'
62
- - \_user: address
63
- - \_balance: rep output from previous `proof` command
64
- - \_proof: proof array output from previous command
65
-
66
- - on **Ethereum** call `GReputation` contract method `proveBalanceOfAtBlockchain(_id,_user,_balance,_proof)` with the following params:
67
- - \_id: 'fuse'
68
- - \_user: address
69
- - \_balance: rep output from previous `proof` command
70
- - \_proof: proof array output from previous command