@gooddollar/goodprotocol 2.0.25-beta.9 → 2.0.26-beta.0

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 (421) hide show
  1. package/artifacts/abis/AdminWallet.min.json +1 -1
  2. package/artifacts/abis/CompoundVotingMachine.min.json +1 -1
  3. package/artifacts/abis/DistributionHelper.min.json +1 -1
  4. package/artifacts/abis/DistributionHelperTest.min.json +1 -1
  5. package/artifacts/abis/DistributionHelperTestHelper.min.json +1 -1
  6. package/artifacts/abis/EternalStorage.min.json +1 -0
  7. package/artifacts/abis/FuseOldBridgeKill.min.json +1 -0
  8. package/artifacts/abis/GoodFundManager.min.json +1 -1
  9. package/artifacts/abis/GoodFundManagerTest.min.json +1 -1
  10. package/artifacts/abis/GoodMarketMaker.min.json +1 -1
  11. package/artifacts/abis/GoodReserveCDai.min.json +1 -1
  12. package/artifacts/abis/IQuoterV2.min.json +1 -1
  13. package/artifacts/abis/ISwapRouter.min.json +1 -1
  14. package/artifacts/abis/IUpgradeabilityOwnerStorage.min.json +1 -0
  15. package/artifacts/abis/Initializable.min.json +1 -0
  16. package/artifacts/abis/Ownable.min.json +1 -0
  17. package/artifacts/abis/ReserveRestore.min.json +1 -0
  18. package/artifacts/abis/SuperfluidFaucet.min.json +1 -0
  19. package/artifacts/abis/Upgradeable.min.json +1 -0
  20. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  21. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  22. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  23. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  24. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  25. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  36. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  37. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  38. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  39. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  40. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  41. package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +4 -0
  42. package/artifacts/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2.json +1 -1
  43. package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +4 -0
  44. package/artifacts/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter.json +1 -1
  45. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  46. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  47. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  48. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  49. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  50. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  51. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  52. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  53. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  54. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
  55. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  56. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
  57. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  58. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +2 -2
  59. package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +4 -0
  60. package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.json +536 -0
  61. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  62. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
  63. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  64. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +20 -2
  65. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  66. package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
  67. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  68. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
  69. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  70. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  71. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  72. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  73. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.json +2 -2
  74. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  75. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  76. package/artifacts/contracts/governance/Reputation.sol/Reputation.json +2 -2
  77. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  78. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
  79. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  80. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
  81. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  82. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
  83. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  84. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
  85. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  86. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +2 -2
  87. package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
  88. package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.json +2 -2
  89. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  95. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  97. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
  98. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +21 -2
  100. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  101. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +21 -2
  102. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  103. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  104. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  105. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  106. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
  107. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  108. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
  109. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  110. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +21 -2
  111. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  112. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.json +2 -2
  113. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  114. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  115. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  116. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  117. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
  118. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  119. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  120. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +2 -2
  121. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  122. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
  123. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  124. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  125. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  126. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  127. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
  128. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  129. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  130. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +2 -2
  131. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  132. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
  133. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  134. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
  135. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  136. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
  137. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  138. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  139. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  140. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  141. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  142. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  143. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  144. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  145. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  146. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +21 -2
  147. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  148. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
  149. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  150. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +6 -6
  151. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  152. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  153. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +3 -3
  154. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  155. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
  156. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  157. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
  158. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  159. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
  160. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  161. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
  162. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  163. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  164. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  165. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +21 -2
  166. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  167. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  168. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  169. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
  170. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  171. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
  172. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  173. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
  174. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  175. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
  176. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  177. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
  178. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  179. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
  180. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  181. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
  182. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  183. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  184. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  185. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  186. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  187. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  188. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.json +2 -2
  189. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  190. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  191. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  192. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  193. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  194. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  195. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  196. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  197. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
  198. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  199. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  200. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  201. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  202. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  203. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  204. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  205. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
  206. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  207. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +2 -2
  208. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  209. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +2 -22
  210. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  211. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +2 -2
  212. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  213. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  214. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
  215. package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
  216. package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.json +2 -2
  217. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  218. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
  219. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  220. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +2 -2
  221. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  222. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +2 -2
  223. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  224. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.json +2 -2
  225. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  226. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
  227. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  228. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
  229. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  230. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  231. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +4 -0
  232. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.json +10 -0
  233. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +4 -0
  234. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.json +31 -0
  235. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +4 -0
  236. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.json +24 -0
  237. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +4 -0
  238. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.json +24 -0
  239. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +4 -0
  240. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.json +56 -0
  241. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +4 -0
  242. package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.json +10 -0
  243. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  244. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.json +2 -2
  245. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  246. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -2
  247. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  248. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  249. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  250. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
  251. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  252. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +2 -2
  253. package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
  254. package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.json +2 -2
  255. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  256. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  257. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
  258. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  259. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  260. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.json +2 -2
  261. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  262. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.json +2 -2
  263. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  264. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  265. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
  266. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  267. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
  268. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  269. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
  270. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  271. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
  272. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  273. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  274. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  275. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
  276. package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +4 -0
  277. package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.json +91 -0
  278. package/contracts/Interfaces.sol +122 -0
  279. package/contracts/fuseFaucet/SuperfluidFacuet.sol +129 -0
  280. package/contracts/governance/CompoundVotingMachine.sol +26 -11
  281. package/contracts/governance/StakersDistribution.sol +13 -13
  282. package/contracts/reserve/DistributionHelper.sol +29 -10
  283. package/contracts/reserve/ExchangeHelper.sol +16 -7
  284. package/contracts/reserve/GoodMarketMaker.sol +43 -53
  285. package/contracts/reserve/GoodReserveCDai.sol +44 -16
  286. package/contracts/staking/GoodFundManager.sol +44 -4
  287. package/contracts/utils/AdminWallet.sol +4 -6
  288. package/contracts/utils/BuyGDClone.sol +0 -122
  289. package/contracts/utils/FuseOldBridgeKill.sol +123 -0
  290. package/contracts/utils/ReserveRestore.sol +157 -0
  291. package/dist/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
  292. package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
  293. package/hardhat.config.ts +21 -39
  294. package/package.json +3 -3
  295. package/releases/deployment.json +6 -0
  296. package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +20 -15
  297. package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +95 -0
  298. package/scripts/multichain-deploy/helpers.ts +8 -8
  299. package/scripts/proposals/reserveRestore.ts +429 -0
  300. package/scripts/test/localOldDaoDeploy.ts +2 -1
  301. package/test/governance/CompoundVotingMachine.daoscheme.ts +3 -0
  302. package/test/governance/CompoundVotingMachine.guardian.test.ts +76 -21
  303. package/test/governance/CompoundVotingMachine.state.test.ts +31 -28
  304. package/test/governance/StakersDistribution.test.ts +79 -5
  305. package/test/helpers.ts +7 -0
  306. package/test/reserve/DistributionHelper.test.ts +10 -10
  307. package/test/reserve/GoodMarketMaker.test.ts +75 -26
  308. package/test/staking/StakingRewards.test.ts +106 -29
  309. package/test/utils/ProtocolUpgrade.test.ts +1 -0
  310. package/types/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2.ts +1 -1
  311. package/types/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter.ts +1 -1
  312. package/types/contracts/Interfaces.sol/index.ts +2 -0
  313. package/types/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.ts +867 -0
  314. package/types/contracts/fuseFaucet/SuperfluidFacuet.sol/index.ts +4 -0
  315. package/types/contracts/fuseFaucet/index.ts +2 -0
  316. package/types/contracts/governance/CompoundVotingMachine.ts +44 -3
  317. package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.ts +35 -0
  318. package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.ts +35 -0
  319. package/types/contracts/mocks/GoodFundManagerTest.ts +35 -0
  320. package/types/contracts/reserve/DistributionHelper.ts +35 -0
  321. package/types/contracts/reserve/GoodMarketMaker.ts +3 -3
  322. package/types/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.ts +5 -5
  323. package/types/contracts/staking/GoodFundManager.ts +35 -0
  324. package/types/contracts/utils/AdminWallet.ts +0 -34
  325. package/types/contracts/utils/BuyGDClone.sol/index.ts +0 -2
  326. package/types/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.ts +108 -0
  327. package/types/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.ts +89 -0
  328. package/types/contracts/utils/FuseOldBridgeKill.sol/Initializable.ts +87 -0
  329. package/types/contracts/utils/FuseOldBridgeKill.sol/Ownable.ts +148 -0
  330. package/types/contracts/utils/FuseOldBridgeKill.sol/index.ts +7 -0
  331. package/types/contracts/utils/ReserveRestore.ts +201 -0
  332. package/types/contracts/utils/index.ts +3 -0
  333. package/types/factories/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2__factory.ts +1 -1
  334. package/types/factories/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter__factory.ts +1 -1
  335. package/types/factories/contracts/Interfaces.sol/index.ts +2 -0
  336. package/types/factories/contracts/fuseFaucet/Faucet__factory.ts +1 -1
  337. package/types/factories/contracts/fuseFaucet/FuseFaucetV2__factory.ts +1 -1
  338. package/types/factories/contracts/fuseFaucet/FuseFaucet__factory.ts +1 -1
  339. package/types/factories/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet__factory.ts +587 -0
  340. package/types/factories/contracts/fuseFaucet/SuperfluidFacuet.sol/index.ts +4 -0
  341. package/types/factories/contracts/fuseFaucet/index.ts +1 -0
  342. package/types/factories/contracts/governance/ClaimersDistribution__factory.ts +1 -1
  343. package/types/factories/contracts/governance/CompoundVotingMachine__factory.ts +19 -1
  344. package/types/factories/contracts/governance/GReputation__factory.ts +1 -1
  345. package/types/factories/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking__factory.ts +1 -1
  346. package/types/factories/contracts/governance/GovernanceStaking__factory.ts +1 -1
  347. package/types/factories/contracts/governance/Reputation__factory.ts +1 -1
  348. package/types/factories/contracts/governance/StakersDistribution__factory.ts +1 -1
  349. package/types/factories/contracts/identity/IdentityV2__factory.ts +1 -1
  350. package/types/factories/contracts/invite/InvitesFuseV2__factory.ts +1 -1
  351. package/types/factories/contracts/invite/InvitesV1__factory.ts +1 -1
  352. package/types/factories/contracts/invite/InvitesV2__factory.ts +1 -1
  353. package/types/factories/contracts/invite/OneTimeReward__factory.ts +1 -1
  354. package/types/factories/contracts/mocks/DistributionBridgeMock__factory.ts +1 -1
  355. package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +20 -1
  356. package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest__factory.ts +20 -1
  357. package/types/factories/contracts/mocks/GoodCompoundStakingTest__factory.ts +1 -1
  358. package/types/factories/contracts/mocks/GoodDollarStakingMock__factory.ts +1 -1
  359. package/types/factories/contracts/mocks/GoodFundManagerTest__factory.ts +20 -1
  360. package/types/factories/contracts/mocks/IdentityMock__factory.ts +1 -1
  361. package/types/factories/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock__factory.ts +1 -1
  362. package/types/factories/contracts/mocks/OverMintTester.sol/OverMintTester__factory.ts +1 -1
  363. package/types/factories/contracts/mocks/OverMintTesterRegularStake__factory.ts +1 -1
  364. package/types/factories/contracts/mocks/SwapHelperTest__factory.ts +1 -1
  365. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock2__factory.ts +1 -1
  366. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock3__factory.ts +1 -1
  367. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock4__factory.ts +1 -1
  368. package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock__factory.ts +1 -1
  369. package/types/factories/contracts/reserve/DistributionHelper__factory.ts +20 -1
  370. package/types/factories/contracts/reserve/ExchangeHelper__factory.ts +1 -1
  371. package/types/factories/contracts/reserve/GoodMarketMaker__factory.ts +5 -5
  372. package/types/factories/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai__factory.ts +2 -2
  373. package/types/factories/contracts/staking/BaseShareFieldV2__factory.ts +1 -1
  374. package/types/factories/contracts/staking/BaseShareField__factory.ts +1 -1
  375. package/types/factories/contracts/staking/DonationsStaking__factory.ts +1 -1
  376. package/types/factories/contracts/staking/FuseStakingV3.sol/FuseStakingV3__factory.ts +1 -1
  377. package/types/factories/contracts/staking/GoodFundManager__factory.ts +20 -1
  378. package/types/factories/contracts/staking/UniswapV2SwapHelper__factory.ts +1 -1
  379. package/types/factories/contracts/staking/aave/AaveStakingFactory__factory.ts +1 -1
  380. package/types/factories/contracts/staking/aave/GoodAaveStakingV2__factory.ts +1 -1
  381. package/types/factories/contracts/staking/aave/GoodAaveStaking__factory.ts +1 -1
  382. package/types/factories/contracts/staking/compound/CompoundStakingFactory__factory.ts +1 -1
  383. package/types/factories/contracts/staking/compound/GoodCompoundStakingV2__factory.ts +1 -1
  384. package/types/factories/contracts/staking/compound/GoodCompoundStaking__factory.ts +1 -1
  385. package/types/factories/contracts/token/GoodDollar__factory.ts +1 -1
  386. package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +1 -1
  387. package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
  388. package/types/factories/contracts/ubi/UBIScheme__factory.ts +1 -1
  389. package/types/factories/contracts/utils/AdminWalletFuse__factory.ts +1 -1
  390. package/types/factories/contracts/utils/AdminWallet__factory.ts +1 -21
  391. package/types/factories/contracts/utils/BulkWhitelist__factory.ts +1 -1
  392. package/types/factories/contracts/utils/BuyAndBridgeHelper__factory.ts +1 -1
  393. package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory__factory.ts +1 -1
  394. package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDClone__factory.ts +1 -1
  395. package/types/factories/contracts/utils/BuyGDClone.sol/DonateGDClone__factory.ts +1 -1
  396. package/types/factories/contracts/utils/BuyGDClone.sol/index.ts +0 -2
  397. package/types/factories/contracts/utils/DAOContract__factory.ts +1 -1
  398. package/types/factories/contracts/utils/DAOUpgradeableContract__factory.ts +1 -1
  399. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill__factory.ts +82 -0
  400. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage__factory.ts +43 -0
  401. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Initializable__factory.ts +75 -0
  402. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Ownable__factory.ts +105 -0
  403. package/types/factories/contracts/utils/FuseOldBridgeKill.sol/index.ts +7 -0
  404. package/types/factories/contracts/utils/GDFaucet__factory.ts +1 -1
  405. package/types/factories/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper__factory.ts +1 -1
  406. package/types/factories/contracts/utils/IdentityFix__factory.ts +1 -1
  407. package/types/factories/contracts/utils/LastauthReduction__factory.ts +1 -1
  408. package/types/factories/contracts/utils/MultichainBridgeHelper__factory.ts +1 -1
  409. package/types/factories/contracts/utils/OneTimePaymentsV2__factory.ts +1 -1
  410. package/types/factories/contracts/utils/OneTimePayments__factory.ts +1 -1
  411. package/types/factories/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade__factory.ts +1 -1
  412. package/types/factories/contracts/utils/ProtocolUpgradeFuseRecover__factory.ts +1 -1
  413. package/types/factories/contracts/utils/ProtocolUpgradeFuse__factory.ts +1 -1
  414. package/types/factories/contracts/utils/ProtocolUpgradeRecover__factory.ts +1 -1
  415. package/types/factories/contracts/utils/ReputationTestHelper__factory.ts +1 -1
  416. package/types/factories/contracts/utils/ReserveRestore__factory.ts +144 -0
  417. package/types/factories/contracts/utils/index.ts +2 -0
  418. package/types/hardhat.d.ts +70 -16
  419. package/types/index.ts +12 -4
  420. package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +0 -4
  421. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +0 -4
