@gooddollar/goodprotocol 1.0.8 → 1.0.11

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 (123) hide show
  1. package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
  2. package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
  3. package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
  4. package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
  5. package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
  6. package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
  7. package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
  8. package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
  9. package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
  10. package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
  11. package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
  12. package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
  13. package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
  14. package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
  15. package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
  16. package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
  17. package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
  18. package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
  19. package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
  20. package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
  21. package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
  22. package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
  23. package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
  24. package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
  25. package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
  26. package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
  27. package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
  28. package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
  29. package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
  30. package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
  31. package/artifacts/contracts/governance/GovarnanceStaking.sol/GovernanceStaking.dbg.json +1 -1
  32. package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
  33. package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
  34. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
  35. package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
  36. package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  37. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  38. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  39. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  40. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +6 -6
  41. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  42. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  43. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  44. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  45. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  46. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
  47. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  48. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  49. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  50. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  60. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  61. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  62. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  63. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  64. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  65. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +4 -0
  66. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +200 -0
  67. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  68. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
  69. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  70. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  71. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +4 -0
  72. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.json +958 -0
  73. package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
  74. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
  75. package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +65 -12
  76. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  77. package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +4 -4
  78. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +4 -0
  79. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +1149 -0
  80. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  81. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +57 -14
  82. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  83. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +6 -6
  84. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +4 -0
  85. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +1092 -0
  86. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  87. package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
  88. package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +1 -1
  89. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  90. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  91. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  92. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  93. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  94. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  95. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  96. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  97. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  98. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  99. package/contracts/staking/BaseShareFieldV2.sol +343 -0
  100. package/contracts/staking/SimpleStaking.sol +0 -7
  101. package/contracts/staking/SimpleStakingV2.sol +488 -0
  102. package/contracts/staking/aave/AaveStakingFactory.sol +45 -19
  103. package/contracts/staking/aave/GoodAaveStaking.sol +1 -1
  104. package/contracts/staking/aave/GoodAaveStakingV2.sol +263 -0
  105. package/contracts/staking/compound/CompoundStakingFactory.sol +41 -18
  106. package/contracts/staking/compound/GoodCompoundStaking.sol +1 -1
  107. package/contracts/staking/compound/GoodCompoundStakingV2.sol +315 -0
  108. package/package.json +1 -1
  109. package/releases/deployment.json +55 -47
  110. package/scripts/deployFullDAO.ts +1 -1
  111. package/scripts/upgradeToV2/upgradeToV2.ts +7 -3
  112. package/test/governance/StakersDistribution.test.ts +43 -14
  113. package/test/helpers.ts +6 -1
  114. package/test/staking/CompoundStakingFactory.test.ts +24 -21
  115. package/test/staking/DifferentStakingTokens.test.ts +3 -1
  116. package/test/staking/DonationsStaking.test.ts +3 -1
  117. package/test/staking/GoodAaveStakingFactory.test.ts +26 -23
  118. package/test/staking/SimpleDAIStaking.test.ts +3 -11
  119. package/test/staking/StakingRewards.test.ts +20 -14
  120. package/test/staking/SwapHelper.test.ts +4 -1
  121. package/test/staking/UsdcAaveStaking.test.ts +22 -3
  122. package/test/ubi/UBIScheme.e2e.test.ts +1 -1
  123. package/test/utils/ProtocolUpgrade.test.ts +1 -1
@@ -321,62 +321,66 @@
321
321
  },
