@gooddollar/goodprotocol 1.0.19-beta.0 → 1.0.19-beta.1

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 (111) 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/GovernanceStaking.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/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
  36. package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
  37. package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
  38. package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
  39. package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
  40. package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
  41. package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
  42. package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
  43. package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
  44. package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
  45. package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
  46. package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
  47. package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
  48. package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
  49. package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
  50. package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
  51. package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
  52. package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
  53. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
  54. package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
  55. package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
  56. package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
  57. package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
  58. package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
  59. package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
  60. package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
  61. package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
  62. package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
  63. package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
  64. package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
  65. package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
  66. package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
  67. package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
  68. package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
  69. package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
  70. package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
  71. package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
  72. package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
  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/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
  76. package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
  77. package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
  78. package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
  79. package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
  80. package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
  81. package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
  82. package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
  83. package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
  84. package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
  85. package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
  86. package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
  87. package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
  88. package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
  89. package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
  90. package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
  91. package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
  92. package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
  93. package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
  94. package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
  95. package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
  96. package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
  97. package/hardhat.config.ts +9 -7
  98. package/package.json +2 -2
  99. package/test/governance/ClaimersDistribution.test.ts +6 -6
  100. package/test/governance/CompoundVotingMachine.guardian.test.ts +2 -1
  101. package/test/governance/GReputation.test.ts +0 -1
  102. package/test/staking/DonationsStaking.test.ts +1 -1
  103. package/yarn.lock +224 -103
  104. package/artifacts/abis/FuseFaucet.min.json +0 -1
  105. package/artifacts/abis/InvitesV1.min.json +0 -1
  106. package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +0 -4
  107. package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.json +0 -200
  108. package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +0 -4
  109. package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.json +0 -486
  110. package/contracts/unaudited-foundation/FuseFaucet.sol +0 -120
  111. package/contracts/unaudited-foundation/InvitesV1.sol +0 -304
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/ff6861a79c763d8ce0e4d9e98e385caf.json"
3
+ "buildInfo": "../../../build-info/1d4e700cdf55d89b032a8f9e1eb69212.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/c8411caca8c56f2e4ea34f12a045e1f4.json"
3
+ "buildInfo": "../../../build-info/4f8206a440cfa6bac16c5683c5407b03.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/c8411caca8c56f2e4ea34f12a045e1f4.json"
3
+ "buildInfo": "../../../build-info/4f8206a440cfa6bac16c5683c5407b03.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/53b2923867b9288b1ebc3b517c5e4810.json"
3
+ "buildInfo": "../../../build-info/06edf668a7129b46ca8ef7fb6ce4d314.json"
4
4
  }
package/hardhat.config.ts CHANGED
@@ -62,7 +62,8 @@ const hhconfig: HardhatUserConfig = {
62
62
  allowUnlimitedContractSize: true,
63
63
  accounts: {
64
64
  accountsBalance: "10000000000000000000000000"
65
- }
65
+ },
66
+ initialDate: "2021-12-01"
66
67
  },
