@gooddollar/goodprotocol 2.0.21 → 2.0.22-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (222) hide show
  1. package/artifacts/abis/ISuperToken.min.json +1 -1
  2. package/artifacts/abis/SuperGoodDollar.min.json +1 -1
  3. package/artifacts/abis/SuperToken.min.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  7. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  8. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  9. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  28. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  29. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  30. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  31. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  32. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  33. package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
  34. package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  35. package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
  36. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  37. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  38. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  39. package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
  40. package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
  41. package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
  42. package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
  43. package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  44. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  45. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  46. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  47. package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
  48. package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
  49. package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  50. package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
  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/IConsensus.dbg.json +1 -1
  102. package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
  103. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  104. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  105. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  106. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  107. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  108. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  109. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  110. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  111. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  112. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  113. package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
  114. package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
  115. package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
  116. package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
  117. package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
  118. package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
  119. package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
  120. package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
  121. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
  122. package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
  123. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
  124. package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
  125. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
  126. package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.json +5 -0
  127. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
  128. package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +25 -2
  129. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
  130. package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.json +7 -2
  131. package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
  132. package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
  133. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
  134. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
  135. package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
  136. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  137. package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
  138. package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
  139. package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
  140. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  141. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  142. package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
  143. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
  144. package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
  145. package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
  146. package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +1 -1
  147. package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +1 -1
  148. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  149. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  150. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  151. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  152. package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
  153. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
  154. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
  155. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
  156. package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
  157. package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
  158. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  159. package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
  160. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  161. package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
  162. package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
  163. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  164. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  165. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  166. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  167. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  168. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  169. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  170. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  171. package/contracts/token/superfluid/ISuperToken.sol +1 -0
  172. package/contracts/token/superfluid/SuperGoodDollar.sol +11 -2
  173. package/contracts/token/superfluid/SuperToken.sol +8 -0
  174. package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +25 -2
  175. package/hardhat.config.ts +1 -1
  176. package/package.json +4 -3
  177. package/scripts/blockchainTestSetup.sh +1 -1
  178. package/test/faucet/Faucet.test.ts +63 -19
  179. package/test/faucet/FuseFaucet.test.ts +43 -14
  180. package/test/governance/ClaimersDistribution.test.ts +3 -3
  181. package/test/governance/CompoundVotingMachine.castvote.test.ts +3 -6
  182. package/test/governance/CompoundVotingMachine.crossblockchain.ts +2 -2
  183. package/test/governance/CompoundVotingMachine.daoscheme.ts +1 -1
  184. package/test/governance/CompoundVotingMachine.guardian.test.ts +4 -4
  185. package/test/governance/CompoundVotingMachine.propose.test.ts +8 -8
  186. package/test/governance/CompoundVotingMachine.state.test.ts +4 -4
  187. package/test/governance/GReputation.test.ts +6 -6
  188. package/test/governance/GoodDollarStaking.gd.test.ts +44 -71
  189. package/test/governance/GoodDollarStaking.good.test.ts +52 -73
  190. package/test/governance/GovernanceStaking.test.ts +1 -1
  191. package/test/governance/Reputation.test.ts +2 -2
  192. package/test/helpers.ts +1 -1
  193. package/test/identity/IdentityV2.test.ts +12 -12
  194. package/test/invite/InvitesV1.test.ts +6 -6
  195. package/test/invite/InvitesV2.test.ts +272 -81
  196. package/test/reserve/DistributionHelper.test.ts +232 -139
  197. package/test/reserve/GoodMarketMaker.test.ts +17 -17
  198. package/test/reserve/GoodReserveCDai.cap.test.ts +4 -4
  199. package/test/reserve/GoodReserveCDai.distribution.test.ts +64 -42
  200. package/test/reserve/GoodReserveCDai.gdx.test.ts +1 -1
  201. package/test/reserve/GoodReserveCDai.pause.test.ts +8 -8
  202. package/test/reserve/GoodReserveCDai.test.ts +307 -101
  203. package/test/reserve/GoodReserveCDai.uniswap.test.ts +1 -1
  204. package/test/staking/DonationsStaking.test.ts +2 -2
  205. package/test/staking/FuseStaking.test.ts +3 -3
  206. package/test/staking/GoodAaveStakingFactory.test.ts +2 -2
  207. package/test/staking/StakingRewards.test.ts +913 -320
  208. package/test/staking/StakingRewardsFixedAPY.test.ts +62 -66
  209. package/test/token/CeloGasToken.test.ts +2 -2
  210. package/test/token/GoodDollar.test.ts +5 -5
  211. package/test/token/SuperGoodDollar.test.ts +17 -13
  212. package/test/ubi/UBIScheme.test.ts +1 -1
  213. package/test/utils/AdminWallet.test.ts +10 -10
  214. package/test/utils/BuyAndBridgeHelper.test.ts +33 -9
  215. package/test/utils/GoodDollarMintBurnWrapper.test.ts +265 -113
  216. package/test/utils/NameService.test.ts +1 -1
  217. package/test/utils/ProxyFactory.test.ts +2 -2
  218. package/types/contracts/token/superfluid/SuperGoodDollar.ts +26 -0
  219. package/types/factories/contracts/token/superfluid/ISuperToken__factory.ts +5 -0
  220. package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +24 -1
  221. package/types/factories/contracts/token/superfluid/SuperToken__factory.ts +6 -1
  222. package/yarn.lock +635 -253