322
322
  "test": {
323
323
  "ProxyFactory": "0x36dE29DB57062A583436Ae071e141404dFE2311C",
324
- "NameService": "0xAd8C024cE4E90D0bf00eD29f441581F6FDE54C34",
325
- "GReputation": "0x80073051B408D4011221634c7fe464d16Eef4eb5",
326
- "CompoundVotingMachine": "0xFA18ab3DD023DAFB2cEB6cb0507557b26362180E",
327
- "ClaimersDistribution": "0x065A4F59bEE2Eaca8a73Ca4eD84CA0aB288b5BdD",
328
- "GovernanceStaking": "0xcFa693a6B5d8399b771582afF07B5a8f55D75d40",
329
- "UBIScheme": "0x4dd4301DB4461EbD0ac859fFFCc90531EBaC5D75",
330
- "ProtocolUpgradeFuse": "0xAf49e224e71AF966D5367E6c8DED0CF7FcD110d0",
324
+ "NameService": "0x105678e10c32a29543902067fEd1BB2e5E0B3CEe",
325
+ "GReputation": "0xFf73F4DEeFFe4f7E53E20d757b99d82D465c93b9",
326
+ "CompoundVotingMachine": "0x1dfBd51e464E45A9Dfe33B79222D6B3f0bedC1f0",
327
+ "ClaimersDistribution": "0xB3375A6f09CFFF8591577d03133eeaF39cA76a84",
328
+ "GovernanceStaking": "0xFD6F7A6a5c21A3f503EBaE7a473639974379c351",
329
+ "UBIScheme": "0x137dbc6fd877D802c567B74741D9B2526685718A",
330
+ "ProtocolUpgradeFuse": "0x0ed64d01D0B4B655E410EF1441dD677B695639E7",
331
331
  "network": "test",
332
332
  "networkId": 4447,
333
- "HomeBridge": "0xc90C13734D20e27904dF248FB850f50C81CE3642",
334
- "OneTimePayments": "0x4D5D3FaE9b08a4FA2aEB9Bc0d86E3dB3b3126438",
335
- "AdminWallet": "0x65E001B67f1aD28FF337C4F6e1cA52F31F5Eb9Fd",
336
- "Identity": "0x473A31861aB89d5D7a78E7efc57ad31d84ED5343",
337
- "GoodDollar": "0x040F0292f908c83BdEcCAE7600344503F2a20691",
338
- "Controller": "0x75B282FdEaEce36C6E9363F30010058c284D9199",
339
- "Avatar": "0xB3cbA81d4ce278661E26E2107936A014efc31343",
340
- "FirstClaimPool": "0xd3aF095DE5D1419ADabE47a48d6110e37236A97F",
341
- "BancorFormula": "0x0d6e43d4d7944408d9a5A10BC57B4348d61cD764",
342
- "DAI": "0xB3a1e45D60f9394bC4327f5Dc46dB56D8a3c3688",
343
- "cDAI": "0x1f720E7952650ED8Ca142feBD52aCBe8b7A21741",
344
- "COMP": "0xD83C9f1B0DaFb1992eF92ac62D6509e54AD4eD48"
333
+ "HomeBridge": "0xDC11f7E700A4c898AE5CAddB1082cFfa76512aDD",
334
+ "OneTimePayments": "0x86A2EE8FAf9A840F7a2c64CA3d51209F9A02081D",
335
+ "AdminWallet": "0x34B40BA116d5Dec75548a9e9A8f15411461E8c70",
336
+ "Identity": "0x36b58F5C1969B7b6591D752ea6F5486D069010AB",
337
+ "GoodDollar": "0x5971B98C0066517Bae7D44021f42e50B77cfe1F9",
338
+ "Controller": "0xF380bC8b4e595dECa3A55A4C98A6C4fA1c96f537",
339
+ "Avatar": "0x724dbC61127E39A610Be416b455deb800d51A3B2",
340
+ "FirstClaimPool": "0x720472c8ce72c2A2D711333e064ABD3E6BbEAdd3",
341
+ "BancorFormula": "0xD8a5a9b31c3C0232E196d518E89Fd8bF83AcAd43",
342
+ "DAI": "0x4C4a2f8c81640e47606d3fd77B353E87Ba015584",
343
+ "cDAI": "0x2E2Ed0Cfd3AD2f1d34481277b3204d807Ca2F8c2",
344
+ "COMP": "0x21dF544947ba3E8b3c32561399E88B52Dc8b2823"
345
345
  },
