@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.
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/hardhat.config.ts +9 -7
- package/package.json +2 -2
- package/test/governance/ClaimersDistribution.test.ts +6 -6
- package/test/governance/CompoundVotingMachine.guardian.test.ts +2 -1
- package/test/governance/GReputation.test.ts +0 -1
- package/test/staking/DonationsStaking.test.ts +1 -1
- package/yarn.lock +224 -103
- package/artifacts/abis/FuseFaucet.min.json +0 -1
- package/artifacts/abis/InvitesV1.min.json +0 -1
- package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +0 -4
- package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.json +0 -200
- package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +0 -4
- package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.json +0 -486
- package/contracts/unaudited-foundation/FuseFaucet.sol +0 -120
- package/contracts/unaudited-foundation/InvitesV1.sol +0 -304
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(
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
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.
|
|
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.
|
|
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 =
|
|
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(
|
|
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 =
|
|
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(
|
|
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 =
|
|
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(
|
|
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
|
|
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
|
|
@@ -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();
|