@@ -1,11 +1,14 @@
1
1
  import { ethers, upgrades, artifacts } from "hardhat";
2
- import { loadFixture, setCode } from "@nomicfoundation/hardhat-network-helpers";
2
+ import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
3
3
  import { expect } from "chai";
4
- import { GoodReserveCDai, DistributionHelperTestHelper, DistributionBridgeMock, IGoodDollar } from "../../types";
4
+ import {
5
+ GoodReserveCDai,
6
+ DistributionHelperTestHelper,
7
+ DistributionBridgeMock,
8
+ IGoodDollar
9
+ } from "../../types";
5
10
  import { createDAO, increaseTime } from "../helpers";
6
- import { FormatTypes } from "@ethersproject/abi";
7
11
  import * as waffle from "ethereum-waffle";
8
- import { BaseContract } from "ethers";
9
12
 
10
13
  const BN = ethers.BigNumber;
11
14
  export const NULL_ADDRESS = ethers.constants.AddressZero;
@@ -13,7 +16,14 @@ export const BLOCK_INTERVAL = 1;
13
16
 
14
17
  describe("DistributionHelper", () => {
15
18
  let goodReserve: GoodReserveCDai;
16
- let goodDollar: IGoodDollar, genericCall, avatar, founder, signers, setDAOAddress, nameService, cDai;
19
+ let goodDollar: IGoodDollar,
20
+ genericCall,
21
+ avatar,
22
+ founder,
23
+ signers,
24
+ setDAOAddress,
25
+ nameService,
26
+ cDai;
17
27
 
18
28
  before(async () => {
19
29
  [founder, ...signers] = await ethers.getSigners();
@@ -67,19 +77,27 @@ describe("DistributionHelper", () => {
67
77
  await distHelper.setOracle(oracle.address);
68
78
 
69
79
  //make sure disthelper has enough native token so it doesnt try to swap G$s
70
- await founder.sendTransaction({ to: distHelper.address, value: ethers.constants.WeiPerEther });
71
- const bridge = (await ethers.deployContract("DistributionBridgeMock")) as DistributionBridgeMock;
72
-
73
- const encodedCall = distHelper.interface.encodeFunctionData("setFeeSettings", [
74
- {
75
- axelarBaseFeeUSD: "100000000000000000",
76
- bridgeExecuteGas: 400000,
77
- targetChainGasPrice: 5e9,
78
- maxFee: "5000000000000000",
79
- minBalanceForFees: "10000000000000000",
80
- percentageToSellForFee: "5"
81
- }
82
- ]);
80
+ await founder.sendTransaction({
81
+ to: distHelper.address,
82
+ value: ethers.constants.WeiPerEther
83
+ });
84
+ const bridge = (await ethers.deployContract(
85
+ "DistributionBridgeMock"
86
+ )) as DistributionBridgeMock;
87
+
88
+ const encodedCall = distHelper.interface.encodeFunctionData(
89
+ "setFeeSettings",
90
+ [
91
+ {
92
+ axelarBaseFeeUSD: "100000000000000000",
93
+ bridgeExecuteGas: 400000,
94
+ targetChainGasPrice: 5e9,
95
+ maxFee: "5000000000000000",
96
+ minBalanceForFees: "10000000000000000",
97
+ percentageToSellForFee: "5"
98
+ }
99
+ ]
100
+ );
83
101
 
84
102
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
85
103
 
@@ -100,7 +118,9 @@ describe("DistributionHelper", () => {
100
118
  addr: recipient.address,
101
119
  transferType: 0
102
120
  })
103
- ).to.be.revertedWith("is missing role 0x0000000000000000000000000000000000000000000000000000000000000000");
121
+ ).to.be.revertedWith(
122
+ /is missing role 0x0000000000000000000000000000000000000000000000000000000000000000/
123
+ );
104
124
  });
105
125
 
106
126
  it("should allow to add recipient by avatar", async () => {
@@ -108,14 +128,17 @@ describe("DistributionHelper", () => {
108
128
 
109
129
  const recipient = signers[0];
110
130
 
111
- const encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
112
- {
113
- bps: 3000,
114
- chainId: 42220,
115
- addr: recipient.address,
116
- transferType: 0
117
- }
118
- ]);
131
+ const encodedCall = distHelper.interface.encodeFunctionData(
132
+ "addOrUpdateRecipient",
133
+ [
134
+ {
135
+ bps: 3000,
136
+ chainId: 42220,
137
+ addr: recipient.address,
138
+ transferType: 0
139
+ }
140
+ ]
141
+ );
119
142
 
120
143
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
121
144
  const dr = await distHelper.distributionRecipients(0);
@@ -130,30 +153,40 @@ describe("DistributionHelper", () => {
130
153
 
131
154
  const recipient = signers[0];
132
155
 
133
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
134
- {
135
- bps: 1000,
136
- chainId: 2,
137
- addr: recipient.address,
138
- transferType: 1
139
- }
140
- ]);
156
+ let encodedCall = distHelper.interface.encodeFunctionData(
157
+ "addOrUpdateRecipient",
158
+ [
159
+ {
160
+ bps: 1000,
161
+ chainId: 2,
162
+ addr: recipient.address,
163
+ transferType: 1
164
+ }
165
+ ]
166
+ );
141
167
 
142
168
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
143
169
 
144
- encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
145
- {
146
- bps: 1500,
147
- chainId: 45,
148
- addr: recipient.address,
149
- transferType: 2
150
- }
151
- ]);
170
+ encodedCall = distHelper.interface.encodeFunctionData(
171
+ "addOrUpdateRecipient",
172
+ [
173
+ {
174
+ bps: 1500,
175
+ chainId: 45,
176
+ addr: recipient.address,
177
+ transferType: 2
178
+ }
179
+ ]
180
+ );
152
181
 
153
182
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
154
183
 
155
- const updEvents = await distHelper.queryFilter(distHelper.filters.RecipientUpdated());
156
- const addEvents = await distHelper.queryFilter(distHelper.filters.RecipientAdded());
184
+ const updEvents = await distHelper.queryFilter(
185
+ distHelper.filters.RecipientUpdated()
186
+ );
187
+ const addEvents = await distHelper.queryFilter(
188
+ distHelper.filters.RecipientAdded()
189
+ );
157
190
 
158
191
  const dr = await distHelper.distributionRecipients(0);
159
192
  expect(dr.addr).to.equal(recipient.address);
@@ -167,20 +200,25 @@ describe("DistributionHelper", () => {
167
200
 
168
201
  const recipient = signers[0];
169
202
 
170
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
171
- {
172
- bps: 2000,
173
- chainId: 42220,
174
- addr: recipient.address,
175
- transferType: 0
176
- }
177
- ]);
203
+ let encodedCall = distHelper.interface.encodeFunctionData(
204
+ "addOrUpdateRecipient",
205
+ [
206
+ {
207
+ bps: 2000,
208
+ chainId: 42220,
209
+ addr: recipient.address,
210
+ transferType: 0
211
+ }
212
+ ]
213
+ );
178
214
 
179
215
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
180
216
 
181
217
  await goodDollar.mint(distHelper.address, "100000000000");
182
218
  await distHelper.onDistribution("100000000000");
183
- expect(await goodDollar.balanceOf(bridge.address)).to.equal((100000000000 * 2000) / 10000);
219
+ expect(await goodDollar.balanceOf(bridge.address)).to.equal(
220
+ (100000000000 * 2000) / 10000
221
+ );
184
222
 
185
223
  const events = await bridge.queryFilter(bridge.filters.OnToken());
186
224
  expect(events[0].args.sender).to.equal(distHelper.address);
@@ -193,21 +231,29 @@ describe("DistributionHelper", () => {
193
231
 
194
232
  const recipient = signers[0];
195
233
 
196
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
197
- {
198
- bps: 2000,
199
- chainId: 42220,
200
- addr: recipient.address, //needs to be a contract for transferAndCall to work
201
- transferType: 1
202
- }
203
- ]);
234
+ let encodedCall = distHelper.interface.encodeFunctionData(
235
+ "addOrUpdateRecipient",
236
+ [
237
+ {
238
+ bps: 2000,
239
+ chainId: 42220,
240
+ addr: recipient.address, //needs to be a contract for transferAndCall to work
241
+ transferType: 1
242
+ }
243
+ ]
244
+ );
204
245
 
205
246
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
206
247
 
207
248
  await goodDollar.mint(distHelper.address, "100000000000");
208
- await founder.sendTransaction({ to: distHelper.address, value: ethers.constants.WeiPerEther });
249
+ await founder.sendTransaction({
250
+ to: distHelper.address,
251
+ value: ethers.constants.WeiPerEther
252
+ });
209
253
  await distHelper.onDistribution("100000000000");
210
- expect(await goodDollar.allowance(distHelper.address, bridge.address)).to.equal((100000000000 * 2000) / 10000);
254
+ expect(
255
+ await goodDollar.allowance(distHelper.address, bridge.address)
256
+ ).to.equal((100000000000 * 2000) / 10000);
211
257
 
212
258
  const events = await bridge.queryFilter(bridge.filters.BridgeLz());
213
259
  expect(events[0].args.recipient).to.equal(recipient.address);
@@ -221,28 +267,38 @@ describe("DistributionHelper", () => {
221
267
 
222
268
  const recipient = signers[0];
223
269
 
224
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
225
- {
226
- bps: 2000,
227
- chainId: 42220,
228
- addr: recipient.address, //needs to be a contract for transferAndCall to work
229
- transferType: 2
230
- }
231
- ]);
270
+ let encodedCall = distHelper.interface.encodeFunctionData(
271
+ "addOrUpdateRecipient",
272
+ [
273
+ {
274
+ bps: 2000,
275
+ chainId: 42220,
276
+ addr: recipient.address, //needs to be a contract for transferAndCall to work
277
+ transferType: 2
278
+ }
279
+ ]
280
+ );
232
281
 
233
282
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
234
283
 
235
284
  await goodDollar.mint(distHelper.address, "100000000000");
236
- await founder.sendTransaction({ to: distHelper.address, value: ethers.constants.WeiPerEther });
285
+ await founder.sendTransaction({
286
+ to: distHelper.address,
287
+ value: ethers.constants.WeiPerEther
288
+ });
237
289
  await distHelper.onDistribution("100000000000");
238
- expect(await goodDollar.allowance(distHelper.address, bridge.address)).to.equal((100000000000 * 2000) / 10000);
290
+ expect(
291
+ await goodDollar.allowance(distHelper.address, bridge.address)
292
+ ).to.equal((100000000000 * 2000) / 10000);
239
293
 
240
294
  const events = await bridge.queryFilter(bridge.filters.BridgeAxl());
241
295
  expect(events[0].args.recipient).to.equal(recipient.address);
242
296
  expect(events[0].args.amount).to.equal((100000000000 * 2000) / 10000);
243
297
  expect(events[0].args.chainId).to.equal(42220);
244
298
  expect(events[0].args.fee).to.equal(2.2e13); //fee should be 2e13 with 10% extra
245
- expect(events[0].args.gasRefund).to.equal(await distHelper.getTargetChainRefundAddress(42220));
299
+ expect(events[0].args.gasRefund).to.equal(
300
+ await distHelper.getTargetChainRefundAddress(42220)
301
+ );
246
302
  });