346
346
  "test-mainnet": {
347
347
  "ProxyFactory": "0xce17442a9e26bcFDFAb2e9028e3A655d046f1654",
348
- "NameService": "0x55125Ed5fa29594A8DbD7D0fB186888537B9c140",
349
- "GReputation": "0x7235eC3c7b450eE36De0141b205d89D08C5de5fE",
350
- "CompoundVotingMachine": "0xE8A10EA2E8764EB25684A2974913dDAbFefA4494",
351
- "GoodMarketMaker": "0xF4eD16cBD64f07230C5bc9667357cE1D161DF894",
352
- "GoodReserveCDai": "0x1bEA43626e0b6Afe157FBD1398093359261bB53e",
353
- "ExchangeHelper": "0x6fad49b578CbF1d8F21b6dF17ccBB5d409Fb6BC8",
354
- "GoodFundManager": "0x7963849A738719BE64c669c8Ce5613A6331C8caC",
355
- "StakersDistribution": "0x5c73Ed454acB4467C0a35264D7a455C607FcE1bA",
356
- "ProtocolUpgrade": "0x9c15162c1f7f01C64c0e068f2E48D39Cd7b18f86",
357
- "UniswapV2SwapHelper": "0x39683C5c01B4a875FA7d4f5766D2Df521Fc0b4AD",
358
- "CompoundStakingFactory": "0x712e1b726F6149C768fff8572CeA0Bdba23a561B",
359
- "AaveStakingFactory": "0x36c7b0946e701EA6cE8e101B4C959FF15D0DeE15",
348
+ "NameService": "0xE88Cd74511b17f10363b557c2E9632CAab353b39",
349
+ "GReputation": "0x3B7bF1232414Bc52E3C233D0aF8524f259463034",
350
+ "CompoundVotingMachine": "0xA6F88E890518adAB4517f95c74b0aF4370b7e0be",
351
+ "GoodMarketMaker": "0xa3b0167657e47ABa3b541C1b21448B449f2CE3bc",
352
+ "GoodReserveCDai": "0xFE67C7f6d6A9eDA3adE28d8d1bdf1B764491E823",
353
+ "ExchangeHelper": "0x9bDB9d2aD7Aaf2763e49aa518A3b3CC4798210c6",
354
+ "GoodFundManager": "0xfE16B3e38B6eEb8f4eA0C820cB4547ec03edFE0e",
355
+ "StakersDistribution": "0xab06522CFF9ec6302a32b9db057293E80e1BC43a",
356
+ "ProtocolUpgrade": "0x5D42EBdBBa61412295D7b0302d6F50aC449Ddb4F",
357
+ "UniswapV2SwapHelper": "0xddE78e6202518FF4936b5302cC2891ec180E8bFf",
358
+ "CompoundStakingFactory": "0xB06c856C8eaBd1d8321b687E188204C1018BC4E5",
359
+ "AaveStakingFactory": "0xaB7B4c595d3cE8C85e16DA86630f2fc223B05057",
360
360
  "network": "test-mainnet",
361
361
  "networkId": 4447,
362
- "ForeignBridge": "0x9F95c870a4104603630CBEDBbbd56c6465Cc8A58",
363
- "Contribution": "0x770ace66dd84B035F71FfC977448032EE688604d",
362
+ "ForeignBridge": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
363
+ "Contribution": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
364
364
  "StakingContracts": [
365
365
  [
366
- "0xb440419193c65B52e68a819BBe11Bd770Bf93B33",
366
+ "0x8f19E89ed457Ca4a3cb0dF96653d1952F465ca4A",
367
367
  13888
368
+ ],
369
+ [
370
+ "0x810D8eB0BC99Faebc340EcA183e0110Cf0635A89",
371
+ "6944"
368
372
  ]
369
373
  ],
370
- "DonationsStaking": "0x4e21A8F1d5C27C3A99b2781E1aB215f6a75A0122",
371
- "Identity": "0x66a2BECe75FCE45ddFe2C06216CE9350a4c46498",
372
- "GoodDollar": "0x53DE0F59992D932020ad00CF4ABEe89051F8961d",
373
- "Controller": "0x86851c91c15A49Ba4a9Cc9859f2d84C47b7aD91d",
374
- "Avatar": "0xB8FC6cFAb3E190e648aac2d7aB69d466f3674bDB",
375
- "FirstClaimPool": "0x59E0b0C67a8f14BE8C5855C95CdD2ba95a7f2BbB",
376
- "BancorFormula": "0x1aaaD333A7d363a8576779B71BF589580cC9D82E",
377
- "DAI": "0x63766F0efAa46a86E9055bB46e41ff7bc64CBEA2",
378
- "cDAI": "0x24ef01de6baE76eE73Da210940A296F739d87952",
379
- "COMP": "0x3C3297C2Be0F0C51b604dC0A798cF610d7406De2"
374
+ "DonationsStaking": "0x0B92eE05ABeeeEdef0a0e861468A4317d6E2AC93",
375
+ "Identity": "0x0165878A594ca255338adfa4d48449f69242Eb8F",
376
+ "GoodDollar": "0x9bd03768a7DCc129555dE410FF8E85528A4F88b5",
377
+ "Controller": "0x23dB4a08f2272df049a4932a4Cc3A6Dc1002B33E",
378
+ "Avatar": "0x61c36a8d610163660E21a8b7359e1Cac0C9133e1",
379
+ "FirstClaimPool": "0xE6E340D132b5f46d1e472DebcD681B2aBc16e57E",
380
+ "BancorFormula": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
381
+ "DAI": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
382
+ "cDAI": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
383
+ "COMP": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
380
384
  },
