@gooddollar/goodprotocol 2.0.25-beta.1 → 2.0.25-beta.3

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 (182) hide show
  1. package/artifacts/abis/FuseStakingV3.min.json +1 -1
  2. package/artifacts/abis/InvitesV2.min.json +1 -1
  3. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  9. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  32. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  33. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  34. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  35. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  36. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  37. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  38. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  39. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  43. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  44. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  45. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  46. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  47. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  48. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  49. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  50. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +15 -2
  51. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
  63. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  64. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  65. package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
  66. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  67. package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
  68. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  69. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  70. package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
  71. package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
  72. package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
  73. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  74. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  75. package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
  76. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  77. package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
  78. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  79. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  80. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  81. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  82. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
  83. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
  84. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  85. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  86. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  87. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  88. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  89. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  90. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  91. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  92. package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
  93. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  94. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  95. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  96. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  97. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  98. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  99. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  100. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
  101. package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +7 -2
  102. package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
  103. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  104. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  105. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  106. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  107. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  108. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  109. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  110. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  111. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  112. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  113. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  114. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  115. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  116. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  117. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  118. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  119. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  120. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  121. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  127. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  129. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  130. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  131. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  132. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  133. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  134. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  135. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  136. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  137. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  138. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  139. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  140. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  141. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  142. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  143. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  144. package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +1 -1
  145. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
  146. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  147. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  148. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  149. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  150. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  151. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  152. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  153. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  154. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  155. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  156. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  157. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  158. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  159. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  160. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  161. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  162. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  163. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  164. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  165. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  166. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  167. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  168. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  169. package/contracts/invite/InvitesV2.sol +41 -4
  170. package/contracts/staking/FuseStakingV3.sol +4 -2
  171. package/dist/test-sdk/deploySuperGoodDollar.js +1 -1
  172. package/package.json +3 -2
  173. package/scripts/analytics/activeWalletsStats.ts +51 -38
  174. package/scripts/analytics/checkBridgeBalances.ts +442 -0
  175. package/test/invite/InvitesV2.test.ts +139 -271
  176. package/test/staking/FuseStaking.test.ts +23 -54
  177. package/types/contracts/invite/InvitesV2.ts +32 -0
  178. package/types/contracts/staking/FuseStakingV3.sol/FuseStakingV3.ts +7 -2
  179. package/types/factories/contracts/invite/InvitesV2__factory.ts +14 -1
  180. package/types/factories/contracts/staking/FuseStakingV3.sol/FuseStakingV3__factory.ts +6 -1
  181. package/contracts/utils/.DS_Store +0 -0
  182. package/yarn.lock +0 -23715
@@ -11,39 +11,14 @@ const BN = ethers.BigNumber;
11
11
 