247
303
 
248
304
  it("should distribute via transferAndCall", async () => {
@@ -250,20 +306,25 @@ describe("DistributionHelper", () => {
250
306
 
251
307
  const recipient = signers[0];
252
308
 
253
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
254
- {
255
- bps: 2555,
256
- chainId: 42220,
257
- addr: signers[0].address,
258
- transferType: 3
259
- }
260
- ]);
309
+ let encodedCall = distHelper.interface.encodeFunctionData(
310
+ "addOrUpdateRecipient",
311
+ [
312
+ {
313
+ bps: 2555,
314
+ chainId: 42220,
315
+ addr: signers[0].address,
316
+ transferType: 3
317
+ }
318
+ ]
319
+ );
261
320
 
262
321
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
263
322
 
264
323
  await goodDollar.mint(distHelper.address, "100000000000");
265
324
  await distHelper.onDistribution("100000000000");
266
- expect(await goodDollar.balanceOf(signers[0].address)).to.equal((100000000000 * 2555) / 10000);
325
+ expect(await goodDollar.balanceOf(signers[0].address)).to.equal(
326
+ (100000000000 * 2555) / 10000
327
+ );
267
328
  });
268
329
 
269
330
  it("should distribute to multiple recipients", async () => {
@@ -271,44 +332,59 @@ describe("DistributionHelper", () => {
271
332
 
272
333
  const recipient = signers[0];
273
334
 
274
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
275
- {
276
- bps: 2555,
277
- chainId: 42220,
278
- addr: signers[0].address,
279
- transferType: 3
280
- }
281
- ]);
335
+ let encodedCall = distHelper.interface.encodeFunctionData(
336
+ "addOrUpdateRecipient",
337
+ [
338
+ {
339
+ bps: 2555,
340
+ chainId: 42220,
341
+ addr: signers[0].address,
342
+ transferType: 3
343
+ }
344
+ ]
345
+ );
282
346
 
283
347
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
284
348
 
285
- encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
286
- {
287
- bps: 1000,
288
- chainId: 42220,
289
- addr: signers[1].address,
290
- transferType: 3
291
- }
292
- ]);
349
+ encodedCall = distHelper.interface.encodeFunctionData(
350
+ "addOrUpdateRecipient",
351
+ [
352
+ {
353
+ bps: 1000,
354
+ chainId: 42220,
355
+ addr: signers[1].address,
356
+ transferType: 3
357
+ }
358
+ ]
359
+ );
293
360
 
