@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
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "LastauthReduction",
|
|
4
|
+
"sourceName": "contracts/utils/LastauthReduction.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "contract NameService",
|
|
10
|
+
"name": "_ns",
|
|
11
|
+
"type": "address"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"stateMutability": "nonpayable",
|
|
15
|
+
"type": "constructor"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"inputs": [],
|
|
19
|
+
"name": "finalPeriod",
|
|
20
|
+
"outputs": [
|
|
21
|
+
{
|
|
22
|
+
"internalType": "uint256",
|
|
23
|
+
"name": "",
|
|
24
|
+
"type": "uint256"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"stateMutability": "view",
|
|
28
|
+
"type": "function"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"inputs": [],
|
|
32
|
+
"name": "manager",
|
|
33
|
+
"outputs": [
|
|
34
|
+
{
|
|
35
|
+
"internalType": "address",
|
|
36
|
+
"name": "",
|
|
37
|
+
"type": "address"
|
|
38
|
+
}
|
|
39
|
+
],
|
|
40
|
+
"stateMutability": "view",
|
|
41
|
+
"type": "function"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"inputs": [],
|
|
45
|
+
"name": "reduce",
|
|
46
|
+
"outputs": [],
|
|
47
|
+
"stateMutability": "nonpayable",
|
|
48
|
+
"type": "function"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"inputs": [],
|
|
52
|
+
"name": "reduceByDays",
|
|
53
|
+
"outputs": [
|
|
54
|
+
{
|
|
55
|
+
"internalType": "uint256",
|
|
56
|
+
"name": "",
|
|
57
|
+
"type": "uint256"
|
|
58
|
+
}
|
|
59
|
+
],
|
|
60
|
+
"stateMutability": "view",
|
|
61
|
+
"type": "function"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"inputs": [],
|
|
65
|
+
"name": "startingPeriodDays",
|
|
66
|
+
"outputs": [
|
|
67
|
+
{
|
|
68
|
+
"internalType": "uint256",
|
|
69
|
+
"name": "",
|
|
70
|
+
"type": "uint256"
|
|
71
|
+
}
|
|
72
|
+
],
|
|
73
|
+
"stateMutability": "view",
|
|
74
|
+
"type": "function"
|
|
75
|
+
}
|
|
76
|
+
],
|
|
77
|
+
"bytecode": "0x6080604052605a60015561027660025560b460035534801561002057600080fd5b50604051610b6b380380610b6b83398101604081905261003f9161006d565b600080546001600160a01b039092166001600160a01b0319928316179055600480549091163317905561009d565b60006020828403121561007f57600080fd5b81516001600160a01b038116811461009657600080fd5b9392505050565b610abf806100ac6000396000f3fe608060405234801561001057600080fd5b50600436106100575760003560e01c80630d8606621461005c57806345219b0e14610078578063481c6a7514610082578063ab0962e0146100a2578063c6ee9b9e146100ab575b600080fd5b61006560025481565b6040519081526020015b60405180910390f35b6100806100b4565b005b600454610095906001600160a01b031681565b60405161006f9190610847565b61006560035481565b61006560015481565b6004546001600160a01b031633146101015760405162461bcd60e51b815260206004820152600b60248201526a3737ba1036b0b730b3b2b960a91b60448201526064015b60405180910390fd5b60008060009054906101000a90046001600160a01b03166001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610155573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101799190610873565b6001600160a01b0316635aef7de66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101da9190610873565b6000805460405163bf40fac160e01b81526020600482015260086024820152674944454e5449545960c01b604482015292935090916001600160a01b039091169063bf40fac190606401602060405180830381865afa158015610241573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102659190610873565b6000805460405163bf40fac160e01b815260206004820152600a60248201526921a7a72a2927a62622a960b11b604482015292935090916001600160a01b039091169063bf40fac190606401602060405180830381865afa1580156102ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f29190610873565b90506000826001600160a01b03166331b376e26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103589190610897565b90506000836001600160a01b0316634125f0f26040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103be9190610873565b9050600354821161048257604051636c525b1360e01b81526001600160a01b03841690636c525b13906103f5908890600401610847565b6020604051808303816000875af1158015610414573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043891906108c5565b61047b5760405162461bcd60e51b81526020600482015260146024820152731d5b9c9959da5cdd195c9a5b99c819985a5b195960621b60448201526064016100f8565b5050505050565b600060025483111561065e57836001600160a01b031663d1b7089a866002546040516024016104b391815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526105059291908b90600090600401610904565b6000604051808303816000875af1158015610524573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261054c919081019061096b565b5090508061056c5760405162461bcd60e51b81526004016100f890610a2b565b6001600160a01b0382161561065957836001600160a01b031663d1b7089a836002546040516024016105a091815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526105f29291908b90600090600401610904565b6000604051808303816000875af1158015610611573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610639919081019061096b565b509050806106595760405162461bcd60e51b81526004016100f890610a2b565b61083f565b836001600160a01b031663d1b7089a866001548661067c9190610a62565b60405160240161068e91815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526106e09291908b90600090600401610904565b6000604051808303816000875af11580156106ff573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610727919081019061096b565b509050806107475760405162461bcd60e51b81526004016100f890610a2b565b6001600160a01b0382161561083f57836001600160a01b031663d1b7089a83600154866107749190610a62565b60405160240161078691815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526107d89291908b90600090600401610904565b6000604051808303816000875af11580156107f7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261081f919081019061096b565b5090508061083f5760405162461bcd60e51b81526004016100f890610a2b565b505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461087057600080fd5b50565b60006020828403121561088557600080fd5b81516108908161085b565b9392505050565b6000602082840312156108a957600080fd5b5051919050565b805180151581146108c057600080fd5b919050565b6000602082840312156108d757600080fd5b610890826108b0565b60005b838110156108fb5781810151838201526020016108e3565b50506000910152565b600060018060a01b0380871683526080602084015285518060808501526109328160a0860160208a016108e0565b9416604083015250606081019190915260a0601f909201601f1916010192915050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097e57600080fd5b610987836108b0565b60208401519092506001600160401b03808211156109a457600080fd5b818501915085601f8301126109b857600080fd5b8151818111156109ca576109ca610955565b604051601f8201601f19908116603f011681019083821181831017156109f2576109f2610955565b81604052828152886020848701011115610a0b57600080fd5b610a1c8360208301602088016108e0565b80955050505050509250929050565b6020808252601e908201527f73657441757468656e7469636174696f6e506572696f64206661696c65640000604082015260600190565b81810381811115610a8357634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220aa3372503faa13c51fb82573a9fc8257ac61745f4b748ad58773bd4944d4375f64736f6c63430008130033",
|
|
78
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100575760003560e01c80630d8606621461005c57806345219b0e14610078578063481c6a7514610082578063ab0962e0146100a2578063c6ee9b9e146100ab575b600080fd5b61006560025481565b6040519081526020015b60405180910390f35b6100806100b4565b005b600454610095906001600160a01b031681565b60405161006f9190610847565b61006560035481565b61006560015481565b6004546001600160a01b031633146101015760405162461bcd60e51b815260206004820152600b60248201526a3737ba1036b0b730b3b2b960a91b60448201526064015b60405180910390fd5b60008060009054906101000a90046001600160a01b03166001600160a01b0316634162169f6040518163ffffffff1660e01b8152600401602060405180830381865afa158015610155573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101799190610873565b6001600160a01b0316635aef7de66040518163ffffffff1660e01b8152600401602060405180830381865afa1580156101b6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101da9190610873565b6000805460405163bf40fac160e01b81526020600482015260086024820152674944454e5449545960c01b604482015292935090916001600160a01b039091169063bf40fac190606401602060405180830381865afa158015610241573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102659190610873565b6000805460405163bf40fac160e01b815260206004820152600a60248201526921a7a72a2927a62622a960b11b604482015292935090916001600160a01b039091169063bf40fac190606401602060405180830381865afa1580156102ce573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102f29190610873565b90506000826001600160a01b03166331b376e26040518163ffffffff1660e01b8152600401602060405180830381865afa158015610334573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103589190610897565b90506000836001600160a01b0316634125f0f26040518163ffffffff1660e01b8152600401602060405180830381865afa15801561039a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103be9190610873565b9050600354821161048257604051636c525b1360e01b81526001600160a01b03841690636c525b13906103f5908890600401610847565b6020604051808303816000875af1158015610414573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061043891906108c5565b61047b5760405162461bcd60e51b81526020600482015260146024820152731d5b9c9959da5cdd195c9a5b99c819985a5b195960621b60448201526064016100f8565b5050505050565b600060025483111561065e57836001600160a01b031663d1b7089a866002546040516024016104b391815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526105059291908b90600090600401610904565b6000604051808303816000875af1158015610524573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261054c919081019061096b565b5090508061056c5760405162461bcd60e51b81526004016100f890610a2b565b6001600160a01b0382161561065957836001600160a01b031663d1b7089a836002546040516024016105a091815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526105f29291908b90600090600401610904565b6000604051808303816000875af1158015610611573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610639919081019061096b565b509050806106595760405162461bcd60e51b81526004016100f890610a2b565b61083f565b836001600160a01b031663d1b7089a866001548661067c9190610a62565b60405160240161068e91815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526106e09291908b90600090600401610904565b6000604051808303816000875af11580156106ff573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610727919081019061096b565b509050806107475760405162461bcd60e51b81526004016100f890610a2b565b6001600160a01b0382161561083f57836001600160a01b031663d1b7089a83600154866107749190610a62565b60405160240161078691815260200190565b60408051601f198184030181529181526020820180516001600160e01b031660016201b3cb60e21b0319179052516001600160e01b031960e085901b1681526107d89291908b90600090600401610904565b6000604051808303816000875af11580156107f7573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261081f919081019061096b565b5090508061083f5760405162461bcd60e51b81526004016100f890610a2b565b505050505050565b6001600160a01b0391909116815260200190565b6001600160a01b038116811461087057600080fd5b50565b60006020828403121561088557600080fd5b81516108908161085b565b9392505050565b6000602082840312156108a957600080fd5b5051919050565b805180151581146108c057600080fd5b919050565b6000602082840312156108d757600080fd5b610890826108b0565b60005b838110156108fb5781810151838201526020016108e3565b50506000910152565b600060018060a01b0380871683526080602084015285518060808501526109328160a0860160208a016108e0565b9416604083015250606081019190915260a0601f909201601f1916010192915050565b634e487b7160e01b600052604160045260246000fd5b6000806040838503121561097e57600080fd5b610987836108b0565b60208401519092506001600160401b03808211156109a457600080fd5b818501915085601f8301126109b857600080fd5b8151818111156109ca576109ca610955565b604051601f8201601f19908116603f011681019083821181831017156109f2576109f2610955565b81604052828152886020848701011115610a0b57600080fd5b610a1c8360208301602088016108e0565b80955050505050509250929050565b6020808252601e908201527f73657441757468656e7469636174696f6e506572696f64206661696c65640000604082015260600190565b81810381811115610a8357634e487b7160e01b600052601160045260246000fd5b9291505056fea2646970667358221220aa3372503faa13c51fb82573a9fc8257ac61745f4b748ad58773bd4944d4375f64736f6c63430008130033",
|
|
79
|
+
"linkReferences": {},
|
|
80
|
+
"deployedLinkReferences": {}
|
|
81
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
pragma solidity >=0.8.0;
|
|
3
|
+
|
|
4
|
+
import "../utils/NameService.sol";
|
|
5
|
+
import "../Interfaces.sol";
|
|
6
|
+
import "../reserve/GoodReserveCDai.sol";
|
|
7
|
+
import "../identity/IdentityV2.sol";
|
|
8
|
+
import "hardhat/console.sol";
|
|
9
|
+
|
|
10
|
+
contract LastauthReduction {
|
|
11
|
+
NameService ns;
|
|
12
|
+
|
|
13
|
+
uint public reduceByDays = 90;
|
|
14
|
+
uint public startingPeriodDays = 180 + 90 * 5;
|
|
15
|
+
uint public finalPeriod = 180;
|
|
16
|
+
address public manager;
|
|
17
|
+
|
|
18
|
+
constructor(NameService _ns) {
|
|
19
|
+
ns = _ns;
|
|
20
|
+
manager = msg.sender;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function reduce() external {
|
|
24
|
+
require(msg.sender == manager, "not manager");
|
|
25
|
+
|
|
26
|
+
address avatar = ns.dao().avatar();
|
|
27
|
+
|
|
28
|
+
IdentityV2 id = IdentityV2(ns.getAddress("IDENTITY"));
|
|
29
|
+
|
|
30
|
+
Controller ctrl = Controller(ns.getAddress("CONTROLLER"));
|
|
31
|
+
uint curPeriod = id.authenticationPeriod();
|
|
32
|
+
|
|
33
|
+
IIdentity oldId = id.oldIdentity();
|
|
34
|
+
|
|
35
|
+
if (curPeriod <= finalPeriod) {
|
|
36
|
+
// prevent executing again
|
|
37
|
+
require(ctrl.unregisterSelf(avatar), "unregistering failed");
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
bool ok;
|
|
42
|
+
if (curPeriod > startingPeriodDays) {
|
|
43
|
+
(ok, ) = ctrl.genericCall(
|
|
44
|
+
address(id),
|
|
45
|
+
abi.encodeCall(
|
|
46
|
+
IdentityV2.setAuthenticationPeriod,
|
|
47
|
+
(startingPeriodDays)
|
|
48
|
+
),
|
|
49
|
+
address(avatar),
|
|
50
|
+
0
|
|
51
|
+
);
|
|
52
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
53
|
+
|
|
54
|
+
if (address(oldId) != address(0)) {
|
|
55
|
+
(ok, ) = ctrl.genericCall(
|
|
56
|
+
address(oldId),
|
|
57
|
+
abi.encodeCall(
|
|
58
|
+
IdentityV2.setAuthenticationPeriod,
|
|
59
|
+
(startingPeriodDays)
|
|
60
|
+
),
|
|
61
|
+
address(avatar),
|
|
62
|
+
0
|
|
63
|
+
);
|
|
64
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
(ok, ) = ctrl.genericCall(
|
|
68
|
+
address(id),
|
|
69
|
+
abi.encodeCall(
|
|
70
|
+
IdentityV2.setAuthenticationPeriod,
|
|
71
|
+
(curPeriod - reduceByDays)
|
|
72
|
+
),
|
|
73
|
+
address(avatar),
|
|
74
|
+
0
|
|
75
|
+
);
|
|
76
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
77
|
+
|
|
78
|
+
if (address(oldId) != address(0)) {
|
|
79
|
+
(ok, ) = ctrl.genericCall(
|
|
80
|
+
address(oldId),
|
|
81
|
+
abi.encodeCall(
|
|
82
|
+
IdentityV2.setAuthenticationPeriod,
|
|
83
|
+
(curPeriod - reduceByDays)
|
|
84
|
+
),
|
|
85
|
+
address(avatar),
|
|
86
|
+
0
|
|
87
|
+
);
|
|
88
|
+
require(ok, "setAuthenticationPeriod failed");
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddollar/goodprotocol",
|
|
3
|
-
"version": "2.0.25-beta.
|
|
3
|
+
"version": "2.0.25-beta.9",
|
|
4
4
|
"description": "GoodDollar Protocol",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.x"
|
|
@@ -61,22 +61,6 @@
|
|
|
61
61
|
"url": "https://github.com/GoodDollar/GoodProtocol/issues"
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://gooddollar.org",
|
|
64
|
-
"dependencies": {
|
|
65
|
-
"@gooddollar/goodcontracts": "^2.6.6",
|
|
66
|
-
"@jsier/retrier": "^1.2.4",
|
|
67
|
-
"@openzeppelin/contracts": "^4.8.0",
|
|
68
|
-
"@openzeppelin/contracts-upgradeable": "^4.8.0",
|
|
69
|
-
"@openzeppelin/hardhat-upgrades": "^1.22.1",
|
|
70
|
-
"@superfluid-finance/ethereum-contracts": "^1.8.1",
|
|
71
|
-
"@superfluid-finance/sdk-core": "^0.5.8",
|
|
72
|
-
"@typechain/hardhat": "^6.1.5",
|
|
73
|
-
"async-promise-pool": "^1.0.4",
|
|
74
|
-
"openzeppelin-solidity": "^4.3.2",
|
|
75
|
-
"patch-package": "latest",
|
|
76
|
-
"press-any-key": "^0.1.1",
|
|
77
|
-
"truffle-plugin-verify": "^0.6.1",
|
|
78
|
-
"truffle-source-verify": "^0.0.6"
|
|
79
|
-
},
|
|
80
64
|
"devDependencies": {
|
|
81
65
|
"@babel/core": "*",
|
|
82
66
|
"@babel/polyfill": "*",
|
|
@@ -88,19 +72,28 @@
|
|
|
88
72
|
"@gnosis.pm/safe-ethers-lib": "^1.7.0",
|
|
89
73
|
"@gnosis.pm/safe-service-client": "^1.4.0",
|
|
90
74
|
"@gooddollar/bridge-contracts": "1.0.14-beta.7",
|
|
75
|
+
"@gooddollar/goodcontracts": "^2.6.6",
|
|
76
|
+
"@jsier/retrier": "^1.2.4",
|
|
91
77
|
"@mean-finance/uniswap-v3-oracle": "^1.0.3",
|
|
92
78
|
"@nomicfoundation/hardhat-chai-matchers": "1",
|
|
93
79
|
"@nomicfoundation/hardhat-network-helpers": "^1.0.8",
|
|
94
80
|
"@nomicfoundation/hardhat-verify": "^2.0.1",
|
|
95
81
|
"@nomiclabs/hardhat-ethers": "^2.2.1",
|
|
96
82
|
"@nomiclabs/hardhat-waffle": "^2.0.6",
|
|
83
|
+
"@openzeppelin/contracts": "^4.8.0",
|
|
84
|
+
"@openzeppelin/contracts-upgradeable": "^4.8.0",
|
|
85
|
+
"@openzeppelin/hardhat-upgrades": "^1.22.1",
|
|
86
|
+
"@superfluid-finance/ethereum-contracts": "^1.8.1",
|
|
87
|
+
"@superfluid-finance/sdk-core": "^0.5.8",
|
|
97
88
|
"@swc/core": "1.3.96",
|
|
98
89
|
"@swc/helpers": "^0.3.16",
|
|
99
90
|
"@typechain/ethers-v5": "^11.1.1",
|
|
91
|
+
"@typechain/hardhat": "^6.1.5",
|
|
100
92
|
"@types/mocha": "*",
|
|
101
93
|
"@types/node": "*",
|
|
102
94
|
"@uniswap/v2-core": "*",
|
|
103
95
|
"@uniswap/v2-periphery": "^1.1.0-beta.0",
|
|
96
|
+
"async-promise-pool": "^1.0.4",
|
|
104
97
|
"bignumber.js": "*",
|
|
105
98
|
"bindings": "*",
|
|
106
99
|
"chai": "*",
|
|
@@ -124,12 +117,17 @@
|
|
|
124
117
|
"mocha-lcov-reporter": "*",
|
|
125
118
|
"node-fetch": "*",
|
|
126
119
|
"node-jq": "*",
|
|
120
|
+
"openzeppelin-solidity": "^4.3.2",
|
|
121
|
+
"patch-package": "latest",
|
|
122
|
+
"press-any-key": "^0.1.1",
|
|
127
123
|
"prompt": "^1.3.0",
|
|
128
124
|
"regenerator-runtime": "^0.13.9",
|
|
129
125
|
"solhint": "*",
|
|
130
126
|
"solidity-coverage": "^0.8.4",
|
|
131
127
|
"truffle": "^5.11.5",
|
|
132
128
|
"truffle-hdwallet-provider": "*",
|
|
129
|
+
"truffle-plugin-verify": "^0.6.1",
|
|
130
|
+
"truffle-source-verify": "^0.0.6",
|
|
133
131
|
"ts-generator": "^0.1.1",
|
|
134
132
|
"ts-node": "^10.9.1",
|
|
135
133
|
"typechain": "^8.3.1",
|
package/releases/deployment.json
CHANGED
|
@@ -436,9 +436,7 @@
|
|
|
436
436
|
"BuyGDFactoryV2": "0x1F60C4C7037C6766924A43666B781ED1479587a2",
|
|
437
437
|
"BulkWhitelist": "0x30Afd0534dAA29135308d048103b40dc1BA4518d"
|
|
438
438
|
},
|
|
439
|
-
"gnosis": {
|
|
440
|
-
"GuardiansSafe": "0x84c10b45fe51bfb4f86c19a47fdbc187d4572fb8"
|
|
441
|
-
},
|
|
439
|
+
"gnosis": { "GuardiansSafe": "0x84c10b45fe51bfb4f86c19a47fdbc187d4572fb8" },
|
|
442
440
|
"development-celo": {
|
|
443
441
|
"network": "development-celo",
|
|
444
442
|
"networkId": 42220,
|
|
@@ -464,7 +462,13 @@
|
|
|
464
462
|
"OneTimePaymentsV2": "0x2cb1c7d50371e277d7a36B171c0ACe9B157518EE",
|
|
465
463
|
"UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4",
|
|
466
464
|
"BuyGDFactory": "0x00e533B7d6255D05b7f15034B1c989c21F51b91C",
|
|
467
|
-
"BuyGDFactoryV2": "0x1F60C4C7037C6766924A43666B781ED1479587a2"
|
|
465
|
+
"BuyGDFactoryV2": "0x1F60C4C7037C6766924A43666B781ED1479587a2",
|
|
466
|
+
"MentoExchangeProvider": "0x02C5e6FfeC49Dca92af50A0718d2c4944DAaCb05",
|
|
467
|
+
"MentoExpansionController": "0xA354fE15A08318912D594E94DC7622C7D23Bb11A",
|
|
468
|
+
"CUSD": "0x2FFc031e855fE7C36669DC95CE00356D52195999",
|
|
469
|
+
"MentoReserve": "0x3f13b9FdB9ca8CDDa1c1E125296C8101B170C37C",
|
|
470
|
+
"MentoBroker": "0x43bC03995090E7B4E74cE70deF6bfA27D62049dC",
|
|
471
|
+
"CeloDistributionHelper": "0x4FE2400B80376a34e6a9011988d9D0D921EEf059"
|
|
468
472
|
},
|
|
469
473
|
"staging-celo": {
|
|
470
474
|
"network": "staging-celo",
|
|
@@ -491,7 +495,13 @@
|
|
|
491
495
|
"OneTimePaymentsV2": "0x963E7B4c970626Bb103c61fA16b002AFf6E6c2C7",
|
|
492
496
|
"UniswapV3Router": "0x5615CDAb10dc425a742d643d949a7F474C01abc4",
|
|
493
497
|
"BuyGDFactory": "0x00e533B7d6255D05b7f15034B1c989c21F51b91C",
|
|
494
|
-
"BuyGDFactoryV2": "0x1F60C4C7037C6766924A43666B781ED1479587a2"
|
|
498
|
+
"BuyGDFactoryV2": "0x1F60C4C7037C6766924A43666B781ED1479587a2",
|
|
499
|
+
"MentoExchangeProvider": "0x02C5e6FfeC49Dca92af50A0718d2c4944DAaCb05",
|
|
500
|
+
"MentoExpansionController": "0xA354fE15A08318912D594E94DC7622C7D23Bb11A",
|
|
501
|
+
"CUSD": "0x2FFc031e855fE7C36669DC95CE00356D52195999",
|
|
502
|
+
"MentoReserve": "0x3f13b9FdB9ca8CDDa1c1E125296C8101B170C37C",
|
|
503
|
+
"MentoBroker": "0x43bC03995090E7B4E74cE70deF6bfA27D62049dC",
|
|
504
|
+
"CeloDistributionHelper": "0x4FE2400B80376a34e6a9011988d9D0D921EEf059"
|
|
495
505
|
},
|
|
496
506
|
"development-goerli": {
|
|
497
507
|
"ProxyFactory": "0x65D8eACBCd9618b8780C4b444081915a5D54D611",
|
|
@@ -541,7 +551,62 @@
|
|
|
541
551
|
"GoodDollarMintBurnWrapper": "0x69d9c8d240E282a4ec0058CF0AC4E9D8ac7a11ac",
|
|
542
552
|
"GoodDollarStaking": "0xC9a3DdadC753e6a7675Aa125991096623d06c437"
|
|
543
553
|
},
|
|
544
|
-
"development-mainnet": {
|
|
545
|
-
|
|
554
|
+
"development-mainnet": { "networkId": 1 },
|
|
555
|
+
"test": {
|
|
556
|
+
"ProxyFactory": "0xCd7c00Ac6dc51e8dCc773971Ac9221cC582F3b1b",
|
|
557
|
+
"NameService": "0xB3d91a2650C8dB4456e96e06Bb147799338c5739",
|
|
558
|
+
"GReputation": "0xD759c30ADea571d35159302515b81473f7F0B5b3",
|
|
559
|
+
"CompoundVotingMachine": "0x07d17EcCcEE4568DE2b40cD1CB99b9984DF4519c",
|
|
560
|
+
"ClaimersDistribution": "0xA6D3dC26fC2f258d06B54EB6634077835C3C73Aa",
|
|
561
|
+
"GovernanceStaking": "0xA9e6Bfa2BF53dE88FEb19761D9b2eE2e821bF1Bf",
|
|
562
|
+
"UBIScheme": "0x16d5EF010758a483f94F3A001DeFf0ac9efF6352",
|
|
563
|
+
"ProtocolUpgradeFuse": "0x286B8DecD5ED79c962b2d8F4346CD97FF0E2C352",
|
|
564
|
+
"network": "test",
|
|
565
|
+
"networkId": 4447,
|
|
566
|
+
"HomeBridge": "0xcE0066b1008237625dDDBE4a751827de037E53D2",
|
|
567
|
+
"OneTimePayments": "0xcC4c41415fc68B2fBf70102742A83cDe435e0Ca7",
|
|
568
|
+
"AdminWallet": "0xAe120F0df055428E45b264E7794A18c54a2a3fAF",
|
|
569
|
+
"Identity": "0x87006e75a5B6bE9D1bbF61AC8Cd84f05D9140589",
|
|
570
|
+
"GoodDollar": "0x609a4341d11C29F8F5cDeF00931AdB96f76EF017",
|
|
571
|
+
"Controller": "0xd1f8C3b3C9C63a7a7f0dCFd20ae9053A04182db1",
|
|
572
|
+
"Avatar": "0xcafCfdF4517F504a473469F3723e674413EE9bce",
|
|
573
|
+
"FirstClaimPool": "0x0aec7c174554AF8aEc3680BB58431F6618311510",
|
|
574
|
+
"BancorFormula": "0x7B4f352Cd40114f12e82fC675b5BA8C7582FC513",
|
|
575
|
+
"DAI": "0xD6b040736e948621c5b6E0a494473c47a6113eA8",
|
|
576
|
+
"cDAI": "0xAdE429ba898c34722e722415D722A70a297cE3a2",
|
|
577
|
+
"COMP": "0x139e1D41943ee15dDe4DF876f9d0E7F85e26660A"
|
|
578
|
+
},
|
|
579
|
+
"test-mainnet": {
|
|
580
|
+
"ProxyFactory": "0x70E5370b8981Abc6e14C91F4AcE823954EFC8eA3",
|
|
581
|
+
"NameService": "0x50f2b544FD7af66D8a9dCF9a8d28F60c4955468D",
|
|
582
|
+
"GReputation": "0x08BC83e7cfe7DfEacAbCdC2432Cc6281ee678B46",
|
|
583
|
+
"CompoundVotingMachine": "0x6B2A2eA3b4965B2069f7112DFc5e766b10f52Bf4",
|
|
584
|
+
"GoodMarketMaker": "0x6E16fE6B78F307d78142A65CdFc3fB1c01Ed5416",
|
|
585
|
+
"GoodReserveCDai": "0xEF4c7EAD8C1aE06E76BD792785c9bed03811173B",
|
|
586
|
+
"ExchangeHelper": "0x39acC72200A9a847c2B6EFe514Db9eeE429e4B29",
|
|
587
|
+
"GoodFundManager": "0x68CC3Dc71a215bbbbc5fFeD38bc92F12d56eA835",
|
|
588
|
+
"StakersDistribution": "0x3957892fB94Ef52aB441e2BA77777F9dC8F7C501",
|
|
589
|
+
"ProtocolUpgrade": "0xa62835D1A6bf5f521C4e2746E1F51c923b8f3483",
|
|
590
|
+
"UniswapV2SwapHelper": "0x8E45C0936fa1a65bDaD3222bEFeC6a03C83372cE",
|
|
591
|
+
"CompoundStakingFactory": "0xBEe6FFc1E8627F51CcDF0b4399a1e1abc5165f15",
|
|
592
|
+
"AaveStakingFactory": "0xC32609C91d6B6b51D48f2611308FEf121B02041f",
|
|
593
|
+
"StakingContracts": [
|
|
594
|
+
["0x14aA87DEed1d13012F1C9C93ef660D88a594D289", 13888],
|
|
595
|
+
["0x47c7D4b2A310E651f846d7E8717F44414F59a7Da", "6944"]
|
|
596
|
+
],
|
|
597
|
+
"DonationsStaking": "0x0Af313Cb7928CC29Db382575b0d96969C00414EC",
|
|
598
|
+
"network": "test-mainnet",
|
|
599
|
+
"networkId": 4447,
|
|
600
|
+
"ForeignBridge": "0x02b0B4EFd909240FCB2Eb5FAe060dC60D112E3a4",
|
|
601
|
+
"Contribution": "0x40a42Baf86Fc821f972Ad2aC878729063CeEF403",
|
|
602
|
+
"Identity": "0x6C2d83262fF84cBaDb3e416D527403135D757892",
|
|
603
|
+
"GoodDollar": "0xDda88b7dF7C04D319c41B53305Cd443B1f975e29",
|
|
604
|
+
"Controller": "0xF2AdAad89d56D49C697B9907C7D66ef27d96f859",
|
|
605
|
+
"Avatar": "0xd1891dD9DFF0784baa1dEb361dDFCAa5aE49cc6F",
|
|
606
|
+
"FirstClaimPool": "0xA56F946D6398Dd7d9D4D9B337Cf9E0F68982ca5B",
|
|
607
|
+
"BancorFormula": "0x01c1DeF3b91672704716159C9041Aeca392DdFfb",
|
|
608
|
+
"DAI": "0xfcDB4564c18A9134002b9771816092C9693622e3",
|
|
609
|
+
"cDAI": "0x32EEce76C2C2e8758584A83Ee2F522D4788feA0f",
|
|
610
|
+
"COMP": "0x927b167526bAbB9be047421db732C663a0b77B11"
|
|
546
611
|
}
|
|
547
612
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { uniq } from "lodash";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import { network, ethers } from "hardhat";
|
|
4
|
+
import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
|
|
5
|
+
import release from "../../releases/deployment.json"
|
|
6
|
+
import { SimpleStakingV2 } from "../../types";
|
|
7
|
+
|
|
8
|
+
setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
|
|
9
|
+
|
|
10
|
+
setMulticallAddress(42220, "0x188C1bf697B66474dC3eaa119Ae691a8352537e3");
|
|
11
|
+
|
|
12
|
+
const main = async () => {
|
|
13
|
+
|
|
14
|
+
const c1 = await ethers.getContractAt("SimpleStakingV2", release["production-mainnet"].StakingContractsV3[0][0]) as SimpleStakingV2
|
|
15
|
+
const c2 = await ethers.getContractAt("SimpleStakingV2", release["production-mainnet"].StakingContractsV3[1][0]) as SimpleStakingV2
|
|
16
|
+
const f = c1.filters.Staked()
|
|
17
|
+
const events = await c1.queryFilter(f, 14338550)
|
|
18
|
+
const events2 = await c2.queryFilter(f, 14338550)
|
|
19
|
+
const stakers = uniq(events.concat(events2).map(_ => _.args[0]))
|
|
20
|
+
console.log(stakers)
|
|
21
|
+
const res = (await Promise.all(stakers.map(async s => [s, await c1.balanceOf(s), await c2.balanceOf(s)]))).filter(_ => _[1].gt(0) || _[2].gt(0))
|
|
22
|
+
console.log(events.length)
|
|
23
|
+
console.log(res)
|
|
24
|
+
}
|
|
25
|
+
main()
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { range, chunk, uniq } from "lodash";
|
|
2
|
-
import { ethers as Ethers } from "hardhat";
|
|
1
|
+
import { range, chunk, uniq, mapValues, groupBy } from "lodash";
|
|
2
|
+
import { ethers, ethers as Ethers } from "hardhat";
|
|
3
|
+
import fs from "fs";
|
|
4
|
+
import { bulkGetLastAuth } from "../utils";
|
|
3
5
|
|
|
4
6
|
const ONE_DAY = 24 * 60 * 60;
|
|
5
7
|
const ONE_HOUR = 60 * 60;
|
|
@@ -19,28 +21,27 @@ const main = async () => {
|
|
|
19
21
|
for (let day of daysAgo) {
|
|
20
22
|
const query = `
|
|
21
23
|
{
|
|
22
|
-
walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${
|
|
23
|
-
|
|
24
|
-
} isActiveUser: true }) {
|
|
24
|
+
walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${curDay - ONE_DAY
|
|
25
|
+
} isActiveUser: true }) {
|
|
25
26
|
id
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
`;
|
|
29
30
|
|
|
30
31
|
console.log("fetching inactive users since:", { curDay, day }, JSON.stringify({ query }));
|
|
31
|
-
const {
|
|
32
|
-
data: { walletStats }
|
|
33
|
-
} = await fetch("https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse", {
|
|
32
|
+
const result = await fetch("https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse", {
|
|
34
33
|
method: "post",
|
|
35
34
|
body: JSON.stringify({ query }),
|
|
36
35
|
headers: { "Content-Type": "application/json" }
|
|
37
36
|
}).then(_ => _.json());
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
|
|
39
|
+
console.log("got inactive wallets:", result);
|
|
40
|
+
// if (walletStats) {
|
|
41
|
+
// const accounts = walletStats.map(_ => _.id);
|
|
42
|
+
// allActive.push(...accounts);
|
|
43
|
+
// }
|
|
44
|
+
|
|
44
45
|
// for (let tofish of chunk(accounts, 50)) {
|
|
45
46
|
// const tx = await ubiScheme.fishMulti(tofish, { gasLimit: 2000000 });
|
|
46
47
|
// console.log("fishing tx:", tx, tofish);
|
|
@@ -54,32 +55,83 @@ const main = async () => {
|
|
|
54
55
|
console.log("active claimers:", unique.length);
|
|
55
56
|
};
|
|
56
57
|
|
|
58
|
+
const countClaimersUsingExplorer = async () => {
|
|
59
|
+
let claimers = [] //JSON.parse(fs.readFileSync("claimers.json").toString())
|
|
60
|
+
const curBlock = await ethers.provider.getBlockNumber()
|
|
61
|
+
const DAYS = 1
|
|
62
|
+
let fromBlock = curBlock - 60 * 60 * 24 * DAYS / 5 //roughly DAYS of blocks
|
|
63
|
+
const querySize = 90// 15 min of blocks
|
|
64
|
+
const blockRanges = range(fromBlock, curBlock, querySize)
|
|
65
|
+
const chunks = chunk(blockRanges, 10)
|
|
66
|
+
for (let idx in chunks) {
|
|
67
|
+
const toFetch = chunks[idx]
|
|
68
|
+
const ps = toFetch.map(async fromBlock => {
|
|
69
|
+
let toBlock = fromBlock + querySize
|
|
70
|
+
toBlock = toBlock > curBlock ? curBlock : toBlock
|
|
71
|
+
const result = await fetch(`https://explorer.celo.org/mainnet/api?module=logs&action=getLogs&fromBlock=${fromBlock}&toBlock=${toBlock}&address=0x43d72ff17701b2da814620735c39c620ce0ea4a1&topic0=0x89ed24731df6b066e4c5186901fffdba18cd9a10f07494aff900bdee260d1304`).then(_ => _.json())
|
|
72
|
+
fromBlock = toBlock
|
|
73
|
+
const addrs = result.result.map(_ => ethers.utils.defaultAbiCoder.decode(["address"], _.topics[1])[0])
|
|
74
|
+
claimers.push(...addrs);
|
|
75
|
+
console.log("claimers:", addrs.length, "block range:", { fromBlock, toBlock }, addrs[0])
|
|
76
|
+
})
|
|
77
|
+
await Promise.all(ps)
|
|
78
|
+
console.log(`${idx} out of ${chunks.length}`)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
claimers = uniq(claimers)
|
|
82
|
+
fs.writeFileSync("claimers.json", JSON.stringify(claimers))
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const countLastWhitelisted = async () => {
|
|
86
|
+
const claimers = JSON.parse(fs.readFileSync("claimers.json").toString())
|
|
87
|
+
const DAY = 60 * 60 * 24
|
|
88
|
+
let total = 0
|
|
89
|
+
let howOld = []
|
|
90
|
+
console.log("unique claimers:", claimers.length)
|
|
91
|
+
for (let bulk of chunk(claimers, 1000)) {
|
|
92
|
+
const results = await bulkGetLastAuth(bulk)
|
|
93
|
+
const older = results.filter(_ => _.toNumber() < Date.now() / 1000 - DAY * 180).length
|
|
94
|
+
bulk.forEach((_, i) => howOld.push([_, Math.ceil((Date.now() / 1000 - DAY * 180 - results[i].toNumber()) / (30 * DAY)).toFixed(0)]))
|
|
95
|
+
console.log(older, "out of", results.length)
|
|
96
|
+
total += older
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
howOld = howOld.filter(_ => Number(_[1]) > 0)
|
|
100
|
+
console.log({ total })
|
|
101
|
+
howOld = mapValues(groupBy(howOld, _ => _[1]), _ => _.length)
|
|
102
|
+
console.log(howOld)
|
|
103
|
+
}
|
|
104
|
+
|
|
57
105
|
const countActive = async () => {
|
|
58
|
-
const twoWeeksAgo = parseInt((Date.now() / 1000).toFixed(0)); //
|
|
59
106
|
|
|
60
|
-
const hoursAgo: number[] = range(0, 24 *
|
|
61
|
-
let curDay =
|
|
107
|
+
const hoursAgo: number[] = range(0, 24 * 30, 1);
|
|
108
|
+
let curDay = parseInt((Date.now() / 1000).toFixed(0));
|
|
62
109
|
const allActive = [];
|
|
63
110
|
for (let hour of hoursAgo) {
|
|
64
111
|
const query = `
|
|
65
112
|
{
|
|
66
|
-
walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${
|
|
67
|
-
|
|
68
|
-
} isActiveUser: true }) {
|
|
113
|
+
walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${curDay - ONE_HOUR
|
|
114
|
+
} isActiveUser: true }) {
|
|
69
115
|
id
|
|
70
116
|
}
|
|
71
117
|
}
|
|
72
118
|
`;
|
|
73
119
|
|
|
74
120
|
console.log("fetching active users since:", { curDay, hour }, JSON.stringify({ query }));
|
|
121
|
+
const result =
|
|
122
|
+
|
|
123
|
+
await fetch("https://gateway-arbitrum.network.thegraph.com/api/3c409250a317ce7b0c6a7a8b9a409ef8/subgraphs/id/F7314rxGdcpKPC1nN5KCoFW84EGRoUyzseY2sAT9PEkw", {
|
|
124
|
+
// await fetch("https://gateway.thegraph.com/api/3c409250a317ce7b0c6a7a8b9a409ef8/subgraphs/id/5cAhhzm7LSqGiFibV1odbbgZWiRmZsYjYrmaoj87UxFd", {
|
|
125
|
+
method: "post",
|
|
126
|
+
body: JSON.stringify({ query }),
|
|
127
|
+
headers: { "Content-Type": "application/json", "origin": "https://wallet.gooddollar.org" }
|
|
128
|
+
|
|
129
|
+
}).then(_ => _.json());
|
|
130
|
+
|
|
131
|
+
console.log(result)
|
|
75
132
|
const {
|
|
76
133
|
data: { walletStats }
|
|
77
|
-
} =
|
|
78
|
-
method: "post",
|
|
79
|
-
body: JSON.stringify({ query }),
|
|
80
|
-
headers: { "Content-Type": "application/json" }
|
|
81
|
-
}).then(_ => _.json());
|
|
82
|
-
|
|
134
|
+
} = result
|
|
83
135
|
console.log("got active wallets:", walletStats.length);
|
|
84
136
|
if (walletStats) {
|
|
85
137
|
const accounts = walletStats.map(_ => _.id);
|
|
@@ -99,4 +151,6 @@ const countActive = async () => {
|
|
|
99
151
|
};
|
|
100
152
|
|
|
101
153
|
//main();
|
|
102
|
-
countActive();
|
|
154
|
+
// countActive();
|
|
155
|
+
// countClaimersUsingExplorer()
|
|
156
|
+
countLastWhitelisted()
|