67
68
  test: {
68
69
  allowUnlimitedContractSize: true,
@@ -243,9 +244,10 @@ task("verifyjson", "verify contracts on etherscan").setAction(
243
244
  );
244
245
  export default hhconfig;
245
246
 
246
- task("sumStakersGdRewards", "Sums the GoodDollar reward for each staker")
247
- .setAction(async (taskArgs, hre) => {
248
- const actions = sumStakersGdRewards(hre.ethers);
249
- return actions.getStakersGdRewards();
250
- }
251
- );
247
+ task(
248
+ "sumStakersGdRewards",
249
+ "Sums the GoodDollar reward for each staker"
250
+ ).setAction(async (taskArgs, hre) => {
251
+ const actions = sumStakersGdRewards(hre.ethers);
252
+ return actions.getStakersGdRewards();
253
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gooddollar/goodprotocol",
3
- "version": "1.0.19-beta.0",
3
+ "version": "1.0.19-beta.1",
4
4
  "description": "GoodDollar Protocol",
5
5
  "scripts": {
6
6
  "build": "scripts/build.sh deploy",
@@ -91,7 +91,7 @@
91
91
  "fs-extra": "9.0.0",
92
92
  "graphql": "^15.5.0",
93
93
  "graphql-request": "^3.4.0",
94
- "hardhat": "^2.6.4",
94
+ "hardhat": "^2.9.3",
95
95
  "hardhat-contract-sizer": "^2.0.3",
96
96
  "hardhat-gas-reporter": "^1.0.4",
97
97
  "lodash": "^4.17.21",
@@ -84,9 +84,9 @@ describe("ClaimersDistribution", () => {
84
84
  });
85
85
 
86
86
  it("should update claim if claimed today", async () => {
87
- const ts = Date.now();
87
+ const ts = await ethers.provider.getBlock("latest").then(_ => _.timestamp);
88
88
  await ubiScheme.connect(claimer1).claim();
89
- expect(await cd.lastUpdated(claimer1.address)).gt((ts / 1000).toFixed(0));
89
+ expect(await cd.lastUpdated(claimer1.address)).gt(ts.toFixed(0));
90
90
  expect(await cd.getMonthClaims(claimer1.address)).to.equal(1);
91
91
  const monthData = await cd.months(await cd.currentMonth());
92
92
  expect(monthData.totalClaims).to.equal(1);
@@ -102,9 +102,9 @@ describe("ClaimersDistribution", () => {
102
102
  });
103
103
 
104
104
  it("should update stats after second claimer", async () => {
105
- const ts = Date.now();
105
+ const ts = await ethers.provider.getBlock("latest").then(_ => _.timestamp);
106
106
  await ubiScheme.connect(claimer2).claim();
107
- expect(await cd.lastUpdated(claimer2.address)).gt((ts / 1000).toFixed(0));
107
+ expect(await cd.lastUpdated(claimer2.address)).gt(ts.toFixed(0));
108
108
  expect(await cd.getMonthClaims(claimer2.address)).to.equal(1);
109
109
  const monthData = await cd.months(await cd.currentMonth());
110
110
  expect(monthData.totalClaims).to.equal(2);
@@ -115,9 +115,9 @@ describe("ClaimersDistribution", () => {
115
115
 
116
116
  it("should distribute reputation after a month and update to current monthly distribution", async () => {
117
117
  await increaseTime(60 * 60 * 24 * 30);
118
- const ts = Date.now();
118
+ const ts = await ethers.provider.getBlock("latest").then(_ => _.timestamp);
119
119
  await ubiScheme.connect(claimer2).claim();
120
- expect(await cd.lastUpdated(claimer2.address)).gt((ts / 1000).toFixed(0));
120
+ expect(await cd.lastUpdated(claimer2.address)).gt(ts.toFixed(0));
121
121
  expect(await cd.getMonthClaims(claimer2.address)).to.equal(1);
122
122
  const monthData = await cd.months(await cd.currentMonth());
123
123
  expect(monthData.totalClaims).to.equal(1);
@@ -130,7 +130,8 @@ describe("CompoundVotingMachine#Guardian", () => {
130
130
  });
131
131
 
132
132
  it("Should be able to set guardian by avatar if foundation expired", async () => {
133
- await increaseTime(60 * 60 * 24 * 365 * 2);
133
+ await ethers.provider.send("evm_setNextBlockTimestamp", [1672531201]); //1672531200
134
+ await ethers.provider.send("evm_mine", []);
134
135
 
135
136
  const encoded = gov.interface.encodeFunctionData("setGuardian", [
136
137
  acct.address
@@ -119,7 +119,6 @@ describe("GReputation", () => {
119
119
  });
120
120
 
121
121
  it("should have avatar as role manager", async () => {
122
- // const invites = await Invites.deployed();
123
122
  expect(await grep.hasRole(await grep.DEFAULT_ADMIN_ROLE(), avatar)).to.be
124
123
  .true;
125
124
  });
@@ -397,7 +397,7 @@ describe("DonationsStaking - DonationStaking contract that receives funds in ETH
397
397
  avatarDaiBalanceBeforeSet.add(stakingAmountBeforeSet.sub(safeAmount))
398
398
  ); // It should send leftover stakingToken to avatar after swap to ETH in safeAmount
399
399
  expect(stakingAmountBeforeSet).to.be.gt(safeAmount); // maxSafeAmount must be smaller than actualstaking amount so we can verify that we hit the limit for transaction amount at once
400
- });
400
+ });
401
401
 
402
402
  it("it should return version of DonationsStaking properly", async () => {
403
403
  const version = await donationsStaking.getVersion();