294
361
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
295
362
 
296
- encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
297
- {
298
- bps: 5,
299
- chainId: 42220,
300
- addr: signers[2].address,
301
- transferType: 3
302
- }
303
- ]);
363
+ encodedCall = distHelper.interface.encodeFunctionData(
364
+ "addOrUpdateRecipient",
365
+ [
366
+ {
367
+ bps: 5,
368
+ chainId: 42220,
369
+ addr: signers[2].address,
370
+ transferType: 3
371
+ }
372
+ ]
373
+ );
304
374
 
305
375
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
306
376
 
307
377
  await goodDollar.mint(distHelper.address, "100000000000");
308
378
  await distHelper.onDistribution("100000000000");
309
- expect(await goodDollar.balanceOf(signers[0].address)).to.equal((100000000000 * 2555) / 10000);
310
- expect(await goodDollar.balanceOf(signers[1].address)).to.equal((100000000000 * 1000) / 10000);
311
- expect(await goodDollar.balanceOf(signers[2].address)).to.equal((100000000000 * 5) / 10000);
379
+ expect(await goodDollar.balanceOf(signers[0].address)).to.equal(
380
+ (100000000000 * 2555) / 10000
381
+ );
382
+ expect(await goodDollar.balanceOf(signers[1].address)).to.equal(
383
+ (100000000000 * 1000) / 10000
384
+ );
385
+ expect(await goodDollar.balanceOf(signers[2].address)).to.equal(
386
+ (100000000000 * 5) / 10000
387
+ );
312
388
  });
