@gooddollar/goodprotocol 1.0.29-beta.3 → 1.0.29

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 (296) hide show
  1. package/artifacts/abis/AdminWallet.min.json +1 -1
  2. package/artifacts/abis/GoodDollarMintBurnWrapper.min.json +1 -1
  3. package/artifacts/abis/GoodDollarStaking.min.json +1 -1
  4. package/artifacts/abis/GoodDollarStakingMock.min.json +1 -1
  5. package/artifacts/abis/IGoodDollar.min.json +1 -1
  6. package/artifacts/abis/IIdentity.min.json +1 -1
  7. package/artifacts/abis/UBIScheme.min.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  9. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  10. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  11. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  12. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  13. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IGoodDollar.json +0 -39
  23. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/IIdentity.json +0 -51
  27. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  36. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  37. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  38. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  39. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
  40. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  41. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
  42. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  43. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +2 -2
  44. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  45. package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
  46. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  47. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -15
  48. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  49. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  50. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.json +2 -2
  51. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  52. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  53. package/artifacts/contracts/governance/Reputation.sol/Reputation.json +2 -2
  54. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  55. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
  56. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  57. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
  58. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
  63. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +2 -2
  65. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +2 -2
  67. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
  69. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -15
  71. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
  73. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
  78. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +2 -2
  81. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
  83. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
  87. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +2 -2
  90. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
  92. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  93. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
  94. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  95. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
  96. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  97. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  100. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  101. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  102. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  103. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  104. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  105. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +2 -2
  106. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  107. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
  108. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  109. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +2 -2
  110. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  111. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  112. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +2 -2
  113. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  114. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
  115. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  116. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
  117. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  118. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
  119. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  120. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
  121. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  122. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  123. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  124. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +2 -2
  125. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  126. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  127. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  128. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
  129. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  130. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
  131. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  132. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
  133. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  134. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
  135. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  136. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
  137. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  138. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
  139. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  140. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
  141. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  142. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  143. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  144. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +22 -15
  145. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  146. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +56 -76
  147. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  148. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  149. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
  150. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  151. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
  152. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  153. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
  154. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  155. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  156. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  157. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -16
  158. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  159. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  160. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  161. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
  162. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  163. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
  164. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  165. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  166. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  167. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
  168. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  169. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
  170. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  171. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
  172. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  173. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
  174. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  175. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  176. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  177. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
  178. package/contracts/Interfaces.sol +0 -26
  179. package/contracts/governance/GoodDollarStaking.sol +9 -23
  180. package/contracts/ubi/UBIScheme.sol +40 -45
  181. package/contracts/utils/AdminWallet.sol +11 -42
  182. package/contracts/utils/GoodDollarMintBurnWrapper.sol +3 -13
  183. package/hardhat.config.ts +7 -21
  184. package/package.json +2 -3
  185. package/releases/deploy-settings.json +1 -36
  186. package/releases/deployment.json +53 -94
  187. package/scripts/analytics/gdinflow.ts +56 -0
  188. package/scripts/analytics/tokenInOutStats.ts +50 -0
  189. package/scripts/deployFullDAO.ts +19 -39
  190. package/scripts/multichain-deploy/{1_basicdao-deploy.ts → basicdao-deploy.ts} +52 -56
  191. package/scripts/multichain-deploy/{3_gdSavings-deploy.ts → gdSavings-deploy.ts} +76 -90
  192. package/scripts/multichain-deploy/helpers.ts +1 -0
  193. package/scripts/{upgrades → multichain-deploy}/nonubiDistribution-deploy.ts +5 -2
  194. package/scripts/test/localOldDaoDeploy.ts +3 -10
  195. package/test/helpers.ts +8 -12
  196. package/test/ubi/UBIScheme.test.ts +30 -30
  197. package/test/ubi/UBISchemeCycle.test.ts +7 -9
  198. package/test/utils/AdminWallet.test.ts +11 -33
  199. package/types/AdminWallet.ts +113 -124
  200. package/types/GoodDollarMintBurnWrapper.ts +0 -42
  201. package/types/GoodDollarStaking.ts +0 -34
  202. package/types/GoodDollarStakingMock.ts +0 -34
  203. package/types/IGoodDollar.ts +0 -54
  204. package/types/IIdentity.ts +0 -75
  205. package/types/UBIScheme.ts +40 -19
  206. package/types/factories/AaveStakingFactory__factory.ts +1 -1
  207. package/types/factories/AdminWallet__factory.ts +55 -75
  208. package/types/factories/BaseShareFieldV2__factory.ts +1 -1
  209. package/types/factories/BaseShareField__factory.ts +1 -1
  210. package/types/factories/ClaimersDistribution__factory.ts +1 -1
  211. package/types/factories/CompoundStakingFactory__factory.ts +1 -1
  212. package/types/factories/CompoundVotingMachine__factory.ts +1 -1
  213. package/types/factories/DAOContract__factory.ts +1 -1
  214. package/types/factories/DAOUpgradeableContract__factory.ts +1 -1
  215. package/types/factories/DistributionBridgeMock__factory.ts +1 -1
  216. package/types/factories/DistributionHelperTestHelper__factory.ts +1 -1
  217. package/types/factories/DistributionHelperTest__factory.ts +1 -1
  218. package/types/factories/DistributionHelper__factory.ts +1 -1
  219. package/types/factories/DonationsStaking__factory.ts +1 -1
  220. package/types/factories/ExchangeHelper__factory.ts +1 -1
  221. package/types/factories/FuseFaucet__factory.ts +1 -1
  222. package/types/factories/FuseStakingV3__factory.ts +1 -1
  223. package/types/factories/GReputation__factory.ts +1 -1
  224. package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
  225. package/types/factories/GoodAaveStaking__factory.ts +1 -1
  226. package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
  227. package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
  228. package/types/factories/GoodCompoundStaking__factory.ts +1 -1
  229. package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1 -15
  230. package/types/factories/GoodDollarStakingMock__factory.ts +1 -14
  231. package/types/factories/GoodDollarStaking__factory.ts +1 -14
  232. package/types/factories/GoodFundManagerTest__factory.ts +1 -1
  233. package/types/factories/GoodFundManager__factory.ts +1 -1
  234. package/types/factories/GoodMarketMaker__factory.ts +1 -1
  235. package/types/factories/GoodReserveCDai__factory.ts +1 -1
  236. package/types/factories/GovernanceStaking__factory.ts +1 -1
  237. package/types/factories/IGoodDollar__factory.ts +0 -39
  238. package/types/factories/IIdentity__factory.ts +0 -51
  239. package/types/factories/InvitesV1__factory.ts +1 -1
  240. package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
  241. package/types/factories/MultichainRouterMock__factory.ts +1 -1
  242. package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
  243. package/types/factories/OverMintTester__factory.ts +1 -1
  244. package/types/factories/ProtocolUpgradeFuseRecover__factory.ts +1 -1
  245. package/types/factories/ProtocolUpgradeFuse__factory.ts +1 -1
  246. package/types/factories/ProtocolUpgradeRecover__factory.ts +1 -1
  247. package/types/factories/ProtocolUpgrade__factory.ts +1 -1
  248. package/types/factories/ReputationTestHelper__factory.ts +1 -1
  249. package/types/factories/Reputation__factory.ts +1 -1
  250. package/types/factories/StakersDistribution__factory.ts +1 -1
  251. package/types/factories/SwapHelperTest__factory.ts +1 -1
  252. package/types/factories/UBIScheme__factory.ts +21 -14
  253. package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
  254. package/types/factories/UpgradableMock2__factory.ts +1 -1
  255. package/types/factories/UpgradableMock3__factory.ts +1 -1
  256. package/types/factories/UpgradableMock4__factory.ts +1 -1
  257. package/types/factories/UpgradableMock__factory.ts +1 -1
  258. package/types/hardhat.d.ts +0 -54
  259. package/types/index.ts +0 -12
  260. package/yarn.lock +4 -4
  261. package/artifacts/abis/Faucet.min.json +0 -1
  262. package/artifacts/abis/IGovernanceStaking.min.json +0 -1
  263. package/artifacts/abis/IIdentityV2.min.json +0 -1
  264. package/artifacts/abis/IdentityV2.min.json +0 -1
  265. package/artifacts/abis/InvitesV2.min.json +0 -1
  266. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +0 -4
  267. package/artifacts/contracts/Interfaces.sol/IIdentityV2.json +0 -281
  268. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +0 -4
  269. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +0 -684
  270. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +0 -4
  271. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.json +0 -24
  272. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +0 -4
  273. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +0 -1000
  274. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +0 -4
  275. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +0 -586
  276. package/contracts/fuseFaucet/Faucet.sol +0 -245
  277. package/contracts/identity/IdentityV2.sol +0 -434
  278. package/contracts/invite/InvitesV2.sol +0 -316
  279. package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -45
  280. package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -143
  281. package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -121
  282. package/scripts/multichain-deploy/5_gov-deploy.ts +0 -123
  283. package/scripts/multichain-deploy/verifyEtherscan.ts +0 -84
  284. package/scripts/upgrades/identity-upgrade.ts +0 -153
  285. package/types/Faucet.ts +0 -1014
  286. package/types/IERC1271.ts +0 -109
  287. package/types/IGovernanceStaking.ts +0 -98
  288. package/types/IIdentityV2.ts +0 -526
  289. package/types/IdentityV2.ts +0 -1612
  290. package/types/InvitesV2.ts +0 -933
  291. package/types/factories/Faucet__factory.ts +0 -729
  292. package/types/factories/IERC1271__factory.ts +0 -47
  293. package/types/factories/IGovernanceStaking__factory.ts +0 -39
  294. package/types/factories/IIdentityV2__factory.ts +0 -293
  295. package/types/factories/IdentityV2__factory.ts +0 -1048
  296. package/types/factories/InvitesV2__factory.ts +0 -634
