@gooddollar/goodprotocol 1.0.2-beta.0 → 1.0.2-beta.4
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 +45 -2
- 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/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/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/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
- 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/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- 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/contracts/governance/GReputation.sol +15 -0
- package/hardhat.config.ts +0 -7
- package/package.json +2 -2
- package/releases/deploy-settings.json +17 -17
- package/releases/deployment.json +30 -30
- package/releases/olddao.json +1 -411
- package/truffle-config.js +3 -21
- package/contracts/.DS_Store +0 -0
- package/scripts/proofs/testStorageProof.ts +0 -33
- package/scripts/ubi/fish.ts +0 -109
- package/test/.DS_Store +0 -0
package/scripts/ubi/fish.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { get, range, chunk, flatten, mergeWith, sortBy, uniq } from "lodash";
|
|
2
|
-
import { ethers } from "ethers";
|
|
3
|
-
import { request, gql } from "graphql-request";
|
|
4
|
-
import { Retrier } from "@jsier/retrier";
|
|
5
|
-
import PromisePool from "async-promise-pool";
|
|
6
|
-
import stakingContracts from "@gooddollar/goodcontracts/stakingModel/releases/deployment.json";
|
|
7
|
-
import UBIABI from "@gooddollar/goodcontracts/stakingModel/build/contracts/UBIScheme.min.json";
|
|
8
|
-
import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
|
|
9
|
-
|
|
10
|
-
const fuseProvider = new ethers.providers.JsonRpcProvider(
|
|
11
|
-
"https://rpc.fuse.io"
|
|
12
|
-
);
|
|
13
|
-
console.log(stakingContracts["production"].UBIScheme);
|
|
14
|
-
setMulticallAddress(122, "0x7a59441fb06666F6d2D766393d876945D06a169c");
|
|
15
|
-
const ubiScheme = new Contract(
|
|
16
|
-
stakingContracts["production"].UBIScheme,
|
|
17
|
-
UBIABI.abi
|
|
18
|
-
);
|
|
19
|
-
const ethcallProvider = new Provider(fuseProvider, 122);
|
|
20
|
-
ethcallProvider
|
|
21
|
-
.all([ubiScheme.isActiveUser("0x4655CAF1A7d660b75bB07332C6Fb4D01026c825d")])
|
|
22
|
-
.then(console.log);
|
|
23
|
-
|
|
24
|
-
const main = async () => {
|
|
25
|
-
const ubiStart = 1612253100;
|
|
26
|
-
const lastClaimed = (Date.now() / 1000 - 60 * 60 * 24 * 14).toFixed();
|
|
27
|
-
const days = range(ubiStart, lastClaimed, 60 * 60 * 4);
|
|
28
|
-
console.log(days.slice(0, 10), days.slice(-4));
|
|
29
|
-
|
|
30
|
-
let [startRange, ...rest] = days;
|
|
31
|
-
const pool = new PromisePool({ concurrency: 100 });
|
|
32
|
-
let total = 0;
|
|
33
|
-
let tofish = [];
|
|
34
|
-
for (let endRange of rest) {
|
|
35
|
-
let curRange = startRange;
|
|
36
|
-
const options = { limit: 20, delay: 2000 };
|
|
37
|
-
const retrier = new Retrier(options);
|
|
38
|
-
const findInactive = async attempt => {
|
|
39
|
-
if (attempt > 0) console.log("retrying:", { attempt });
|
|
40
|
-
const dayClaimers = await checkDayClaimers(curRange, endRange);
|
|
41
|
-
total += dayClaimers.length;
|
|
42
|
-
|
|
43
|
-
const calls = dayClaimers
|
|
44
|
-
.map(c => [
|
|
45
|
-
ubiScheme.isActiveUser(c.id),
|
|
46
|
-
ubiScheme.fishedUsersAddresses(c.id)
|
|
47
|
-
])
|
|
48
|
-
.flat();
|
|
49
|
-
|
|
50
|
-
let activeResult: any = await Promise.all(
|
|
51
|
-
chunk(calls, 300).map(chunk => ethcallProvider.all(chunk))
|
|
52
|
-
);
|
|
53
|
-
|
|
54
|
-
activeResult = activeResult.flat();
|
|
55
|
-
const inactive = chunk(activeResult, 2)
|
|
56
|
-
.map((pair, index) => ({
|
|
57
|
-
isActive: pair[0],
|
|
58
|
-
isFished: pair[1],
|
|
59
|
-
addr: dayClaimers[index].id
|
|
60
|
-
}))
|
|
61
|
-
.filter(user => user.isActive === false && user.isFished === false);
|
|
62
|
-
|
|
63
|
-
console.log("got day claimers:", {
|
|
64
|
-
curRange,
|
|
65
|
-
endRange,
|
|
66
|
-
claimers: dayClaimers.length,
|
|
67
|
-
total,
|
|
68
|
-
// dayClaimers: dayClaimers.slice(0, 5),
|
|
69
|
-
// activeResult: activeResult.slice(0, 5),
|
|
70
|
-
blockchainCallsResultLength: activeResult.length,
|
|
71
|
-
inactiveFound: inactive.length
|
|
72
|
-
});
|
|
73
|
-
tofish = tofish.concat(inactive);
|
|
74
|
-
// console.log({ activeResult });
|
|
75
|
-
};
|
|
76
|
-
pool.add(() => retrier.resolve(findInactive));
|
|
77
|
-
startRange = endRange;
|
|
78
|
-
}
|
|
79
|
-
await pool.all();
|
|
80
|
-
console.log("total inactive found:", tofish.length);
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
const checkDayClaimers = async (start, end, skip = 0) => {
|
|
84
|
-
let result = [];
|
|
85
|
-
const query = gql`
|
|
86
|
-
{
|
|
87
|
-
walletStats(
|
|
88
|
-
where: { lastClaimed_not: null, lastClaimed_gte:${start}, lastClaimed_lt:${end} }
|
|
89
|
-
first: 1000
|
|
90
|
-
skip: ${skip}
|
|
91
|
-
orderBy: lastClaimed
|
|
92
|
-
) {
|
|
93
|
-
id
|
|
94
|
-
lastClaimed
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
`;
|
|
98
|
-
const { walletStats } = await request(
|
|
99
|
-
"https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse",
|
|
100
|
-
query
|
|
101
|
-
);
|
|
102
|
-
if (walletStats.length === 1000) {
|
|
103
|
-
const nextPage = await checkDayClaimers(start, end, skip + 1000);
|
|
104
|
-
console.log("fetching next page for:", { start, end, skip });
|
|
105
|
-
return walletStats.concat(nextPage);
|
|
106
|
-
}
|
|
107
|
-
return walletStats;
|
|
108
|
-
};
|
|
109
|
-
main();
|
package/test/.DS_Store
DELETED
|
Binary file
|