313
389
 
314
390
  it("should emit distribution event for multiple recipients", async () => {
@@ -316,45 +392,62 @@ describe("DistributionHelper", () => {
316
392
 
317
393
  const recipient = signers[0];
318
394
 
319
- let encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
320
- {
321
- bps: 2555,
322
- chainId: 42220,
323
- addr: signers[0].address,
324
- transferType: 3
325
- }
326
- ]);
395
+ let encodedCall = distHelper.interface.encodeFunctionData(
396
+ "addOrUpdateRecipient",
397
+ [
398
+ {
399
+ bps: 2555,
400
+ chainId: 42220,
401
+ addr: signers[0].address,
402
+ transferType: 3
403
+ }
404
+ ]
405
+ );
327
406
 
328
407
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
329
408
 
330
- encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
331
- {
332
- bps: 1000,
333
- chainId: 42220,
334
- addr: signers[1].address,
335
- transferType: 3
336
- }
337
- ]);
409
+ encodedCall = distHelper.interface.encodeFunctionData(
410
+ "addOrUpdateRecipient",
411
+ [
412
+ {
413
+ bps: 1000,
414
+ chainId: 42220,
415
+ addr: signers[1].address,
416
+ transferType: 3
417
+ }
418
+ ]
419
+ );
338
420
 