@@ -32,6 +32,13 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
32
32
  //address of the active staking contracts
33
33
  address[] public activeContracts;
34
34
 
35
+ // Rewards per block for particular Staking contract
36
+ mapping(address => Reward) public rewardsForStakingContract;
37
+
38
+ uint256 private _reentrantStatus;
39
+
40
+ /** ADD NEW VARIABLES AFTER THIS LINE **/
41
+
35
42
  event GasCostSet(uint256 newGasCost);
36
43
  event CollectInterestTimeThresholdSet(
37
44
  uint256 newCollectInterestTimeThreshold
@@ -62,8 +69,7 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
62
69
  uint256 maxGasAmountSoFar; // Max gas amount that can spend to collect this interest according to interest amount
63
70
  bool maxGasLargerOrEqualRequired; // Bool that indicates if max gas amount larger or equal to actual gas needed
64
71
  }
65
- // Rewards per block for particular Staking contract
66
- mapping(address => Reward) public rewardsForStakingContract;
72
+
67
73
  // Emits when `transferInterest` transfers
68
74
  // funds to the staking contract and to
69
75
  // the bridge
@@ -221,7 +227,7 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
221
227
  function collectInterest(
222
228
  address[] calldata _stakingContracts,
223
229
  bool _forceAndWaiverRewards
224
- ) external {
230
+ ) external nonReentrant {
225
231
  uint256 initialGas = gasleft();
226
232
  uint256 gdUBI;
227
233
  uint256 interestInCdai;
@@ -242,6 +248,10 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
242
248
  // elements are sorted by balances from lowest to highest
243
249
 
244
250
  if (_stakingContracts[i - 1] != address(0x0)) {
251
+ require(
252
+ isActiveContract(_stakingContracts[i - 1]),
253
+ "collectInterest: not a dao contract"
254
+ );
245
255
  IGoodStaking(_stakingContracts[i - 1]).collectUBIInterest(
246
256
  reserveAddress
247
257
  );
@@ -277,7 +287,11 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
277
287
  if (
278
288
  block.timestamp >= lastCollectedInterest + collectInterestTimeThreshold
279
289
  ) {
280
- require(interestInCdai >= gasPriceIncDAI, "UBI < gas costs"); // This require is necessary to keeper can not abuse this function
290
+ require(
291
+ interestInCdai >= gasPriceIncDAI ||
292
+ gdUBI >= interestMultiplier * gdRewardToMint,
293
+ "UBI < gas costs"
294
+ ); // This require is necessary to keeper can not abuse this function
281
295
  } else {
282
296
  require(
283
297
  interestInCdai >= interestMultiplier * gasPriceIncDAI ||
@@ -299,6 +313,20 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
299
313
  lastCollectedInterestBlock = block.number;
300
314
  }
301
315
 
316
+ /**
317
+ * @dev verifies that contract was added to the approved staking contracts in the past, and is not blacklisted
318
+ * @param _contract address of the contract
319
+ * @return isActive true if contract is active
320
+ **/
321
+ function isActiveContract(
322
+ address _contract
323
+ ) public view returns (bool isActive) {
324
+ return
325
+ !rewardsForStakingContract[_contract].isBlackListed &&
326
+ (rewardsForStakingContract[_contract].blockStart > 0 ||
327
+ rewardsForStakingContract[_contract].blockEnd > 0);
328
+ }
329
+
302
330
  /**
303
331
  * @dev Function that get interest informations of staking contracts in the sorted array by highest interest to lowest interest amount
304
332
  * @return array of interestInfo struct
@@ -467,4 +495,16 @@ contract GoodFundManager is DAOUpgradeableContract, DSMath {
467
495
  function getActiveContractsCount() public view returns (uint256) {
468
496
  return activeContracts.length;
469
497
  }
498
+
499
+ modifier nonReentrant() {
500
+ // On the first call to nonReentrant, _status will be _NOT_ENTERED
501
+ require(_reentrantStatus != 1, "ReentrancyGuard: reentrant call");
502
+
503
+ // Any calls to nonReentrant after this point will fail
504
+ _reentrantStatus = 1;
505
+ _;
506
+ // By storing the original value once again, a refund is triggered (see
507
+ // https://eips.ethereum.org/EIPS/eip-2200)
508
+ _reentrantStatus = 0;
509
+ }
470
510
  }
@@ -34,7 +34,8 @@ contract AdminWallet is
34
34
  uint64 public maxDailyNewWallets;
35
35
  uint64 public day;
36
36
 
37
- ERC20 public gd;
37
+ ERC20 private gd_removed;
38
+
38
39
  mapping(address => uint256) public lastGdBalance; // only top non whitelisted if active G$ users
39
40
 
40
41
  event AdminsAdded(address payable[] indexed admins);
@@ -66,7 +67,6 @@ contract AdminWallet is
66
67
  addAdmins(_admins);
67
68
  }
68
69
  if (msg.sender != _owner) revokeRole(DEFAULT_ADMIN_ROLE, msg.sender);
69
- gd = ERC20(nameService.getAddress("GOODDOLLAR"));
70
70
  }
71
71
 
72
72
  modifier onlyOwner() {
@@ -74,10 +74,6 @@ contract AdminWallet is
74
74
  _;
75
75
  }
76
76
 
77
- function upgrade() public onlyOwner {
78
- gd = ERC20(nameService.getAddress("GOODDOLLAR"));
79
- }
80
-
81
77
  function getIdentity() public view returns (IIdentityV2) {
82
78
  return IIdentityV2(nameService.getAddress("IDENTITY"));
83
79
  }
@@ -236,6 +232,8 @@ contract AdminWallet is
236
232
  * @param _user The address to transfer to
237
233
  */
238
234
  function topWallet(address payable _user) public onlyAdmin reimburseGas {
235
+ ERC20 gd = ERC20(nameService.getAddress("GOODDOLLAR"));
236
+
239
237
  uint256 gdBalance = gd.balanceOf(_user);
240
238
  require(
241
239
  getIdentity().isWhitelisted(_user) || gdBalance != lastGdBalance[_user],
@@ -6,128 +6,6 @@ import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
6
6
  import "@mean-finance/uniswap-v3-oracle/solidity/interfaces/IStaticOracle.sol";
7
7
  import "../Interfaces.sol";
8
8
 
9
- // @uniswap/v3-core
10
- interface ISwapRouter {
11
- struct ExactInputSingleParams {
12
- address tokenIn;
13
- address tokenOut;
14
- uint24 fee;
15
- address recipient;
16
- uint256 amountIn;
17
- uint256 amountOutMinimum;
18
- uint160 sqrtPriceLimitX96;
19
- }
20
-
21
- /// @notice Swaps `amountIn` of one token for as much as possible of another token
22
- /// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
23
- /// and swap the entire amount, enabling contracts to send tokens before calling this function.
24
- /// @param params The parameters necessary for the swap, encoded as `ExactInputSingleParams` in calldata
25
- /// @return amountOut The amount of the received token
26
- function exactInputSingle(
27
- ExactInputSingleParams calldata params
28
- ) external payable returns (uint256 amountOut);
29
-
30
- struct ExactInputParams {
31
- bytes path;
32
- address recipient;
33
- uint256 amountIn;
34
- uint256 amountOutMinimum;
35
- }
36
-
37
- /// @notice Swaps `amountIn` of one token for as much as possible of another along the specified path
38
- /// @dev Setting `amountIn` to 0 will cause the contract to look up its own balance,
39
- /// and swap the entire amount, enabling contracts to send tokens before calling this function.
40
- /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactInputParams` in calldata
41
- /// @return amountOut The amount of the received token
42
- function exactInput(
43
- ExactInputParams calldata params
44
- ) external payable returns (uint256 amountOut);
45
-
46
- struct ExactOutputSingleParams {
47
- address tokenIn;
48
- address tokenOut;
49
- uint24 fee;
50
- address recipient;
51
- uint256 amountOut;
52
- uint256 amountInMaximum;
53
- uint160 sqrtPriceLimitX96;
54
- }
55
-
56
- /// @notice Swaps as little as possible of one token for `amountOut` of another token
57
- /// that may remain in the router after the swap.
58
- /// @param params The parameters necessary for the swap, encoded as `ExactOutputSingleParams` in calldata
59
- /// @return amountIn The amount of the input token
60
- function exactOutputSingle(
61
- ExactOutputSingleParams calldata params
62
- ) external payable returns (uint256 amountIn);
63
-
64
- struct ExactOutputParams {
65
- bytes path;
66
- address recipient;
67
- uint256 amountOut;
68
- uint256 amountInMaximum;
69
- }
70
-
71
- /// @notice Swaps as little as possible of one token for `amountOut` of another along the specified path (reversed)
72
- /// that may remain in the router after the swap.
73
- /// @param params The parameters necessary for the multi-hop swap, encoded as `ExactOutputParams` in calldata
74
- /// @return amountIn The amount of the input token
75
- function exactOutput(
76
- ExactOutputParams calldata params
77
- ) external payable returns (uint256 amountIn);
78
- }
79
-
80
- interface IQuoterV2 {
81
- /// @notice Returns the amount out received for a given exact input swap without executing the swap
82
- /// @param path The path of the swap, i.e. each token pair and the pool fee
83
- /// @param amountIn The amount of the first token to swap
84
- /// @return amountOut The amount of the last token that would be received
85
- /// @return sqrtPriceX96AfterList List of the sqrt price after the swap for each pool in the path
86
- /// @return initializedTicksCrossedList List of the initialized ticks that the swap crossed for each pool in the path
87
- /// @return gasEstimate The estimate of the gas that the swap consumes
88
- function quoteExactInput(
89
- bytes memory path,
90
- uint256 amountIn
91
- )
92
- external
93
- returns (
94
- uint256 amountOut,
95
- uint160[] memory sqrtPriceX96AfterList,
96
- uint32[] memory initializedTicksCrossedList,
97
- uint256 gasEstimate
98
- );
99
-
100
- struct QuoteExactInputSingleParams {
101
- address tokenIn;
102
- address tokenOut;
103
- uint256 amountIn;
104
- uint24 fee;
105
- uint160 sqrtPriceLimitX96;
106
- }
107
-
108
- /// @notice Returns the amount out received for a given exact input but for a swap of a single pool
109
- /// @param params The params for the quote, encoded as `QuoteExactInputSingleParams`
110
- /// tokenIn The token being swapped in
111
- /// tokenOut The token being swapped out
112
- /// fee The fee of the token pool to consider for the pair
113
- /// amountIn The desired input amount
114
- /// sqrtPriceLimitX96 The price limit of the pool that cannot be exceeded by the swap
115
- /// @return amountOut The amount of `tokenOut` that would be received
116
- /// @return sqrtPriceX96After The sqrt price of the pool after the swap
117
- /// @return initializedTicksCrossed The number of initialized ticks that the swap crossed
118
- /// @return gasEstimate The estimate of the gas that the swap consumes
119
- function quoteExactInputSingle(
120
- QuoteExactInputSingleParams memory params
121
- )
122
- external
123
- returns (
124
- uint256 amountOut,
125
- uint160 sqrtPriceX96After,
126
- uint32 initializedTicksCrossed,
127
- uint256 gasEstimate
128
- );
129
- }
130
-
131
9
  /*
132
10
  * @title BuyGDClone
133
11
  * @notice This contract allows users to swap Celo or cUSD for GoodDollar (GD) tokens.
@@ -0,0 +1,123 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8;
3
+
4
+ import "../Interfaces.sol";
5
+
6
+ interface IUpgradeabilityOwnerStorage {
7
+ function upgradeabilityOwner() external view returns (address);
8
+ }
9
+
10
+ contract Upgradeable {
11
+ // Avoid using onlyUpgradeabilityOwner name to prevent issues with implementation from proxy contract
12
+ modifier onlyIfUpgradeabilityOwner() {
13
+ require(
14
+ msg.sender ==
15
+ IUpgradeabilityOwnerStorage(address(this)).upgradeabilityOwner()
16
+ );
17
+ /* solcov ignore next */
18
+ _;
19
+ }
20
+ }
21
+
22
+ /**
23
+ * @title EternalStorage
24
+ * @dev This contract holds all the necessary state variables to carry out the storage of any contract.
25
+ */
26
+ contract EternalStorage {
27
+ mapping(bytes32 => uint256) internal uintStorage;
28
+ mapping(bytes32 => string) internal stringStorage;
29
+ mapping(bytes32 => address) internal addressStorage;
30
+ mapping(bytes32 => bytes) internal bytesStorage;
31
+ mapping(bytes32 => bool) internal boolStorage;
32
+ mapping(bytes32 => int256) internal intStorage;
33
+ }
34
+
35
+ /**
36
+ * @title Ownable
37
+ * @dev This contract has an owner address providing basic authorization control
38
+ */
39
+ contract Ownable is EternalStorage {
40
+ bytes4 internal constant UPGRADEABILITY_OWNER = 0x6fde8202; // upgradeabilityOwner()
41
+
42
+ /**
43
+ * @dev Event to show ownership has been transferred
44
+ * @param previousOwner representing the address of the previous owner
45
+ * @param newOwner representing the address of the new owner
46
+ */
47
+ event OwnershipTransferred(address previousOwner, address newOwner);
48
+
49
+ /**
50
+ * @dev Throws if called by any account other than the owner.
51
+ */
52
+ modifier onlyOwner() {
53
+ require(msg.sender == owner());
54
+ /* solcov ignore next */
55
+ _;
56
+ }
57
+
58
+ /**
59
+ * @dev Throws if called by any account other than contract itself or owner.
60
+ */
61
+ modifier onlyRelevantSender() {
62
+ // proxy owner if used through proxy, address(0) otherwise
63
+ (bool ok, bytes memory addr) = address(this).call(
64
+ abi.encodeWithSelector(UPGRADEABILITY_OWNER)
65
+ );
66
+ address upgowner = abi.decode(addr, (address));
67
+ require(
68
+ (ok && upgowner != address(0)) || // covers usage without calling through storage proxy
69
+ msg.sender ==
70
+ IUpgradeabilityOwnerStorage(address(this)).upgradeabilityOwner() || // covers usage through regular proxy calls
71
+ msg.sender == address(this) // covers calls through upgradeAndCall proxy method
72
+ );
73
+ /* solcov ignore next */
74
+ _;
75
+ }
76
+
77
+ bytes32 internal constant OWNER =
78
+ 0x02016836a56b71f0d02689e69e326f4f4c1b9057164ef592671cf0d37c8040c0; // keccak256(abi.encodePacked("owner"))
79
+
80
+ /**
81
+ * @dev Tells the address of the owner
82
+ * @return the address of the owner
83
+ */
84
+ function owner() public view returns (address) {
85
+ return addressStorage[OWNER];
86
+ }
87
+
88
+ /**
89
+ * @dev Allows the current owner to transfer control of the contract to a newOwner.
90
+ * @param newOwner the address to transfer ownership to.
91
+ */
92
+ function transferOwnership(address newOwner) external onlyOwner {
93
+ require(newOwner != address(0));
94
+ setOwner(newOwner);
95
+ }
96
+
97
+ /**
98
+ * @dev Sets a new owner address
99
+ */
100
+ function setOwner(address newOwner) internal {
101
+ emit OwnershipTransferred(owner(), newOwner);
102
+ addressStorage[OWNER] = newOwner;
103
+ }
104
+ }
105
+
106
+ contract Initializable is EternalStorage {
107
+ bytes32 internal constant INITIALIZED =
108
+ 0x0a6f646cd611241d8073675e00d1a1ff700fbf1b53fcf473de56d1e6e4b714ba; // keccak256(abi.encodePacked("isInitialized"))
109
+
110
+ function setInitialize() internal {
111
+ boolStorage[INITIALIZED] = true;
112
+ }
113
+
114
+ function isInitialized() public view returns (bool) {
115
+ return boolStorage[INITIALIZED];
116
+ }
117
+ }
118
+
119
+ contract FuseOldBridgeKill is Initializable, Upgradeable {
120
+ function end() external {
121
+ IGoodDollar(0x495d133B938596C9984d462F007B676bDc57eCEC).renounceMinter();
122
+ }
123
+ }
@@ -0,0 +1,157 @@
1
+ // SPDX-License-Identifier: MIT
2
+ pragma solidity >=0.8.0;
3
+
4
+ import "../utils/NameService.sol";
5
+ import "../Interfaces.sol";
6
+ import "../reserve/GoodReserveCDai.sol";
7
+ import "hardhat/console.sol";
8
+
9
+ contract ReserveRestore {
10
+ NameService ns;
11
+ uint256 public constant LOCKED_HACKED_FUNDS = 971921364208;
12
+ bool public executed;
13
+ address owner;
14
+
15
+ constructor(NameService _ns) {
16
+ ns = _ns;
17
+ owner = msg.sender;
18
+ }
19
+
20
+ function end() external {
21
+ require(msg.sender == owner, "not owner");
22
+ Controller ctrl = Controller(ns.getAddress("CONTROLLER"));
23
+ address avatar = ns.dao().avatar();
24
+
25
+ // prevent executing again}
26
+ require(ctrl.unregisterSelf(avatar), "unregistering failed");
27
+ }
28
+
29
+ function donate(address daiFrom, uint256 amount) external {
30
+ require(msg.sender == owner, "not owner");
31
+ address avatar = ns.dao().avatar();
32
+
33
+ GoodReserveCDai reserve = GoodReserveCDai(ns.getAddress("RESERVE"));
34
+ ERC20(ns.getAddress("DAI")).transferFrom(daiFrom, address(this), amount);
35
+ uint256 daiBalance = ERC20(ns.getAddress("DAI")).balanceOf(address(this));
36
+ cERC20 cdai = cERC20(ns.getAddress("CDAI"));
37
+ ERC20 dai = ERC20(ns.getAddress("DAI"));
38
+
39
+ dai.approve(address(cdai), daiBalance);
40
+ //Mint cDAIs
41
+ uint256 cDaiResult = cdai.mint(daiBalance);
42
+ require(cDaiResult == 0, "Minting cDai failed");
43
+ uint256 cdaiBalance = cdai.balanceOf(address(this));
44
+ cdai.transfer(address(reserve), cdaiBalance);
45
+ cdaiBalance = cdai.balanceOf(address(reserve));
46
+
47
+ uint256 gdSupply = ERC20(ns.getAddress("GOODDOLLAR")).totalSupply() -
48
+ LOCKED_HACKED_FUNDS;
49
+ console.log("supply: %s", gdSupply);
50
+ // get 0.0001 dai price in cdai
51
+ uint256 currentPrice = reserve.currentPrice();
52
+ console.log("currentPrice: %s", currentPrice);
53
+
54
+ console.log("cdaiBalance: %s", cdaiBalance);
55
+
56
+ // given price calculate the reserve ratio
57
+ uint32 reserveRatio = uint32(
58
+ (cdaiBalance * 1e2 * 1e6) / (currentPrice * gdSupply)
59
+ ); // mul by 1e2 to cover gd precision, cdaibalance precision=initialprice, mul by 1e6 to receive result in the precision of reserveRatio(1e6)
60
+ console.log("reserveRatio: %s", reserveRatio);
61
+ Controller ctrl = Controller(ns.getAddress("CONTROLLER"));
62
+ // function initializeToken(
63
+ // ERC20 _token,
64
+ // uint256 _gdSupply,
65
+ // uint256 _tokenSupply,
66
+ // uint32 _reserveRatio,
67
+ // uint256 _lastExpansion
68
+ // )
69
+ (bool ok, ) = ctrl.genericCall(
70
+ address(reserve.getMarketMaker()),
71
+ abi.encodeCall(
72
+ GoodMarketMaker.initializeToken,
73
+ (cdai, gdSupply, cdaiBalance, reserveRatio, block.timestamp)
74
+ ),
75
+ address(avatar),
76
+ 0
77
+ );
78
+ require(ok, "initializeToken failed");
79
+ }
80
+
81
+ function upgrade(address daiFrom, uint256 amount) external {
82
+ require(msg.sender == owner, "not owner");
83
+ require(executed == false, "already upgraded");
84
+ executed = true;
85
+ address avatar = ns.dao().avatar();
86
+
87
+ GoodReserveCDai reserve = GoodReserveCDai(ns.getAddress("RESERVE"));
88
+ ERC20(ns.getAddress("DAI")).transferFrom(daiFrom, address(this), amount);
89
+ uint256 daiBalance = ERC20(ns.getAddress("DAI")).balanceOf(address(this));
90
+ require(daiBalance >= 50000e18, "not enough reserve");
91
+ cERC20 cdai = cERC20(ns.getAddress("CDAI"));
92
+ ERC20 dai = ERC20(ns.getAddress("DAI"));
93
+
94
+ dai.approve(address(cdai), daiBalance);
95
+ //Mint cDAIs
96
+ uint256 cDaiResult = cdai.mint(daiBalance);
97
+ require(cDaiResult == 0, "Minting cDai failed");
98
+ uint256 cdaiBalance = cdai.balanceOf(address(this));
99
+ cdai.transfer(address(reserve), cdaiBalance);
100
+ cdaiBalance = cdai.balanceOf(address(reserve));
101
+
102
+ uint256 gdSupply = ERC20(ns.getAddress("GOODDOLLAR")).totalSupply() -
103
+ LOCKED_HACKED_FUNDS;
104
+ console.log("supply: %s", gdSupply);
105
+ // get 0.0001 dai price in cdai
106
+ uint256 initialPriceCdai = (0.0001 * 1e8 * 1e28) /
107
+ cdai.exchangeRateStored(); //excghange rate is at 1e28 precision rate/1e28=1 cdai price in dai mul by 1e8 to get in cdai precision
108
+ console.log("initialPriceCdai: %s", initialPriceCdai);
109
+
110
+ console.log("cdaiBalance: %s", cdaiBalance);
111
+
112
+ // given price calculate the reserve ratio
113
+ uint32 reserveRatio = uint32(
114
+ (cdaiBalance * 1e2 * 1e6) / (initialPriceCdai * gdSupply)
115
+ ); // mul by 1e2 to cover gd precision, cdaibalance precision=initialprice, mul by 1e6 to receive result in the precision of reserveRatio(1e6)
116
+ console.log("reserveRatio: %s", reserveRatio);
117
+ Controller ctrl = Controller(ns.getAddress("CONTROLLER"));
118
+ // function initializeToken(
119
+ // ERC20 _token,
120
+ // uint256 _gdSupply,
121
+ // uint256 _tokenSupply,
122
+ // uint32 _reserveRatio,
123
+ // uint256 _lastExpansion
124
+ // )
125
+ (bool ok, ) = ctrl.genericCall(
126
+ address(reserve.getMarketMaker()),
127
+ abi.encodeCall(
128
+ GoodMarketMaker.initializeToken,
129
+ (cdai, gdSupply, cdaiBalance, reserveRatio, block.timestamp)
130
+ ),
131
+ address(avatar),
132
+ 0
133
+ );
134
+ require(ok, "initializeToken failed");
135
+ // ContributionCalc(
136
+ // ns.getAddress("CONTRIBUTION_CALCULATION")
137
+ // ).setContributionRatio(0.1*1e18,1e18);
138
+
139
+ // exit contribution to 10%
140
+ (ok, ) = ctrl.genericCall(
141
+ address(ns.getAddress("CONTRIBUTION_CALCULATION")),
142
+ abi.encodeCall(ContributionCalc.setContributionRatio, (0.1 * 1e18, 1e18)),
143
+ address(avatar),
144
+ 0
145
+ );
146
+ require(ok, "setContributionRatio failed");
147
+
148
+ (ok, ) = ctrl.genericCall(
149
+ address(reserve),
150
+ abi.encodeCall(GoodReserveCDai.setGDXDisabled, (true, true)),
151
+ address(avatar),
152
+ 0
153
+ );
154
+
155
+ require(ok, "setContributionRatio failed");
156
+ }
157
+ }