381
385
  "production": {
382
386
  "ProxyFactory": "0x4659176E962763e7C8A4eF965ecfD0fdf9f52057",
@@ -415,8 +419,8 @@
415
419
  "StakersDistribution": "0x12D15EfC3c9661AD68209CD197D416BFd9B145f5",
416
420
  "ProtocolUpgrade": "0xfc918F32D89b7592Fbda5a0FbC7Eaa0c9a0d5d4a",
417
421
  "UniswapV2SwapHelper": "0x62305662fA7c4BC442803b940d9192DbDC92D710",
418
- "CompoundStakingFactory": "0x2C89e77d53C31ED6b331a19207799B3C11Db07eA",
419
- "AaveStakingFactory": "0xa9Ec98203296ED5BC3985490058575e49c40300a",
422
+ "CompoundStakingFactory": "0x5f6f25143cd580e2e285210d7cfcb26e59cf9566",
423
+ "AaveStakingFactory": "0xa99ba154223052b8c5fd92b3f5df9eb08b72d5fc",
420
424
  "network": "production-mainnet",
421
425
  "networkId": 1,
422
426
  "ForeignBridge": "0xD5D11eE582c8931F336fbcd135e98CEE4DB8CCB0",
@@ -424,10 +428,14 @@
424
428
  "StakingContracts": [
425
429
  [
426
430
  "0xD33bA17C8A644C585089145e86E282fada6F3bfd",
431
+ 310
432
+ ],
433
+ [
434
+ "0x02416eb83cff1f19163f21010149c3867f3261e1",
427
435
  13888
428
436
  ],
429
437
  [
430
- "0x589ceb6cA1112f7aCCA19930b47871c5A259B0fC",
438
+ "0xf4c34bed7dd779485692bb1857acf9c561b45010",
431
439
  6944
432
440
  ]
433
441
  ],
@@ -478,7 +478,7 @@ export const deploySidechain = async (
478
478
  })
479
479
  .then(printDeploy);
480
480
 
481
- let encoded = (
481
+ encoded = (
482
482
  await ethers.getContractAt("IGoodDollar", gd)
483
483
  ).interface.encodeFunctionData("mint", [firstClaim.address, 1000000]);
484
484
  await genericCall(gd, encoded);
@@ -819,7 +819,9 @@ export const main = async (
819
819
  ]
820
820
  });