339
421
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
340
422
 
341
- encodedCall = distHelper.interface.encodeFunctionData("addOrUpdateRecipient", [
342
- {
343
- bps: 5,
344
- chainId: 42220,
345
- addr: signers[2].address,
346
- transferType: 3
347
- }
348
- ]);
423
+ encodedCall = distHelper.interface.encodeFunctionData(
424
+ "addOrUpdateRecipient",
425
+ [
426
+ {
427
+ bps: 5,
428
+ chainId: 42220,
429
+ addr: signers[2].address,
430
+ transferType: 3
431
+ }
432
+ ]
433
+ );
349
434
 
350
435
  await genericCall(distHelper.address, encodedCall, avatar.address, 0);
351
436
 
352
437
  await goodDollar.mint(distHelper.address, "100000000000");
353
438
  await distHelper.onDistribution("100000000000");
354
439
 
355
- const DistributionEvents = await distHelper.queryFilter(distHelper.filters.Distribution());
356
- expect(DistributionEvents[0].args.distributionRecipients[0].addr).eq(signers[0].address);
357
- expect(DistributionEvents[0].args.distributionRecipients[1].addr).eq(signers[1].address);
358
- expect(DistributionEvents[0].args.distributionRecipients[2].addr).eq(signers[2].address);
440
+ const DistributionEvents = await distHelper.queryFilter(
441
+ distHelper.filters.Distribution()
442
+ );
443
+ expect(DistributionEvents[0].args.distributionRecipients[0].addr).eq(
444
+ signers[0].address
445
+ );
446
+ expect(DistributionEvents[0].args.distributionRecipients[1].addr).eq(
447
+ signers[1].address
448
+ );
449
+ expect(DistributionEvents[0].args.distributionRecipients[2].addr).eq(
450
+ signers[2].address
451
+ );
359
452
  });
360
453
  });
@@ -1,4 +1,4 @@
1
- import { default as hre, ethers, upgrades, waffle } from "hardhat";
1
+ import { default as hre, ethers, upgrades } from "hardhat";
2
2
  import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
3
3
  import { expect } from "chai";
4
4
  import { GoodMarketMaker, CERC20 } from "../../types";
@@ -176,7 +176,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
176
176
  ethers.utils.parseEther("2")
177
177
  );
178
178
  await expect(res).to.be.revertedWith(
179
- "GD amount is lower than the contribution amount"
179
+ /GD amount is lower than the contribution amount/
180
180
  );
181
181
  });
182
182
 
@@ -194,14 +194,14 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
194
194
  let res = marketMaker.connect(staker).mintInterest(cdai, BN.from(1e8));
195
195
 
196
196
  await expect(res).to.be.revertedWith(
197
- "GoodMarketMaker: not Reserve or Avatar"
197
+ /GoodMarketMaker: not Reserve or Avatar/
198
198
  );
199
199
  });
200
200
 
201
201
  it("should not be able to mint expansion by a non owner", async () => {
202
202
  let res = marketMaker.connect(staker).mintExpansion(cdai);
203
203
  await expect(res).to.be.revertedWith(
204
- "GoodMarketMaker: not Reserve or Avatar"
204
+ /GoodMarketMaker: not Reserve or Avatar/
205
205
  );
206
206
  });
207
207
 
@@ -217,21 +217,21 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
217
217
  it("should be able to update the reserve ratio only by the owner", async () => {
218
218
  let res = marketMaker.connect(staker).expandReserveRatio(cdai);
219
219
  await expect(res).to.be.revertedWith(
220
- "GoodMarketMaker: not Reserve or Avatar"
220
+ /GoodMarketMaker: not Reserve or Avatar/
221
221
  );
222
222
  });
223
223
 
224
224
  it("should be able to mint interest only by the owner", async () => {
225
225
  let res = marketMaker.connect(staker).mintInterest(cdai, BN.from(1e8));
226
226
  await expect(res).to.be.revertedWith(
227
- "GoodMarketMaker: not Reserve or Avatar"
227
+ /GoodMarketMaker: not Reserve or Avatar/
228
228
  );
229
229
  });
230
230
 
