@gooddollar/goodprotocol 2.0.5-beta.0 → 2.0.5-beta.10

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 (334) hide show
  1. package/artifacts/abis/Faucet.min.json +1 -1
  2. package/artifacts/abis/FuseFaucetV2.min.json +1 -1
  3. package/artifacts/abis/IFirstClaimPool.min.json +1 -1
  4. package/artifacts/abis/IdentityFix.min.json +1 -0
  5. package/artifacts/abis/IdentityV2.min.json +1 -1
  6. package/artifacts/abis/InvitesFuseV2.min.json +1 -1
  7. package/artifacts/abis/OneTimePaymentsV2.min.json +1 -0
  8. package/artifacts/abis/UBISchemeV2.min.json +1 -0
  9. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  10. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  11. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  12. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  13. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  14. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.json +7 -0
  23. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  33. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  34. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  35. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  36. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  37. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  38. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  39. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  40. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +29 -10
  41. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  42. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
  43. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  44. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +28 -2
  45. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  46. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
  47. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  48. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +2 -2
  49. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  50. package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
  51. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  52. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
  53. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  54. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  55. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  56. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  57. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.json +2 -2
  58. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  59. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  60. package/artifacts/contracts/governance/Reputation.sol/Reputation.json +2 -2
  61. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  62. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
  63. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  64. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +20 -2
  65. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  66. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +15 -2
  67. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  68. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
  69. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  70. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +2 -2
  71. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
  80. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +2 -2
  82. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +2 -2
  84. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
  89. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
  91. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  92. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
  93. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  94. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.json +2 -2
  95. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  96. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  97. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  98. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  99. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
  100. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  101. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  102. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +2 -2
  103. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  104. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
  105. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  106. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  107. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  108. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  109. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
  110. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  111. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  112. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +2 -2
  113. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  114. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
  115. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  116. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
  117. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  118. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
  119. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  120. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  121. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  122. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  123. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  124. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  125. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  126. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  127. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  128. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +2 -2
  129. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  130. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
  131. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  132. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +2 -2
  133. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  134. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  135. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +2 -2
  136. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  137. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
  138. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  139. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
  140. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  141. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
  142. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  143. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
  144. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  145. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  146. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  147. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +2 -2
  148. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  149. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  150. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  151. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
  152. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  153. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
  154. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  155. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
  156. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  157. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
  158. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  159. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
  160. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  161. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
  162. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  163. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
  164. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  165. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  166. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  167. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  168. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  169. package/artifacts/contracts/token/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
  170. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  171. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.json +2 -2
  172. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  173. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  174. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  175. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  176. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  177. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
  178. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  179. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  180. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  181. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  182. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  183. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.json +2 -2
  184. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  185. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.json +2 -2
  186. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  187. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
  188. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +4 -0
  189. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +789 -0
  190. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  191. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +2 -2
  192. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  193. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +2 -2
  194. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  195. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  196. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
  197. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  198. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
  199. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  200. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
  201. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  202. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
  203. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  204. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  205. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  206. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -2
  207. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  208. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  209. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  210. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
  211. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +4 -0
  212. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +60 -0
  213. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  214. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  215. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
  216. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  217. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  218. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.json +2 -2
  219. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +4 -0
  220. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.json +316 -0
  221. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  222. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  223. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
  224. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  225. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
  226. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  227. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
  228. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  229. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
  230. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  231. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  232. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  233. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
  234. package/contracts/Interfaces.sol +46 -61
  235. package/contracts/fuseFaucet/Faucet.sol +22 -26
  236. package/contracts/fuseFaucet/FuseFaucetV2.sol +16 -9
  237. package/contracts/identity/IdentityV2.sol +52 -61
  238. package/contracts/invite/InvitesFuseV2.sol +21 -25
  239. package/contracts/invite/InvitesV2.sol +20 -30
  240. package/contracts/token/superfluid/SuperGoodDollar.sol +16 -22
  241. package/contracts/token/superfluid/UUPSProxy.sol +1 -1
  242. package/contracts/ubi/UBISchemeV2.sol +470 -0
  243. package/contracts/utils/IdentityFix.sol +31 -0
  244. package/contracts/utils/OneTimePaymentsV2.sol +172 -0
  245. package/hardhat.config.ts +11 -1
  246. package/package.json +11 -9
  247. package/releases/deploy-settings.json +6 -0
  248. package/releases/deployment.json +22 -4
  249. package/scripts/analytics/activeUsersCount.ts +56 -18
  250. package/scripts/analytics/whitelistsyncIssue.ts +87 -0
  251. package/scripts/multichain-deploy/1_basicdao-deploy.ts +34 -94
  252. package/scripts/multichain-deploy/2b_otp-deploy.ts +4 -4
  253. package/scripts/multichain-deploy/helpers.ts +25 -12
  254. package/scripts/proposals/gip-14_1.ts +251 -0
  255. package/scripts/proposals/gips-14_1.md +29 -0
  256. package/test/faucet/Faucet.test.ts +166 -130
  257. package/truffle-config.js +6 -0
  258. package/types/Faucet.ts +60 -29
  259. package/types/FuseFaucetV2.ts +50 -0
  260. package/types/IFirstClaimPool.ts +21 -0
  261. package/types/IdentityFix.ts +141 -0
  262. package/types/IdentityV2.ts +39 -0
  263. package/types/InvitesFuseV2.ts +28 -0
  264. package/types/OneTimePaymentsV2.ts +456 -0
  265. package/types/UBISchemeV2.ts +1192 -0
  266. package/types/factories/AaveStakingFactory__factory.ts +1 -1
  267. package/types/factories/AdminWalletFuse__factory.ts +1 -1
  268. package/types/factories/AdminWallet__factory.ts +1 -1
  269. package/types/factories/BaseShareFieldV2__factory.ts +1 -1
  270. package/types/factories/BaseShareField__factory.ts +1 -1
  271. package/types/factories/BuyAndBridgeHelper__factory.ts +1 -1
  272. package/types/factories/ClaimersDistribution__factory.ts +1 -1
  273. package/types/factories/CompoundStakingFactory__factory.ts +1 -1
  274. package/types/factories/CompoundVotingMachine__factory.ts +1 -1
  275. package/types/factories/DAOContract__factory.ts +1 -1
  276. package/types/factories/DAOUpgradeableContract__factory.ts +1 -1
  277. package/types/factories/DistributionBridgeMock__factory.ts +1 -1
  278. package/types/factories/DistributionHelperTestHelper__factory.ts +1 -1
  279. package/types/factories/DistributionHelperTest__factory.ts +1 -1
  280. package/types/factories/DistributionHelper__factory.ts +1 -1
  281. package/types/factories/DonationsStaking__factory.ts +1 -1
  282. package/types/factories/ExchangeHelper__factory.ts +1 -1
  283. package/types/factories/Faucet__factory.ts +28 -9
  284. package/types/factories/FuseFaucetV2__factory.ts +27 -1
  285. package/types/factories/FuseFaucet__factory.ts +1 -1
  286. package/types/factories/FuseStakingV3__factory.ts +1 -1
  287. package/types/factories/GReputation__factory.ts +1 -1
  288. package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
  289. package/types/factories/GoodAaveStaking__factory.ts +1 -1
  290. package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
  291. package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
  292. package/types/factories/GoodCompoundStaking__factory.ts +1 -1
  293. package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1 -1
  294. package/types/factories/GoodDollarStakingMock__factory.ts +1 -1
  295. package/types/factories/GoodDollarStaking__factory.ts +1 -1
  296. package/types/factories/GoodDollar__factory.ts +1 -1
  297. package/types/factories/GoodFundManagerTest__factory.ts +1 -1
  298. package/types/factories/GoodFundManager__factory.ts +1 -1
  299. package/types/factories/GoodMarketMaker__factory.ts +1 -1
  300. package/types/factories/GoodReserveCDai__factory.ts +1 -1
  301. package/types/factories/GovernanceStaking__factory.ts +1 -1
  302. package/types/factories/IFirstClaimPool__factory.ts +7 -0
  303. package/types/factories/IdentityFix__factory.ts +110 -0
  304. package/types/factories/IdentityMock__factory.ts +1 -1
  305. package/types/factories/IdentityV2__factory.ts +19 -1
  306. package/types/factories/InvitesFuseV2__factory.ts +14 -1
  307. package/types/factories/InvitesV1__factory.ts +1 -1
  308. package/types/factories/InvitesV2__factory.ts +1 -1
  309. package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
  310. package/types/factories/MultichainRouterMock__factory.ts +1 -1
  311. package/types/factories/OneTimePaymentsV2__factory.ts +369 -0
  312. package/types/factories/OneTimePayments__factory.ts +1 -1
  313. package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
  314. package/types/factories/OverMintTester__factory.ts +1 -1
  315. package/types/factories/ProtocolUpgradeFuseRecover__factory.ts +1 -1
  316. package/types/factories/ProtocolUpgradeFuse__factory.ts +1 -1
  317. package/types/factories/ProtocolUpgradeRecover__factory.ts +1 -1
  318. package/types/factories/ProtocolUpgrade__factory.ts +1 -1
  319. package/types/factories/ReputationTestHelper__factory.ts +1 -1
  320. package/types/factories/Reputation__factory.ts +1 -1
  321. package/types/factories/StakersDistribution__factory.ts +1 -1
  322. package/types/factories/SuperGoodDollar__factory.ts +1 -1
  323. package/types/factories/SwapHelperTest__factory.ts +1 -1
  324. package/types/factories/UBISchemeV2__factory.ts +837 -0
  325. package/types/factories/UBIScheme__factory.ts +1 -1
  326. package/types/factories/UUPSProxy__factory.ts +1 -1
  327. package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
  328. package/types/factories/UpgradableMock2__factory.ts +1 -1
  329. package/types/factories/UpgradableMock3__factory.ts +1 -1
  330. package/types/factories/UpgradableMock4__factory.ts +1 -1
  331. package/types/factories/UpgradableMock__factory.ts +1 -1
  332. package/types/hardhat.d.ts +27 -0
  333. package/types/index.ts +6 -0
  334. package/yarn.lock +22499 -20151
