@gooddollar/goodprotocol 1.0.29-beta.0 → 1.0.29-beta.2
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/AdminWallet.min.json +1 -1
- package/artifacts/abis/BulkProof.min.json +1 -1
- package/artifacts/abis/DistributionBridgeMock.min.json +1 -0
- package/artifacts/abis/DistributionHelper.min.json +1 -0
- package/artifacts/abis/DistributionHelperTest.min.json +1 -0
- package/artifacts/abis/DistributionHelperTestHelper.min.json +1 -0
- package/artifacts/abis/ERC20.min.json +1 -1
- package/artifacts/abis/Faucet.min.json +1 -0
- package/artifacts/abis/GoodDollarMintBurnWrapper.min.json +1 -0
- package/artifacts/abis/GoodDollarStaking.min.json +1 -0
- package/artifacts/abis/GoodDollarStakingMock.min.json +1 -0
- package/artifacts/abis/GoodReserveCDai.min.json +1 -1
- package/artifacts/abis/IERC2917.min.json +1 -1
- package/artifacts/abis/IGoodDollar.min.json +1 -1
- package/artifacts/abis/IGoodDollarStakingTest.min.json +1 -0
- package/artifacts/abis/IGovernanceStaking.min.json +1 -0
- package/artifacts/abis/IIdentity.min.json +1 -1
- package/artifacts/abis/IIdentityV2.min.json +1 -0
- package/artifacts/abis/IMultichainRouter.min.json +1 -0
- package/artifacts/abis/IRouter.min.json +1 -0
- package/artifacts/abis/IWrapper.min.json +1 -0
- package/artifacts/abis/IdentityV2.min.json +1 -0
- package/artifacts/abis/InvitesV2.min.json +1 -0
- package/artifacts/abis/Math64x64.min.json +1 -0
- package/artifacts/abis/MultichainBridgeHelper.min.json +1 -0
- package/artifacts/abis/MultichainRouterMock.min.json +1 -0
- package/artifacts/abis/OverMintTester.min.json +1 -1
- package/artifacts/abis/PausableControl.min.json +1 -0
- package/artifacts/abis/RewardsMinter.min.json +1 -0
- package/artifacts/abis/StakingMockFixedAPY.min.json +1 -0
- package/artifacts/abis/StakingRewardsFixedAPY.min.json +1 -0
- package/artifacts/abis/TokenOperation.min.json +1 -0
- package/artifacts/abis/UBIScheme.min.json +1 -1
- package/artifacts/abis/cERC20.min.json +1 -1
- 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/ERC20.json +13 -0
- 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/IERC2917.json +13 -0
- 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/IGoodDollar.json +39 -0
- 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/IIdentity.json +51 -0
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +4 -0
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.json +281 -0
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +4 -0
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.json +67 -0
- 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/Interfaces.sol/cERC20.json +13 -0
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +4 -0
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +684 -0
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +2 -2
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +4 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +1335 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +4 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.json +24 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +4 -0
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.json +35 -0
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.json +2 -2
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.json +2 -2
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +4 -0
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +1000 -0
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +4 -0
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +586 -0
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +4 -0
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +152 -0
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +4 -0
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +662 -0
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +4 -0
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +680 -0
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +4 -0
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +1335 -0
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +2 -2
- 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 +4 -0
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.json +59 -0
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +4 -0
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +81 -0
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +4 -0
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.json +49 -0
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +4 -4
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +4 -0
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +682 -0
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
- 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/UpgradableMock.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
- 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 +4 -0
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +662 -0
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +2 -2
- 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/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +75 -35
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
- 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/GoodFundManager.sol/GoodFundManager.json +2 -2
- 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/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +4 -0
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.json +10 -0
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +4 -0
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.json +268 -0
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +15 -22
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +76 -56
- 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/BulkProof.sol/BulkProof.json +3 -34
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
- 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/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +4 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +1263 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +4 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.json +59 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +4 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.json +69 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +4 -0
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +10 -0
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +4 -0
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +79 -0
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
- 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/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
- package/contracts/Interfaces.sol +46 -0
- package/contracts/fuseFaucet/Faucet.sol +245 -0
- package/contracts/governance/GoodDollarStaking.sol +524 -0
- package/contracts/governance/MultiBaseGovernanceShareField.sol +1 -0
- package/contracts/identity/IdentityV2.sol +434 -0
- package/contracts/invite/InvitesV2.sol +316 -0
- package/contracts/mocks/DistributionBridgeMock.sol +50 -0
- package/contracts/mocks/DistributionHelperTest.sol +22 -0
- package/contracts/mocks/GoodDollarStakingMock.sol +24 -0
- package/contracts/mocks/MultichainRouterMock.sol +38 -0
- package/contracts/mocks/OverMintTester.sol +39 -25
- package/contracts/mocks/StakingMockFixedAPY.sol +78 -0
- package/contracts/reserve/DistributionHelper.sol +142 -0
- package/contracts/reserve/GoodReserveCDai.sol +95 -41
- package/contracts/staking/utils/Math64X64.sol +268 -0
- package/contracts/staking/utils/StakingRewardsFixedAPY.sol +336 -0
- package/contracts/ubi/UBIScheme.sol +45 -40
- package/contracts/utils/AdminWallet.sol +42 -11
- package/contracts/utils/BulkProof.sol +10 -10
- package/contracts/utils/GoodDollarMintBurnWrapper.sol +638 -0
- package/contracts/utils/MultichainBridgeHelper.sol +39 -0
- package/hardhat.config.ts +21 -5
- package/package.json +9 -5
- package/patches/@openzeppelin+hardhat-upgrades+1.7.0.patch.depracate +67 -0
- package/releases/deploy-settings.json +36 -1
- package/releases/deployment.json +103 -55
- package/releases/olddao.json +1 -1
- package/scripts/analytics/activeUsersCount.ts +65 -0
- package/scripts/analytics/activeWalletsStats.ts +150 -0
- package/scripts/analytics/claimIncidentStats.ts +117 -0
- package/scripts/analytics/faucetStats.ts +103 -0
- package/scripts/analytics/goodHolders.ts +50 -0
- package/scripts/{misc → analytics}/goodgiveback.ts +0 -0
- package/scripts/governance/airdropCalculation.ts +1 -0
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +45 -0
- package/scripts/multichain-deploy/{basicdao-deploy.ts → 1_basicdao-deploy.ts} +75 -56
- package/scripts/multichain-deploy/2_helpers-deploy.ts +143 -0
- package/scripts/multichain-deploy/3_gdSavings-deploy.ts +246 -0
- package/scripts/multichain-deploy/4_ubi-deploy.ts +121 -0
- package/scripts/multichain-deploy/5_gov-deploy.ts +123 -0
- package/scripts/multichain-deploy/helpers.ts +72 -8
- package/scripts/multichain-deploy/multichainWrapper-deploy.ts +56 -0
- package/scripts/multichain-deploy/verifyEtherscan.ts +84 -0
- package/scripts/test/localOldDaoDeploy.ts +10 -3
- package/scripts/upgrades/identity-upgrade.ts +153 -0
- package/scripts/upgrades/nonubiDistribution-deploy.ts +167 -0
- package/scripts/voltageswaps.ts +47 -0
- package/test/governance/ClaimersDistribution.test.ts +1 -1
- package/test/governance/GoodDollarStaking.gd.test.ts +559 -0
- package/test/governance/GoodDollarStaking.good.test.ts +998 -0
- package/test/governance/GovernanceStaking.test.ts +43 -0
- package/test/helpers.ts +21 -20
- package/test/reserve/DistributionHelper.test.ts +394 -0
- package/test/reserve/GoodReserveCDai.distribution.test.ts +296 -0
- package/test/reserve/GoodReserveCDai.gdx.test.ts +21 -16
- package/test/reserve/GoodReserveCDai.pause.test.ts +116 -0
- package/test/staking/StakingRewardsFixedAPY.test.ts +900 -0
- package/test/ubi/UBIScheme.test.ts +30 -30
- package/test/ubi/UBISchemeCycle.test.ts +9 -7
- package/test/utils/AdminWallet.test.ts +40 -13
- package/test/utils/GoodDollarMintBurnWrapper.test.ts +796 -0
- package/tsconfig.json +4 -9
- package/types/AccessControl.ts +361 -0
- package/types/AdminWallet.ts +124 -113
- package/types/CERC20.ts +25 -0
- package/types/DistributionBridgeMock.ts +251 -0
- package/types/DistributionHelper.ts +908 -0
- package/types/DistributionHelperTest.ts +909 -0
- package/types/DistributionHelperTestHelper.ts +945 -0
- package/types/ERC165.ts +104 -0
- package/types/ERC20.ts +101 -49
- package/types/Faucet.ts +1014 -0
- package/types/GoodDollarMintBurnWrapper.ts +1806 -0
- package/types/GoodDollarStaking.ts +1889 -0
- package/types/GoodDollarStakingMock.ts +1889 -0
- package/types/GoodReserveCDai.ts +90 -55
- package/types/IAccessControl.ts +306 -0
- package/types/IERC1271.ts +109 -0
- package/types/IERC165.ts +104 -0
- package/types/IERC20.ts +300 -0
- package/types/IERC20Metadata.ts +339 -0
- package/types/IERC2917.ts +25 -0
- package/types/IGoodDollar.ts +54 -0
- package/types/IGoodDollarStakingTest.ts +160 -0
- package/types/{BulkProof.ts → IGovernanceStaking.ts} +15 -28
- package/types/IIdentity.ts +75 -0
- package/types/IIdentityV2.ts +526 -0
- package/types/IMultichainRouter.ts +166 -0
- package/types/IRouter.ts +143 -0
- package/types/IWrapper.ts +143 -0
- package/types/IdentityV2.ts +1612 -0
- package/types/InvitesV2.ts +933 -0
- package/types/MultichainBridgeHelper.ts +170 -0
- package/types/MultichainRouterMock.ts +141 -0
- package/types/Pausable.ts +103 -0
- package/types/PausableControl.ts +125 -0
- package/types/RewardsMinter.ts +107 -0
- package/types/StakingMockFixedAPY.ts +995 -0
- package/types/StakingRewardsFixedAPY.ts +428 -0
- package/types/UBIScheme.ts +19 -40
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AccessControl__factory.ts +227 -0
- package/types/factories/AdminWallet__factory.ts +75 -55
- package/types/factories/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/BaseShareField__factory.ts +1 -1
- package/types/factories/CERC20__factory.ts +13 -0
- package/types/factories/ClaimersDistribution__factory.ts +1 -1
- package/types/factories/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/CompoundVotingMachine__factory.ts +1 -1
- package/types/factories/DAOContract__factory.ts +1 -1
- package/types/factories/DAOUpgradeableContract__factory.ts +1 -1
- package/types/factories/DistributionBridgeMock__factory.ts +207 -0
- package/types/factories/DistributionHelperTestHelper__factory.ts +737 -0
- package/types/factories/DistributionHelperTest__factory.ts +717 -0
- package/types/factories/DistributionHelper__factory.ts +713 -0
- package/types/factories/DonationsStaking__factory.ts +1 -1
- package/types/factories/ERC165__factory.ts +39 -0
- package/types/factories/ERC20__factory.ts +13 -0
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/Faucet__factory.ts +729 -0
- package/types/factories/FuseFaucet__factory.ts +1 -1
- package/types/factories/FuseStakingV3__factory.ts +1 -1
- package/types/factories/GReputation__factory.ts +1 -1
- package/types/factories/GoodAaveStakingV2__factory.ts +1 -1
- package/types/factories/GoodAaveStaking__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingTest__factory.ts +1 -1
- package/types/factories/GoodCompoundStakingV2__factory.ts +1 -1
- package/types/factories/GoodCompoundStaking__factory.ts +1 -1
- package/types/factories/GoodDollarMintBurnWrapper__factory.ts +1318 -0
- package/types/factories/GoodDollarStakingMock__factory.ts +1417 -0
- package/types/factories/GoodDollarStaking__factory.ts +1413 -0
- package/types/factories/GoodFundManagerTest__factory.ts +1 -1
- package/types/factories/GoodFundManager__factory.ts +1 -1
- package/types/factories/GoodMarketMaker__factory.ts +1 -1
- package/types/factories/GoodReserveCDai__factory.ts +74 -34
- package/types/factories/GovernanceStaking__factory.ts +1 -1
- package/types/factories/IAccessControl__factory.ts +198 -0
- package/types/factories/IERC1271__factory.ts +47 -0
- package/types/factories/IERC165__factory.ts +42 -0
- package/types/factories/IERC20Metadata__factory.ts +248 -0
- package/types/factories/IERC20__factory.ts +203 -0
- package/types/factories/IERC2917__factory.ts +13 -0
- package/types/factories/IGoodDollarStakingTest__factory.ts +68 -0
- package/types/factories/IGoodDollar__factory.ts +39 -0
- package/types/factories/IGovernanceStaking__factory.ts +39 -0
- package/types/factories/IIdentityV2__factory.ts +293 -0
- package/types/factories/IIdentity__factory.ts +51 -0
- package/types/factories/IMultichainRouter__factory.ts +82 -0
- package/types/factories/IRouter__factory.ts +71 -0
- package/types/factories/IWrapper__factory.ts +71 -0
- package/types/factories/IdentityV2__factory.ts +1048 -0
- package/types/factories/InvitesV1__factory.ts +1 -1
- package/types/factories/InvitesV2__factory.ts +634 -0
- package/types/factories/MultichainBridgeHelper__factory.ts +134 -0
- package/types/factories/MultichainRouterMock__factory.ts +141 -0
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/OverMintTester__factory.ts +3 -3
- package/types/factories/PausableControl__factory.ts +84 -0
- package/types/factories/Pausable__factory.ts +62 -0
- package/types/factories/ProtocolUpgradeFuseRecover__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeFuse__factory.ts +1 -1
- package/types/factories/ProtocolUpgradeRecover__factory.ts +1 -1
- package/types/factories/ProtocolUpgrade__factory.ts +1 -1
- package/types/factories/ReputationTestHelper__factory.ts +1 -1
- package/types/factories/Reputation__factory.ts +1 -1
- package/types/factories/RewardsMinter__factory.ts +47 -0
- package/types/factories/StakersDistribution__factory.ts +1 -1
- package/types/factories/StakingMockFixedAPY__factory.ts +745 -0
- package/types/factories/StakingRewardsFixedAPY__factory.ts +287 -0
- package/types/factories/SwapHelperTest__factory.ts +1 -1
- package/types/factories/UBIScheme__factory.ts +14 -21
- package/types/factories/UniswapV2SwapHelper__factory.ts +1 -1
- package/types/factories/UpgradableMock2__factory.ts +1 -1
- package/types/factories/UpgradableMock3__factory.ts +1 -1
- package/types/factories/UpgradableMock4__factory.ts +1 -1
- package/types/factories/UpgradableMock__factory.ts +1 -1
- package/types/hardhat.d.ts +279 -9
- package/types/index.ts +62 -4
- package/yarn.lock +184 -108
- package/types/factories/BulkProof__factory.ts +0 -89
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { range, chunk, uniq } from "lodash";
|
|
2
|
+
import { ethers as Ethers } from "hardhat";
|
|
3
|
+
import fetch from "node-fetch";
|
|
4
|
+
|
|
5
|
+
const ONE_DAY = 24 * 60 * 60;
|
|
6
|
+
|
|
7
|
+
const main = async () => {
|
|
8
|
+
const signer = (await Ethers.getSigners())[0];
|
|
9
|
+
console.log("signer:", signer.address);
|
|
10
|
+
const ubiScheme = new Ethers.Contract(
|
|
11
|
+
"0xD7aC544F8A570C4d8764c3AAbCF6870CBD960D0D",
|
|
12
|
+
["function fishMulti(address[] tofish)"]
|
|
13
|
+
).connect(signer);
|
|
14
|
+
const twoWeeksAgo = parseInt((Date.now() / 1000).toFixed(0)); //
|
|
15
|
+
//parseInt((Date.now() / 1000).toFixed(0)) - 24 * 60 * 60 * 14;
|
|
16
|
+
|
|
17
|
+
const daysAgo: number[] = range(0, 180, 1);
|
|
18
|
+
let curDay = twoWeeksAgo;
|
|
19
|
+
const allActive = [];
|
|
20
|
+
for (let day of daysAgo) {
|
|
21
|
+
const query = `
|
|
22
|
+
{
|
|
23
|
+
walletStats(first:1000, where: { lastClaimed_lte: ${curDay},lastClaimed_gt: ${
|
|
24
|
+
curDay - ONE_DAY
|
|
25
|
+
} isActiveUser: true }) {
|
|
26
|
+
id
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
`;
|
|
30
|
+
|
|
31
|
+
console.log(
|
|
32
|
+
"fetching inactive users since:",
|
|
33
|
+
{ curDay, day },
|
|
34
|
+
JSON.stringify({ query })
|
|
35
|
+
);
|
|
36
|
+
const {
|
|
37
|
+
data: { walletStats }
|
|
38
|
+
} = await fetch(
|
|
39
|
+
"https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse",
|
|
40
|
+
{
|
|
41
|
+
method: "post",
|
|
42
|
+
body: JSON.stringify({ query }),
|
|
43
|
+
headers: { "Content-Type": "application/json" }
|
|
44
|
+
}
|
|
45
|
+
).then(_ => _.json());
|
|
46
|
+
|
|
47
|
+
console.log("got inactive wallets:", walletStats.length);
|
|
48
|
+
if (walletStats) {
|
|
49
|
+
const accounts = walletStats.map(_ => _.id);
|
|
50
|
+
allActive.push(...accounts);
|
|
51
|
+
}
|
|
52
|
+
// for (let tofish of chunk(accounts, 50)) {
|
|
53
|
+
// const tx = await ubiScheme.fishMulti(tofish, { gasLimit: 2000000 });
|
|
54
|
+
// console.log("fishing tx:", tx, tofish);
|
|
55
|
+
// const res = await tx.wait();
|
|
56
|
+
// console.log("fishing tx result:", res);
|
|
57
|
+
// }
|
|
58
|
+
|
|
59
|
+
curDay = curDay - ONE_DAY;
|
|
60
|
+
}
|
|
61
|
+
const unique = uniq(allActive);
|
|
62
|
+
console.log("active claimers:", unique.length);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
main();
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { range, sortBy } from "lodash";
|
|
2
|
+
import fetch from "node-fetch";
|
|
3
|
+
import PromisePool from "async-promise-pool";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import { ethers } from "hardhat";
|
|
6
|
+
|
|
7
|
+
const main = async () => {
|
|
8
|
+
let result = [];
|
|
9
|
+
let balances = {};
|
|
10
|
+
let curPage = 1;
|
|
11
|
+
let maxResult;
|
|
12
|
+
// do {
|
|
13
|
+
// const pages = range(curPage, curPage + 5, 1);
|
|
14
|
+
// curPage += 5;
|
|
15
|
+
// const ps = pages.map(p =>
|
|
16
|
+
// fetch(
|
|
17
|
+
// `https://explorer.fuse.io/api?module=token&action=getTokenHolders&contractaddress=0x495d133B938596C9984d462F007B676bDc57eCEC&page=${p}&offset=10000`
|
|
18
|
+
// )
|
|
19
|
+
// .then(_ => _.json())
|
|
20
|
+
// .then(_ => _.result)
|
|
21
|
+
// );
|
|
22
|
+
// const results = await Promise.all(ps);
|
|
23
|
+
// result = result.concat(...results);
|
|
24
|
+
// maxResult = maxBy(results, "length");
|
|
25
|
+
// console.log(maxResult.length, result.length);
|
|
26
|
+
// } while (maxResult.length === 10000);
|
|
27
|
+
// result.forEach(
|
|
28
|
+
// r => (balances[r.address.toLowerCase()] = { balance: r.value, lastSeen: 0 })
|
|
29
|
+
// );
|
|
30
|
+
// fs.writeFileSync("activeWalletsBalances.json", JSON.stringify(balances));
|
|
31
|
+
|
|
32
|
+
balances = JSON.parse(
|
|
33
|
+
fs.readFileSync("activeWalletsBalances.json").toString()
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const EPOCH = 60 * 60 * 6;
|
|
37
|
+
const pool = new PromisePool({ concurrency: 30 });
|
|
38
|
+
const lastUsed = {};
|
|
39
|
+
const epochs = range(1596045730, (Date.now() / 1000).toFixed(0), EPOCH);
|
|
40
|
+
|
|
41
|
+
const graphQuery = async (start, skip) => {
|
|
42
|
+
const query = `{
|
|
43
|
+
walletStats(first: 1000 skip:${skip} where: { dateAppeared_gte: ${start} dateAppeared_lt:${
|
|
44
|
+
start + EPOCH
|
|
45
|
+
} }) {
|
|
46
|
+
id
|
|
47
|
+
dateAppeared
|
|
48
|
+
balance
|
|
49
|
+
lastTransactionTo
|
|
50
|
+
lastTransactionFrom
|
|
51
|
+
lastClaimed
|
|
52
|
+
}
|
|
53
|
+
}`;
|
|
54
|
+
// console.log({ query });
|
|
55
|
+
try {
|
|
56
|
+
const { data = {}, errors } = await fetch(
|
|
57
|
+
"https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse",
|
|
58
|
+
{
|
|
59
|
+
method: "POST",
|
|
60
|
+
headers: {
|
|
61
|
+
"Content-Type": "application/json"
|
|
62
|
+
},
|
|
63
|
+
body: JSON.stringify({ query })
|
|
64
|
+
}
|
|
65
|
+
).then(_ => _.json());
|
|
66
|
+
errors && console.log({ errors });
|
|
67
|
+
if (data?.walletStats?.length === 1000) {
|
|
68
|
+
return data.walletStats.concat(await graphQuery(start, skip + 1000));
|
|
69
|
+
}
|
|
70
|
+
return data.walletStats || [];
|
|
71
|
+
} catch (error) {
|
|
72
|
+
console.log({ query, error });
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
epochs.forEach(e => {
|
|
77
|
+
pool.add(async () => {
|
|
78
|
+
const walletStats = await graphQuery(e, 0);
|
|
79
|
+
walletStats.forEach(w => {
|
|
80
|
+
balances[w.id.toLowerCase()] = {
|
|
81
|
+
lastSeen: Math.max(
|
|
82
|
+
Number(w.lastClaimed),
|
|
83
|
+
Number(w.lastTransactionFrom),
|
|
84
|
+
Number(w.lastTransactionTo),
|
|
85
|
+
Number(w.dateAppeared)
|
|
86
|
+
),
|
|
87
|
+
balance: balances[w.id.toLowerCase()]?.balance || w.balance
|
|
88
|
+
};
|
|
89
|
+
});
|
|
90
|
+
console.log({ curDate: e, records: walletStats.length });
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
await pool.all();
|
|
95
|
+
fs.writeFileSync("activeWalletsLastUsed.json", JSON.stringify(balances));
|
|
96
|
+
// console.log({ lastUsed });
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const etl = async () => {
|
|
100
|
+
/** Convert a 2D array into a CSV string
|
|
101
|
+
*/
|
|
102
|
+
function arrayToCsv(data) {
|
|
103
|
+
return data
|
|
104
|
+
.map(
|
|
105
|
+
row =>
|
|
106
|
+
row
|
|
107
|
+
.map(String) // convert every value to String
|
|
108
|
+
.map(v => v.replaceAll('"', '""')) // escape double colons
|
|
109
|
+
.map(v => `"${v}"`) // quote it
|
|
110
|
+
.join(",") // comma-separated
|
|
111
|
+
)
|
|
112
|
+
.join("\r\n"); // rows starting on new lines
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const balances = JSON.parse(
|
|
116
|
+
fs.readFileSync("activeWalletsLastUsed.json").toString()
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
let result = [];
|
|
120
|
+
|
|
121
|
+
for (let addr in balances) {
|
|
122
|
+
const r = balances[addr];
|
|
123
|
+
if (!r.balance) {
|
|
124
|
+
continue;
|
|
125
|
+
}
|
|
126
|
+
result.push([addr, r.balance / 100, r.lastSeen, false]);
|
|
127
|
+
}
|
|
128
|
+
const top100 = result.slice(0, 100);
|
|
129
|
+
const pool = new PromisePool({ concurrency: 30 });
|
|
130
|
+
const provider = new ethers.providers.JsonRpcBatchProvider(
|
|
131
|
+
"https://rpc.fuse.io"
|
|
132
|
+
);
|
|
133
|
+
|
|
134
|
+
for (let idx in top100) {
|
|
135
|
+
pool.add(async () => {
|
|
136
|
+
const record = top100[idx];
|
|
137
|
+
let isContract =
|
|
138
|
+
(await provider.getCode(record[0]).catch(e => "0x")) !== "0x";
|
|
139
|
+
record[3] = isContract;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
await pool.all();
|
|
143
|
+
console.log({ top100 });
|
|
144
|
+
fs.writeFileSync(
|
|
145
|
+
"activeWalletsLastUsed.csv",
|
|
146
|
+
arrayToCsv(sortBy(result, _ => -Number(_[1])))
|
|
147
|
+
);
|
|
148
|
+
};
|
|
149
|
+
// main().catch(e => console.log(e));
|
|
150
|
+
etl();
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { countBy, chunk, difference, flatten, sortBy } from "lodash";
|
|
2
|
+
import fs from "fs";
|
|
3
|
+
import fetch from "node-fetch";
|
|
4
|
+
import { network, ethers, upgrades } from "hardhat";
|
|
5
|
+
import { Contract, Provider, setMulticallAddress } from "ethers-multicall";
|
|
6
|
+
import Identity from "../../artifacts/contracts/Interfaces.sol/IIdentity.json";
|
|
7
|
+
|
|
8
|
+
setMulticallAddress(122, "0x3CE6158b7278Bf6792e014FA7B4f3c6c46fe9410");
|
|
9
|
+
const CLAIM_START_BLOCK = 17896430;
|
|
10
|
+
|
|
11
|
+
const fuseProvider = new ethers.providers.JsonRpcBatchProvider(
|
|
12
|
+
"https://explorer-node.fuse.io/"
|
|
13
|
+
// "https://rpc.fuse.io"
|
|
14
|
+
);
|
|
15
|
+
const ethcallProvider = new Provider(fuseProvider, 122);
|
|
16
|
+
|
|
17
|
+
const GD_FUSE = "0x495d133b938596c9984d462f007b676bdc57ecec";
|
|
18
|
+
const IDENTITY_FUSE = "0xFa8d865A962ca8456dF331D78806152d3aC5B84F";
|
|
19
|
+
|
|
20
|
+
let gd = new ethers.Contract(
|
|
21
|
+
GD_FUSE,
|
|
22
|
+
[
|
|
23
|
+
"event Transfer(address indexed from, address indexed to, uint amount)",
|
|
24
|
+
"function balanceOf(address) view returns(uint256)"
|
|
25
|
+
],
|
|
26
|
+
fuseProvider
|
|
27
|
+
);
|
|
28
|
+
const gdMulti = new Contract(GD_FUSE, [
|
|
29
|
+
"event Transfer(address indexed from, address indexed to, uint amount)",
|
|
30
|
+
"function balanceOf(address) view returns(uint256)"
|
|
31
|
+
]);
|
|
32
|
+
|
|
33
|
+
const hasBalanceToRefund = async wallets => {
|
|
34
|
+
const chunks = chunk(wallets, 1000);
|
|
35
|
+
let balances = {};
|
|
36
|
+
for (let batch of chunks) {
|
|
37
|
+
const calls = batch.map(a => gdMulti.balanceOf(a));
|
|
38
|
+
const result = await ethcallProvider.all(calls);
|
|
39
|
+
console.log("batch:", batch.length, calls.length, result.length);
|
|
40
|
+
batch.forEach((d, i) => (balances[d] = result[i]));
|
|
41
|
+
}
|
|
42
|
+
console.log("got balances for:", Object.entries(balances).length);
|
|
43
|
+
const hasBalance = countBy(balances, v => v >= 9622260);
|
|
44
|
+
const noBalance = Object.entries(balances).filter(([k, v]) => v < 9622260);
|
|
45
|
+
console.log({ hasBalance });
|
|
46
|
+
return noBalance.map(_ => _[0]);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
const hasRefunded = async wallets => {
|
|
50
|
+
const curBlock = (await gd.provider.getBlockNumber()) - 1;
|
|
51
|
+
console.log({ curBlock });
|
|
52
|
+
let toBlock = CLAIM_START_BLOCK + 50000;
|
|
53
|
+
let refunded = [];
|
|
54
|
+
let startBlock = CLAIM_START_BLOCK;
|
|
55
|
+
while (startBlock <= curBlock) {
|
|
56
|
+
const events = await gd.queryFilter(
|
|
57
|
+
gd.filters.Transfer(
|
|
58
|
+
undefined,
|
|
59
|
+
"0xd253A5203817225e9768C05E5996d642fb96bA86"
|
|
60
|
+
),
|
|
61
|
+
startBlock,
|
|
62
|
+
toBlock
|
|
63
|
+
);
|
|
64
|
+
const accounts = events
|
|
65
|
+
.filter(e => e.args.amount >= 9622260)
|
|
66
|
+
.map(_ => _.args.from.toLowerCase());
|
|
67
|
+
refunded.push(...accounts);
|
|
68
|
+
console.log("has refunded:", {
|
|
69
|
+
startBlock,
|
|
70
|
+
toBlock,
|
|
71
|
+
accounts: accounts.length
|
|
72
|
+
});
|
|
73
|
+
toBlock = Math.min(curBlock, toBlock + 50000);
|
|
74
|
+
startBlock += 50000;
|
|
75
|
+
}
|
|
76
|
+
return refunded;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const whereIsTheMoney = async noBalance => {
|
|
80
|
+
let targets = [];
|
|
81
|
+
for (let batch of chunk(noBalance, 100)) {
|
|
82
|
+
const tos = await Promise.all(
|
|
83
|
+
batch.map(async a => {
|
|
84
|
+
const e = await gd.queryFilter(
|
|
85
|
+
gd.filters.Transfer(a),
|
|
86
|
+
CLAIM_START_BLOCK
|
|
87
|
+
);
|
|
88
|
+
const tos = e.filter(_ => _.args.amount > 1000000).map(_ => _.args.to);
|
|
89
|
+
return tos;
|
|
90
|
+
})
|
|
91
|
+
);
|
|
92
|
+
targets.push(...flatten(tos));
|
|
93
|
+
}
|
|
94
|
+
const targetCounter = countBy(targets, _ => _);
|
|
95
|
+
console.log(
|
|
96
|
+
"transfer targets:",
|
|
97
|
+
sortBy(Object.entries(targetCounter), "1").reverse()
|
|
98
|
+
);
|
|
99
|
+
};
|
|
100
|
+
const main = async () => {
|
|
101
|
+
const wallets = JSON.parse(fs.readFileSync("torefund.json").toString()).map(
|
|
102
|
+
_ => _.toLowerCase()
|
|
103
|
+
);
|
|
104
|
+
console.log("Total Claimed:", wallets.length);
|
|
105
|
+
const refunded = await hasRefunded(wallets);
|
|
106
|
+
const notRefunded = difference(wallets, refunded);
|
|
107
|
+
console.log(
|
|
108
|
+
"refunded:",
|
|
109
|
+
refunded.length,
|
|
110
|
+
"not refunded:",
|
|
111
|
+
notRefunded.length
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
const noBalanceToRefund = await hasBalanceToRefund(notRefunded);
|
|
115
|
+
await whereIsTheMoney(noBalanceToRefund);
|
|
116
|
+
};
|
|
117
|
+
main().catch(e => console.log(e));
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { range, sortBy, toPairs } from "lodash";
|
|
2
|
+
import fetch from "node-fetch";
|
|
3
|
+
import PromisePool from "async-promise-pool";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import { ethers } from "hardhat";
|
|
6
|
+
import { start } from "repl";
|
|
7
|
+
import { JsonRpcProvider } from "@ethersproject/providers";
|
|
8
|
+
import { off } from "process";
|
|
9
|
+
|
|
10
|
+
function arrayToCsv(data) {
|
|
11
|
+
return data
|
|
12
|
+
.map(
|
|
13
|
+
row =>
|
|
14
|
+
row
|
|
15
|
+
.map(String) // convert every value to String
|
|
16
|
+
.map(v => v.replaceAll('"', '""')) // escape double colons
|
|
17
|
+
.map(v => `"${v}"`) // quote it
|
|
18
|
+
.join(",") // comma-separated
|
|
19
|
+
)
|
|
20
|
+
.join("\r\n"); // rows starting on new lines
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const main = async () => {
|
|
24
|
+
const archive = new JsonRpcProvider("https://explorer-node.fuse.io");
|
|
25
|
+
const blockStep = 10000;
|
|
26
|
+
const pool = new PromisePool({ concurrency: 10 });
|
|
27
|
+
|
|
28
|
+
let faucet = await ethers.getContractAt(
|
|
29
|
+
["event WalletTopped(address indexed user, uint256 amount)"],
|
|
30
|
+
"0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9"
|
|
31
|
+
);
|
|
32
|
+
const endBlock = Number(await ethers.provider.getBlockNumber());
|
|
33
|
+
const daysBack = 30;
|
|
34
|
+
const dayBlocks = 12 * 60 * 24;
|
|
35
|
+
const startBlock = endBlock - dayBlocks * daysBack;
|
|
36
|
+
const days = range(startBlock, endBlock, dayBlocks);
|
|
37
|
+
const dailyBalance = [];
|
|
38
|
+
for (let day of days) {
|
|
39
|
+
dailyBalance.push(
|
|
40
|
+
(
|
|
41
|
+
await archive.getBalance(
|
|
42
|
+
"0x01ab5966C1d742Ae0CFF7f14cC0F4D85156e83d9",
|
|
43
|
+
day
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
.div(1e10)
|
|
47
|
+
.toNumber() / 1e8
|
|
48
|
+
);
|
|
49
|
+
}
|
|
50
|
+
let curBlock = startBlock;
|
|
51
|
+
|
|
52
|
+
const toppingsByAddress = {};
|
|
53
|
+
const toppingsByAmount = {};
|
|
54
|
+
let totalToppings = 0;
|
|
55
|
+
let totalAmount = 0;
|
|
56
|
+
console.log({ dailyBalance });
|
|
57
|
+
console.log({ startBlock, endBlock });
|
|
58
|
+
while (curBlock <= endBlock) {
|
|
59
|
+
const fromBlock = curBlock;
|
|
60
|
+
const toBlock = Math.min(fromBlock + blockStep, endBlock);
|
|
61
|
+
pool.add(async () => {
|
|
62
|
+
const f = faucet.filters.WalletTopped();
|
|
63
|
+
const events = await faucet
|
|
64
|
+
.queryFilter(f, fromBlock, toBlock)
|
|
65
|
+
.catch(e => {
|
|
66
|
+
console.log("failed", { fromBlock, toBlock });
|
|
67
|
+
return [];
|
|
68
|
+
});
|
|
69
|
+
events.forEach(e => {
|
|
70
|
+
totalToppings += 1;
|
|
71
|
+
totalAmount += Number(e.args.amount);
|
|
72
|
+
toppingsByAddress[e.args.user] =
|
|
73
|
+
(toppingsByAddress[e.args.user] || 0) + 1;
|
|
74
|
+
toppingsByAmount[e.args.amount] =
|
|
75
|
+
(toppingsByAmount[e.args.amount] || 0) + 1;
|
|
76
|
+
});
|
|
77
|
+
console.log("fetched events", {
|
|
78
|
+
fromBlock,
|
|
79
|
+
toBlock,
|
|
80
|
+
events: events.length
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
curBlock += blockStep;
|
|
84
|
+
}
|
|
85
|
+
await pool.all();
|
|
86
|
+
|
|
87
|
+
const topToppers = sortBy(toPairs(toppingsByAddress), "1").reverse();
|
|
88
|
+
const topAmounts = sortBy(toPairs(toppingsByAmount), "1").reverse();
|
|
89
|
+
const totalWallets = topToppers.length;
|
|
90
|
+
|
|
91
|
+
const avgToppingsPerWallet = totalToppings / totalWallets;
|
|
92
|
+
const avgToppingAmount = totalAmount / totalToppings;
|
|
93
|
+
|
|
94
|
+
fs.writeFileSync("topToppers.csv", arrayToCsv(topToppers));
|
|
95
|
+
fs.writeFileSync("topAmounts.csv", arrayToCsv(topAmounts));
|
|
96
|
+
console.log({
|
|
97
|
+
totalAmount,
|
|
98
|
+
totalToppings,
|
|
99
|
+
avgToppingsPerWallet,
|
|
100
|
+
avgToppingAmount
|
|
101
|
+
});
|
|
102
|
+
};
|
|
103
|
+
main().catch(e => console.log(e));
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { last, range, sortBy } from "lodash";
|
|
2
|
+
import fetch from "node-fetch";
|
|
3
|
+
import PromisePool from "async-promise-pool";
|
|
4
|
+
import fs from "fs";
|
|
5
|
+
import { ethers } from "hardhat";
|
|
6
|
+
|
|
7
|
+
const main = async () => {
|
|
8
|
+
let result = [];
|
|
9
|
+
let balances = {};
|
|
10
|
+
let lastAddr = ethers.constants.AddressZero;
|
|
11
|
+
|
|
12
|
+
const graphQuery = async (start, skip) => {
|
|
13
|
+
const query = `{
|
|
14
|
+
goodBalances(first:1000 orderBy:id orderDirection: asc where:{id_gt:"${start}" }) {
|
|
15
|
+
id
|
|
16
|
+
coreBalance
|
|
17
|
+
totalVotes
|
|
18
|
+
}
|
|
19
|
+
}`;
|
|
20
|
+
// console.log({ query });
|
|
21
|
+
try {
|
|
22
|
+
const { data = {}, errors } = await fetch(
|
|
23
|
+
"https://api.thegraph.com/subgraphs/name/gooddollar/gooddollarfuse2",
|
|
24
|
+
{
|
|
25
|
+
method: "POST",
|
|
26
|
+
headers: {
|
|
27
|
+
"Content-Type": "application/json"
|
|
28
|
+
},
|
|
29
|
+
body: JSON.stringify({ query })
|
|
30
|
+
}
|
|
31
|
+
).then(_ => _.json());
|
|
32
|
+
errors && console.log({ errors });
|
|
33
|
+
if (data?.goodBalances?.length === 1000) {
|
|
34
|
+
const nextAddr = last(data?.goodBalances).id;
|
|
35
|
+
console.log("fetching next page:", nextAddr);
|
|
36
|
+
return data.goodBalances.concat(await graphQuery(nextAddr, 0));
|
|
37
|
+
}
|
|
38
|
+
return data.goodBalances || [];
|
|
39
|
+
} catch (error) {
|
|
40
|
+
console.log({ query, error });
|
|
41
|
+
return [];
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const goodBalances = await graphQuery(lastAddr, 0);
|
|
45
|
+
console.log("goodBalances:", goodBalances.length);
|
|
46
|
+
fs.writeFileSync("goodBalances.json", JSON.stringify(goodBalances));
|
|
47
|
+
// console.log({ lastUsed });
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
main().catch(e => console.log(e));
|
|
File without changes
|
|
@@ -1209,6 +1209,7 @@ export const airdrop = (
|
|
|
1209
1209
|
const getProof = addr => {
|
|
1210
1210
|
const { treeData, merkleRoot } = JSON.parse(
|
|
1211
1211
|
fs.readFileSync("airdrop/airdrop.json").toString()
|
|
1212
|
+
// fs.readFileSync("airdrop/airdropPrev.json").toString()
|
|
1212
1213
|
);
|
|
1213
1214
|
|
|
1214
1215
|
let entries = Object.entries(treeData as Tree);
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
2
|
+
import { Contract } from "ethers";
|
|
3
|
+
|
|
4
|
+
import { deployDeterministic, printDeploy } from "./helpers";
|
|
5
|
+
import releaser from "../../scripts/releaser";
|
|
6
|
+
import dao from "../../releases/deployment.json";
|
|
7
|
+
|
|
8
|
+
const { name } = network;
|
|
9
|
+
|
|
10
|
+
export const deployProxy = async (defaultAdmin = null) => {
|
|
11
|
+
let release: { [key: string]: any } = dao[network.name] || {};
|
|
12
|
+
|
|
13
|
+
if (network.name.match(/production|staging|fuse/) && release.ProxyFactory) {
|
|
14
|
+
throw new Error("ProxyFactory already exists for env");
|
|
15
|
+
}
|
|
16
|
+
let [root] = await ethers.getSigners();
|
|
17
|
+
//generic call permissions
|
|
18
|
+
let schemeMock = root;
|
|
19
|
+
|
|
20
|
+
console.log("got signers:", {
|
|
21
|
+
network,
|
|
22
|
+
root: root.address,
|
|
23
|
+
schemeMock: schemeMock.address,
|
|
24
|
+
balance: await ethers.provider
|
|
25
|
+
.getBalance(root.address)
|
|
26
|
+
.then(_ => _.toString())
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const proxyFactory = await (
|
|
30
|
+
await ethers.getContractFactory("ProxyFactory1967")
|
|
31
|
+
).deploy();
|
|
32
|
+
|
|
33
|
+
release = {
|
|
34
|
+
ProxyFactory: proxyFactory.address
|
|
35
|
+
};
|
|
36
|
+
await releaser(release, network.name, "deployment", false);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const main = async (networkName = name) => {
|
|
40
|
+
await deployProxy().catch(console.log);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
if (process.argv[1].includes("proxyFactory-deploy")) {
|
|
44
|
+
main();
|
|
45
|
+
}
|