231
231
  it("should be able to mint expansion only by the owner", async () => {
232
232
  let res = marketMaker.connect(staker).mintExpansion(cdai);
233
233
  await expect(res).to.be.revertedWith(
234
- "GoodMarketMaker: not Reserve or Avatar"
234
+ /GoodMarketMaker: not Reserve or Avatar/
235
235
  );
236
236
  });
237
237
 
@@ -412,21 +412,21 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
412
412
  .connect(staker)
413
413
  .buy(dai, ethers.utils.parseEther("1"));
414
414
  await expect(res).to.be.revertedWith(
415
- "GoodMarketMaker: not Reserve or Avatar"
415
+ /GoodMarketMaker: not Reserve or Avatar/
416
416
  );
417
417
  });
418
418
 
419
419
  it("should not be able to calculate the sell return in reserve token and update the bonding curve params by a non-owner account", async () => {
420
420
  let res = marketMaker.connect(staker).sellWithContribution(dai, 100, 0);
421
421
  await expect(res).to.be.revertedWith(
422
- "GoodMarketMaker: not Reserve or Avatar"
422
+ /GoodMarketMaker: not Reserve or Avatar/
423
423
  );
424
424
  });
425
425
 
426
426
  it("should not be able to calculate the sellWithContribution return in reserve token and update the bonding curve params by a non-owner account", async () => {
427
427
  let res = marketMaker.connect(staker).sellWithContribution(dai, 100, 80);
428
428
  await expect(res).to.be.revertedWith(
429
- "GoodMarketMaker: not Reserve or Avatar"
429
+ /GoodMarketMaker: not Reserve or Avatar/
430
430
  );
431
431
  });
432
432
 
@@ -442,7 +442,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
442
442
  reserveRatioBefore.toString()
443
443
  );
444
444
  let res = marketMaker.buy(cdai, ethers.utils.parseEther("1"));
445
- await expect(res).to.be.revertedWith("Reserve token not initialized");
445
+ await expect(res).to.be.revertedWith(/Reserve token not initialized/);
446
446
  await initializeToken(
447
447
  cdai,
448
448
  gdSupplyBefore,
@@ -458,7 +458,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
458
458
  0
459
459
  );
460
460
 
461
- await expect(res).to.be.revertedWith("Reserve token not initialized");
461
+ await expect(res).to.be.revertedWith(/Reserve token not initialized/);
462
462
  });
463
463
 
464
464
  it("should be able to sellWithContribution only with active token", async () => {
@@ -467,7 +467,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
467
467
  ethers.utils.parseEther("1"),
468
468
  ethers.utils.parseEther("1")
469
469
  );
470
- await expect(res).to.be.revertedWith("Reserve token not initialized");
470
+ await expect(res).to.be.revertedWith(/Reserve token not initialized/);
471
471
  });
472
472
 
473
473
  it("should be able to sell gd only when the amount is lower than the total supply", async () => {
@@ -479,7 +479,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
479
479
  0
480
480
  );
481
481
  await expect(res).to.be.revertedWith(
482
- "GD amount is higher than the total supply"
482
+ /GD amount is higher than the total supply/
483
483
  );
484
484
  });
485
485
 
@@ -510,7 +510,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
510
510
  .connect(staker)
511
511
  .setReserveRatioDailyExpansion(1, 1e15);
512
512
  await expect(res).to.be.revertedWith(
513
- "GoodMarketMaker: not Reserve or Avatar"
513
+ /GoodMarketMaker: not Reserve or Avatar/
514
514
  );
515
515
  });
516
516
 
@@ -598,7 +598,7 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
598
598
  const invalidZeroDenominator = 0;
599
599
  await expect(
600
600
  marketMaker.setReserveRatioDailyExpansion(1, invalidZeroDenominator)
601
- ).to.be.revertedWith("denominator must be above 0");
601
+ ).to.be.revertedWith(/denominator must be above 0/);
602
602
 
603
603
  const denominator = 1;
604
604
  const nominatorHigherThanDenom = 2;
@@ -607,6 +607,6 @@ describe("GoodMarketMaker - calculate gd value at reserve", () => {
607
607
  nominatorHigherThanDenom,
608
608
  denominator
609
609
  )
610
- ).to.be.revertedWith("Invalid nom or denom value");
610
+ ).to.be.revertedWith(/Invalid nom or denom value/);
611
611
  });
612
612
  });