@@ -19,10 +19,10 @@ interface ERC20 {
19
19
 
20
20
  function totalSupply() external view returns (uint256);
21
21
 
22
- function allowance(address owner, address spender)
23
- external
24
- view
25
- returns (uint256);
22
+ function allowance(
23
+ address owner,
24
+ address spender
25
+ ) external view returns (uint256);
26
26
 
27
27
  function transferFrom(
28
28
  address sender,
@@ -136,24 +136,25 @@ interface IERC2917 is ERC20 {
136
136
  /// @notice It will get the productivity of given user.
137
137
  /// @dev it will return 0 if user has no productivity proved in the contract.
138
138
  /// @return user's productivity and overall productivity.
139
- function getProductivity(address user)
140
- external
141
- view
142
- returns (uint256, uint256);
139
+ function getProductivity(
140
+ address user
141
+ ) external view returns (uint256, uint256);
143
142
 
144
143
  /// @notice increase a user's productivity.
145
144
  /// @dev Note the best practice will be restrict the callee to prove of productivity's contract address.
146
145
  /// @return true to confirm that the productivity added success.
147
- function increaseProductivity(address user, uint256 value)
148
- external
149
- returns (bool);
146
+ function increaseProductivity(
147
+ address user,
148
+ uint256 value
149
+ ) external returns (bool);
150
150
 
151
151
  /// @notice decrease a user's productivity.
152
152
  /// @dev Note the best practice will be restrict the callee to prove of productivity's contract address.
153
153
  /// @return true to confirm that the productivity removed success.
154
- function decreaseProductivity(address user, uint256 value)
155
- external
156
- returns (bool);
154
+ function decreaseProductivity(
155
+ address user,
156
+ uint256 value
157
+ ) external returns (bool);
157
158
 
158
159
  /// @notice take() will return the interests that callee will get at current block height.
159
160
  /// @dev it will always calculated by block.number, so it will change when block height changes.
@@ -233,28 +234,24 @@ interface Uniswap {
233
234
  uint256 reserveOut
234
235
  ) external pure returns (uint256 amountOut);
235
236
 
236
- function getAmountsOut(uint256 amountIn, address[] memory path)
237
- external
238
- pure
239
- returns (uint256[] memory amounts);
237
+ function getAmountsOut(
238
+ uint256 amountIn,
239
+ address[] memory path
240
+ ) external pure returns (uint256[] memory amounts);
240
241
  }
241
242
 
242
243
  interface UniswapFactory {
243
- function getPair(address tokenA, address tokenB)
244
- external
245
- view
246
- returns (address);
244
+ function getPair(
245
+ address tokenA,
246
+ address tokenB
247
+ ) external view returns (address);
247
248
  }
248
249
 
249
250
  interface UniswapPair {
250
251
  function getReserves()
251
252
  external
252
253
  view
253
- returns (
254
- uint112 reserve0,
255
- uint112 reserve1,
256
- uint32 blockTimestampLast
257
- );
254
+ returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
258
255
 
259
256
  function kLast() external view returns (uint256);
260
257
 
@@ -317,10 +314,9 @@ interface IIdentityV2 is IIdentity {
317
314
  uint256 dateAuthenticated
318
315
  ) external;
319
316
 
320
- function getWhitelistedRoot(address account)
321
- external
322
- view
323
- returns (address root);
317
+ function getWhitelistedRoot(
318
+ address account
319
+ ) external view returns (address root);
324
320
  }
325
321
 
326
322
  interface IUBIScheme {
@@ -335,13 +331,14 @@ interface IFirstClaimPool {
335
331
  function awardUser(address user) external returns (uint256);
336
332
 
337
333
  function claimAmount() external view returns (uint256);
334
+
335
+ function end() external;
338
336
  }
339
337
 
340
338
  interface ProxyAdmin {
341
- function getProxyImplementation(address proxy)
342
- external
343
- view
344
- returns (address);
339
+ function getProxyImplementation(
340
+ address proxy
341
+ ) external view returns (address);
345
342
 
346
343
  function getProxyAdmin(address proxy) external view returns (address);
347
344
 
@@ -371,7 +368,9 @@ interface AggregatorV3Interface {
371
368
  // getRoundData and latestRoundData should both raise "No data present"
372
369
  // if they do not have data to report, instead of returning unset values
373
370
  // which could be misinterpreted as actual reported values.
374
- function getRoundData(uint80 _roundId)
371
+ function getRoundData(
372
+ uint80 _roundId
373
+ )
375
374
  external
376
375
  view
377
376
  returns (
@@ -429,10 +428,9 @@ interface ILendingPool {
429
428
  * @param asset The address of the underlying asset of the reserve
430
429
  * @return The state of the reserve
431
430
  **/
432
- function getReserveData(address asset)
433
- external
434
- view
435
- returns (DataTypes.ReserveData memory);
431
+ function getReserveData(
432
+ address asset
433
+ ) external view returns (DataTypes.ReserveData memory);
436
434
  }
437
435
 
438
436
  interface IDonationStaking {
@@ -461,36 +459,23 @@ interface IAaveIncentivesController {
461
459
  * @param user The address of the user
462
460
  * @return The rewards
463
461
  **/
464
- function getRewardsBalance(address[] calldata assets, address user)
465
- external
466
- view
467
- returns (uint256);
462
+ function getRewardsBalance(
463
+ address[] calldata assets,
464
+ address user
465
+ ) external view returns (uint256);
468
466
  }
469
467
 
470
468
  interface IGoodStaking {
471
- function collectUBIInterest(address recipient)
472
- external
473
- returns (
474
- uint256,
475
- uint256,
476
- uint256
477
- );
469
+ function collectUBIInterest(
470
+ address recipient
471
+ ) external returns (uint256, uint256, uint256);
478
472
 
479
473
  function iToken() external view returns (address);
480
474
 
481
475
  function currentGains(
482
476
  bool _returnTokenBalanceInUSD,
483
477
  bool _returnTokenGainsInUSD
484
- )
485
- external
486
- view
487
- returns (
488
- uint256,
489
- uint256,
490
- uint256,
491
- uint256,
492
- uint256
493
- );
478
+ ) external view returns (uint256, uint256, uint256, uint256, uint256);
494
479
 
495
480
  function getRewardEarned(address user) external view returns (uint256);
496
481
 
@@ -42,11 +42,12 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
42
42
  uint32 public maxDailyToppings;
43
43
  uint64 public gasPrice;
44
44
  uint32 public maxPerWeekMultiplier;
45
- uint32 public maxSwapAmount;
45
+ uint32 public maxSwapAmount_unused; // kept because of upgrades layout
46
46
  address public goodDollar_unused; //kept because of upgrades
47
47
  uint64 public maxDailyNewWallets;
48
48
  uint64 public dailyNewWalletsCount;
49
49
  uint32 public version;
50
+ uint8 public minTopping; //percentage of topping amount, that user can request to top
50
51
 
51
52
  function initialize(
52
53
  NameService _ns,
@@ -64,27 +65,18 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
64
65
  startTime = block.timestamp;
65
66
  nameService = _ns;
66
67
  maxPerWeekMultiplier = 2;
67
- maxSwapAmount = 1000;
68
68
  maxDailyNewWallets = 5000;
69
+ minTopping = 15;
69
70
  }
70
71
 
71
- function _authorizeUpgrade(address newImplementation)
72
- internal
73
- override
74
- onlyRole(DEFAULT_ADMIN_ROLE)
75
- {}
72
+ function _authorizeUpgrade(
73
+ address newImplementation
74
+ ) internal override onlyRole(DEFAULT_ADMIN_ROLE) {}
76
75
 
77
76
  function getIdentity() public view returns (IIdentityV2) {
78
77
  return IIdentityV2(nameService.getAddress("IDENTITY"));
79
78
  }
80
79
 
81
- function upgrade() public {
82
- require(version == 0, "already upgraded");
83
- if (maxDailyNewWallets == 0) maxDailyNewWallets = 5000;
84
- version++;
85
- setGasTopping(gasTopping / gasPrice);
86
- }
87
-
88
80
  modifier reimburseGas() {
89
81
  uint256 _gasRefund = gasleft();
90
82
  _;
@@ -160,6 +152,8 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
160
152
 
161
153
  function canTop(address _user) external view returns (bool) {
162
154
  if (getToppingAmount() < address(_user).balance) return false;
155
+ uint256 toTop = getToppingAmount() - address(_user).balance;
156
+ if ((toTop * 100) / getToppingAmount() < minTopping) return false;
163
157
 
164
158
  address whitelistedRoot = getIdentity().getWhitelistedRoot(_user);
165
159
  _user = whitelistedRoot == address(0) ? _user : whitelistedRoot;
@@ -194,12 +188,9 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
194
188
  * can only be done by admin the amount of times specified in constructor per day
195
189
  * @param _user The address to transfer to
196
190
  */
197
- function topWallet(address payable _user)
198
- public
199
- reimburseGas
200
- toppingLimit(_user)
201
- onlyAuthorized(_user)
202
- {
191
+ function topWallet(
192
+ address payable _user
193
+ ) public reimburseGas toppingLimit(_user) onlyAuthorized(_user) {
203
194
  _topWallet(_user);
204
195
  }
205
196
 
@@ -212,8 +203,8 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
212
203
  ? _wallet
213
204
  : payable(whitelistedRoot);
214
205
 
215
- require(getToppingAmount() > address(_wallet).balance);
216
206
  uint256 toTop = getToppingAmount() - address(_wallet).balance;
207
+ require((toTop * 100) / getToppingAmount() >= minTopping, "low toTop");
217
208
 
218
209
  uint256 dayOfWeek = currentDay % 7;
219
210
 
@@ -232,12 +223,14 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
232
223
  emit WalletTopped(target, toTop, whitelistedRoot, msg.sender);
233
224
  }
234
225
 
226
+ /**
227
+ @notice only safe for small amounts, since we dont have slippage check
228
+ */
235
229
  function onTokenTransfer(
236
230
  address payable _from,
237
231
  uint256 amount,
238
232
  bytes calldata data
239
233
  ) external returns (bool) {
240
- require(amount <= maxSwapAmount, "slippage");
241
234
  address uniswapLike = abi.decode(data, (address));
242
235
  Uniswap uniswap = Uniswap(uniswapLike);
243
236
  address[] memory path = new address[](2);
@@ -253,10 +246,9 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
253
246
  return gasTopping * gasPrice;
254
247
  }
255
248
 
256
- function setGasTopping(uint256 _gasUnits)
257
- public
258
- onlyRole(DEFAULT_ADMIN_ROLE)
259
- {
249
+ function setGasTopping(
250
+ uint256 _gasUnits
251
+ ) public onlyRole(DEFAULT_ADMIN_ROLE) {
260
252
  gasTopping = _gasUnits;
261
253
  perDayRoughLimit = 2 * gasTopping;
262
254
  }
@@ -264,4 +256,8 @@ contract Faucet is Initializable, UUPSUpgradeable, AccessControlUpgradeable {
264
256
  function setGasPrice(uint64 _price) external onlyRole(DEFAULT_ADMIN_ROLE) {
265
257
  gasPrice = _price;
266
258
  }
259
+
260
+ function setMinTopping(uint8 _minTop) external onlyRole(DEFAULT_ADMIN_ROLE) {
261
+ minTopping = _minTop;
262
+ }
267
263
  }
@@ -46,6 +46,7 @@ contract FuseFaucetV2 is Initializable {
46
46
  address public relayer;
47
47
  address public owner;
48
48
  uint32 public version;
49
+ uint8 public minTopping;
49
50
 
50
51
  function initialize(
51
52
  NameService _ns,
@@ -53,15 +54,17 @@ contract FuseFaucetV2 is Initializable {
53
54
  address _relayer,
54
55
  uint64 gweiTopping
55
56
  ) public initializer {
56
- if (relayer != address(0)) relayer = _relayer;
57
+ relayer = _relayer;
57
58
  gasPrice = _gasPrice;
58
- setGasTopping(gweiTopping);
59
+ gasTopping = gweiTopping; //1m gwei
60
+ perDayRoughLimit = 2 * gasTopping;
59
61
  maxDailyToppings = 3;
60
62
  startTime = block.timestamp;
61
63
  nameService = _ns;
62
64
  maxPerWeekMultiplier = 2;
63
65
  maxSwapAmount = 1000;
64
66
  maxDailyNewWallets = 5000;
67
+ minTopping = 15;
65
68
  }
66
69
 
67
70
  modifier upgrader(uint32 _newversion) {
@@ -175,6 +178,8 @@ contract FuseFaucetV2 is Initializable {
175
178
 
176
179
  function canTop(address _user) external view returns (bool) {
177
180
  if (getToppingAmount() < address(_user).balance) return false;
181
+ uint256 toTop = getToppingAmount() - address(_user).balance;
182
+ if ((toTop * 100) / getToppingAmount() < minTopping) return false;
178
183
 
179
184
  address whitelistedRoot = getIdentity().getWhitelistedRoot(_user);
180
185
  _user = whitelistedRoot == address(0) ? _user : whitelistedRoot;
@@ -209,12 +214,9 @@ contract FuseFaucetV2 is Initializable {
209
214
  * can only be done by admin the amount of times specified in constructor per day
210
215
  * @param _user The address to transfer to
211
216
  */
212
- function topWallet(address payable _user)
213
- public
214
- reimburseGas
215
- toppingLimit(_user)
216
- onlyAuthorized(_user)
217
- {
217
+ function topWallet(
218
+ address payable _user
219
+ ) public reimburseGas toppingLimit(_user) onlyAuthorized(_user) {
218
220
  _topWallet(_user);
219
221
  }
220
222
 
@@ -227,8 +229,9 @@ contract FuseFaucetV2 is Initializable {
227
229
  ? _wallet
228
230
  : payable(whitelistedRoot);
229
231
 
230
- require(getToppingAmount() > address(_wallet).balance);
232
+ // require(getToppingAmount() > address(_wallet).balance);
231
233
  uint256 toTop = getToppingAmount() - address(_wallet).balance;
234
+ require((toTop * 100) / getToppingAmount() >= minTopping, "low toTop");
232
235
 
233
236
  uint256 dayOfWeek = currentDay % 7;
234
237
 
@@ -276,4 +279,8 @@ contract FuseFaucetV2 is Initializable {
276
279
  function setGasPrice(uint64 _price) external onlyOwner {
277
280
  gasPrice = _price;
278
281
  }
282
+
283
+ function setMinTopping(uint8 _minTop) external onlyOwner {
284
+ minTopping = _minTop;
285
+ }
279
286
  }
@@ -57,10 +57,10 @@ contract IdentityV2 is
57
57
  event ContractAdded(address indexed account);
58
58
  event ContractRemoved(address indexed account);
59
59
 
60
- function initialize(address _owner, IIdentity _oldIdentity)
61
- public
62
- initializer
63
- {
60
+ function initialize(
61
+ address _owner,
62
+ IIdentity _oldIdentity
63
+ ) public initializer {
64
64
  __AccessControl_init_unchained();
65
65
  __Pausable_init_unchained();
66
66
  __EIP712_init_unchained("Identity", "1.0.0");
@@ -107,14 +107,24 @@ contract IdentityV2 is
107
107
  * Can only be called by Identity Administrators.
108
108
  * @param account address to change its auth date
109
109
  */
110
- function authenticate(address account)
111
- public
112
- onlyRole(IDENTITY_ADMIN_ROLE)
113
- whenNotPaused
114
- {
110
+ function authenticate(address account) public {
111
+ return authenticateWithTimestamp(account, block.timestamp);
112
+ }
113
+
114
+ /**
115
+ * @dev Sets the authentication date of `account`
116
+ * to the current time.
117
+ * Can only be called by Identity Administrators.
118
+ * @param account address to change its auth date
119
+ * @param timestamp the authentication timestamp
120
+ */
121
+ function authenticateWithTimestamp(
122
+ address account,
123
+ uint256 timestamp
124
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
115
125
  require(identities[account].status == 1, "not whitelisted");
116
- identities[account].dateAuthenticated = block.timestamp;
117
- emit WhitelistedAuthenticated(account, block.timestamp);
126
+ identities[account].dateAuthenticated = timestamp;
127
+ emit WhitelistedAuthenticated(account, timestamp);
118
128
  }
119
129
 
120
130
  /**
@@ -122,11 +132,9 @@ contract IdentityV2 is
122
132
  * Can only be called by Identity Administrators.
123
133
  * @param account address to add as whitelisted
124
134
  */
125
- function addWhitelisted(address account)
126
- public
127
- onlyRole(IDENTITY_ADMIN_ROLE)
128
- whenNotPaused
129
- {
135
+ function addWhitelisted(
136
+ address account
137
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
130
138
  _addWhitelisted(account, _chainId());
131
139
  }
132
140
 
@@ -154,11 +162,10 @@ contract IdentityV2 is
154
162
  * @param account The address to add
155
163
  * @param did the ID to add account under
156
164
  */
157
- function addWhitelistedWithDID(address account, string memory did)
158
- public
159
- onlyRole(IDENTITY_ADMIN_ROLE)
160
- whenNotPaused
161
- {
165
+ function addWhitelistedWithDID(
166
+ address account,
167
+ string memory did
168
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
162
169
  _addWhitelistedWithDID(account, did, _chainId());
163
170
  }
164
171
 
@@ -167,11 +174,9 @@ contract IdentityV2 is
167
174
  * Can only be called by Identity Administrators.
168
175
  * @param account address to remove as whitelisted
169
176
  */
170
- function removeWhitelisted(address account)
171
- public
172
- onlyRole(IDENTITY_ADMIN_ROLE)
173
- whenNotPaused
174
- {
177
+ function removeWhitelisted(
178
+ address account
179
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
175
180
  _removeWhitelisted(account);
176
181
  }
177
182
 
@@ -228,11 +233,9 @@ contract IdentityV2 is
228
233
  * Can only be called by Identity Administrators.
229
234
  * @param account address to add as blacklisted
230
235
  */
231
- function addBlacklisted(address account)
232
- public
233
- onlyRole(IDENTITY_ADMIN_ROLE)
234
- whenNotPaused
235
- {
236
+ function addBlacklisted(
237
+ address account
238
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
236
239
  identities[account].status = 255;
237
240
  emit BlacklistAdded(account);
238
241
  }
@@ -242,11 +245,9 @@ contract IdentityV2 is
242
245
  * Can only be called by Identity Administrators.
243
246
  * @param account address to remove as blacklisted
244
247
  */
245
- function removeBlacklisted(address account)
246
- external
247
- onlyRole(IDENTITY_ADMIN_ROLE)
248
- whenNotPaused
249
- {
248
+ function removeBlacklisted(
249
+ address account
250
+ ) external onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
250
251
  if (
251
252
  address(oldIdentity) != address(0) && oldIdentity.isBlacklisted(account)
252
253
  ) oldIdentity.removeBlacklisted(account);
@@ -259,11 +260,9 @@ contract IdentityV2 is
259
260
  * @dev Function to add a Contract to list of contracts
260
261
  * @param account The address to add
261
262
  */
262
- function addContract(address account)
263
- public
264
- onlyRole(IDENTITY_ADMIN_ROLE)
265
- whenNotPaused
266
- {
263
+ function addContract(
264
+ address account
265
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
267
266
  require(isContract(account), "Given address is not a contract");
268
267
  _addWhitelisted(account, _chainId());
269
268
  identities[account].status = 2; //this must come after _addWhitelisted
@@ -275,11 +274,9 @@ contract IdentityV2 is
275
274
  * @dev Function to remove a Contract from list of contracts
276
275
  * @param account The address to add
277
276
  */
278
- function removeContract(address account)
279
- public
280
- onlyRole(IDENTITY_ADMIN_ROLE)
281
- whenNotPaused
282
- {
277
+ function removeContract(
278
+ address account
279
+ ) public onlyRole(IDENTITY_ADMIN_ROLE) whenNotPaused {
283
280
  if (
284
281
  address(oldIdentity) != address(0) && oldIdentity.isDAOContract(account)
285
282
  ) {
@@ -472,11 +469,9 @@ contract IdentityV2 is
472
469
  @param account address to get its identity
473
470
  @return whitelisted the identity or address 0 if _account not connected or not identity
474
471
  **/
475
- function getWhitelistedRoot(address account)
476
- external
477
- view
478
- returns (address whitelisted)
479
- {
472
+ function getWhitelistedRoot(
473
+ address account
474
+ ) external view returns (address whitelisted) {
480
475
  if (isWhitelisted(account)) return account;
481
476
  if (isWhitelisted(connectedAccounts[account]))
482
477
  return connectedAccounts[account];
@@ -533,11 +528,9 @@ contract IdentityV2 is
533
528
  @param account to get DID for
534
529
  @return did of the account
535
530
  */
536
- function addrToDID(address account)
537
- external
538
- view
539
- returns (string memory did)
540
- {
531
+ function addrToDID(
532
+ address account
533
+ ) external view returns (string memory did) {
541
534
  did = identities[account].did;
542
535
  bytes32 pHash = keccak256(bytes(did));
543
536
 
@@ -555,11 +548,9 @@ contract IdentityV2 is
555
548
  return "";
556
549
  }
557
550
 
558
- function getWhitelistedOnChainId(address account)
559
- external
560
- view
561
- returns (uint256 chainId)
562
- {
551
+ function getWhitelistedOnChainId(
552
+ address account
553
+ ) external view returns (uint256 chainId) {
563
554
  chainId = identities[account].whitelistedOnChainId;
564
555
  return chainId > 0 ? chainId : _chainId();
565
556
  }
@@ -141,11 +141,9 @@ contract InvitesFuseV2 is Initializable {
141
141
  emit InviteeJoined(inviter, msg.sender);
142
142
  }
143
143
 
144
- function _whitelistedOnChainOrDefault(address _invitee)
145
- internal
146
- view
147
- returns (uint256 chainId)
148
- {
144
+ function _whitelistedOnChainOrDefault(
145
+ address _invitee
146
+ ) internal view returns (uint256 chainId) {
149
147
  (bool success, bytes memory result) = address(identity).staticcall(
150
148
  abi.encodeWithSignature("getWhitelistedOnChainId(address)", _invitee)
151
149
  );
@@ -173,19 +171,15 @@ contract InvitesFuseV2 is Initializable {
173
171
  isLevelExpired == false;
174
172
  }
175
173
 
176
- function getInvitees(address _inviter)
177
- public
178
- view
179
- returns (address[] memory)
180
- {
174
+ function getInvitees(
175
+ address _inviter
176
+ ) public view returns (address[] memory) {
181
177
  return users[_inviter].invitees;
182
178
  }
183
179
 
184
- function getPendingInvitees(address _inviter)
185
- public
186
- view
187
- returns (address[] memory)
188
- {
180
+ function getPendingInvitees(
181
+ address _inviter
182
+ ) public view returns (address[] memory) {
189
183
  address[] memory pending = users[_inviter].pending;
190
184
  uint256 cur = 0;
191
185
  uint256 total = 0;
@@ -222,19 +216,17 @@ contract InvitesFuseV2 is Initializable {
222
216
  * @dev pay bounty for the inviter of _invitee
223
217
  * invitee need to be whitelisted
224
218
  */
225
- function bountyFor(address _invitee)
226
- public
227
- isActive
228
- returns (uint256 bounty)
229
- {
219
+ function bountyFor(
220
+ address _invitee
221
+ ) public isActive returns (uint256 bounty) {
230
222
  require(canCollectBountyFor(_invitee), "user not elligble for bounty yet");
231
223
  return _bountyFor(_invitee, true);
232
224
  }
233
225
 
234
- function _bountyFor(address _invitee, bool isSingleBounty)
235
- internal
236
- returns (uint256 bounty)
237
- {
226
+ function _bountyFor(
227
+ address _invitee,
228
+ bool isSingleBounty
229
+ ) internal returns (uint256 bounty) {
238
230
  address invitedBy = users[_invitee].invitedBy;
239
231
  uint256 joinedAt = users[_invitee].joinedAt;
240
232
  Level memory level = levels[users[invitedBy].level];
@@ -291,6 +283,10 @@ contract InvitesFuseV2 is Initializable {
291
283
  if (totalBounties > 0) goodDollar.transfer(msg.sender, totalBounties);
292
284
  }
293
285
 
286
+ function setIdentity(IIdentityV2 _identity) external ownerOrAvatar {
287
+ identity = _identity;
288
+ }
289
+
294
290
  function setLevel(
295
291
  uint256 _lvl,
296
292
  uint256 _toNext,
@@ -309,7 +305,7 @@ contract InvitesFuseV2 is Initializable {
309
305
 
310
306
  function end() public ownerOrAvatar isActive {
311
307
  uint256 gdBalance = goodDollar.balanceOf(address(this));
312
- goodDollar.transfer(avatar, gdBalance);
308
+ goodDollar.transfer(msg.sender, gdBalance);
313
309
  payable(msg.sender).transfer(address(this).balance);
314
310
  active = false;
315
311
  }