@gooddollar/goodprotocol 1.0.7-beta.3 → 1.0.9
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/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
- 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/GReputation.sol/GReputation.json +62 -4
- package/artifacts/contracts/governance/GovarnanceStaking.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/Reputation.sol/Reputation.json +17 -17
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- 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/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- 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 +4 -0
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +256 -0
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
- 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 +4 -0
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.json +1033 -0
- 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/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/AaveStakingFactoryV2.sol/AaveStakingFactoryV2.dbg.json +4 -0
- package/artifacts/contracts/staking/aave/AaveStakingFactoryV2.sol/AaveStakingFactoryV2.json +148 -0
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +4 -0
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +1224 -0
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
- package/artifacts/contracts/unaudited-foundation/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/unaudited-foundation/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.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/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/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
- package/contracts/governance/GReputation.sol +53 -14
- package/contracts/governance/Reputation.sol +13 -25
- package/contracts/staking/BaseShareFieldV2.sol +319 -0
- package/contracts/staking/SimpleStakingV2.sol +522 -0
- package/contracts/staking/aave/AaveStakingFactoryV2.sol +93 -0
- package/contracts/staking/aave/GoodAaveStakingV2.sol +263 -0
- package/contracts/ubi/UBIScheme.sol +2 -2
- package/package.json +1 -1
- package/releases/deployment.json +108 -97
- package/releases/olddao.json +1 -406
- package/scripts/deployFullDAO.ts +1 -1
- package/scripts/misc/goodgiveback.ts +4 -5
- package/test/governance/ClaimersDistribution.test.ts +5 -5
- package/test/governance/CompoundVotingMachine.castvote.test.ts +1 -1
- package/test/governance/CompoundVotingMachine.daoscheme.ts +1 -1
- package/test/governance/CompoundVotingMachine.guardian.test.ts +1 -1
- package/test/governance/GReputation.test.ts +49 -18
- package/test/governance/GovernanceStaking.test.ts +71 -47
- package/test/governance/Reputation.test.ts +52 -51
- package/test/governance/StakersDistribution.test.ts +12 -8
- package/test/helpers.ts +5 -1
- package/test/staking/GoodAaveStakingFactoryV2.test.ts +122 -0
- package/test/staking/UsdcAaveStaking.test.ts +5 -1
- package/test/staking/UsdcAaveStakingV2.test.ts +291 -0
|
@@ -7,6 +7,7 @@ import { expect } from "chai";
|
|
|
7
7
|
import { GReputation } from "../../types";
|
|
8
8
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
9
9
|
import { advanceBlocks, createDAO, increaseTime } from "../helpers";
|
|
10
|
+
import { TextDecoder } from "util";
|
|
10
11
|
|
|
11
12
|
const BN = ethers.BigNumber;
|
|
12
13
|
export const NULL_ADDRESS = ethers.constants.AddressZero;
|
|
@@ -130,7 +131,7 @@ describe("GReputation", () => {
|
|
|
130
131
|
});
|
|
131
132
|
|
|
132
133
|
it("should get balanceOf", async () => {
|
|
133
|
-
const repBalance = await grep.
|
|
134
|
+
const repBalance = await grep.balanceOfLocal(founder);
|
|
134
135
|
expect(repBalance.toNumber()).to.be.equal(0);
|
|
135
136
|
});
|
|
136
137
|
|
|
@@ -162,7 +163,7 @@ describe("GReputation", () => {
|
|
|
162
163
|
await grep.proveBalanceOfAtBlockchain("rootState", rep1, 1, proof, 1);
|
|
163
164
|
|
|
164
165
|
//root states changes the core balance
|
|
165
|
-
const newRep = await grep.
|
|
166
|
+
const newRep = await grep.balanceOfLocal(rep1);
|
|
166
167
|
expect(newRep.toNumber()).to.be.equal(1);
|
|
167
168
|
|
|
168
169
|
const newVotes = await grep.getVotes(rep1);
|
|
@@ -199,10 +200,12 @@ describe("GReputation", () => {
|
|
|
199
200
|
|
|
200
201
|
describe("delegation", async () => {
|
|
201
202
|
it("should allow delegation", async () => {
|
|
202
|
-
expect(await grep.
|
|
203
|
+
expect(await grep.balanceOfLocal(rep3)).to.be.eq(BN.from(0));
|
|
203
204
|
await grep.connect(signers[2]).delegateTo(rep3); //rep1 -> rep3
|
|
204
205
|
|
|
205
|
-
expect(await grep.getVotes(rep3)).to.be.eq(
|
|
206
|
+
expect(await grep.getVotes(rep3)).to.be.eq(
|
|
207
|
+
await grep.balanceOfLocal(rep1)
|
|
208
|
+
); //with delegation
|
|
206
209
|
expect(
|
|
207
210
|
await grep.getVotes(rep1),
|
|
208
211
|
"delegator should now have 0 votes"
|
|
@@ -238,7 +241,7 @@ describe("GReputation", () => {
|
|
|
238
241
|
});
|
|
239
242
|
|
|
240
243
|
it("should allow to change delegate", async () => {
|
|
241
|
-
expect(await grep.
|
|
244
|
+
expect(await grep.balanceOfLocal(rep1)).to.be.eq(BN.from(1)); //proof was submitted
|
|
242
245
|
await grep.connect(signers[3]).delegateTo(rep1); //rep2 -> rep1
|
|
243
246
|
expect(await grep.getVotes(rep3)).to.be.eq(BN.from(1)); //previous delegate should now be 1 bcause it has only rep1
|
|
244
247
|
expect(await grep.getVotes(rep1)).to.be.eq(
|
|
@@ -251,10 +254,10 @@ describe("GReputation", () => {
|
|
|
251
254
|
|
|
252
255
|
it("should allow undelegation", async () => {
|
|
253
256
|
await grep.connect(signers[2]).undelegate(); //rep1 -> remove delegattion to rep3
|
|
254
|
-
expect(await grep.
|
|
257
|
+
expect(await grep.balanceOfLocal(rep3)).to.be.eq(BN.from(0));
|
|
255
258
|
expect(await grep.getVotes(rep3)).to.be.eq(BN.from(0));
|
|
256
259
|
expect(await grep.getVotes(rep1)).to.be.eq(BN.from(3)); //rep2 delegating to rep1 + rep1 votes
|
|
257
|
-
expect(await grep.
|
|
260
|
+
expect(await grep.balanceOfLocal(rep1)).to.be.eq(BN.from(1));
|
|
258
261
|
|
|
259
262
|
expect(await grep.delegates(rep1)).to.be.eq(rep1);
|
|
260
263
|
});
|
|
@@ -409,20 +412,30 @@ describe("GReputation", () => {
|
|
|
409
412
|
["fuse", "0x" + merkleRoot.toString("hex"), 200]
|
|
410
413
|
);
|
|
411
414
|
|
|
415
|
+
const totalSupply = await grep.totalSupply();
|
|
412
416
|
await expect(avatarGenericCall(grep.address, encodedCall)).to.not.be
|
|
413
417
|
.reverted;
|
|
418
|
+
const totalAfterSupply = await grep.totalSupply();
|
|
419
|
+
expect(totalAfterSupply).to.eq(totalSupply.add(200));
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
it("should modify only local totalSupply on burn mint", async () => {
|
|
423
|
+
const totalSupply = await grep.totalSupply();
|
|
424
|
+
await grepWithOwner["mint(address,uint256)"](founder, 155);
|
|
425
|
+
const totalSupplyAfter = await grep.totalSupply();
|
|
426
|
+
expect(totalSupplyAfter).to.eq(totalSupply.add(155));
|
|
414
427
|
});
|
|
415
428
|
|
|
416
429
|
it("should not reset core balance", async () => {
|
|
417
430
|
//before proving new rep in new root balance should be 0
|
|
418
|
-
const newRep = await grep.
|
|
431
|
+
const newRep = await grep.balanceOfLocal(rep1);
|
|
419
432
|
expect(newRep.toNumber()).to.be.gt(0);
|
|
420
|
-
const newRep2 = await grep.
|
|
433
|
+
const newRep2 = await grep.balanceOfLocal(rep2);
|
|
421
434
|
expect(newRep2.toNumber()).to.be.gt(0);
|
|
422
435
|
});
|
|
423
436
|
|
|
424
437
|
it("should prove balance in new state", async () => {
|
|
425
|
-
const prevRep = await grep.
|
|
438
|
+
const prevRep = await grep.balanceOfLocal(rep2);
|
|
426
439
|
const prevVotes = await grep.getVotes(rep2);
|
|
427
440
|
const { proof } = getMerkleAndProof(
|
|
428
441
|
[
|
|
@@ -435,17 +448,29 @@ describe("GReputation", () => {
|
|
|
435
448
|
);
|
|
436
449
|
|
|
437
450
|
await grep.proveBalanceOfAtBlockchain("fuse", rep2, 200, proof, 2);
|
|
438
|
-
const newRep = await grep.
|
|
451
|
+
const newRep = await grep.balanceOfLocal(rep2);
|
|
439
452
|
expect(newRep).to.be.equal(prevRep); //core rep should not change
|
|
440
453
|
const newVotes = await grep.getVotes(rep2);
|
|
441
454
|
|
|
442
455
|
expect(newVotes).to.be.equal(prevVotes.add(200));
|
|
443
456
|
});
|
|
444
457
|
|
|
445
|
-
it("should
|
|
458
|
+
it("should keep active votes (local balance) correctly after mint/burn", async () => {
|
|
459
|
+
await grep.connect(signers[3]).undelegate();
|
|
460
|
+
const totalSupply = await grep.getCurrentVotes(rep2);
|
|
461
|
+
const tx = await grepWithOwner["mint(address,uint256)"](rep2, 155);
|
|
462
|
+
const result = await tx.wait();
|
|
463
|
+
const totalSupplyAfter = await grep.getVotes(rep2);
|
|
464
|
+
expect(totalSupplyAfter).to.eq(totalSupply.add(155));
|
|
465
|
+
});
|
|
466
|
+
|
|
467
|
+
it("should only delegate core balance and not new state balance", async () => {
|
|
446
468
|
expect(await grep.getVotes(rep3)).to.be.eq(BN.from(0));
|
|
447
469
|
await grep.connect(signers[3]).delegateTo(rep3); //rep2=signers[3]
|
|
448
|
-
expect(await grep.getVotes(rep3)).to.be.eq(
|
|
470
|
+
expect(await grep.getVotes(rep3)).to.be.eq(
|
|
471
|
+
await grep.balanceOfLocal(rep2)
|
|
472
|
+
);
|
|
473
|
+
expect(await grep.getVotes(rep3)).to.be.lt(await grep.getVotes(rep2));
|
|
449
474
|
});
|
|
450
475
|
|
|
451
476
|
it("should not effect delegate balance after new state hash", async () => {
|
|
@@ -680,12 +705,18 @@ describe("GReputation", () => {
|
|
|
680
705
|
|
|
681
706
|
it("it should be able to get totalSupply for particular block", async () => {
|
|
682
707
|
let currentSupply = await grep["totalSupply()"]();
|
|
708
|
+
let localSupply = await grep.totalSupplyLocalAt(
|
|
709
|
+
await ethers.provider.getBlockNumber()
|
|
710
|
+
);
|
|
683
711
|
await grepWithOwner["mint(address,uint256)"](
|
|
684
712
|
founder,
|
|
685
713
|
ethers.utils.parseEther("1")
|
|
686
714
|
);
|
|
687
715
|
let currentBlock = await ethers.provider.getBlockNumber();
|
|
688
|
-
let totalSupply = await grep.
|
|
716
|
+
let totalSupply = await grep.totalSupplyAt(currentBlock);
|
|
717
|
+
expect(await grep.totalSupplyLocalAt(currentBlock)).to.equal(
|
|
718
|
+
localSupply.add(ethers.utils.parseEther("1"))
|
|
719
|
+
);
|
|
689
720
|
expect(
|
|
690
721
|
totalSupply
|
|
691
722
|
.sub(currentSupply)
|
|
@@ -785,11 +816,11 @@ describe("GReputation", () => {
|
|
|
785
816
|
await grep.connect(signers[4]).setReputationRecipient(repTarget);
|
|
786
817
|
expect(await grep.reputationRecipients(rep3)).to.equal(repTarget);
|
|
787
818
|
await grepWithOwner.mint(rep3, 111);
|
|
788
|
-
expect(await grep.
|
|
819
|
+
expect(await grep.balanceOfLocal(repTarget)).to.equal(111);
|
|
789
820
|
});
|
|
790
821
|
|
|
791
822
|
it("user should be able to unset recipient", async () => {
|
|
792
|
-
const startBalance = await grep.
|
|
823
|
+
const startBalance = await grep.balanceOfLocal(rep3);
|
|
793
824
|
await grep
|
|
794
825
|
.connect(signers[4])
|
|
795
826
|
.setReputationRecipient(ethers.constants.AddressZero);
|
|
@@ -797,8 +828,8 @@ describe("GReputation", () => {
|
|
|
797
828
|
ethers.constants.AddressZero
|
|
798
829
|
);
|
|
799
830
|
await grepWithOwner.mint(rep3, 111);
|
|
800
|
-
expect(await grep.
|
|
801
|
-
expect(await grep.
|
|
831
|
+
expect(await grep.balanceOfLocal(repTarget)).to.equal(111);
|
|
832
|
+
expect(await grep.balanceOfLocal(rep3)).to.equal(startBalance.add(111));
|
|
802
833
|
});
|
|
803
834
|
});
|
|
804
835
|
});
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
CERC20,
|
|
8
8
|
GoodReserveCDai,
|
|
9
9
|
SimpleStaking,
|
|
10
|
-
GReputation
|
|
10
|
+
GReputation
|
|
11
11
|
} from "../../types";
|
|
12
12
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
13
13
|
import { createDAO, increaseTime, advanceBlocks } from "../helpers";
|
|
@@ -64,7 +64,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
64
64
|
cdaiAddress,
|
|
65
65
|
reserve,
|
|
66
66
|
reputation,
|
|
67
|
-
setReserveToken
|
|
67
|
+
setReserveToken
|
|
68
68
|
} = await createDAO();
|
|
69
69
|
dai = await ethers.getContractAt("DAIMock", daiAddress);
|
|
70
70
|
cDAI = await ethers.getContractAt("cDAIMock", cdaiAddress);
|
|
@@ -79,7 +79,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
79
79
|
gd,
|
|
80
80
|
identity,
|
|
81
81
|
controller,
|
|
82
|
-
avatar
|
|
82
|
+
avatar
|
|
83
83
|
});
|
|
84
84
|
goodFundManager = await upgrades.deployProxy(
|
|
85
85
|
goodFundManagerFactory,
|
|
@@ -91,7 +91,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
91
91
|
reputation
|
|
92
92
|
)) as GReputation;
|
|
93
93
|
console.log("Deployed goodfund manager", {
|
|
94
|
-
manager: goodFundManager.address
|
|
94
|
+
manager: goodFundManager.address
|
|
95
95
|
});
|
|
96
96
|
goodDollar = await ethers.getContractAt("IGoodDollar", gd);
|
|
97
97
|
contribution = await ethers.getContractAt(
|
|
@@ -102,7 +102,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
102
102
|
marketMaker = mm;
|
|
103
103
|
|
|
104
104
|
console.log("deployed contribution, deploying reserve...", {
|
|
105
|
-
founder: founder.address
|
|
105
|
+
founder: founder.address
|
|
106
106
|
});
|
|
107
107
|
|
|
108
108
|
console.log("setting permissions...");
|
|
@@ -125,7 +125,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
125
125
|
await goodDollar.approve(governanceStaking.address, "100");
|
|
126
126
|
await governanceStaking.stake("100");
|
|
127
127
|
await advanceBlocks(5);
|
|
128
|
-
const error = await governanceStaking.withdrawStake("100").catch(
|
|
128
|
+
const error = await governanceStaking.withdrawStake("100").catch(e => e);
|
|
129
129
|
expect(error.message).to.have.string(
|
|
130
130
|
"GReputation: need minter role or be GDAO contract"
|
|
131
131
|
);
|
|
@@ -133,9 +133,11 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
133
133
|
|
|
134
134
|
it("Should be able mint rewards after set GDAO staking contract", async () => {
|
|
135
135
|
await setDAOAddress("GDAO_STAKING", governanceStaking.address);
|
|
136
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
136
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
137
|
+
founder.address
|
|
138
|
+
);
|
|
137
139
|
await governanceStaking.withdrawStake("100");
|
|
138
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
140
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
139
141
|
|
|
140
142
|
expect(GDAOBalanceAfterWithdraw).to.gt(GDAOBalanceBeforeWithdraw);
|
|
141
143
|
});
|
|
@@ -163,10 +165,12 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
163
165
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
164
166
|
await governanceStaking.stake("100");
|
|
165
167
|
await advanceBlocks(4);
|
|
166
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
168
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
169
|
+
founder.address
|
|
170
|
+
);
|
|
167
171
|
await governanceStaking.withdrawStake("100");
|
|
168
172
|
const withdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
169
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
173
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
170
174
|
const multiplier = withdrawBlockNumber - stakeBlockNumber;
|
|
171
175
|
const calculatedReward = rewardsPerBlock.mul(multiplier); // We calculate user rewards since it's the only staker so gets whole rewards so rewardsPerBlock * multipler(block that passed between stake and withdraw)
|
|
172
176
|
expect(GDAOBalanceAfterWithdraw).to.be.equal(
|
|
@@ -186,18 +190,20 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
186
190
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
187
191
|
await governanceStaking.stake("100");
|
|
188
192
|
await advanceBlocks(4);
|
|
189
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
193
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
194
|
+
founder.address
|
|
195
|
+
);
|
|
190
196
|
const transaction = await (
|
|
191
197
|
await governanceStaking.withdrawRewards()
|
|
192
198
|
).wait();
|
|
193
199
|
const withdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
194
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
200
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
195
201
|
const multiplier = withdrawBlockNumber - stakeBlockNumber;
|
|
196
202
|
const calculatedReward = rewardsPerBlock.mul(multiplier); // We calculate user rewards since it's the only staker so gets whole rewards so rewardsPerBlock * multipler(block that passed between stake and withdraw)
|
|
197
203
|
expect(GDAOBalanceAfterWithdraw).to.be.equal(
|
|
198
204
|
GDAOBalanceBeforeWithdraw.add(calculatedReward)
|
|
199
205
|
);
|
|
200
|
-
expect(transaction.events.find(
|
|
206
|
+
expect(transaction.events.find(_ => _.event === "ReputationEarned")).to.be
|
|
201
207
|
.not.empty;
|
|
202
208
|
await governanceStaking.withdrawStake("100");
|
|
203
209
|
});
|
|
@@ -209,9 +215,11 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
209
215
|
await advanceBlocks(4);
|
|
210
216
|
await governanceStaking.connect(staker).transfer(founder.address, "100");
|
|
211
217
|
await governanceStaking.connect(staker).withdrawRewards();
|
|
212
|
-
const gdaoBalanceBeforeWithdraw = await grep.
|
|
218
|
+
const gdaoBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
219
|
+
founder.address
|
|
220
|
+
);
|
|
213
221
|
await governanceStaking.withdrawStake("100");
|
|
214
|
-
const gdaoBalanceAfterWithdraw = await grep.
|
|
222
|
+
const gdaoBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
215
223
|
expect(gdaoBalanceAfterWithdraw).to.gt(gdaoBalanceBeforeWithdraw);
|
|
216
224
|
});
|
|
217
225
|
|
|
@@ -219,7 +227,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
219
227
|
let transaction = await governanceStaking
|
|
220
228
|
.connect(staker)
|
|
221
229
|
.withdrawStake("100")
|
|
222
|
-
.catch(
|
|
230
|
+
.catch(e => e);
|
|
223
231
|
expect(transaction.message).to.have.string("Not enough token staked");
|
|
224
232
|
});
|
|
225
233
|
|
|
@@ -243,10 +251,12 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
243
251
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
244
252
|
await governanceStaking.stake("100");
|
|
245
253
|
await advanceBlocks(4);
|
|
246
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
254
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
255
|
+
founder.address
|
|
256
|
+
);
|
|
247
257
|
await governanceStaking.withdrawStake("100");
|
|
248
258
|
const withdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
249
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
259
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
250
260
|
const multiplier = withdrawBlockNumber - stakeBlockNumber;
|
|
251
261
|
const calculatedReward = rewardsPerBlock.mul(multiplier); // We calculate user rewards since it's the only staker so gets whole rewards so rewardsPerBlock * multipler(block that passed between stake and withdraw)
|
|
252
262
|
expect(GDAOBalanceAfterWithdraw).to.be.equal(
|
|
@@ -277,9 +287,11 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
277
287
|
](founder.address);
|
|
278
288
|
expect(userProductivity[0]).to.be.equal(BN.from("100"));
|
|
279
289
|
await advanceBlocks(4);
|
|
280
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
290
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
291
|
+
founder.address
|
|
292
|
+
);
|
|
281
293
|
await governanceStaking.withdrawStake("100");
|
|
282
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
294
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
283
295
|
expect(GDAOBalanceAfterWithdraw.sub(GDAOBalanceBeforeWithdraw)).to.equal(0);
|
|
284
296
|
encodedCall = governanceStakingFactory.interface.encodeFunctionData(
|
|
285
297
|
"setMonthlyRewards",
|
|
@@ -325,10 +337,12 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
325
337
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
326
338
|
await governanceStaking.stake("1000000000000");
|
|
327
339
|
await advanceBlocks(4);
|
|
328
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
340
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
341
|
+
founder.address
|
|
342
|
+
);
|
|
329
343
|
await governanceStaking.withdrawStake("1000000000000");
|
|
330
344
|
const withdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
331
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
345
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
332
346
|
const multiplier = withdrawBlockNumber - stakeBlockNumber;
|
|
333
347
|
const calculatedReward = rewardsPerBlock.mul(multiplier); // We calculate user rewards since it's the only staker so gets whole rewards so rewardsPerBlock * multipler(block that passed between stake and withdraw)
|
|
334
348
|
expect(GDAOBalanceAfterWithdraw).to.be.equal(
|
|
@@ -347,15 +361,15 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
347
361
|
(await ethers.provider.getBlockNumber()) + 1;
|
|
348
362
|
await governanceStaking.connect(staker).stake("200");
|
|
349
363
|
await advanceBlocks(4);
|
|
350
|
-
const GDAOBalanceBeforeWithdraw = await grep.
|
|
351
|
-
const FounderGDAOBalanceBeforeWithdraw = await grep.
|
|
364
|
+
const GDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(staker.address);
|
|
365
|
+
const FounderGDAOBalanceBeforeWithdraw = await grep.balanceOfLocal(
|
|
352
366
|
founder.address
|
|
353
367
|
);
|
|
354
368
|
await governanceStaking.withdrawStake("800");
|
|
355
369
|
const founderWithdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
356
370
|
await governanceStaking.connect(staker).withdrawStake("200");
|
|
357
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
358
|
-
const FounderGDAOBalanceAfterWithdraw = await grep.
|
|
371
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(staker.address);
|
|
372
|
+
const FounderGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
359
373
|
founder.address
|
|
360
374
|
);
|
|
361
375
|
const founderCalculatedRewards = rewardsPerBlock.add(
|
|
@@ -558,7 +572,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
558
572
|
});
|
|
559
573
|
|
|
560
574
|
it("Stake amount should be positive", async () => {
|
|
561
|
-
const tx = await governanceStaking.stake("0").catch(
|
|
575
|
+
const tx = await governanceStaking.stake("0").catch(e => e);
|
|
562
576
|
expect(tx.message).to.have.string(
|
|
563
577
|
"You need to stake a positive token amount"
|
|
564
578
|
);
|
|
@@ -567,7 +581,7 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
567
581
|
it("It should approve stake amount in order to stake", async () => {
|
|
568
582
|
const tx = await governanceStaking
|
|
569
583
|
.stake(ethers.utils.parseEther("10000000"))
|
|
570
|
-
.catch(
|
|
584
|
+
.catch(e => e);
|
|
571
585
|
expect(tx.message).not.to.be.empty;
|
|
572
586
|
});
|
|
573
587
|
|
|
@@ -594,10 +608,14 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
594
608
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
595
609
|
await governanceStaking.stake("100");
|
|
596
610
|
await advanceBlocks(5);
|
|
597
|
-
const gdaoBalanceBeforeGetRewards = await grep.
|
|
611
|
+
const gdaoBalanceBeforeGetRewards = await grep.balanceOfLocal(
|
|
612
|
+
founder.address
|
|
613
|
+
);
|
|
598
614
|
await governanceStaking.stake("100");
|
|
599
615
|
const getRewardsBlockNumber = await ethers.provider.getBlockNumber();
|
|
600
|
-
const gdaoBalanceAfterGetRewards = await grep.
|
|
616
|
+
const gdaoBalanceAfterGetRewards = await grep.balanceOfLocal(
|
|
617
|
+
founder.address
|
|
618
|
+
);
|
|
601
619
|
const multiplier = getRewardsBlockNumber - stakeBlockNumber;
|
|
602
620
|
const calculatedReward = rewardsPerBlock.mul(multiplier); // We calculate user rewards since it's the only staker so gets whole rewards so rewardsPerBlock * multipler(block that passed between stake and withdraw)
|
|
603
621
|
await governanceStaking.withdrawStake("200");
|
|
@@ -624,43 +642,45 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
624
642
|
.connect(signers[1])
|
|
625
643
|
.approve(governanceStaking.address, stakingAmount);
|
|
626
644
|
await governanceStaking.stake(stakingAmount);
|
|
627
|
-
const stakerOneGDAOBalanceAfterStake = await grep.
|
|
645
|
+
const stakerOneGDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
628
646
|
founder.address
|
|
629
647
|
);
|
|
630
648
|
await governanceStaking.connect(staker).stake(stakingAmount.div(10));
|
|
631
|
-
const stakerTwoGDAOBalanceAfterStake = await grep.
|
|
649
|
+
const stakerTwoGDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
650
|
+
staker.address
|
|
651
|
+
);
|
|
632
652
|
await governanceStaking.connect(signers[0]).stake(stakingAmount.div(4));
|
|
633
|
-
const stakerThreeGDAOBalanceAfterStake = await grep.
|
|
653
|
+
const stakerThreeGDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
634
654
|
signers[0].address
|
|
635
655
|
);
|
|
636
656
|
const stakerFourStakeBlockNumber =
|
|
637
657
|
(await ethers.provider.getBlockNumber()) + 1;
|
|
638
658
|
await governanceStaking.connect(signers[1]).stake(stakingAmount.div(5));
|
|
639
|
-
const stakerFourGDAOBalanceAfterStake = await grep.
|
|
659
|
+
const stakerFourGDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
640
660
|
signers[1].address
|
|
641
661
|
);
|
|
642
662
|
await advanceBlocks(10);
|
|
643
663
|
await governanceStaking.withdrawStake(stakingAmount);
|
|
644
664
|
const stakerOneWithdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
645
|
-
const stakerOneGDAOBalanceAfterWithdraw = await grep.
|
|
665
|
+
const stakerOneGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
646
666
|
founder.address
|
|
647
667
|
);
|
|
648
668
|
await governanceStaking
|
|
649
669
|
.connect(staker)
|
|
650
670
|
.withdrawStake(stakingAmount.div(10));
|
|
651
|
-
const stakerTwoGDAOBalanceAfterWithdraw = await grep.
|
|
671
|
+
const stakerTwoGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
652
672
|
staker.address
|
|
653
673
|
);
|
|
654
674
|
await governanceStaking
|
|
655
675
|
.connect(signers[0])
|
|
656
676
|
.withdrawStake(stakingAmount.div(4));
|
|
657
|
-
const stakerThreeGDAOBalanceAfterWithdraw = await grep.
|
|
677
|
+
const stakerThreeGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
658
678
|
signers[0].address
|
|
659
679
|
);
|
|
660
680
|
await governanceStaking
|
|
661
681
|
.connect(signers[1])
|
|
662
682
|
.withdrawStake(stakingAmount.div(5));
|
|
663
|
-
const stakerFourGDAOBalanceAfterWithdraw = await grep.
|
|
683
|
+
const stakerFourGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
664
684
|
signers[1].address
|
|
665
685
|
);
|
|
666
686
|
const stakerOneRewardsCalculated = rewardsPerBlock
|
|
@@ -729,13 +749,15 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
729
749
|
.connect(staker)
|
|
730
750
|
.approve(governanceStaking.address, stakingAmount);
|
|
731
751
|
await governanceStaking.stake(stakingAmount);
|
|
732
|
-
const stakerOneGDAOBalanceAfterStake = await grep.
|
|
752
|
+
const stakerOneGDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
733
753
|
founder.address
|
|
734
754
|
);
|
|
735
755
|
const stakerTwoStakeBlockNumber =
|
|
736
756
|
(await ethers.provider.getBlockNumber()) + 1;
|
|
737
757
|
await governanceStaking.connect(staker).stake(stakingAmount.div(10000));
|
|
738
|
-
const stakerTwoGDAOBalanceAfterStake = await grep.
|
|
758
|
+
const stakerTwoGDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
759
|
+
staker.address
|
|
760
|
+
);
|
|
739
761
|
await advanceBlocks(10);
|
|
740
762
|
|
|
741
763
|
await governanceStaking
|
|
@@ -744,10 +766,10 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
744
766
|
const stakerTwoWithdrawBlockNumber = await ethers.provider.getBlockNumber();
|
|
745
767
|
await governanceStaking.withdrawStake(stakingAmount);
|
|
746
768
|
|
|
747
|
-
const stakerOneGDAOBalanceAfterWithdraw = await grep.
|
|
769
|
+
const stakerOneGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
748
770
|
founder.address
|
|
749
771
|
);
|
|
750
|
-
const stakerTwoGDAOBalanceAfterWithdraw = await grep.
|
|
772
|
+
const stakerTwoGDAOBalanceAfterWithdraw = await grep.balanceOfLocal(
|
|
751
773
|
staker.address
|
|
752
774
|
);
|
|
753
775
|
const calculatedRewardsStakerOne = rewardsPerBlock
|
|
@@ -785,11 +807,11 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
785
807
|
|
|
786
808
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
787
809
|
await simpleGovernanceStaking.stake("200");
|
|
788
|
-
const GDAOBalanceAfterStake = await grep.
|
|
810
|
+
const GDAOBalanceAfterStake = await grep.balanceOfLocal(founder.address);
|
|
789
811
|
await advanceBlocks(100);
|
|
790
812
|
await simpleGovernanceStaking.withdrawRewards();
|
|
791
813
|
const withdrawRewardsBlockNumber = await ethers.provider.getBlockNumber();
|
|
792
|
-
const GDAOBalanceAfterWithdraw = await grep.
|
|
814
|
+
const GDAOBalanceAfterWithdraw = await grep.balanceOfLocal(founder.address);
|
|
793
815
|
|
|
794
816
|
expect(GDAOBalanceAfterWithdraw).to.be.equal(
|
|
795
817
|
GDAOBalanceAfterStake.add(
|
|
@@ -819,18 +841,20 @@ describe("GovernanceStaking - staking with GD and get Rewards in GDAO", () => {
|
|
|
819
841
|
const rewardsPerBlock = await simpleGovernanceStaking.getRewardsPerBlock();
|
|
820
842
|
const stakeBlockNumber = (await ethers.provider.getBlockNumber()) + 1;
|
|
821
843
|
await overMintTester.stake();
|
|
822
|
-
const GDAOBalanceAfterStake = await grep.
|
|
844
|
+
const GDAOBalanceAfterStake = await grep.balanceOfLocal(
|
|
845
|
+
overMintTester.address
|
|
846
|
+
);
|
|
823
847
|
await advanceBlocks(100);
|
|
824
848
|
await overMintTester.overMintTest();
|
|
825
849
|
const withdrawRewardsBlockNumber = await ethers.provider.getBlockNumber();
|
|
826
|
-
const GDAOBalanceAfterWithdrawReward = await grep.
|
|
850
|
+
const GDAOBalanceAfterWithdrawReward = await grep.balanceOfLocal(
|
|
827
851
|
overMintTester.address
|
|
828
852
|
);
|
|
829
853
|
await advanceBlocks(20);
|
|
830
854
|
await overMintTester.overMintTest();
|
|
831
855
|
const secondWithdrawRewardsBlockNumber =
|
|
832
856
|
await ethers.provider.getBlockNumber();
|
|
833
|
-
const GDAOBalanceAfterSecondWithdrawReward = await grep.
|
|
857
|
+
const GDAOBalanceAfterSecondWithdrawReward = await grep.balanceOfLocal(
|
|
834
858
|
overMintTester.address
|
|
835
859
|
);
|
|
836
860
|
|