@gooddollar/goodprotocol 2.0.25-beta.8 → 2.0.25-beta.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/abis/LastauthReduction.min.json +1 -0
- 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/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.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/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.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/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.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/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.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/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.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/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.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/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.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/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.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/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.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/DistributionHelper.sol/DistributionHelper.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/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.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/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.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/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.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/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +4 -0
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.json +81 -0
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.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/contracts/utils/LastauthReduction.sol +92 -0
- package/package.json +15 -17
- package/releases/deployment.json +72 -7
- package/scripts/analytics/activeStakers.ts +25 -0
- package/scripts/analytics/activeUsersCount.ts +80 -26
- package/scripts/analytics/activeWalletsStats.ts +138 -18
- package/scripts/fv.ts +7 -5
- package/scripts/proposals/identityAuthPeriod.ts +229 -0
- package/scripts/utils.ts +14 -1
- package/types/contracts/utils/LastauthReduction.ts +168 -0
- package/types/contracts/utils/index.ts +1 -0
- package/types/factories/contracts/utils/LastauthReduction__factory.ts +134 -0
- package/types/factories/contracts/utils/index.ts +1 -0
- package/types/hardhat.d.ts +9 -0
- package/types/index.ts +2 -0
|
@@ -1,24 +1,88 @@
|
|
|
1
|
-
import { maxBy, range, sortBy } from "lodash";
|
|
1
|
+
import { maxBy, range, sortBy, flatten } from "lodash";
|
|
2
2
|
import PromisePool from "async-promise-pool";
|
|
3
3
|
import fs from "fs";
|
|
4
4
|
import { ethers } from "hardhat";
|
|
5
5
|
|
|
6
|
+
const today = new Date().toLocaleDateString().replace(/\//g, "");
|
|
7
|
+
console.log({ today });
|
|
6
8
|
/****
|
|
7
9
|
* Fetch token holders and their last activity date
|
|
8
10
|
* can be used to create stats about active users and how much G$ isnt active
|
|
9
11
|
*/
|
|
10
12
|
const main = async (chain = "fuse") => {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
let result = [];
|
|
14
|
+
let balances = {};
|
|
15
|
+
let curPage = 1;
|
|
16
|
+
let maxResult;
|
|
17
|
+
const fuseExplorer = "https://explorer.fuse.io/api";
|
|
18
|
+
const celoExplorer = "https://explorer.celo.org/mainnet/api";
|
|
19
|
+
const fuseSubgraph =
|
|
20
|
+
"https://gateway.thegraph.com/api/9048669a7632776aae01a191c4939445/subgraphs/id/5cAhhzm7LSqGiFibV1odbbgZWiRmZsYjYrmaoj87UxFd";
|
|
21
|
+
const celoSubgraph =
|
|
22
|
+
"https://gateway.thegraph.com/api/9048669a7632776aae01a191c4939445/subgraphs/id/F7314rxGdcpKPC1nN5KCoFW84EGRoUyzseY2sAT9PEkw";
|
|
23
|
+
do {
|
|
24
|
+
const pages = range(curPage, curPage + 5, 1);
|
|
25
|
+
curPage += 5;
|
|
26
|
+
const ps = pages.map(p =>
|
|
27
|
+
fetch(
|
|
28
|
+
`${fuseExplorer}?module=token&action=getTokenHolders&contractaddress=0x495d133B938596C9984d462F007B676bDc57eCEC&page=${p}&offset=10000`
|
|
29
|
+
)
|
|
30
|
+
.then(_ => _.json())
|
|
31
|
+
.then(_ => _.result)
|
|
32
|
+
);
|
|
33
|
+
const results = await Promise.all(ps);
|
|
34
|
+
result = result.concat(...results);
|
|
35
|
+
maxResult = maxBy(results, "length");
|
|
36
|
+
console.log(maxResult.length, result.length);
|
|
37
|
+
} while (maxResult.length === 10000);
|
|
38
|
+
result.forEach(
|
|
39
|
+
r =>
|
|
40
|
+
(balances[r.address.toLowerCase()] = {
|
|
41
|
+
balance: Number(r.value) / 100,
|
|
42
|
+
fuseBalance: Number(r.value) / 100,
|
|
43
|
+
lastSeen: 0
|
|
44
|
+
})
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
console.log("fetching celo balances....");
|
|
48
|
+
curPage = 1;
|
|
49
|
+
result = [];
|
|
50
|
+
do {
|
|
51
|
+
const pages = range(curPage, curPage + 3, 1);
|
|
52
|
+
curPage += 3;
|
|
53
|
+
const ps = pages.map(p =>
|
|
54
|
+
fetch(
|
|
55
|
+
`${celoExplorer}?module=token&action=getTokenHolders&contractaddress=0x62B8B11039FcfE5aB0C56E502b1C372A3d2a9c7A&page=${p}&offset=10000`
|
|
56
|
+
)
|
|
57
|
+
.then(_ => _.json())
|
|
58
|
+
.then(_ => _.result)
|
|
59
|
+
);
|
|
60
|
+
const results = await Promise.all(ps);
|
|
61
|
+
result = result.concat(...results);
|
|
62
|
+
maxResult = maxBy(results, "length");
|
|
63
|
+
console.log(maxResult.length, result.length);
|
|
64
|
+
} while (maxResult.length === 10000);
|
|
65
|
+
|
|
66
|
+
result.forEach(
|
|
67
|
+
r =>
|
|
68
|
+
(balances[r.address.toLowerCase()] = {
|
|
69
|
+
...balances[r.address.toLowerCase()],
|
|
70
|
+
celoBalance: Number(r.value) / 1e18,
|
|
71
|
+
balance: Number(balances[r.address.toLowerCase()]?.fuseBalance || 0) + Number(r.value) / 1e18,
|
|
72
|
+
lastSeen: 0
|
|
73
|
+
})
|
|
74
|
+
);
|
|
75
|
+
|
|
76
|
+
fs.writeFileSync(`activeWalletsBalances-${today}.json`, JSON.stringify(balances));
|
|
13
77
|
|
|
14
|
-
|
|
78
|
+
balances = JSON.parse(fs.readFileSync(`activeWalletsBalances-${today}.json`).toString());
|
|
15
79
|
|
|
16
80
|
const EPOCH = 60 * 60 * 6;
|
|
17
|
-
const pool = new PromisePool({ concurrency:
|
|
81
|
+
const pool = new PromisePool({ concurrency: 10 });
|
|
18
82
|
const lastUsed = {};
|
|
19
83
|
const epochs = range(1596045730, (Date.now() / 1000).toFixed(0), EPOCH);
|
|
20
84
|
|
|
21
|
-
const graphQuery = async (start, skip) => {
|
|
85
|
+
const graphQuery = async (start, skip, subgraph, retry = 3) => {
|
|
22
86
|
const query = `{
|
|
23
87
|
walletStats(first: 1000 skip:${skip} where: { dateAppeared_gte: ${start} dateAppeared_lt:${start + EPOCH} }) {
|
|
24
88
|
id
|
|
@@ -31,7 +95,7 @@ const main = async (chain = "fuse") => {
|
|
|
31
95
|
}`;
|
|
32
96
|
// console.log({ query });
|
|
33
97
|
try {
|
|
34
|
-
const { data = {}, errors } = await fetch(
|
|
98
|
+
const { data = {}, errors } = await fetch(subgraph, {
|
|
35
99
|
method: "POST",
|
|
36
100
|
headers: {
|
|
37
101
|
"Content-Type": "application/json"
|
|
@@ -39,27 +103,36 @@ const main = async (chain = "fuse") => {
|
|
|
39
103
|
body: JSON.stringify({ query })
|
|
40
104
|
}).then(_ => _.json());
|
|
41
105
|
errors && console.log({ errors });
|
|
106
|
+
if (errors) {
|
|
107
|
+
console.log("query failed:", { subgraph, start, skip, retrying: retry > 0 });
|
|
108
|
+
if (retry > 0) {
|
|
109
|
+
return graphQuery(start, skip, subgraph, retry - 1);
|
|
110
|
+
}
|
|
111
|
+
return [];
|
|
112
|
+
}
|
|
113
|
+
// console.log("query ok:", { subgraph, start, skip, records: data.walletStats.length })
|
|
42
114
|
if (data?.walletStats?.length === 1000) {
|
|
43
|
-
return data.walletStats.concat(await graphQuery(start, skip + 1000));
|
|
115
|
+
return data.walletStats.concat(await graphQuery(start, skip + 1000, subgraph));
|
|
44
116
|
}
|
|
45
117
|
return data.walletStats || [];
|
|
46
118
|
} catch (error) {
|
|
47
|
-
console.log({ query, error });
|
|
119
|
+
console.log({ query, error, subgraph });
|
|
48
120
|
return [];
|
|
49
121
|
}
|
|
50
122
|
};
|
|
51
123
|
epochs.forEach(e => {
|
|
52
124
|
pool.add(async () => {
|
|
53
|
-
const walletStats = await graphQuery(e, 0);
|
|
125
|
+
const walletStats = flatten(await Promise.all([graphQuery(e, 0, fuseSubgraph), graphQuery(e, 0, celoSubgraph)]));
|
|
54
126
|
walletStats.forEach(w => {
|
|
55
127
|
balances[w.id.toLowerCase()] = {
|
|
128
|
+
...balances[w.id.toLowerCase()],
|
|
56
129
|
lastSeen: Math.max(
|
|
130
|
+
balances[w.id.toLowerCase()]?.lastSeen,
|
|
57
131
|
Number(w.lastClaimed),
|
|
58
132
|
Number(w.lastTransactionFrom),
|
|
59
133
|
Number(w.lastTransactionTo),
|
|
60
134
|
Number(w.dateAppeared)
|
|
61
|
-
)
|
|
62
|
-
balance: balances[w.id.toLowerCase()]?.balance || w.balance
|
|
135
|
+
)
|
|
63
136
|
};
|
|
64
137
|
});
|
|
65
138
|
console.log({ curDate: e, records: walletStats.length });
|
|
@@ -67,7 +140,7 @@ const main = async (chain = "fuse") => {
|
|
|
67
140
|
});
|
|
68
141
|
|
|
69
142
|
await pool.all();
|
|
70
|
-
fs.writeFileSync(
|
|
143
|
+
fs.writeFileSync(`activeWalletsLastUsed-${today}.json`, JSON.stringify(balances));
|
|
71
144
|
// console.log({ lastUsed });
|
|
72
145
|
};
|
|
73
146
|
|
|
@@ -85,8 +158,46 @@ function arrayToCsv(data) {
|
|
|
85
158
|
)
|
|
86
159
|
.join("\r\n"); // rows starting on new lines
|
|
87
160
|
}
|
|
161
|
+
|
|
162
|
+
const fix = async () => {
|
|
163
|
+
const balances = JSON.parse(fs.readFileSync(`activeWalletsLastUsed-${today}.json`).toString());
|
|
164
|
+
|
|
165
|
+
let result = [];
|
|
166
|
+
|
|
167
|
+
let missing = 0;
|
|
168
|
+
for (let addr in balances) {
|
|
169
|
+
const r = balances[addr];
|
|
170
|
+
if (!r.fuseBalance && !r.celoBalance) {
|
|
171
|
+
console.log("missing:", addr);
|
|
172
|
+
missing += 1;
|
|
173
|
+
continue;
|
|
174
|
+
}
|
|
175
|
+
r.celoBalance = (r.celoBalance || 0) * 100;
|
|
176
|
+
r.balance = r.celoBalance + r.fuseBalance;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
console.log("missing balance", missing);
|
|
180
|
+
console.log(sortBy(Object.entries(balances), _ => -_.balance).slice(0, 10));
|
|
181
|
+
|
|
182
|
+
fs.writeFileSync(`activeWalletsLastUsed-${today}.json`, JSON.stringify(balances));
|
|
183
|
+
};
|
|
88
184
|
const etl = async () => {
|
|
89
|
-
|
|
185
|
+
/** Convert a 2D array into a CSV string
|
|
186
|
+
*/
|
|
187
|
+
function arrayToCsv(data) {
|
|
188
|
+
return data
|
|
189
|
+
.map(
|
|
190
|
+
row =>
|
|
191
|
+
row
|
|
192
|
+
.map(String) // convert every value to String
|
|
193
|
+
.map(v => v.replaceAll('"', '""')) // escape double colons
|
|
194
|
+
.map(v => `"${v}"`) // quote it
|
|
195
|
+
.join(",") // comma-separated
|
|
196
|
+
)
|
|
197
|
+
.join("\r\n"); // rows starting on new lines
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
const balances = JSON.parse(fs.readFileSync(`activeWalletsLastUsed-${today}.json`).toString());
|
|
90
201
|
|
|
91
202
|
let result = [];
|
|
92
203
|
|
|
@@ -95,22 +206,30 @@ const etl = async () => {
|
|
|
95
206
|
if (!r.balance) {
|
|
96
207
|
continue;
|
|
97
208
|
}
|
|
98
|
-
result.push([addr, r.balance
|
|
209
|
+
result.push([addr, r.balance, r.lastSeen, false, r.fuseBalance, r.celoBalance]);
|
|
99
210
|
}
|
|
211
|
+
result = sortBy(result, _ => -_[1]);
|
|
100
212
|
const top100 = result.slice(0, 100);
|
|
101
213
|
const pool = new PromisePool({ concurrency: 30 });
|
|
102
214
|
const provider = new ethers.providers.JsonRpcBatchProvider("https://rpc.fuse.io");
|
|
215
|
+
const celoprovider = new ethers.providers.JsonRpcBatchProvider("https://forno.celo.org");
|
|
103
216
|
|
|
104
217
|
for (let idx in top100) {
|
|
105
218
|
pool.add(async () => {
|
|
106
219
|
const record = top100[idx];
|
|
107
|
-
let isContract =
|
|
220
|
+
let isContract =
|
|
221
|
+
(
|
|
222
|
+
await Promise.all([
|
|
223
|
+
provider.getCode(record[0]).catch(e => "0x"),
|
|
224
|
+
celoprovider.getCode(record[0]).catch(e => "0x")
|
|
225
|
+
])
|
|
226
|
+
).find(_ => _ !== "0x") !== undefined;
|
|
108
227
|
record[3] = isContract;
|
|
109
228
|
});
|
|
110
229
|
}
|
|
111
230
|
await pool.all();
|
|
112
231
|
console.log({ top100 });
|
|
113
|
-
fs.writeFileSync(
|
|
232
|
+
fs.writeFileSync(`activeWalletsLastUsed-${today}.csv`, arrayToCsv(result));
|
|
114
233
|
};
|
|
115
234
|
|
|
116
235
|
const getFuseBalances = async (refetch = true) => {
|
|
@@ -177,5 +296,6 @@ const fundsByLastSeen = async () => {
|
|
|
177
296
|
};
|
|
178
297
|
getFuseBalances(false).catch(e => console.log(e));
|
|
179
298
|
// main().catch(e => console.log(e));
|
|
180
|
-
//
|
|
299
|
+
// fix();
|
|
300
|
+
etl();
|
|
181
301
|
// fundsByLastSeen();
|
package/scripts/fv.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import fs from "fs";
|
|
2
2
|
import { chunk, uniqBy } from "lodash";
|
|
3
3
|
import delay from "delay";
|
|
4
|
+
import { bulkIsWhitelisted, bulkLastAuth } from "./utils";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
//create tunnel to fv server ssh -L 9090:server:8080 -N user@server -i sshkey
|
|
6
7
|
|
|
7
|
-
const
|
|
8
|
+
const saveImages = async a => {
|
|
8
9
|
const i1 = await fetch("http://localhost:9090/enrollment-3d/" + a[1]).then(_ => _.json());
|
|
9
10
|
const i2 = await fetch("http://localhost:9090/enrollment-3d/" + a[2]).then(_ => _.json());
|
|
10
11
|
if (i1.auditTrailBase64 && i2.auditTrailBase64) {
|
|
@@ -16,7 +17,7 @@ const fetchImages = async a => {
|
|
|
16
17
|
});
|
|
17
18
|
} else console.log("not found", a, !!i1.auditTrailBase64, !!i2.auditTrailBase64);
|
|
18
19
|
};
|
|
19
|
-
|
|
20
|
+
|
|
20
21
|
const main = async () => {
|
|
21
22
|
const data = JSON.parse(fs.readFileSync("fvtriplets2.txt").toString());
|
|
22
23
|
const triplets = uniqBy(chunk(data, 3), _ => _.join("_"));
|
|
@@ -33,7 +34,7 @@ const main = async () => {
|
|
|
33
34
|
return fs.existsSync(key) === false;
|
|
34
35
|
});
|
|
35
36
|
console.log({ notfetched });
|
|
36
|
-
const ps = notfetched.map(
|
|
37
|
+
const ps = notfetched.map(saveImages);
|
|
37
38
|
|
|
38
39
|
await Promise.all(ps);
|
|
39
40
|
};
|
|
@@ -207,6 +208,7 @@ const deleteIdentifiers = async password => {
|
|
|
207
208
|
};
|
|
208
209
|
// checkIndexedOrDelete();
|
|
209
210
|
fixInvalidIndexed();
|
|
210
|
-
// main();
|
|
211
211
|
// console.log(process.env.ADMIN_PASSWORD);
|
|
212
212
|
// deleteIdentifiers(process.env.ADMIN_PASSWORD);
|
|
213
|
+
// main();
|
|
214
|
+
saveImages(["", "", ""]);
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Bring UBI distribution to a temporary working state
|
|
3
|
+
* Celo:
|
|
4
|
+
* - upgrade bridge to be able to prevent UBI bridge transfers as result of the hack
|
|
5
|
+
* - mark unexecuted bridge transfers as executed
|
|
6
|
+
* - set UBI with new cycle params
|
|
7
|
+
* - unpause ubi contract
|
|
8
|
+
* Fuse:
|
|
9
|
+
* - withdraw ubi to avatar and bridge ubi to contract on celo
|
|
10
|
+
* - burn excess UBI tokens
|
|
11
|
+
* - set UBI with new cycle params
|
|
12
|
+
* - unpause ubi contract
|
|
13
|
+
* Mainnet:
|
|
14
|
+
* - withdraw excess UBI from bridge to avatar
|
|
15
|
+
* - burn excess UBI from bridge
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { network, ethers } from "hardhat";
|
|
20
|
+
import { defaultsDeep, last } from "lodash";
|
|
21
|
+
import prompt from "prompt";
|
|
22
|
+
|
|
23
|
+
import { executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
|
|
24
|
+
|
|
25
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
26
|
+
|
|
27
|
+
import dao from "../../releases/deployment.json";
|
|
28
|
+
let { name: networkName } = network;
|
|
29
|
+
|
|
30
|
+
export const upgradeCelo = async () => {
|
|
31
|
+
const isProduction = networkName.includes("production");
|
|
32
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
33
|
+
|
|
34
|
+
if (isProduction) verifyProductionSigner(root);
|
|
35
|
+
|
|
36
|
+
let guardian = root;
|
|
37
|
+
|
|
38
|
+
//simulate produciton on fork
|
|
39
|
+
if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
|
|
40
|
+
networkName = "production-celo";
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
let release: { [key: string]: any } = dao[networkName];
|
|
44
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
45
|
+
|
|
46
|
+
//simulate on fork, make sure safe has enough eth to simulate txs
|
|
47
|
+
if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
|
|
48
|
+
guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
|
|
49
|
+
|
|
50
|
+
await root.sendTransaction({
|
|
51
|
+
value: ethers.constants.WeiPerEther.mul(3),
|
|
52
|
+
to: protocolSettings.guardiansSafe
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const rootBalance = await ethers.provider.getBalance(root.address).then(_ => _.toString());
|
|
57
|
+
const guardianBalance = await ethers.provider.getBalance(guardian.address).then(_ => _.toString());
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
console.log("got signers:", {
|
|
61
|
+
networkName,
|
|
62
|
+
root: root.address,
|
|
63
|
+
guardian: guardian.address,
|
|
64
|
+
balance: rootBalance,
|
|
65
|
+
guardianBalance: guardianBalance
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const reducerContract = await ethers.deployContract("LastauthReduction", [release.NameService])
|
|
69
|
+
console.log("executing proposals");
|
|
70
|
+
|
|
71
|
+
const proposalContracts = [
|
|
72
|
+
release.Controller,
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
76
|
+
|
|
77
|
+
const proposalFunctionSignatures = [
|
|
78
|
+
"registerScheme(address,bytes32,bytes4,address)", //make sure mpb is a registered scheme so it can mint G$ tokens
|
|
79
|
+
];
|
|
80
|
+
|
|
81
|
+
const proposalFunctionInputs = [
|
|
82
|
+
ethers.utils.defaultAbiCoder.encode(["address", "bytes32", "bytes4", "address"], [reducerContract.address, ethers.constants.HashZero, "0x0000001f", release.Avatar]),
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
if (isProduction) {
|
|
86
|
+
await executeViaSafe(
|
|
87
|
+
proposalContracts,
|
|
88
|
+
proposalEthValues,
|
|
89
|
+
proposalFunctionSignatures,
|
|
90
|
+
proposalFunctionInputs,
|
|
91
|
+
protocolSettings.guardiansSafe,
|
|
92
|
+
"celo"
|
|
93
|
+
);
|
|
94
|
+
} else {
|
|
95
|
+
//simulation or dev envs
|
|
96
|
+
await executeViaGuardian(
|
|
97
|
+
proposalContracts,
|
|
98
|
+
proposalEthValues,
|
|
99
|
+
proposalFunctionSignatures,
|
|
100
|
+
proposalFunctionInputs,
|
|
101
|
+
guardian,
|
|
102
|
+
networkName
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
//perform sanity checks on fork, for production we need to wait until everything executed
|
|
107
|
+
if (!isProduction) {
|
|
108
|
+
try {
|
|
109
|
+
while (true) {
|
|
110
|
+
await reducerContract.reduce()
|
|
111
|
+
let id = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
112
|
+
console.log("authperiod", await id.authenticationPeriod());
|
|
113
|
+
}
|
|
114
|
+
} catch (error) {
|
|
115
|
+
console.log("reduce reverted:", error)
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export const upgradeFuse = async () => {
|
|
122
|
+
const isProduction = networkName.includes("production");
|
|
123
|
+
|
|
124
|
+
let [root] = await ethers.getSigners();
|
|
125
|
+
|
|
126
|
+
//simulate produciton on fork
|
|
127
|
+
if (network.name === "hardhat" || network.name === "fork" || network.name === "localhost") {
|
|
128
|
+
networkName = "production";
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
let networkEnv = networkName.split("-")[0];
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
if (networkEnv === "fuse") networkEnv = "development";
|
|
135
|
+
|
|
136
|
+
let release: { [key: string]: any } = dao[networkEnv];
|
|
137
|
+
|
|
138
|
+
let guardian = root;
|
|
139
|
+
console.log({ networkEnv })
|
|
140
|
+
//simulate on fork, make sure safe has enough eth to simulate txs
|
|
141
|
+
if (network.name === "hardhat" || network.name === "localhost" || network.name === "fork") {
|
|
142
|
+
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
143
|
+
|
|
144
|
+
await root.sendTransaction({
|
|
145
|
+
value: ethers.constants.WeiPerEther.mul(3),
|
|
146
|
+
to: guardian.address
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
console.log({
|
|
152
|
+
networkEnv,
|
|
153
|
+
guardian: guardian.address,
|
|
154
|
+
isProduction,
|
|
155
|
+
avatarBalance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
const reducerContract = await ethers.deployContract("LastauthReduction", [release.NameService])
|
|
159
|
+
|
|
160
|
+
const proposalContracts = [
|
|
161
|
+
release.Controller,
|
|
162
|
+
];
|
|
163
|
+
|
|
164
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
165
|
+
|
|
166
|
+
const proposalFunctionSignatures = [
|
|
167
|
+
"registerScheme(address,bytes32,bytes4,address)", //make sure mpb is a registered scheme so it can mint G$ tokens
|
|
168
|
+
];
|
|
169
|
+
|
|
170
|
+
const proposalFunctionInputs = [
|
|
171
|
+
ethers.utils.defaultAbiCoder.encode(["address", "bytes32", "bytes4", "address"], [reducerContract.address, ethers.constants.HashZero, "0x0000001f", release.Avatar]),
|
|
172
|
+
];
|
|
173
|
+
|
|
174
|
+
if (isProduction) {
|
|
175
|
+
await executeViaSafe(
|
|
176
|
+
proposalContracts,
|
|
177
|
+
proposalEthValues,
|
|
178
|
+
proposalFunctionSignatures,
|
|
179
|
+
proposalFunctionInputs,
|
|
180
|
+
release.GuardiansSafe,
|
|
181
|
+
"fuse"
|
|
182
|
+
);
|
|
183
|
+
} else {
|
|
184
|
+
//simulation or dev envs
|
|
185
|
+
await executeViaGuardian(
|
|
186
|
+
proposalContracts,
|
|
187
|
+
proposalEthValues,
|
|
188
|
+
proposalFunctionSignatures,
|
|
189
|
+
proposalFunctionInputs,
|
|
190
|
+
guardian,
|
|
191
|
+
networkName
|
|
192
|
+
);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
//perform sanity checks on fork, for production we need to wait until everything executed
|
|
196
|
+
if (!isProduction) {
|
|
197
|
+
try {
|
|
198
|
+
while (true) {
|
|
199
|
+
await reducerContract.reduce()
|
|
200
|
+
let id = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
201
|
+
let idOld = await ethers.getContractAt("IdentityV2", release.IdentityOld);
|
|
202
|
+
|
|
203
|
+
console.log("authperiod", await id.authenticationPeriod(), await idOld.authenticationPeriod());
|
|
204
|
+
}
|
|
205
|
+
} catch (error) {
|
|
206
|
+
console.log("reduce reverted:", error)
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
};
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
export const main = async () => {
|
|
215
|
+
prompt.start();
|
|
216
|
+
const { network } = await prompt.get(["network"]);
|
|
217
|
+
|
|
218
|
+
console.log("running step:", { network });
|
|
219
|
+
switch (network) {
|
|
220
|
+
case "celo":
|
|
221
|
+
await upgradeCelo();
|
|
222
|
+
break;
|
|
223
|
+
case "fuse":
|
|
224
|
+
await upgradeFuse();
|
|
225
|
+
break;
|
|
226
|
+
}
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
main().catch(console.log);
|
package/scripts/utils.ts
CHANGED
|
@@ -33,5 +33,18 @@ export const bulkLastAuth = async (accounts: Array<String>) => {
|
|
|
33
33
|
const identityContract = new Contract("0x2F9C28de9e6d44b71B91b8BA337A5D82e308E7BE", Identity.abi);
|
|
34
34
|
const calls = accounts.map(d => identityContract.lastAuthenticated(d));
|
|
35
35
|
const result = await ethcallProvider.all(calls);
|
|
36
|
-
|
|
36
|
+
// console.log({ result });
|
|
37
|
+
const whitelisted = accounts.filter((v, i) => parseInt(result[i]));
|
|
38
|
+
return whitelisted;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
export const bulkGetLastAuth = async (accounts: Array<String>) => {
|
|
42
|
+
setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
|
|
43
|
+
setMulticallAddress(42220, "0x75F59534dd892c1f8a7B172D639FA854D529ada3");
|
|
44
|
+
const celoProvider = new ethers.providers.JsonRpcProvider("https://forno.celo.org");
|
|
45
|
+
const ethcallProvider = new Provider(celoProvider, 42220);
|
|
46
|
+
const identityContract = new Contract("0xC361A6E67822a0EDc17D899227dd9FC50BD62F42", Identity.abi);
|
|
47
|
+
const calls = accounts.map(d => identityContract.lastAuthenticated(d));
|
|
48
|
+
const result = await ethcallProvider.all(calls);
|
|
49
|
+
return result;
|
|
37
50
|
};
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
import type {
|
|
5
|
+
BaseContract,
|
|
6
|
+
BigNumber,
|
|
7
|
+
BytesLike,
|
|
8
|
+
CallOverrides,
|
|
9
|
+
ContractTransaction,
|
|
10
|
+
Overrides,
|
|
11
|
+
PopulatedTransaction,
|
|
12
|
+
Signer,
|
|
13
|
+
utils,
|
|
14
|
+
} from "ethers";
|
|
15
|
+
import type { FunctionFragment, Result } from "@ethersproject/abi";
|
|
16
|
+
import type { Listener, Provider } from "@ethersproject/providers";
|
|
17
|
+
import type {
|
|
18
|
+
TypedEventFilter,
|
|
19
|
+
TypedEvent,
|
|
20
|
+
TypedListener,
|
|
21
|
+
OnEvent,
|
|
22
|
+
} from "../../common";
|
|
23
|
+
|
|
24
|
+
export interface LastauthReductionInterface extends utils.Interface {
|
|
25
|
+
functions: {
|
|
26
|
+
"finalPeriod()": FunctionFragment;
|
|
27
|
+
"manager()": FunctionFragment;
|
|
28
|
+
"reduce()": FunctionFragment;
|
|
29
|
+
"reduceByDays()": FunctionFragment;
|
|
30
|
+
"startingPeriodDays()": FunctionFragment;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
getFunction(
|
|
34
|
+
nameOrSignatureOrTopic:
|
|
35
|
+
| "finalPeriod"
|
|
36
|
+
| "manager"
|
|
37
|
+
| "reduce"
|
|
38
|
+
| "reduceByDays"
|
|
39
|
+
| "startingPeriodDays"
|
|
40
|
+
): FunctionFragment;
|
|
41
|
+
|
|
42
|
+
encodeFunctionData(
|
|
43
|
+
functionFragment: "finalPeriod",
|
|
44
|
+
values?: undefined
|
|
45
|
+
): string;
|
|
46
|
+
encodeFunctionData(functionFragment: "manager", values?: undefined): string;
|
|
47
|
+
encodeFunctionData(functionFragment: "reduce", values?: undefined): string;
|
|
48
|
+
encodeFunctionData(
|
|
49
|
+
functionFragment: "reduceByDays",
|
|
50
|
+
values?: undefined
|
|
51
|
+
): string;
|
|
52
|
+
encodeFunctionData(
|
|
53
|
+
functionFragment: "startingPeriodDays",
|
|
54
|
+
values?: undefined
|
|
55
|
+
): string;
|
|
56
|
+
|
|
57
|
+
decodeFunctionResult(
|
|
58
|
+
functionFragment: "finalPeriod",
|
|
59
|
+
data: BytesLike
|
|
60
|
+
): Result;
|
|
61
|
+
decodeFunctionResult(functionFragment: "manager", data: BytesLike): Result;
|
|
62
|
+
decodeFunctionResult(functionFragment: "reduce", data: BytesLike): Result;
|
|
63
|
+
decodeFunctionResult(
|
|
64
|
+
functionFragment: "reduceByDays",
|
|
65
|
+
data: BytesLike
|
|
66
|
+
): Result;
|
|
67
|
+
decodeFunctionResult(
|
|
68
|
+
functionFragment: "startingPeriodDays",
|
|
69
|
+
data: BytesLike
|
|
70
|
+
): Result;
|
|
71
|
+
|
|
72
|
+
events: {};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface LastauthReduction extends BaseContract {
|
|
76
|
+
connect(signerOrProvider: Signer | Provider | string): this;
|
|
77
|
+
attach(addressOrName: string): this;
|
|
78
|
+
deployed(): Promise<this>;
|
|
79
|
+
|
|
80
|
+
interface: LastauthReductionInterface;
|
|
81
|
+
|
|
82
|
+
queryFilter<TEvent extends TypedEvent>(
|
|
83
|
+
event: TypedEventFilter<TEvent>,
|
|
84
|
+
fromBlockOrBlockhash?: string | number | undefined,
|
|
85
|
+
toBlock?: string | number | undefined
|
|
86
|
+
): Promise<Array<TEvent>>;
|
|
87
|
+
|
|
88
|
+
listeners<TEvent extends TypedEvent>(
|
|
89
|
+
eventFilter?: TypedEventFilter<TEvent>
|
|
90
|
+
): Array<TypedListener<TEvent>>;
|
|
91
|
+
listeners(eventName?: string): Array<Listener>;
|
|
92
|
+
removeAllListeners<TEvent extends TypedEvent>(
|
|
93
|
+
eventFilter: TypedEventFilter<TEvent>
|
|
94
|
+
): this;
|
|
95
|
+
removeAllListeners(eventName?: string): this;
|
|
96
|
+
off: OnEvent<this>;
|
|
97
|
+
on: OnEvent<this>;
|
|
98
|
+
once: OnEvent<this>;
|
|
99
|
+
removeListener: OnEvent<this>;
|
|
100
|
+
|
|
101
|
+
functions: {
|
|
102
|
+
finalPeriod(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
103
|
+
|
|
104
|
+
manager(overrides?: CallOverrides): Promise<[string]>;
|
|
105
|
+
|
|
106
|
+
reduce(
|
|
107
|
+
overrides?: Overrides & { from?: string }
|
|
108
|
+
): Promise<ContractTransaction>;
|
|
109
|
+
|
|
110
|
+
reduceByDays(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
111
|
+
|
|
112
|
+
startingPeriodDays(overrides?: CallOverrides): Promise<[BigNumber]>;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
finalPeriod(overrides?: CallOverrides): Promise<BigNumber>;
|
|
116
|
+
|
|
117
|
+
manager(overrides?: CallOverrides): Promise<string>;
|
|
118
|
+
|
|
119
|
+
reduce(
|
|
120
|
+
overrides?: Overrides & { from?: string }
|
|
121
|
+
): Promise<ContractTransaction>;
|
|
122
|
+
|
|
123
|
+
reduceByDays(overrides?: CallOverrides): Promise<BigNumber>;
|
|
124
|
+
|
|
125
|
+
startingPeriodDays(overrides?: CallOverrides): Promise<BigNumber>;
|
|
126
|
+
|
|
127
|
+
callStatic: {
|
|
128
|
+
finalPeriod(overrides?: CallOverrides): Promise<BigNumber>;
|
|
129
|
+
|
|
130
|
+
manager(overrides?: CallOverrides): Promise<string>;
|
|
131
|
+
|
|
132
|
+
reduce(overrides?: CallOverrides): Promise<void>;
|
|
133
|
+
|
|
134
|
+
reduceByDays(overrides?: CallOverrides): Promise<BigNumber>;
|
|
135
|
+
|
|
136
|
+
startingPeriodDays(overrides?: CallOverrides): Promise<BigNumber>;
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
filters: {};
|
|
140
|
+
|
|
141
|
+
estimateGas: {
|
|
142
|
+
finalPeriod(overrides?: CallOverrides): Promise<BigNumber>;
|
|
143
|
+
|
|
144
|
+
manager(overrides?: CallOverrides): Promise<BigNumber>;
|
|
145
|
+
|
|
146
|
+
reduce(overrides?: Overrides & { from?: string }): Promise<BigNumber>;
|
|
147
|
+
|
|
148
|
+
reduceByDays(overrides?: CallOverrides): Promise<BigNumber>;
|
|
149
|
+
|
|
150
|
+
startingPeriodDays(overrides?: CallOverrides): Promise<BigNumber>;
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
populateTransaction: {
|
|
154
|
+
finalPeriod(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
155
|
+
|
|
156
|
+
manager(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
157
|
+
|
|
158
|
+
reduce(
|
|
159
|
+
overrides?: Overrides & { from?: string }
|
|
160
|
+
): Promise<PopulatedTransaction>;
|
|
161
|
+
|
|
162
|
+
reduceByDays(overrides?: CallOverrides): Promise<PopulatedTransaction>;
|
|
163
|
+
|
|
164
|
+
startingPeriodDays(
|
|
165
|
+
overrides?: CallOverrides
|
|
166
|
+
): Promise<PopulatedTransaction>;
|
|
167
|
+
};
|
|
168
|
+
}
|