@@ -74,8 +74,8 @@
74
74
  "type": "function"
75
75
  }
76
76
  ],
77
- "bytecode": "0x608060405234801561001057600080fd5b5060405161035c38038061035c83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6102c9806100936000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80635653eeeb1461004657806391d61f3e1461005b578063c52164c61461006e575b600080fd5b6100596100543660046101e7565b61009d565b005b6100596100693660046101e7565b610145565b600054610081906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005b8181101561013f576000546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906100da9087908790600401610228565b602060405180830381600087803b1580156100f457600080fd5b505af1158015610108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012c9190610241565b50806101378161026a565b9150506100a0565b50505050565b60005b8181101561013f57600054604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906101829087908790600401610228565b602060405180830381600087803b15801561019c57600080fd5b505af11580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d49190610241565b50806101df8161026a565b915050610148565b6000806000606084860312156101fc57600080fd5b83356001600160a01b038116811461021357600080fd5b95602085013595506040909401359392505050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561025357600080fd5b8151801515811461026357600080fd5b9392505050565b600060001982141561028c57634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220bf5af15fd554b440d628427d634d0ac3eb559002d7f37b7154c4e720322a9e9c64736f6c63430008080033",
78
- "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80635653eeeb1461004657806391d61f3e1461005b578063c52164c61461006e575b600080fd5b6100596100543660046101e7565b61009d565b005b6100596100693660046101e7565b610145565b600054610081906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005b8181101561013f576000546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906100da9087908790600401610228565b602060405180830381600087803b1580156100f457600080fd5b505af1158015610108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012c9190610241565b50806101378161026a565b9150506100a0565b50505050565b60005b8181101561013f57600054604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906101829087908790600401610228565b602060405180830381600087803b15801561019c57600080fd5b505af11580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d49190610241565b50806101df8161026a565b915050610148565b6000806000606084860312156101fc57600080fd5b83356001600160a01b038116811461021357600080fd5b95602085013595506040909401359392505050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561025357600080fd5b8151801515811461026357600080fd5b9392505050565b600060001982141561028c57634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220bf5af15fd554b440d628427d634d0ac3eb559002d7f37b7154c4e720322a9e9c64736f6c63430008080033",
77
+ "bytecode": "0x608060405234801561001057600080fd5b5060405161035c38038061035c83398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b6102c9806100936000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c80635653eeeb1461004657806391d61f3e1461005b578063c52164c61461006e575b600080fd5b6100596100543660046101e7565b61009d565b005b6100596100693660046101e7565b610145565b600054610081906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005b8181101561013f576000546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906100da9087908790600401610228565b602060405180830381600087803b1580156100f457600080fd5b505af1158015610108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012c9190610241565b50806101378161026a565b9150506100a0565b50505050565b60005b8181101561013f57600054604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906101829087908790600401610228565b602060405180830381600087803b15801561019c57600080fd5b505af11580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d49190610241565b50806101df8161026a565b915050610148565b6000806000606084860312156101fc57600080fd5b83356001600160a01b038116811461021357600080fd5b95602085013595506040909401359392505050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561025357600080fd5b8151801515811461026357600080fd5b9392505050565b600060001982141561028c57634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220a9e79a4dd3fd1fa013d0a2232cbff569221ba33b84f992e39b9a89213eb5edac64736f6c63430008080033",
78
+ "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c80635653eeeb1461004657806391d61f3e1461005b578063c52164c61461006e575b600080fd5b6100596100543660046101e7565b61009d565b005b6100596100693660046101e7565b610145565b600054610081906001600160a01b031681565b6040516001600160a01b03909116815260200160405180910390f35b60005b8181101561013f576000546040516340c10f1960e01b81526001600160a01b03909116906340c10f19906100da9087908790600401610228565b602060405180830381600087803b1580156100f457600080fd5b505af1158015610108573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061012c9190610241565b50806101378161026a565b9150506100a0565b50505050565b60005b8181101561013f57600054604051632770a7eb60e21b81526001600160a01b0390911690639dc29fac906101829087908790600401610228565b602060405180830381600087803b15801561019c57600080fd5b505af11580156101b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d49190610241565b50806101df8161026a565b915050610148565b6000806000606084860312156101fc57600080fd5b83356001600160a01b038116811461021357600080fd5b95602085013595506040909401359392505050565b6001600160a01b03929092168252602082015260400190565b60006020828403121561025357600080fd5b8151801515811461026357600080fd5b9392505050565b600060001982141561028c57634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220a9e79a4dd3fd1fa013d0a2232cbff569221ba33b84f992e39b9a89213eb5edac64736f6c63430008080033",
79
79
  "linkReferences": {},