821
821
  const tx = await (
822
- await compfactory.cloneAndInit(
822
+ await compfactory[
823
+ "cloneAndInit(address,address,uint64,address,address,address[])"
824
+ ](
823
825
  token.address,
824
826
  release.NameService,
825
827
  protocolSettings.staking.fullRewardsThreshold, //blocks before switching for 0.5x rewards to 1x multiplier
@@ -841,7 +843,7 @@ export const main = async (
841
843
  // Promise.resolve(["0x9999c40c8b88c740076b15d2e708db6a7a071b53", 13888])
842
844
  // ];
843
845
  let deployed;
844
- if (!isRopsten && !isDevelop) {
846
+ if (!isRopsten || isTest) {
845
847
  const aaveps = aaveTokens.map(async token => {
846
848
  let rewardsPerBlock = (protocolSettings.staking.rewardsPerBlock / 2) //aave gets half of the rewards
847
849
  .toFixed(0);
@@ -851,7 +853,9 @@ export const main = async (
851
853
  rewardsPerBlock
852
854
  });
853
855
  const tx = await (
854
- await aavefactory.cloneAndInit(
856
+ await aavefactory[
857
+ "cloneAndInit(address,address,address,uint64,address,address,address,address[])"
858
+ ](
855
859
  token.address,
856
860
  get(protocolSettings, "aave.lendingPool", dao.AaveLendingPool),
857
861
  release.NameService,
@@ -149,7 +149,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
149
149
  const router = uniswap.router;
150
150
  await setDAOAddress("UNISWAP_ROUTER", router.address);
151
151
 
152
- let simpleStakingFactory = await getStakingFactory("GoodCompoundStaking");
152
+ let simpleStakingFactory = await getStakingFactory("GoodCompoundStakingV2");
153
153
 
154
154
  simpleUsdcStaking = await simpleStakingFactory
155
155
  .deploy()
@@ -213,7 +213,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
213
213
  await setDAOAddress("GDAO_STAKERS", stakersDistribution.address);
214
214
  });
215
215
 
216
- it("it should have 2M monthly Reputation distribution", async () => {
216
+ xit("it should have 2M monthly Reputation distribution", async () => {
217
217
  const monthlyReputationDistribution =
218
218
  await stakersDistribution.monthlyReputationDistribution();
219
219
  expect(monthlyReputationDistribution).to.be.equal(
@@ -221,14 +221,14 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
221
221
  );
222
222
  });
223
223
 
224
- it("it should have 0 monthly rewards since staking amount was zero while initializing stakersDistribution", async () => {
224
+ xit("it should have 0 monthly rewards since staking amount was zero while initializing stakersDistribution", async () => {
225
225
  const rewardsPerBlock = await stakersDistribution.rewardsPerBlock(
226
226
  simpleStaking.address
227
227
  );
228
228
  expect(rewardsPerBlock).to.be.equal(0);
229
229
  });
230
230
 
231
- it("It should update monthly rewards according to staking amount of staking contract after one month passed from initialized", async () => {
231
+ xit("It should update monthly rewards according to staking amount of staking contract after one month passed from initialized", async () => {
232
232
  const stakingAmount = ethers.utils.parseEther("1000");
233
233
  const rewardsPerBlockBeforeStake =
234
234
  await stakersDistribution.rewardsPerBlock(simpleStaking.address);
@@ -257,7 +257,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
257
257
  expect(rewardsPerBlockAfterStake).to.be.equal(rewardsPerBlockAfterWithdraw);
258
258
  });
259
259
 
260
- it("it should not be set monthly reputation when not Avatar", async () => {
260
+ xit("it should not be set monthly reputation when not Avatar", async () => {
261
261
  const transaction = await stakersDistribution
262
262
  .setMonthlyReputationDistribution("1000000")
263
263
  .catch(e => e);
@@ -266,7 +266,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
266
266
  );
267
267
  });
268
268
 
269
- it("it should set monthly reputation when Avatar", async () => {
269
+ xit("it should set monthly reputation when Avatar", async () => {
270
270
  let encoded = stakersDistribution.interface.encodeFunctionData(
271
271
  "setMonthlyReputationDistribution",
272
272
  [ethers.utils.parseEther("1000000")]
@@ -284,7 +284,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
284
284
  await genericCall(stakersDistribution.address, encoded);
285
285
  });
286
286
 
287
- it("it should distribute monthly rewards according to staking amount of contracts so in this particular case simpleStaking contract should get %75 of the monthly rewards ", async () => {
287
+ xit("it should distribute monthly rewards according to staking amount of contracts so in this particular case simpleStaking contract should get %75 of the monthly rewards ", async () => {
288
288
  const goodFundManagerFactory = await ethers.getContractFactory(
289
289
  "GoodFundManager"
290
290
  );
@@ -349,7 +349,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
349
349
  await ictrl.genericCall(goodFundManager.address, encodedData, avatar, 0);
350
350
  });
351
351
 
352
- it("It should not update monthly rewards if staking contract's blockEnd Passed", async () => {
352
+ xit("It should not update monthly rewards if staking contract's blockEnd Passed", async () => {
353
353
  const goodFundManagerFactory = await ethers.getContractFactory(
354
354
  "GoodFundManager"
355
355
  );
@@ -403,7 +403,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
403
403
  .true;
404
404
  });
405
405
 
406
- it("it should give distribute if blockend passed but some of the rewards during reward period was not distributed", async () => {
406
+ xit("it should give distribute if blockend passed but some of the rewards during reward period was not distributed", async () => {
407
407
  const goodFundManagerFactory = await ethers.getContractFactory(
408
408
  "GoodFundManager"
409
409
  );
@@ -449,7 +449,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
449
449
  );
450
450
  });
451
451
 
452
- it("it should not increaseProductivity of staking contract which is blacklisted", async () => {
452
+ xit("it should not increaseProductivity of staking contract which is blacklisted", async () => {
453
453
  const goodFundManagerFactory = await ethers.getContractFactory(
454
454
  "GoodFundManager"
455
455
  );
@@ -484,7 +484,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
484
484
  expect(productivityOfStaker[0]).to.be.equal(0);
485
485
  });
486
486
 
487
- it("it should not decreaseProductivity of staking contract which is blacklisted", async () => {
487
+ xit("it should not decreaseProductivity of staking contract which is blacklisted", async () => {
488
488
  const goodFundManagerFactory = await ethers.getContractFactory(
489
489
  "GoodFundManager"
490
490
  );
@@ -555,7 +555,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
555
555
  expect(pendingGDAO).equal(0); //should have 0 pending after contract was blacklisted
556
556
  });
557
557
 
558
- it("it should not earn rewards when current block < startBlock", async () => {
558
+ xit("it should not earn rewards when current block < startBlock", async () => {
559
559
  const goodFundManagerFactory = await ethers.getContractFactory(
560
560
  "GoodFundManager"
561
561
  );
@@ -619,7 +619,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
619
619
  await ictrl.genericCall(goodFundManager.address, encodedData, avatar, 0);
620
620
  });
621
621
 
622
- it("Accumulated per share has enough precision when reward << totalproductivity", async () => {
622
+ xit("Accumulated per share has enough precision when reward << totalproductivity", async () => {
623
623
  const goodFundManagerFactory = await ethers.getContractFactory(
624
624
  "GoodFundManager"
625
625
  );
@@ -676,7 +676,7 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
676
676
  await ictrl.genericCall(goodFundManager.address, encodedData, avatar, 0);
677
677
  });
678
678
 
679
- it("it should distribute rewards properly when staking contract's token is different decimals than 18", async () => {
679
+ xit("it should distribute rewards properly when staking contract's token is different decimals than 18", async () => {
680
680
  const goodFundManagerFactory = await ethers.getContractFactory(
681
681
  "GoodFundManager"
682
682
  );
@@ -774,4 +774,33 @@ describe("StakersDistribution - staking with GD and get Rewards in GDAO", () =>
774
774
  expect(usdcStakingProductivity[1]).to.be.equal(daiStakingProductivity[1]);
775
775
  expect(usdcStakingRewardsPerBlock).to.be.equal(daiStakingRewardsPerBlock);
776
776
  });
777
+
778
+ it("should be able to transfer staking token when using stakersdistribution", async () => {
779
+ const stakingAmountDai = ethers.utils.parseEther("10000");
780
+ const stakingAmountUsdc = ethers.utils.parseUnits("10000", 6);
781
+ await dai["mint(address,uint256)"](staker.address, stakingAmountDai);
782
+ await dai.connect(staker).approve(simpleStaking.address, stakingAmountDai);
783
+ await usdc["mint(address,uint256)"](staker.address, stakingAmountUsdc);
784
+ await usdc
785
+ .connect(staker)
786
+ .approve(simpleUsdcStaking.address, stakingAmountUsdc);
787
+ await simpleStaking.connect(staker).stake(stakingAmountDai, 0, false);
788
+ await increaseTime(86700 * 30); // Increase one month
789
+ await simpleUsdcStaking.connect(staker).stake(stakingAmountUsdc, 0, false);
790
+ await advanceBlocks(10);
791
+
792
+ await simpleUsdcStaking
793
+ .connect(staker)
794
+ .transfer(signers[1].address, stakingAmountUsdc);
795
+
796
+ expect(await simpleUsdcStaking.balanceOf(signers[1].address)).to.eq(
797
+ stakingAmountUsdc
798
+ );
799
+ expect(await simpleUsdcStaking.balanceOf(staker.address)).to.eq(0);
800
+ // await expect(
801
+ // simpleStaking
802
+ // .connect(staker)
803
+ // .transfer(signers[1].address, ethers.utils.parseEther("10000"))
804
+ // ).to.not.reverted;
805
+ });
777
806
  });
package/test/helpers.ts CHANGED
@@ -18,7 +18,12 @@ import { GoodMarketMaker, CompoundVotingMachine } from "../types";
18
18
  import { Contract } from "ethers";
19
19
 
20
20
  export const getStakingFactory = async (
21
- factory: "GoodCompoundStaking" | "GoodAaveStaking" | "GoodCompoundStakingTest"
21
+ factory:
22
+ | "GoodCompoundStaking"
23
+ | "GoodAaveStaking"
24
+ | "GoodCompoundStakingTest"
25
+ | "GoodAaveStakingV2"
26
+ | "GoodCompoundStakingV2"
22
27
  ) => {
23
28
  let swapHelper = await ethers
24
29
  .getContractFactory("UniswapV2SwapHelper")
@@ -4,7 +4,7 @@ import { expect } from "chai";
4
4
  import {
5
5
  CERC20,
6
6
  GoodCompoundStaking,
7
- CompoundStakingFactory,
7
+ CompoundStakingFactory
8
8
  } from "../../types";
9
9
  import { createDAO, deployUniswap } from "../helpers";
10
10
  import { Contract } from "ethers";
@@ -46,33 +46,35 @@ describe("CompoundStakingFactory", () => {
46
46
  await dao.setDAOAddress("UNISWAP_ROUTER", router.address);
47
47
  let swapHelper = await ethers
48
48
  .getContractFactory("UniswapV2SwapHelper")
49
- .then((_) => _.deploy());
49
+ .then(_ => _.deploy());
50
50
 
51
51
  stakingFactory = (await ethers
52
52
  .getContractFactory("CompoundStakingFactory", {
53
- libraries: { UniswapV2SwapHelper: swapHelper.address },
53
+ libraries: { UniswapV2SwapHelper: swapHelper.address }
54
54
  })
55
- .then((_) => _.deploy())) as CompoundStakingFactory;
55
+ .then(_ => _.deploy())) as CompoundStakingFactory;
56
56
  });
57
57
 
58
- it("should create proxy clone", async () => {
59
- const res = await (
60
- await stakingFactory.clone(cdai, ethers.constants.HashZero)
61
- ).wait();
62
- const log = res.events.find((_) => _.event === "Deployed");
63
- const detAddress = await stakingFactory.predictAddress(
64
- cdai,
65
- ethers.constants.HashZero
66
- );
67
- expect(log).to.not.empty;
68
- expect(log.args.proxy).to.equal(detAddress);
69
- expect(log.args.cToken).to.equal(cdai);
70
- });
58
+ // it("should create proxy clone", async () => {
59
+ // const res = await (
60
+ // await stakingFactory.clone(cdai, ethers.constants.HashZero)
61
+ // ).wait();
62
+ // const log = res.events.find(_ => _.event === "Deployed");
63
+ // const detAddress = await stakingFactory.predictAddress(
64
+ // cdai,
65
+ // ethers.constants.HashZero
66
+ // );
67
+ // expect(log).to.not.empty;
68
+ // expect(log.args.proxy).to.equal(detAddress);
69
+ // expect(log.args.cToken).to.equal(cdai);
70
+ // });
71
71
 
72
72
  it("should create and initialize clone", async () => {
73
73
  console.log(await dao.nameService.getAddress("UNISWAP_ROUTER"));
74
74
  const res = await (
75
- await stakingFactory.cloneAndInit(
75
+ await stakingFactory[
76
+ "cloneAndInit(address,address,uint64,address,address,address[])"
77
+ ](
76
78
  cdai,
77
79
  dao.nameService.address,
78
80
  5760,
@@ -81,8 +83,9 @@ describe("CompoundStakingFactory", () => {
81
83
  []
82
84
  )
83
85
  ).wait();
84
- const log = res.events.find((_) => _.event === "Deployed");
86
+ const log = res.events.find(_ => _.event === "Deployed");
85
87
  const detAddress = await stakingFactory.predictAddress(
88
+ await stakingFactory.impl(),
86
89
  cdai,
87
90
  ethers.utils.solidityKeccak256(
88
91
  ["address", "uint64", "address", "address[]"],
@@ -95,12 +98,12 @@ describe("CompoundStakingFactory", () => {
95
98
 
96
99
  //check initialization
97
100
  const staking: GoodCompoundStaking = (await ethers.getContractAt(
98
- "GoodCompoundStaking",
101
+ "GoodCompoundStakingV2",
99
102
  detAddress
100
103
  )) as GoodCompoundStaking;
101
104
  expect(await staking.iToken()).to.equal(cdai);
102
105
  expect(await staking.token()).to.equal(dai);
103
- expect(await staking.name()).to.equal("GoodCompoundStaking Compound DAI");
106
+ expect(await staking.name()).to.equal("GoodCompoundStakingV2 Compound DAI");
104
107
  expect(await staking.symbol()).to.equal("gcDAI");
105
108
  });
106
109
  });
@@ -90,7 +90,9 @@ describe("Different decimals staking token", () => {
90
90
  goodDollar = await ethers.getContractAt("IGoodDollar", gd);
91
91
 
92
92
  tokenUsdOracleFactory = await ethers.getContractFactory("BatUSDMockOracle");
93
- goodCompoundStakingFactory = await getStakingFactory("GoodCompoundStaking");
93
+ goodCompoundStakingFactory = await getStakingFactory(
94
+ "GoodCompoundStakingV2"
95
+ );
94
96
 
95
97
  tokenFactory = await ethers.getContractFactory("DecimalsMock");
96
98
  cTokenFactory = await ethers.getContractFactory("cDecimalsMock");
@@ -57,7 +57,9 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
57
57
  const goodFundManagerFactory = await ethers.getContractFactory(
58
58
  "GoodFundManager"
59
59
  );
60
- goodCompoundStakingFactory = await getStakingFactory("GoodCompoundStaking");
60
+ goodCompoundStakingFactory = await getStakingFactory(
61
+ "GoodCompoundStakingV2"
62
+ );
61
63
 
62
64
  const daiFactory = await ethers.getContractFactory("DAIMock");
63
65
  let {
@@ -50,36 +50,38 @@ describe("AaveStakingFactory", () => {
50
50
  await dao.setDAOAddress("AAVE", aave.address);
51
51
  let swapHelper = await ethers
52
52
  .getContractFactory("UniswapV2SwapHelper")
53
- .then((_) => _.deploy());
53
+ .then(_ => _.deploy());
54
54
 
55
55
  stakingFactory = (await ethers
56
56
  .getContractFactory("AaveStakingFactory", {
57
- libraries: { UniswapV2SwapHelper: swapHelper.address },
57
+ libraries: { UniswapV2SwapHelper: swapHelper.address }
58
58
  })
59
- .then((_) => _.deploy())) as AaveStakingFactory;
59
+ .then(_ => _.deploy())) as AaveStakingFactory;
60
60
  });
61
61
 
62
- it("should create proxy clone", async () => {
63
- const res = await (
64
- await stakingFactory.clone(usdc.address, ethers.constants.HashZero)
65
- ).wait();
66
- const log = res.events.find((_) => _.event === "Deployed");
67
- const detAddress = await stakingFactory.predictAddress(
68
- usdc.address,
69
- ethers.constants.HashZero
70
- );
62
+ // it("should create proxy clone", async () => {
63
+ // const res = await (
64
+ // await stakingFactory.clone(usdc.address, ethers.constants.HashZero)
65
+ // ).wait();
66
+ // const log = res.events.find((_) => _.event === "Deployed");
67
+ // const detAddress = await stakingFactory.predictAddress(
68
+ // usdc.address,
69
+ // ethers.constants.HashZero
70
+ // );
71
71
 
72
- expect(log).to.not.empty;
73
- expect(log.args.proxy).to.equal(detAddress);
74
- expect(log.args.token).to.equal(usdc.address);
75
- });
72
+ // expect(log).to.not.empty;
73
+ // expect(log.args.proxy).to.equal(detAddress);
74
+ // expect(log.args.token).to.equal(usdc.address);
75
+ // });
76
76
 
77
77
  it("should create and initialize clone", async () => {
78
78
  const ns = await ethers
79
79
  .getContractFactory("NameService")
80
- .then((_) => _.deploy());
80
+ .then(_ => _.deploy());
81
81
  const res = await (
82
- await stakingFactory.cloneAndInit(
82
+ await stakingFactory[
83
+ "cloneAndInit(address,address,address,uint64,address,address,address,address[])"
84
+ ](
83
85
  usdc.address,
84
86
  lendingPool.address,
85
87
  dao.nameService.address,
@@ -90,8 +92,9 @@ describe("AaveStakingFactory", () => {
90
92
  [usdc.address, dai]
91
93
  )
92
94
  ).wait();
93
- const log = res.events.find((_) => _.event === "Deployed");
95
+ const log = res.events.find(_ => _.event === "Deployed");
94
96
  const detAddress = await stakingFactory.predictAddress(
97
+ await stakingFactory.impl(),
95
98
  usdc.address,
96
99
  ethers.utils.solidityKeccak256(
97
100
  ["address", "address", "uint64", "address", "address", "address"],
@@ -101,7 +104,7 @@ describe("AaveStakingFactory", () => {
101
104
  5760,
102
105
  stakingFactory.address,
103
106
  incentiveController.address,
104
- aaveUsdOracle.address,
107
+ aaveUsdOracle.address
105
108
  ]
106
109
  )
107
110
  );
@@ -111,12 +114,12 @@ describe("AaveStakingFactory", () => {
111
114
 
112
115
  //check initialization
113
116
  const staking: GoodAaveStaking = (await ethers.getContractAt(
114
- "GoodAaveStaking",
117
+ "GoodAaveStakingV2",
115
118
  detAddress
116
119
  )) as GoodAaveStaking;
117
120
  expect(await staking.iToken()).to.equal(lendingPool.address);
118
121
  expect(await staking.token()).to.equal(usdc.address);
119
- expect(await staking.name()).to.equal("GoodAaveStaking USDC");
120
- expect(await staking.symbol()).to.equal("gUSDC");
122
+ expect(await staking.name()).to.equal("GoodAaveStakingV2 USDC");
123
+ expect(await staking.symbol()).to.equal("gaUSDC");
121
124
  });
122
125
  });
@@ -97,7 +97,9 @@ describe("SimpleDAISTAking - staking with cDAI mocks", () => {
97
97
  );
98
98
  compUsdOracle = await compUsdOracleFactory.deploy();
99
99
 
100
- goodCompoundStakingFactory = await getStakingFactory("GoodCompoundStaking");
100
+ goodCompoundStakingFactory = await getStakingFactory(
101
+ "GoodCompoundStakingV2"
102
+ );
101
103
 
102
104
  deployStaking = async (token, itoken) => {
103
105
  return goodCompoundStakingFactory.deploy().then(async contract => {
@@ -1256,16 +1258,6 @@ describe("SimpleDAISTAking - staking with cDAI mocks", () => {
1256
1258
  );
1257
1259
  });
1258
1260
 
1259
- it("should not withdraw interest if the recipient specified by the owner is the staking contract", async () => {
1260
- await advanceBlocks(BLOCK_INTERVAL);
1261
- await setDAOAddress("FUND_MANAGER", founder.address);
1262
- const error = await goodCompoundStaking
1263
- .collectUBIInterest(goodCompoundStaking.address)
1264
- .catch(e => e);
1265
- await setDAOAddress("FUND_MANAGER", goodFundManager.address);
1266
- expect(error.message).to.be.not.empty;
1267
- });
1268
-
1269
1261
  it("should pause the contract", async () => {
1270
1262
  let encodedCall = goodCompoundStakingFactory.interface.encodeFunctionData(
1271
1263
  "pause",