12
12
  describe("InvitesV2", () => {
13
13
  let invites: InvitesV2, founder: SignerWithAddress;
14
- let inviter1,
15
- inviter2,
16
- invitee1,
17
- invitee2,
18
- invitee3,
19
- invitee4,
20
- invitee5,
21
- invitee6,
22
- invitee7,
23
- invitee8;
24
-
25
- let avatar,
26
- gd: IGoodDollar,
27
- Controller,
28
- id: IdentityV2,
29
- setDAOAddress,
30
- setSchemes;
14
+ let inviter1, inviter2, invitee1, invitee2, invitee3, invitee4, invitee5, invitee6, invitee7, invitee8;
15
+
16
+ let avatar, gd: IGoodDollar, Controller, id: IdentityV2, setDAOAddress, setSchemes;
31
17
 
32
18
  const initialState = async () => {};
33
19
  before(async () => {
34
- [
35
- founder,
36
- inviter1,
37
- inviter2,
38
- invitee1,
39
- invitee2,
40
- invitee3,
41
- invitee4,
42
- invitee5,
43
- invitee6,
44
- invitee7,
45
- invitee8
46
- ] = await ethers.getSigners();
20
+ [founder, inviter1, inviter2, invitee1, invitee2, invitee3, invitee4, invitee5, invitee6, invitee7, invitee8] =
21
+ await ethers.getSigners();
47
22
 
48
23
  const InvitesV2 = await ethers.getContractFactory("InvitesV2");
49
24
 
@@ -62,24 +37,12 @@ describe("InvitesV2", () => {
62
37
  setDAOAddress = sda;
63
38
  setSchemes = sc;
64
39
 
65
- invites = (await upgrades.deployProxy(
66
- InvitesV2,
67
- [nameService.address, 500, founder.address],
68
- {
69
- kind: "uups"
70
- }
71
- )) as InvitesV2;
72
-
73
- gd = (await ethers.getContractAt(
74
- "IGoodDollar",
75
- gooddollar,
76
- founder
77
- )) as IGoodDollar;
78
- id = (await ethers.getContractAt(
79
- "IdentityV2",
80
- identity,
81
- founder
82
- )) as IdentityV2;
40
+ invites = (await upgrades.deployProxy(InvitesV2, [nameService.address, 500, founder.address], {
41
+ kind: "uups"
42
+ })) as InvitesV2;
43
+
44
+ gd = (await ethers.getContractAt("IGoodDollar", gooddollar, founder)) as IGoodDollar;
45
+ id = (await ethers.getContractAt("IdentityV2", identity, founder)) as IdentityV2;
83
46
 
84
47
  await gd["mint(address,uint256)"](invites.address, BN.from(5000));
85
48
  await loadFixture(initialState);
@@ -88,21 +51,13 @@ describe("InvitesV2", () => {
88
51
 
89
52
  it("v1 should be upgradeable via old proxy method", async () => {
90
53
  const InvitesV1 = await ethers.getContractFactory("InvitesV1");
91
- const invites = await upgrades.deployProxy(
92
- InvitesV1,
93
- [avatar, id.address, gd.address, 500],
94
- {
95
- kind: "transparent"
96
- }
97
- );
98
- const res = await upgrades.upgradeProxy(
99
- invites.address,
100
- await ethers.getContractFactory("InvitesFuseV2"),
101
- {
102
- kind: "transparent",
103
- unsafeAllowRenames: true
104
- }
105
- );
54
+ const invites = await upgrades.deployProxy(InvitesV1, [avatar, id.address, gd.address, 500], {
55
+ kind: "transparent"
56
+ });
57
+ const res = await upgrades.upgradeProxy(invites.address, await ethers.getContractFactory("InvitesFuseV2"), {
58
+ kind: "transparent",
59
+ unsafeAllowRenames: true
60
+ });
106
61
  expect(res).not.empty;
107
62
  });
108
63
 
@@ -114,44 +69,30 @@ describe("InvitesV2", () => {
114
69
  it("should have version", async () => {
115
70
  expect(await invites.active()).to.be.true;
116
71
  const version = await invites.version();
117
- expect(version).to.be.equal("2.2");
72
+ expect(version).to.be.equal("2.3");
118
73
  });
119
74
 
120
75
  it("should let anyone join", async () => {
121
- await invites
122
- .connect(inviter1)
123
- .join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
76
+ await invites.connect(inviter1).join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
124
77
  let inviter = await invites.users(inviter1.address);
125
78
  expect(inviter.inviteCode).to.equal(ethers.utils.hexZeroPad("0xfa", 32));
126
79
  });
127
80
 
128
81
  it("should allow to join only once", async () => {
129
82
  await expect(
130
- invites
131
- .connect(inviter1)
132
- .join(
133
- ethers.utils.hexZeroPad("0xfa", 32),
134
- ethers.utils.hexZeroPad("0x01", 32)
135
- )
83
+ invites.connect(inviter1).join(ethers.utils.hexZeroPad("0xfa", 32), ethers.utils.hexZeroPad("0x01", 32))
136
84
  ).to.revertedWith(/user already joined/);
137
85
  });
138
86
 
139
87
  it("should not allow code reuse", async () => {
140
88
  // const invites = await Invites.deployed();
141
89
  await expect(
142
- invites
143
- .connect(inviter2)
144
- .join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero)
90
+ invites.connect(inviter2).join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero)
145
91
  ).to.revertedWith(/invite code already in use/);
146
92
  });
147
93
 
148
94
  it("should mark inviter", async () => {
149
- await invites
150
- .connect(invitee1)
151
- .join(
152
- ethers.utils.hexZeroPad("0xaa", 32),
153
- ethers.utils.hexZeroPad("0xfa", 32)
154
- );
95
+ await invites.connect(invitee1).join(ethers.utils.hexZeroPad("0xaa", 32), ethers.utils.hexZeroPad("0xfa", 32));
155
96
  let invitee = await invites.users(invitee1.address);
156
97
  let inviterInvitees = await invites.getInvitees(inviter1.address);
157
98
  expect(invitee.invitedBy).to.be.equal(inviter1.address);
@@ -159,9 +100,9 @@ describe("InvitesV2", () => {
159
100
  });
160
101
 
161
102
  it("should not pay bounty for non whitelisted invitee", async () => {
162
- await expect(
163
- invites.connect(inviter1).bountyFor(invitee1.address)
164
- ).to.revertedWith(/user not elligble for bounty yet/);
103
+ await expect(invites.connect(inviter1).bountyFor(invitee1.address)).to.revertedWith(
104
+ /user not elligble for bounty yet/
105
+ );
165
106
  });
166
107
 
167
108
  it("should not allow to pay bounty for non whitelisted inviter", async () => {
@@ -175,45 +116,29 @@ describe("InvitesV2", () => {
175
116
 
176
117
  it("should pay bounty for whitelisted invitee and inviter", async () => {
177
118
  const bounty = (await invites.levels(0)).bounty.toNumber();
178
- await id
179
- .addWhitelistedWithDID(inviter1.address, Math.random() + "")
180
- .catch(e => e);
181
- const startBalance = await gd
182
- .balanceOf(inviter1.address)
183
- .then(_ => _.toNumber());
119
+ await id.addWhitelistedWithDID(inviter1.address, Math.random() + "").catch(e => e);
120
+ const startBalance = await gd.balanceOf(inviter1.address).then(_ => _.toNumber());
184
121
  expect(await id.isWhitelisted(inviter1.address)).to.be.true;
185
122
  let pending = await invites.getPendingInvitees(inviter1.address);
186
123
  expect(pending.length, "pending").to.be.equal(1);
187
- const inviteeBalance = await gd
188
- .balanceOf(invitee1.address)
189
- .then(_ => _.toNumber());
124
+ const inviteeBalance = await gd.balanceOf(invitee1.address).then(_ => _.toNumber());
190
125
  await invites.connect(inviter1).bountyFor(invitee1.address);
191
126
 
192
127
  let invitee = await invites.users(invitee1.address);
193
128
  let inviter = await invites.users(inviter1.address);
194
- const endBalance = await gd
195
- .balanceOf(inviter1.address)
196
- .then(_ => _.toNumber());
129
+ const endBalance = await gd.balanceOf(inviter1.address).then(_ => _.toNumber());
197
130
 
198
131
  pending = await invites.getPendingInvitees(inviter1.address);
199
- const txFee = await gd["getFees(uint256)"](bounty).then(_ =>
200
- _["0"].toNumber()
201
- ); //gd might have a tx fee
202
- const txFee2 = await gd["getFees(uint256)"](bounty / 2).then(_ =>
203
- _["0"].toNumber()
204
- ); //gd might have a tx fee
132
+ const txFee = await gd["getFees(uint256)"](bounty).then(_ => _["0"].toNumber()); //gd might have a tx fee
133
+ const txFee2 = await gd["getFees(uint256)"](bounty / 2).then(_ => _["0"].toNumber()); //gd might have a tx fee
205
134
 
206
135
  expect(pending.length, "pending").to.be.equal(0);
207
136
  expect(invitee.bountyPaid).to.be.true;
208
137
  expect(inviter.totalApprovedInvites.toNumber()).to.be.equal(1);
209
138
  expect(inviter.totalEarned.toNumber()).to.be.equal(bounty);
139
+ expect(endBalance - startBalance + txFee, "inviter rewards not matching bounty").to.be.equal(bounty);
210
140
  expect(
211
- endBalance - startBalance + txFee,
212
- "inviter rewards not matching bounty"
213
- ).to.be.equal(bounty);
214
- expect(
215
- (await gd.balanceOf(invitee1.address).then(_ => _.toNumber())) -
216
- inviteeBalance,
141
+ (await gd.balanceOf(invitee1.address).then(_ => _.toNumber())) - inviteeBalance,
217
142
  "invitee rewrad should be bounty/2"
218
143
  ).to.be.equal(bounty / 2 - txFee2); //test that invitee got half bonus
219
144
  });
@@ -221,33 +146,20 @@ describe("InvitesV2", () => {
221
146
  it("should update global stats", async () => {
222
147
  const bounty = (await invites.levels(0)).bounty.toNumber();
223
148
  const stats = await invites.stats();
224
- expect(stats.totalApprovedInvites.toNumber()).to.be.equal(
225
- 1,
226
- "approved invites"
227
- );
149
+ expect(stats.totalApprovedInvites.toNumber()).to.be.equal(1, "approved invites");
228
150
  expect(stats.totalInvited.toNumber()).to.be.equal(1, "total invited");
229
151
  expect(stats.totalBountiesPaid.toNumber()).to.be.equal(bounty);
230
152
  });
231
153
 
232
154
  it("should not pay bounty twice", async () => {
233
- await expect(
234
- invites.connect(inviter2).bountyFor(invitee1.address)
235
- ).to.revertedWith(/user not elligble for bounty yet/);
155
+ await expect(invites.connect(inviter2).bountyFor(invitee1.address)).to.revertedWith(
156
+ /user not elligble for bounty yet/
157
+ );
236
158
  });
237
159
 
238
160
  it("should not fail in collectBounties for invalid invitees", async () => {
239
- await invites
240
- .connect(invitee7)
241
- .join(
242
- ethers.utils.hexZeroPad("0x01", 32),
243
- ethers.utils.hexZeroPad("0xfa", 32)
244
- );
245
- await invites
246
- .connect(invitee8)
247
- .join(
248
- ethers.utils.hexZeroPad("0x02", 32),
249
- ethers.utils.hexZeroPad("0xfa", 32)
250
- );
161
+ await invites.connect(invitee7).join(ethers.utils.hexZeroPad("0x01", 32), ethers.utils.hexZeroPad("0xfa", 32));
162
+ await invites.connect(invitee8).join(ethers.utils.hexZeroPad("0x02", 32), ethers.utils.hexZeroPad("0xfa", 32));
251
163
 
252
164
  let pending = await invites.getPendingInvitees(inviter1.address);
253
165
  expect(pending.length, "pending").to.be.equal(2);
@@ -255,9 +167,7 @@ describe("InvitesV2", () => {
255
167
  let user1 = await invites.users(invitee7.address);
256
168
  let user2 = await invites.users(invitee8.address);
257
169
  pending = await invites.getPendingInvitees(inviter1.address);
258
- expect(
259
- await invites.getPendingBounties(inviter1.address).then(_ => _.toNumber())
260
- ).to.be.equal(0);
170
+ expect(await invites.getPendingBounties(inviter1.address).then(_ => _.toNumber())).to.be.equal(0);
261
171
  expect(user1.bountyPaid).to.be.false;
262
172
  expect(user2.bountyPaid).to.be.false;
263
173
  expect(pending.length, "pending").to.be.equal(2);
@@ -266,26 +176,22 @@ describe("InvitesV2", () => {
266
176
  it("should collectBounties for inviter", async () => {
267
177
  await id.addWhitelistedWithDID(invitee7.address, Math.random() + "");
268
178
  await id.addWhitelistedWithDID(invitee8.address, Math.random() + "");
269
- expect(
270
- await invites.getPendingBounties(inviter1.address).then(_ => _.toNumber())
271
- ).to.be.equal(2);
179
+ expect(await invites.getPendingBounties(inviter1.address).then(_ => _.toNumber())).to.be.equal(2);
272
180
  const res = await invites.connect(inviter1).collectBounties();
273
181
 
274
182
  let user1 = await invites.users(invitee7.address);
275
183
  let user2 = await invites.users(invitee8.address);
276
184
  let pending = await invites.getPendingInvitees(inviter1.address);
277
- expect(
278
- await invites.getPendingBounties(inviter1.address).then(_ => _.toNumber())
279
- ).to.be.equal(0);
185
+ expect(await invites.getPendingBounties(inviter1.address).then(_ => _.toNumber())).to.be.equal(0);
280
186
  expect(pending.length, "pending").to.be.equal(0);
281
187
  expect(user1.bountyPaid, "user1").to.be.true;
282
188
  expect(user2.bountyPaid, "user2").to.be.true;
283
189
  });
284
190
 
285
191
  it("should not set level not by owner", async () => {
286
- await expect(
287
- invites.connect(inviter1).setLevel(0, 1, 5, 1)
288
- ).to.revertedWith(/Only owner or avatar can perform this action/);
192
+ await expect(invites.connect(inviter1).setLevel(0, 1, 5, 1)).to.revertedWith(
193
+ /Only owner or avatar can perform this action/
194
+ );
289
195
  });
290
196
 
291
197
  it("should set level by owner", async () => {
@@ -307,30 +213,14 @@ describe("InvitesV2", () => {
307
213
  .then(_ => _.wait())
308
214
  .catch(e => e);
309
215
 
310
- await id
311
- .addWhitelistedWithDID(inviter1.address, Math.random() + "")
312
- .catch(e => e);
216
+ await id.addWhitelistedWithDID(inviter1.address, Math.random() + "").catch(e => e);
313
217
  await invites.setLevel(0, 1, 5, 1); //1 inviter to level up
314
218
  await invites.setLevel(1, 0, 10, 2); // 10 bounty for second level
315
219
 
316
- await invites
317
- .connect(invitee4)
318
- .join(
319
- ethers.utils.hexZeroPad("0x03", 32),
320
- ethers.utils.hexZeroPad("0xfa", 32)
321
- );
322
- await invites
323
- .connect(invitee5)
324
- .join(
325
- ethers.utils.hexZeroPad("0x04", 32),
326
- ethers.utils.hexZeroPad("0xfa", 32)
327
- );
328
- await id
329
- .addWhitelistedWithDID(invitee4.address, Math.random() + "")
330
- .catch(e => e);
331
- await id
332
- .addWhitelistedWithDID(invitee5.address, Math.random() + "")
333
- .catch(e => e);
220
+ await invites.connect(invitee4).join(ethers.utils.hexZeroPad("0x03", 32), ethers.utils.hexZeroPad("0xfa", 32));
221
+ await invites.connect(invitee5).join(ethers.utils.hexZeroPad("0x04", 32), ethers.utils.hexZeroPad("0xfa", 32));
222
+ await id.addWhitelistedWithDID(invitee4.address, Math.random() + "").catch(e => e);
223
+ await id.addWhitelistedWithDID(invitee5.address, Math.random() + "").catch(e => e);
334
224
  const res1 = await (await invites.bountyFor(invitee4.address)).wait();
335
225
 
336
226
  const log1 = res1.events.find(_ => _.event === "InviterBounty");
@@ -341,9 +231,7 @@ describe("InvitesV2", () => {
341
231
 
342
232
  let inviter = await invites.users(inviter1.address);
343
233
  expect(inviter.level.toNumber()).to.be.equal(1);
344
- const res2 = await (
345
- await invites.connect(inviter1).collectBounties()
346
- ).wait();
234
+ const res2 = await (await invites.connect(inviter1).collectBounties()).wait();
347
235
  const log2 = res2.events.find(_ => _.event === "InviterBounty");
348
236
  expect(log2.event).to.be.equal("InviterBounty");
349
237
  expect(log2.args.inviterLevel.toNumber()).to.be.equal(1);
@@ -352,50 +240,27 @@ describe("InvitesV2", () => {
352
240
  });
353
241
 
354
242
  it("should allow to set inviter later and pay bounty", async () => {
355
- await invites
356
- .connect(invitee6)
357
- .join(ethers.utils.hexZeroPad("0xfd", 32), ethers.constants.HashZero);
358
- await invites
359
- .connect(invitee6)
360
- .join(
361
- ethers.utils.hexZeroPad("0xfd", 32),
362
- ethers.utils.hexZeroPad("0xfa", 32)
363
- );
243
+ await invites.connect(invitee6).join(ethers.utils.hexZeroPad("0xfd", 32), ethers.constants.HashZero);
244
+ await invites.connect(invitee6).join(ethers.utils.hexZeroPad("0xfd", 32), ethers.utils.hexZeroPad("0xfa", 32));
364
245
  const invitee = await invites.users(invitee6.address);
365
246
  expect(invitee.invitedBy).to.equal(inviter1.address);
366
- await id
367
- .addWhitelistedWithDID(invitee6.address, Math.random() + "")
368
- .catch(e => e);
369
- await expect(invites.bountyFor(invitee6.address)).to.emit(
370
- invites,
371
- "InviterBounty"
372
- );
247
+ await id.addWhitelistedWithDID(invitee6.address, Math.random() + "").catch(e => e);
248
+ await expect(invites.bountyFor(invitee6.address)).to.emit(invites, "InviterBounty");
373
249
  });
374
250
 
375
251
  describe("MultiChain", () => {
376
252
  it("should not revert if old identity contract without getWhitelistedOnChain", async () => {
377
253
  await loadFixture(initialState);
378
- const contractFactory = new ethers.ContractFactory(
379
- IdentityABI.abi,
380
- IdentityABI.bytecode,
381
- founder
382
- );
254
+ const contractFactory = new ethers.ContractFactory(IdentityABI.abi, IdentityABI.bytecode, founder);
383
255
  const oldId = await contractFactory.deploy();
384
256
  await oldId.setAvatar(avatar);
385
257
  await setSchemes([oldId.address], []);
386
258
  await setDAOAddress("IDENTITY", oldId.address);
387
259
 
388
260
  expect(await invites.getIdentity()).equal(oldId.address);
389
- await invites
390
- .connect(inviter1)
391
- .join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
261
+ await invites.connect(inviter1).join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
392
262
 
393
- await invites
394
- .connect(invitee2)
395
- .join(
396
- ethers.utils.hexZeroPad("0xaa", 32),
397
- ethers.utils.hexZeroPad("0xfa", 32)
398
- );
263
+ await invites.connect(invitee2).join(ethers.utils.hexZeroPad("0xaa", 32), ethers.utils.hexZeroPad("0xfa", 32));
399
264
 
400
265
  await oldId.addWhitelistedWithDID(invitee2.address, Math.random() + "");
401
266
  await oldId.addWhitelistedWithDID(inviter1.address, Math.random() + "");
@@ -405,115 +270,118 @@ describe("InvitesV2", () => {
405
270
  it("should always be able to use my address as invite code", async () => {
406
271
  await loadFixture(initialState);
407
272
 
408
- await invites
409
- .connect(inviter1)
410
- .join(
411
- ethers.utils.hexZeroPad(inviter1.address, 32),
412
- ethers.constants.HashZero
413
- );
273
+ await invites.connect(inviter1).join(ethers.utils.hexZeroPad(inviter1.address, 32), ethers.constants.HashZero);
414
274
 
415
275
  await expect(
416
- invites
417
- .connect(inviter2)
418
- .join(
419
- ethers.utils.hexZeroPad(inviter2.address, 32),
420
- ethers.constants.HashZero
421
- )
276
+ invites.connect(inviter2).join(ethers.utils.hexZeroPad(inviter2.address, 32), ethers.constants.HashZero)
422
277
  ).not.reverted;
423
278
 
424
279
  await expect(
425
- invites
426
- .connect(inviter1)
427
- .join(
428
- ethers.utils.hexZeroPad(inviter1.address, 32),
429
- ethers.constants.HashZero
430
- )
280
+ invites.connect(inviter1).join(ethers.utils.hexZeroPad(inviter1.address, 32), ethers.constants.HashZero)
431
281
  ).reverted;
432
282
  });
433
283
 
434
284
  it("should not allow to claim if whitelisted originally on another chain", async () => {
435
285
  await loadFixture(initialState);
436
- await invites
437
- .connect(inviter1)
438
- .join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
439
- await invites
440
- .connect(invitee2)
441
- .join(
442
- ethers.utils.hexZeroPad("0xaa", 32),
443
- ethers.utils.hexZeroPad("0xfa", 32)
444
- );
445
-
446
- await id.addWhitelistedWithDIDAndChain(
447
- invitee2.address,
448
- Math.random() + "",
449
- 122,
450
- 0
451
- );
286
+ await invites.connect(inviter1).join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
287
+ await invites.connect(invitee2).join(ethers.utils.hexZeroPad("0xaa", 32), ethers.utils.hexZeroPad("0xfa", 32));
288
+
289
+ await id.addWhitelistedWithDIDAndChain(invitee2.address, Math.random() + "", 122, 0);
452
290
  expect(await id.getWhitelistedOnChainId(invitee2.address)).equal(122);
453
- await expect(
454
- invites.connect(inviter1).bountyFor(invitee2.address)
455
- ).to.revertedWith(/user not elligble for bounty yet/);
291
+ await expect(invites.connect(inviter1).bountyFor(invitee2.address)).to.revertedWith(
292
+ /user not elligble for bounty yet/
293
+ );
456
294
  });
457
295
 
458
296
  it("should allow to claim if whitelisted originally on same chain", async () => {
459
297
  await loadFixture(initialState);
460
- await invites
461
- .connect(inviter1)
462
- .join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
463
- await invites
464
- .connect(invitee2)
465
- .join(
466
- ethers.utils.hexZeroPad("0xaa", 32),
467
- ethers.utils.hexZeroPad("0xfa", 32)
468
- );
298
+ await invites.connect(inviter1).join(ethers.utils.hexZeroPad("0xfa", 32), ethers.constants.HashZero);
299
+ await invites.connect(invitee2).join(ethers.utils.hexZeroPad("0xaa", 32), ethers.utils.hexZeroPad("0xfa", 32));
469
300
 
470
301
  await id.addWhitelistedWithDID(inviter1.address, Math.random() + "");
471
302
 
472
- await id.addWhitelistedWithDIDAndChain(
473
- invitee2.address,
474
- Math.random() + "",
475
- 4447,
476
- 0
477
- );
303
+ await id.addWhitelistedWithDIDAndChain(invitee2.address, Math.random() + "", 4447, 0);
478
304
  expect(await id.getWhitelistedOnChainId(invitee2.address)).equal(4447);
479
- await expect(invites.connect(inviter1).bountyFor(invitee2.address)).not
480
- .reverted;
305
+ await expect(invites.connect(inviter1).bountyFor(invitee2.address)).not.reverted;
481
306
  });
482
307
 
483
308
  it("should pay bounty on join for whitelisted invitee and inviter", async () => {
484
309
  await loadFixture(initialState);
485
- await id
486
- .addWhitelistedWithDID(inviter1.address, Math.random() + "")
487
- .catch(e => e);
488
- await id
489
- .addWhitelistedWithDID(invitee1.address, Math.random() + "")
490
- .catch(e => e);
491
-
492
- await invites
493
- .connect(inviter1)
494
- .join(
495
- ethers.utils.hexZeroPad(inviter1.address, 32),
496
- ethers.constants.HashZero
497
- );
310
+ await id.addWhitelistedWithDID(inviter1.address, Math.random() + "").catch(e => e);
311
+ await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
312
+
313
+ await invites.connect(inviter1).join(ethers.utils.hexZeroPad(inviter1.address, 32), ethers.constants.HashZero);
498
314
  const tx = await invites
499
315
  .connect(invitee1)
500
- .join(
501
- ethers.utils.hexZeroPad(invitee1.address, 32),
502
- ethers.utils.hexZeroPad(inviter1.address, 32)
503
- );
316
+ .join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.utils.hexZeroPad(inviter1.address, 32));
504
317
  const { events } = await tx.wait();
505
318
  const bountyEvent = events.find(_ => _.event === "InviterBounty");
506
319
  expect(bountyEvent).not.empty;
507
320
  });
508
321
  });
509
322
 
323
+ describe("Campaign Code", () => {
324
+ it("should not pay bounty on empty campaignCode", async () => {
325
+ await loadFixture(initialState);
326
+ await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
327
+
328
+ const tx = await invites
329
+ .connect(invitee1)
330
+ .join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.constants.HashZero);
331
+ const { events } = await tx.wait();
332
+ const bountyEvent = events.find(_ => _.event === "InviterBounty");
333
+ expect(bountyEvent).undefined;
334
+ });
335
+ it("should not pay bounty on wrong campaignCode", async () => {
336
+ await loadFixture(initialState);
337
+ await invites.setCampaignCode(ethers.utils.formatBytes32String("test"));
338
+ await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
339
+
340
+ const tx = await invites
341
+ .connect(invitee1)
342
+ .join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.utils.formatBytes32String("test2"));
343
+ const { events } = await tx.wait();
344
+ const bountyEvent = events.find(_ => _.event === "InviterBounty");
345
+ expect(bountyEvent).undefined;
346
+ });
347
+
348
+ it("should pay bounty with campaignCode", async () => {
349
+ await loadFixture(initialState);
350
+ await invites.setCampaignCode(ethers.utils.formatBytes32String("test"));
351
+ await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
352
+
353
+ const tx = await invites
354
+ .connect(invitee1)
355
+ .join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.utils.formatBytes32String("test"));
356
+ const { events } = await tx.wait();
357
+ const bountyEvent = events.find(_ => _.event === "InviterBounty");
358
+ expect(bountyEvent).not.empty;
359
+ });
360
+
361
+ it("should pay bounty with campaignCode after first join without code", async () => {
362
+ await loadFixture(initialState);
363
+ await invites.setCampaignCode(ethers.utils.formatBytes32String("test"));
364
+ await id.addWhitelistedWithDID(invitee1.address, Math.random() + "").catch(e => e);
365
+
366
+ const tx = await invites
367
+ .connect(invitee1)
368
+ .join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.constants.HashZero);
369
+ const { events } = await tx.wait();
370
+ const bountyEvent = events.find(_ => _.event === "InviterBounty");
371
+ expect(bountyEvent).undefined;
372
+
373
+ const tx2 = await invites
374
+ .connect(invitee1)
375
+ .join(ethers.utils.hexZeroPad(invitee1.address, 32), ethers.utils.formatBytes32String("test"));
376
+ const { events: events2 } = await tx2.wait();
377
+ const bountyEvent2 = events2.find(_ => _.event === "InviterBounty");
378
+ expect(bountyEvent2).not.undefined;
379
+ });
380
+ });
381
+
510
382
  it("should end contract by owner", async () => {
511
- expect(
512
- await gd.balanceOf(invites.address).then(_ => _.toNumber())
513
- ).to.be.gt(0);
383
+ expect(await gd.balanceOf(invites.address).then(_ => _.toNumber())).to.be.gt(0);
514
384
  await invites.end();
515
- expect(
516
- await gd.balanceOf(invites.address).then(_ => _.toNumber())
517
- ).to.be.eq(0);
385
+ expect(await gd.balanceOf(invites.address).then(_ => _.toNumber())).to.be.eq(0);
518
386
  });
519
387
  });