80
80
  "deployedLinkReferences": {}
81
81
  }
@@ -77,12 +77,6 @@ interface IGoodDollar is ERC20 {
77
77
  ) external returns (bool);
78
78
 
79
79
  function formula() external view returns (address);
80
-
81
- function setIdentity(address identity) external;
82
-
83
- function identity() external view returns (address);
84
-
85
- function owner() external view returns (address);
86
80
  }
87
81
 
88
82
  interface IERC2917 is ERC20 {
@@ -270,29 +264,9 @@ interface IIdentity {
270
264
 
271
265
  function owner() external view returns (address);
272
266
 
273
- function removeContract(address account) external;
274
-
275
- function isDAOContract(address account) external view returns (bool);
276
-
277
- function addrToDID(address account) external view returns (string memory);
278
-
279
267
  event WhitelistedAdded(address user);
280
268
  }
281
269
 
282
- interface IIdentityV2 is IIdentity {
283
- function addWhitelistedWithDIDAndChain(
284
- address account,
285
- string memory did,
286
- uint256 orgChainId,
287
- uint256 dateAuthenticated
288
- ) external;
289
-
290
- function getWhitelistedRoot(address account)
291
- external
292
- view
293
- returns (address root);
294
- }
295
-
296
270
  interface IUBIScheme {
297
271
  function currentDay() external view returns (uint256);
298
272
 
@@ -17,10 +17,6 @@ interface RewardsMinter {
17
17
  function sendOrMint(address to, uint256 amount) external returns (uint256);
18
18
  }
19
19
 
20
- interface IGovernanceStaking {
21
- function withdrawRewards() external returns (uint256);
22
- }
23
-
24
20
  /**
25
21
  * @title Staking contract that allows citizens to stake G$ to get GOOD + G$ rewards
26
22
  * it implements
@@ -275,7 +271,7 @@ contract GoodDollarStaking is
275
271
  * @return gdRewards recieved G$ rewards
276
272
  */
277
273
  function withdrawRewards()
278
- external
274
+ public
279
275
  returns (uint256 goodRewards, uint256 gdRewards)
280
276
  {
281
277
  uint256 gdRewardsShares = amountToShares(earned(msg.sender));
@@ -367,11 +363,6 @@ contract GoodDollarStaking is
367
363
  emit GOODRewardsSet(_monthlyAmount);
368
364
  }
369
365
 
370
- function setBlockPerYear(uint128 _blocksPerYear) external {
371
- _onlyAvatar();
372
- numberOfBlocksPerYear = _blocksPerYear;
373
- }
374
-
375
366
  /**
376
367
  * @dev interest rate per one block in 1e18 precision.
377
368
  * for example APY=5% then per block = nroot(1+0.05,numberOfBlocksPerYear)
@@ -474,19 +465,14 @@ contract GoodDollarStaking is
474
465
  emit GOODRewardsSet(2 ether * 1e6);
475
466
 
476
467
  //this will make sure rewards are set at 0, so no withdraw issue will happen.
477
- address curStaking = nameService.getAddress("GDAO_STAKING");
478
- bool ok;
479
- if (curStaking != address(0)) {
480
- //this will trigger updating of accumulated rewards, so everyone's rewards are updated to this point
481
- IGovernanceStaking(curStaking).withdrawRewards();
482
- (ok, ) = dao.genericCall(
483
- curStaking,
484
- abi.encodeWithSignature("setMonthlyRewards(uint256)", 0),
485
- avatar,
486
- 0
487
- );
488
- require(ok, "calling setMonthlyRewards failed");
489
- }
468
+ //on governacnestaking anyone withdrawing from now on will get 0 GOOD, not matter how long he has been staking
469
+ (bool ok, ) = dao.genericCall(
470
+ nameService.getAddress("GDAO_STAKING"),
471
+ abi.encodeWithSignature("setMonthlyRewards(uint256)", 0),
472
+ avatar,
473
+ 0
474
+ );
475
+ require(ok, "calling setMonthlyRewards failed");
490
476
 
491
477
  //this will set this contract as the GDAO_STAKING contract and give us minting rights on the reputation token
492
478
  (ok, ) = dao.genericCall(
@@ -71,8 +71,7 @@ contract UBIScheme is DAOUpgradeableContract {
71
71
  //dont use first claim, and give ubi as usual
72
72
  bool public useFirstClaimPool;
73
73
 
74
- //minimum amount of users to divide the pool for, renamed from defaultDailyUbi
75
- uint256 public minActiveUsers;
74
+ uint256 public defaultDailyUbi;
76
75
 
77
76
  // A pool of GD to give to activated users,
78
77
  // since they will enter the UBI pool
@@ -100,14 +99,14 @@ contract UBIScheme is DAOUpgradeableContract {
100
99
  // Total claims per user stat
101
100
  mapping(address => uint256) public totalClaimsPerUser;
102
101
 
103
- bool public paused;
104
-
105
102
  // Emits when a withdraw has been succeded
106
103
  event WithdrawFromDao(uint256 prevBalance, uint256 newBalance);
107
104
 
108
105
  // Emits when a user is activated
109
106
  event ActivatedUser(address indexed account);
110
107
 
108
+ bool public paused;
109
+
111
110
  // Emits when a fish has been succeded
112
111
  event InactiveUserFished(
113
112
  address indexed caller,
@@ -158,8 +157,8 @@ contract UBIScheme is DAOUpgradeableContract {
158
157
  iterationGasLimit = 150000;
159
158
  periodStart = (block.timestamp / (1 days)) * 1 days + 12 hours; //set start time to GMT noon
160
159
  startOfCycle = periodStart;
161
- useFirstClaimPool = address(_firstClaimPool) != address(0);
162
- minActiveUsers = 1000;
160
+ useFirstClaimPool = true;
161
+ defaultDailyUbi = 5000;
163
162
  }
164
163
 
165
164
  function setUseFirstClaimPool(bool _use) public {
@@ -286,20 +285,17 @@ contract UBIScheme is DAOUpgradeableContract {
286
285
  Funds storage funds = dailyUBIHistory[currentDay];
287
286
  funds.hasWithdrawn = shouldWithdrawFromDAO;
288
287
  funds.openAmount = currentBalance;
289
- dailyUbi = dailyCyclePool / max(activeUsersCount, minActiveUsers);
290
- //update minActiveUsers as claimers grow
291
- minActiveUsers = max(activeUsersCount / 2, minActiveUsers);
292
-
288
+ if (activeUsersCount > 0) {
289
+ dailyUbi = dailyCyclePool / activeUsersCount;
290
+ } else if (useFirstClaimPool == false) {
291
+ dailyUbi = defaultDailyUbi;
292
+ }
293
293
  emit UBICalculated(currentDay, dailyUbi, block.number);
294
294
  }
295
295
 
296
296
  return dailyUbi;
297
297
  }
298
298
 
299
- function max(uint256 a, uint256 b) private pure returns (uint256) {
300
- return a >= b ? a : b;
301
- }
302
-
303
299
  /**
304
300
  *@dev Sets the currentDay variable to amount of days
305
301
  * since start of contract.
@@ -360,14 +356,12 @@ contract UBIScheme is DAOUpgradeableContract {
360
356
  * and emits an event in case of claimed.
361
357
  * In case that `isFirstTime` is true, it awards the user.
362
358
  * @param _account the account which recieves the funds
363
- * @param _target the recipient of funds
364
359
  * @param _amount the amount to transfer
365
360
  * @param _isClaimed true for claimed
366
361
  * @param _isFirstTime true for new user or fished user
367
362
  */
368
363
  function _transferTokens(
369
364
  address _account,
370
- address _target,
371
365
  uint256 _amount,
372
366
  bool _isClaimed,
373
367
  bool _isFirstTime
@@ -383,7 +377,7 @@ contract UBIScheme is DAOUpgradeableContract {
383
377
 
384
378
  // awards a new user or a fished user
385
379
  if (_isFirstTime) {
386
- uint256 awardAmount = firstClaimPool.awardUser(_target);
380
+ uint256 awardAmount = firstClaimPool.awardUser(_account);
387
381
  claimDay[currentDay].claimAmount += awardAmount;
388
382
  emit UBIClaimed(_account, awardAmount);
389
383
  } else {
@@ -392,7 +386,7 @@ contract UBIScheme is DAOUpgradeableContract {
392
386
  emit UBIClaimed(_account, _amount);
393
387
  }
394
388
  IGoodDollar token = nativeToken();
395
- require(token.transfer(_target, _amount), "claim transfer failed");
389
+ require(token.transfer(_account, _amount), "claim transfer failed");
396
390
  }
397
391
  }
398
392
 
@@ -409,9 +403,11 @@ contract UBIScheme is DAOUpgradeableContract {
409
403
  {
410
404
  _dailyCyclePool = currentBalance / cycleLength;
411
405
  }
412
-
413
- _dailyUbi = _dailyCyclePool / max(activeUsersCount, minActiveUsers);
414
-
406
+ if (activeUsersCount > 0) {
407
+ _dailyUbi = _dailyCyclePool / activeUsersCount;
408
+ } else if (useFirstClaimPool == false) {
409
+ _dailyUbi = defaultDailyUbi;
410
+ }
415
411
  return _dailyUbi;
416
412
  }
417
413
 
@@ -451,10 +447,9 @@ contract UBIScheme is DAOUpgradeableContract {
451
447
  * calculats the amount the account can claims, and transfers the amount to the account.
452
448
  * Emits the address of account and amount claimed.
453
449
  * @param _account The claimer account
454
- * @param _target recipient of funds
455
450
  * @return A bool indicating if UBI was claimed
456
451
  */
457
- function _claim(address _account, address _target) internal returns (bool) {
452
+ function _claim(address _account) internal returns (bool) {
458
453
  // calculats the formula up today ie on day 0 there are no active users, on day 1 any user
459
454
  // (new or active) will trigger the calculation with the active users count of the day before
460
455
  // and so on. the new or inactive users that will become active today, will not take into account
@@ -467,16 +462,16 @@ contract UBIScheme is DAOUpgradeableContract {
467
462
  !fishedUsersAddresses[_account] &&
468
463
  !hasClaimed(_account)
469
464
  ) {
470
- _transferTokens(_account, _target, newDistribution, true, false);
465
+ _transferTokens(_account, newDistribution, true, false);
471
466
  return true;
472
467
  } else if (!isNotNewUser(_account) || fishedUsersAddresses[_account]) {
473
468
  // a unregistered or fished user
474
469
  activeUsersCount += 1;
475
470
  fishedUsersAddresses[_account] = false;
476
471
  if (useFirstClaimPool) {
477
- _transferTokens(_account, _target, 0, false, true);
472
+ _transferTokens(_account, 0, false, true);
478
473
  } else {
479
- _transferTokens(_account, _target, newDistribution, true, false);
474
+ _transferTokens(_account, newDistribution, true, false);
480
475
  }
481
476
  emit ActivatedUser(_account);
482
477
  return true;
@@ -491,13 +486,14 @@ contract UBIScheme is DAOUpgradeableContract {
491
486
  * @return A bool indicating if UBI was claimed
492
487
  */
493
488
  function claim() public requireStarted returns (bool) {
494
- address whitelistedRoot = IIdentityV2(nameService.getAddress("IDENTITY"))
495
- .getWhitelistedRoot(msg.sender);
496
- require(whitelistedRoot != address(0), "UBIScheme: not whitelisted");
497
- bool didClaim = _claim(whitelistedRoot, msg.sender);
489
+ require(
490
+ IIdentity(nameService.getAddress("IDENTITY")).isWhitelisted(msg.sender),
491
+ "UBIScheme: not whitelisted"
492
+ );
493
+ bool didClaim = _claim(msg.sender);
498
494
  address claimerDistribution = nameService.getAddress("GDAO_CLAIMERS");
499
495
  if (didClaim && claimerDistribution != address(0)) {
500
- ClaimersDistribution(claimerDistribution).updateClaim(whitelistedRoot);
496
+ ClaimersDistribution(claimerDistribution).updateClaim(msg.sender);
501
497
  }
502
498
  return didClaim;
503
499
  }
@@ -528,7 +524,7 @@ contract UBIScheme is DAOUpgradeableContract {
528
524
  if (activeUsersCount > 0) {
529
525
  activeUsersCount -= 1;
530
526
  }
531
- _transferTokens(msg.sender, msg.sender, newDistribution, false, false);
527
+ _transferTokens(msg.sender, newDistribution, false, false);
532
528
  emit InactiveUserFished(msg.sender, _account, newDistribution);
533
529
  return true;
534
530
  }
@@ -576,19 +572,18 @@ contract UBIScheme is DAOUpgradeableContract {
576
572
  paused = _pause;
577
573
  }
578
574
 
579
- // function upgrade() public {
580
- // _onlyAvatar();
581
- // paused = true;
582
- // activeUsersCount = 50000; //estimated
583
- // dailyUbi = 0; //required so distributionformula will trigger
584
- // cycleLength = 30;
585
- // currentCycleLength = 0; //this will trigger a new cycle calculation in distribution formula
586
- // startOfCycle = block.timestamp - 91 days; //this will trigger a new calculation in distributionFormula
587
- // periodStart = 1646136000;
588
- // maxDailyUBI = 50000;
589
- // distributionFormula();
590
- // emit CycleLengthSet(cycleLength);
591
- // }
575
+ function upgrade() public {
576
+ _onlyAvatar();
577
+ paused = true;
578
+ activeUsersCount = 50000; //estimated
579
+ dailyUbi = 0; //required so distributionformula will trigger
580
+ cycleLength = 30;
581
+ currentCycleLength = 0; //this will trigger a new cycle calculation in distribution formula
582
+ startOfCycle = block.timestamp - 91 days; //this will trigger a new calculation in distributionFormula
583
+ periodStart = 1646136000;
584
+ distributionFormula();
585
+ emit CycleLengthSet(cycleLength);
586
+ }
592
587
 
593
588
  function setActiveUserCount(uint256 _activeUserCount) public {
594
589
  _onlyAvatar();
@@ -4,10 +4,10 @@ pragma solidity >=0.8.0;
4
4
 
5
5
  import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
6
6
  import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
7
+ import "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol";
7
8
  import "@openzeppelin/contracts-upgradeable/access/AccessControlUpgradeable.sol";
8
9
 
9
10
  import "../Interfaces.sol";
10
- import "../utils/NameService.sol";
11
11
 
12
12
  /* @title Admin wallet contract allowing whitelisting and topping up of
13
13
  * addresses
@@ -15,6 +15,7 @@ import "../utils/NameService.sol";
15
15
  contract AdminWallet is
16
16
  Initializable,
17
17
  UUPSUpgradeable,
18
+ OwnableUpgradeable,
18
19
  AccessControlUpgradeable
19
20
  {
20
21
  bytes32 public constant WALLET_ADMIN_ROLE = keccak256("WALLET_ADMIN_ROLE");
@@ -27,13 +28,10 @@ contract AdminWallet is
27
28
  uint256 public toppingTimes;
28
29
  uint256 public gasPrice;
29
30
 
30
- NameService public nameService;
31
+ IIdentity public identity;
31
32
 
32
33
  mapping(uint256 => mapping(address => uint256)) toppings;
33
34
 
34
- uint64 public maxDailyNewWallets;
35
- uint64 public day;
36
-
37
35
  event AdminsAdded(address payable[] indexed admins);
38
36
  event AdminsRemoved(address[] indexed admins);
39
37
  event WalletTopped(address indexed user, uint256 amount);
@@ -49,29 +47,17 @@ contract AdminWallet is
49
47
  */
50
48
  function initialize(
51
49
  address payable[] memory _admins,
52
- NameService _ns,
53
50
  address _owner,
54
- uint256 _gasPrice
51
+ IIdentity _identity
55
52
  ) public initializer {
56
53
  __AccessControl_init_unchained();
54
+ __Ownable_init_unchained();
57
55
  _setupRole(DEFAULT_ADMIN_ROLE, _owner);
58
- _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
59
-
60
- _setDefaults(600000, 9e6, 3, _gasPrice);
61
- nameService = _ns;
56
+ _setDefaults(600000, 9e6, 3, 1e10);
57
+ identity = _identity;
62
58
  if (_admins.length > 0) {
63
59
  addAdmins(_admins);
64
60
  }
65
- if (msg.sender != _owner) revokeRole(DEFAULT_ADMIN_ROLE, msg.sender);
66
- }
67
-
68
- modifier onlyOwner() {
69
- require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "not owner");
70
- _;
71
- }
72
-
73
- function getIdentity() public view returns (IIdentityV2) {
74
- return IIdentityV2(nameService.getAddress("IDENTITY"));
75
61
  }
76
62
 
77
63
  function setDefaults(
@@ -185,45 +171,28 @@ contract AdminWallet is
185
171
  onlyAdmin
186
172
  reimburseGas
187
173
  {
188
- getIdentity().addWhitelistedWithDID(_user, _did);
189
- }
190
-
191
- /* @dev Function to add given address to whitelist of identity contract
192
- * can only be done by admins of wallet and if wallet is an IdentityAdmin
193
- */
194
- function whitelist(
195
- address _user,
196
- string memory _did,
197
- uint256 orgChain,
198
- uint256 dateAuthenticated
199
- ) public onlyAdmin reimburseGas {
200
- getIdentity().addWhitelistedWithDIDAndChain(
201
- _user,
202
- _did,
203
- orgChain,
204
- dateAuthenticated
205
- );
174
+ identity.addWhitelistedWithDID(_user, _did);
206
175
  }
207
176
 
208
177
  /* @dev Function to remove given address from whitelist of identity contract
209
178
  * can only be done by admins of wallet and if wallet is an IdentityAdmin
210
179
  */
211
180
  function removeWhitelist(address _user) public onlyAdmin reimburseGas {
212
- getIdentity().removeWhitelisted(_user);
181
+ identity.removeWhitelisted(_user);
213
182
  }
214
183
 
215
184
  /* @dev Function to add given address to blacklist of identity contract
216
185
  * can only be done by admins of wallet and if wallet is an IdentityAdmin
217
186
  */
218
187
  function blacklist(address _user) public onlyAdmin reimburseGas {
219
- getIdentity().addBlacklisted(_user);
188
+ identity.addBlacklisted(_user);
220
189
  }
221
190
 
222
191
  /* @dev Function to remove given address from blacklist of identity contract
223
192
  * can only be done by admins of wallet and if wallet is an IdentityAdmin
224
193
  */
225
194
  function removeBlacklist(address _user) public onlyAdmin reimburseGas {
226
- getIdentity().removeBlacklisted(_user);
195
+ identity.removeBlacklisted(_user);
227
196
  }
228
197
 
229
198
  /* @dev Function to top given address with amount of G$ given in constructor
@@ -129,11 +129,11 @@ contract GoodDollarMintBurnWrapper is
129
129
  uint256 maxIn; // single limit of each mint
130
130
  uint256 capIn; // total limit of all mint
131
131
  uint256 totalIn; // total minted minus burned
132
- uint128 dailyCapIn; //cap per day
132
+ uint128 dailyCapIn; //cap per day (rewards sendOrMint only)
133
133
  uint128 mintedToday; //total minted today
134
134
  uint128 lastUpdate; //last update of dailyCap
135
- uint128 totalRewards; // total rewards sent (sent + minted)
136
- uint32 bpsPerDayIn; //basis points relative to token supply daily limit
135
+ uint128 totalRewards; // total rewards sent (sent + minted) (rewards sendOrMint only)
136
+ uint32 bpsPerDayIn; //basis points relative to token supply daily limit (rewards sendOrMint only)
137
137
  uint128 lastDayReset; //last day we reset the daily limits
138
138
  }
139
139
 
@@ -204,16 +204,6 @@ contract GoodDollarMintBurnWrapper is
204
204
  _setupRole(DEFAULT_ADMIN_ROLE, _admin);
205
205
  }
206
206
 
207
- function upgrade1() external {
208
- if (updateFrequency == 0) {
209
- updateFrequency = 90 days;
210
- }
211
- }
212
-
213
- function upgrade2() external {
214
- IGoodDollar(token).renounceMinter(); //moving to mint via Controller
215
- }
216
-
217
207
  function decimals() external view returns (uint8) {
218
208
  return ERC20(token).decimals();
219
209
  }
package/hardhat.config.ts CHANGED
@@ -60,8 +60,8 @@ const hhconfig: HardhatUserConfig = {
60
60
  network: "celo",
61
61
  chainId: 42220,
62
62
  urls: {
63
- apiURL: "https://api.celoscan.io/api",
64
- browserURL: "https://celoscan.io/"
63
+ apiURL: "https://api.celoscan.io",
64
+ browserURL: "https://celoscan.io"
65
65
  }
66
66
  }
67
67
  ]
@@ -129,20 +129,20 @@ const hhconfig: HardhatUserConfig = {
129
129
  url: "https://rpc.fuse.io/",
130
130
  chainId: 122,
131
131
  gas: 6000000,
132
- gasPrice: 1000000000
132
+ gasPrice: 10000000000
133
133
  },
134
134
  fuseexplorer: {
135
135
  accounts: { mnemonic },
136
136
  url: "https://explorer-node.fuse.io/",
137
137
  chainId: 122,
138
138
  gas: 6000000,
139
- gasPrice: 1000000000
139
+ gasPrice: 10000000000
140
140
  },
141
141
  fusespark: {
142
142
  accounts: { mnemonic },
143
143
  url: "https://rpc.fusespark.io/",
144
144
  gas: 3000000,
145
- gasPrice: 1000000000,
145
+ gasPrice: 10000000000,
146
146
  chainId: 123
147
147
  },
148
148
  "fuse-mainnet": {
@@ -157,7 +157,7 @@ const hhconfig: HardhatUserConfig = {
157
157
  url: "https://rpc.fuse.io/",
158
158
  chainId: 122,
159
159
  gas: 6000000,
160
- gasPrice: 1000000000
160
+ gasPrice: 10000000000
161
161
  },
162
162
  "staging-mainnet": {
163
163
  accounts: { mnemonic },
@@ -170,7 +170,7 @@ const hhconfig: HardhatUserConfig = {
170
170
  accounts: [deployerPrivateKey],
171
171
  url: "https://rpc.fuse.io/",
172
172
  gas: 3000000,
173
- gasPrice: 1000000000,
173
+ gasPrice: 10000000000,
174
174
  chainId: 122
175
175
  },
176
176
  "production-mainnet": {
@@ -193,20 +193,6 @@ const hhconfig: HardhatUserConfig = {
193
193
  gas: 3000000,
194
194
  gasPrice: 500000000,
195
195
  chainId: 42220
196
- },
197
- "staging-celo": {
198
- accounts: { mnemonic },
199
- url: "https://forno.celo.org",
200
- gas: 3000000,
201
- gasPrice: 150000000,
202
- chainId: 42220
203
- },
204
- "development-celo": {
205
- accounts: { mnemonic },
206
- url: "https://forno.celo.org",
207
- gas: 3000000,
208
- gasPrice: 150000000,
209
- chainId: 42220
210
196
  }
211
197
  },
212
198
  mocha: {
package/package.json CHANGED
@@ -1,9 +1,8 @@
1
1
  {
2
2
  "name": "@gooddollar/goodprotocol",
3
- "version": "1.0.29-beta.3",
3
+ "version": "1.0.29",
4
4
  "description": "GoodDollar Protocol",
5
5
  "scripts": {
6
- "prepack": "npm run minimize",
7
6
  "build": "scripts/build.sh deploy",
8
7
  "coverage:report": "export COVERALLS_REPO_TOKEN='qiXNelh1HXMAsoPah9yRD2yG2WlqrDfLh' && cat ../coverage/lcov.info coverage/lcov.info | coveralls",
9
8
  "coverage": "export CODE_COVERAGE=true; hardhat --max-memory 6096 coverage",
@@ -56,7 +55,7 @@
56
55
  },
57
56
  "homepage": "https://gooddollar.org",
58
57
  "dependencies": {
59
- "@gooddollar/goodcontracts": "^2.6.4",
58
+ "@gooddollar/goodcontracts": "^2.6.2",
60
59
  "@jsier/retrier": "^1.2.4",
61
60
  "@openzeppelin/contracts": "^4.5.0",
62
61
  "@openzeppelin/contracts-upgradeable": "^4.3.2",
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "default": {
3
3
  "governance": {
4
- "gdaoAirdrop": "0x2feece0e9bc03b54e63e6eb7abb81a128f6bc7ce9a3bafd5ca2bea0c40e3634b",
5
- "gdaoTotalSupply": "24000000000000000000000000",
6
4
  "proposalVotingPeriod": 241920
7
5
  },
8
- "guardiansSafe": null,
9
- "walletAdminsCount": 10,
10
- "gasPrice": 100000000,
11
6
  "compound": {},
12
7
  "aave": {},
13
8
  "expansionRatio": {
@@ -25,14 +20,6 @@
25
20
  "GoodAaveStaking": {
26
21
  "stkAaveClaimCost": 50000,
27
22
  "CollectInterestGasCost": 250000
28
- },
29
- "savings": {
30
- "blockAPY": "1000000007735630000",
31
- "daysUntilUpgrade": "7",
32
- "blocksPerYear": "6307200"
33
- },
34
- "ubi": {
35
- "maxInactiveDays": 14
36
23
  }
37
24
  },
38
25
  "develop": {
@@ -60,9 +47,7 @@
60
47
  "gdaoAirdrop": "0x2feece0e9bc03b54e63e6eb7abb81a128f6bc7ce9a3bafd5ca2bea0c40e3634b",
61
48
  "gdaoTotalSupply": "24000000000000000000000000",
62
49
  "proposalVotingPeriod": 241920
63
- },
64
- "walletAdminsCount": 10,
65
- "gasPrice": 1000000000
50
+ }
66
51
  },
67
52
  "dapptest-mainnet": {
68
53
  "gdxAirdrop": "0x707f775d730a9b17ee62c21e00188da4dff26602a58c338269cd115f30acbe2f",
@@ -99,9 +84,6 @@
99
84
  "gdaoAirdrop": "0x2feece0e9bc03b54e63e6eb7abb81a128f6bc7ce9a3bafd5ca2bea0c40e3634b",
100
85
  "gdaoTotalSupply": "24000000000000000000000000",
101
86
  "proposalVotingPeriod": 241920
102
- },
103
- "savings": {
104
- "daysUntilUpgrade": "7"
105
87
  }
106
88
  },
107
89
  "fuse-mainnet": {
@@ -211,9 +193,6 @@
211
193
  "gdaoTotalSupply": "96000000000000000000000000",
212
194
  "proposalVotingPeriod": 241920,
213
195
  "guardian": "0x914dA3B2508634998d244059dAb5488D9bA1814f"
214
- },
215
- "savings": {
216
- "daysUntilUpgrade": 30
217
196
  }
218
197
  },
219
198
  "production-mainnet": {
@@ -245,19 +224,5 @@
245
224
  "eth_usd": "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
246
225
  },
247
226
  "uniswapRouter": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D"
248
- },
249
- "staging-celo": {
250
- "guardiansSafe": "0xdF3e980a175904a26A7BA627048a789Ae6A141cD",
251
- "gasPrice": 150000000
252
- },
253
- "production-celo": {
254
- "governance": {
255
- "gdaoAirdrop": "0x2feece0e9bc03b54e63e6eb7abb81a128f6bc7ce9a3bafd5ca2bea0c40e3634b",
256
- "gdaoTotalSupply": "96000000000000000000000000",
257
- "proposalVotingPeriod": 241920,
258
- "guardian": "0x914dA3B2508634998d244059dAb5488D9bA1814f"
259
- },
260
- "gasPrice": 150000000,
261
- "guardiansSafe": "0xC9D09BA972B4EB6Bb7347F2229FB6d50434fFCa6"
262
227
  }
263
228
  }