@gooddollar/goodprotocol 2.0.5-beta.5 → 2.0.5-beta.7
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/Faucet.min.json +1 -1
- package/artifacts/abis/FuseFaucetV2.min.json +1 -1
- package/artifacts/abis/IFirstClaimPool.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/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/IFirstClaimPool.json +7 -0
- 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/Faucet.sol/Faucet.json +28 -9
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +28 -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 +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
- 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/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 +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +2 -2
- 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/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +2 -2
- 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/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
- 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/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.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 +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
- 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/OverMintTester.sol/OverMintTester.json +2 -2
- 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/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/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 +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +2 -2
- 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 +2 -2
- 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 +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/FeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.json +2 -2
- 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/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
- 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/UUPSProxy.json +2 -2
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.json +2 -2
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +2 -2
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +2 -2
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +2 -2
- 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 +2 -2
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
- 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 +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -2
- 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/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
- 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/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
- 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/OneTimePayments.sol/OneTimePayments.json +2 -2
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.json +2 -2
- 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 -61
- package/contracts/fuseFaucet/Faucet.sol +9 -8
- package/contracts/fuseFaucet/FuseFaucetV2.sol +16 -9
- package/contracts/invite/InvitesFuseV2.sol +1 -1
- package/contracts/invite/InvitesV2.sol +20 -30
- package/contracts/token/superfluid/UUPSProxy.sol +1 -1
- package/package.json +2 -2
- package/releases/deployment.json +4 -2
- package/scripts/multichain-deploy/helpers.ts +13 -2
- package/scripts/proposals/gip-14_1.ts +255 -0
- package/scripts/proposals/gips-14_1.md +29 -0
- package/test/faucet/Faucet.test.ts +166 -130
- package/types/Faucet.ts +50 -21
- package/types/FuseFaucetV2.ts +50 -0
- package/types/IFirstClaimPool.ts +21 -0
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AdminWalletFuse__factory.ts +1 -1
- package/types/factories/AdminWallet__factory.ts +1 -1
- package/types/factories/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/BaseShareField__factory.ts +1 -1
- package/types/factories/BuyAndBridgeHelper__factory.ts +1 -1
- 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 +1 -1
- package/types/factories/DistributionHelperTestHelper__factory.ts +1 -1
- package/types/factories/DistributionHelperTest__factory.ts +1 -1
- package/types/factories/DistributionHelper__factory.ts +1 -1
- package/types/factories/DonationsStaking__factory.ts +1 -1
- package/types/factories/ExchangeHelper__factory.ts +1 -1
- package/types/factories/Faucet__factory.ts +27 -8
- package/types/factories/FuseFaucetV2__factory.ts +27 -1
- 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 +1 -1
- package/types/factories/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/GoodDollarStaking__factory.ts +1 -1
- package/types/factories/GoodDollar__factory.ts +1 -1
- 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 +1 -1
- package/types/factories/GovernanceStaking__factory.ts +1 -1
- package/types/factories/IFirstClaimPool__factory.ts +7 -0
- package/types/factories/IdentityMock__factory.ts +1 -1
- package/types/factories/IdentityV2__factory.ts +1 -1
- package/types/factories/InvitesFuseV2__factory.ts +1 -1
- package/types/factories/InvitesV1__factory.ts +1 -1
- package/types/factories/InvitesV2__factory.ts +1 -1
- package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/OneTimePaymentsV2__factory.ts +1 -1
- package/types/factories/OneTimePayments__factory.ts +1 -1
- package/types/factories/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/OverMintTester__factory.ts +1 -1
- 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/StakersDistribution__factory.ts +1 -1
- package/types/factories/SuperGoodDollar__factory.ts +1 -1
- package/types/factories/SwapHelperTest__factory.ts +1 -1
- package/types/factories/UBIScheme__factory.ts +1 -1
- package/types/factories/UUPSProxy__factory.ts +1 -1
- 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/yarn.lock +4 -4
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* increase rate of UBI distribution on Celo
|
|
3
|
+
* also includes old foundation funds transfers from firstclaimpool and avatar towards initial topping of the UBI pool for the launch campaign
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import { ethers, network } from "hardhat";
|
|
7
|
+
import { defaultsDeep } from "lodash";
|
|
8
|
+
import prompt from "prompt";
|
|
9
|
+
import { reset } from "@nomicfoundation/hardhat-network-helpers";
|
|
10
|
+
|
|
11
|
+
import { executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
|
|
12
|
+
|
|
13
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
14
|
+
|
|
15
|
+
import dao from "../../releases/deployment.json";
|
|
16
|
+
|
|
17
|
+
const { name: networkName } = network;
|
|
18
|
+
|
|
19
|
+
export const step1 = async () => {
|
|
20
|
+
const isProduction = networkName.includes("production");
|
|
21
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
22
|
+
|
|
23
|
+
if (isProduction) verifyProductionSigner(root);
|
|
24
|
+
|
|
25
|
+
let networkEnv = networkName.split("-")[0];
|
|
26
|
+
const isForkSimulation = networkName === "localhost";
|
|
27
|
+
if (isForkSimulation) networkEnv = "production";
|
|
28
|
+
const fuseNetwork = networkEnv;
|
|
29
|
+
|
|
30
|
+
if (networkEnv === "fuse") networkEnv = "development";
|
|
31
|
+
const celoNetwork = networkEnv + "-celo";
|
|
32
|
+
const mainnetNetwork = `${networkName === "localhost" ? "production" : networkName}-mainnet`; //simulate production on localhost requires running hardhat node in fork mode
|
|
33
|
+
|
|
34
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
35
|
+
|
|
36
|
+
if (isForkSimulation)
|
|
37
|
+
// fund safe with eth so we can simulate TXs
|
|
38
|
+
await root.sendTransaction({ to: dao[mainnetNetwork].GuardiansSafe, value: ethers.constants.WeiPerEther });
|
|
39
|
+
|
|
40
|
+
console.log("got signers:", {
|
|
41
|
+
networkName,
|
|
42
|
+
root: root.address,
|
|
43
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
|
|
44
|
+
mainnetNetwork,
|
|
45
|
+
fuseNetwork,
|
|
46
|
+
celoNetwork
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const proposalContracts = [
|
|
50
|
+
dao[mainnetNetwork].GoodReserveCDai, // update the nonubi bps to 55%. 10% community fund + 45% celo ubi
|
|
51
|
+
dao[mainnetNetwork].DistributionHelper, //set community fund to 0.1818 so it gets 10% from 55%
|
|
52
|
+
dao[mainnetNetwork].DistributionHelper //set celo ubi to 0.8182 so it gets 45% from 55%
|
|
53
|
+
];
|
|
54
|
+
|
|
55
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
56
|
+
|
|
57
|
+
const proposalFunctionSignatures = [
|
|
58
|
+
"setDistributionHelper(address,uint32)",
|
|
59
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))",
|
|
60
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))"
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
const proposalFunctionInputs = [
|
|
64
|
+
ethers.utils.defaultAbiCoder.encode(["address", "uint32"], [dao[mainnetNetwork].DistributionHelper, 5500]),
|
|
65
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
66
|
+
["uint32", "uint32", "address", "uint8"],
|
|
67
|
+
[8182, 42220, dao[celoNetwork].UBIScheme, 1]
|
|
68
|
+
),
|
|
69
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
70
|
+
["uint32", "uint32", "address", "uint8"],
|
|
71
|
+
[1818, 122, dao[fuseNetwork].CommunitySafe, 0] //community safe on fuse
|
|
72
|
+
)
|
|
73
|
+
];
|
|
74
|
+
|
|
75
|
+
if (isProduction) {
|
|
76
|
+
await executeViaSafe(
|
|
77
|
+
proposalContracts,
|
|
78
|
+
proposalEthValues,
|
|
79
|
+
proposalFunctionSignatures,
|
|
80
|
+
proposalFunctionInputs,
|
|
81
|
+
protocolSettings.guardiansSafe,
|
|
82
|
+
"mainnet"
|
|
83
|
+
);
|
|
84
|
+
} else {
|
|
85
|
+
await executeViaGuardian(
|
|
86
|
+
proposalContracts,
|
|
87
|
+
proposalEthValues,
|
|
88
|
+
proposalFunctionSignatures,
|
|
89
|
+
proposalFunctionInputs,
|
|
90
|
+
isForkSimulation ? await ethers.getImpersonatedSigner(dao[mainnetNetwork].GuardiansSafe) : root,
|
|
91
|
+
mainnetNetwork
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
if (isForkSimulation) {
|
|
96
|
+
const reserve = await ethers.getContractAt("GoodReserveCDai", dao[mainnetNetwork].GoodReserveCDai);
|
|
97
|
+
//verify balance of avatar is 0
|
|
98
|
+
const events = await reserve.queryFilter(reserve.filters.DistributionHelperSet(), -10);
|
|
99
|
+
console.log({ events });
|
|
100
|
+
console.assert(events[0].args?.bps === 5500, "wrong bps");
|
|
101
|
+
const helper = await ethers.getContractAt("DistributionHelper", dao[mainnetNetwork].DistributionHelper);
|
|
102
|
+
const helperEvents = await helper.queryFilter(helper.filters.RecipientUpdated(), -10);
|
|
103
|
+
console.log(
|
|
104
|
+
"helperEvents",
|
|
105
|
+
helperEvents.map(_ => _.args)
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
//verify multichain bridge did burn
|
|
109
|
+
console.assert(
|
|
110
|
+
helperEvents.find(
|
|
111
|
+
_ =>
|
|
112
|
+
_.args?.recipient[0] === 1818 &&
|
|
113
|
+
_.args?.recipient[2] == dao[fuseNetwork].CommunitySafe &&
|
|
114
|
+
_.args?.recipient[1] === 122 &&
|
|
115
|
+
_.args?.recipient[3] === 0
|
|
116
|
+
),
|
|
117
|
+
"wrong community pool bps"
|
|
118
|
+
);
|
|
119
|
+
console.assert(
|
|
120
|
+
helperEvents.find(
|
|
121
|
+
_ =>
|
|
122
|
+
_.args?.recipient[0] === 8182 &&
|
|
123
|
+
_.args?.recipient[2] == dao[celoNetwork].UBIScheme &&
|
|
124
|
+
_.args?.recipient[1] === 42220 &&
|
|
125
|
+
_.args?.recipient[3] === 1
|
|
126
|
+
),
|
|
127
|
+
"wrong celo ubi pool bps"
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export const step2 = async () => {
|
|
133
|
+
const isProduction = networkName.includes("production");
|
|
134
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
135
|
+
|
|
136
|
+
if (isProduction) verifyProductionSigner(root);
|
|
137
|
+
|
|
138
|
+
let networkEnv = networkName.split("-")[0];
|
|
139
|
+
const isForkSimulation = networkName === "localhost";
|
|
140
|
+
if (isForkSimulation) networkEnv = "production";
|
|
141
|
+
const fuseNetwork = networkEnv;
|
|
142
|
+
|
|
143
|
+
if (networkEnv === "fuse") networkEnv = "development";
|
|
144
|
+
const celoNetwork = networkEnv + "-celo";
|
|
145
|
+
const mainnetNetwork = `${networkName === "localhost" ? "production" : networkName}-mainnet`; //simulate production on localhost requires running hardhat node in fork mode
|
|
146
|
+
|
|
147
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
148
|
+
|
|
149
|
+
if (isForkSimulation)
|
|
150
|
+
// fund safe with eth so we can simulate TXs
|
|
151
|
+
await root.sendTransaction({ to: dao[fuseNetwork].GuardiansSafe, value: ethers.constants.WeiPerEther });
|
|
152
|
+
|
|
153
|
+
console.log("got signers:", {
|
|
154
|
+
networkName,
|
|
155
|
+
root: root.address,
|
|
156
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
|
|
157
|
+
mainnetNetwork,
|
|
158
|
+
fuseNetwork,
|
|
159
|
+
celoNetwork
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
const fuseProposalContracts = [
|
|
163
|
+
dao[fuseNetwork].FirstClaimPool, // end the pool to get locked funds
|
|
164
|
+
dao[fuseNetwork].GoodDollar, //approve multichain wrapper
|
|
165
|
+
dao[fuseNetwork].MultichainRouter //anyswapout
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
const fuseProposalEthValues = fuseProposalContracts.map(_ => 0);
|
|
169
|
+
|
|
170
|
+
const fuseProposalFunctionSignatures = [
|
|
171
|
+
"end()",
|
|
172
|
+
// "transferAndCall(address,uint256,bytes)"//transferAndcall not working in simulation. using aprrove+anyswapout
|
|
173
|
+
"approve(address,uint256)",
|
|
174
|
+
"anySwapOut(address,address,uint256,uint256)"
|
|
175
|
+
];
|
|
176
|
+
|
|
177
|
+
const gd = await ethers.getContractAt("GoodDollar", dao[fuseNetwork].GoodDollar);
|
|
178
|
+
const aBalance = await gd.balanceOf(dao[fuseNetwork].Avatar);
|
|
179
|
+
const bBalance = await gd.balanceOf(dao[fuseNetwork].FirstClaimPool);
|
|
180
|
+
|
|
181
|
+
console.log("balances to bridge:", aBalance.toString(), bBalance.toString());
|
|
182
|
+
const fuseProposalFunctionInputs = [
|
|
183
|
+
ethers.utils.defaultAbiCoder.encode([], []),
|
|
184
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
185
|
+
["address", "uint256"],
|
|
186
|
+
[dao[fuseNetwork].GoodDollarMintBurnWrapper, aBalance.add(bBalance)]
|
|
187
|
+
),
|
|
188
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
189
|
+
["address", "address", "uint256", "uint256"],
|
|
190
|
+
[dao[fuseNetwork].GoodDollarMintBurnWrapper, dao[celoNetwork].UBIScheme, aBalance.add(bBalance), 42220]
|
|
191
|
+
)
|
|
192
|
+
|
|
193
|
+
//transferAndCall isnt working in simualation for some reason
|
|
194
|
+
// ethers.utils.defaultAbiCoder.encode(
|
|
195
|
+
// ["address", "uint256", "bytes"],
|
|
196
|
+
// [
|
|
197
|
+
// dao[fuseNetwork].GoodDollarMintBurnWrapper,
|
|
198
|
+
// aBalance.add(bBalance),
|
|
199
|
+
// ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [dao[celoNetwork].UBIScheme, 42220])
|
|
200
|
+
// ] //target ubipool on celo for multichain bridge
|
|
201
|
+
// )
|
|
202
|
+
];
|
|
203
|
+
|
|
204
|
+
const totalSupplyBefore = await gd.totalSupply();
|
|
205
|
+
if (isProduction) {
|
|
206
|
+
await executeViaSafe(
|
|
207
|
+
fuseProposalContracts,
|
|
208
|
+
fuseProposalEthValues,
|
|
209
|
+
fuseProposalFunctionSignatures,
|
|
210
|
+
fuseProposalFunctionInputs,
|
|
211
|
+
protocolSettings.guardiansSafe,
|
|
212
|
+
"fuse"
|
|
213
|
+
);
|
|
214
|
+
} else {
|
|
215
|
+
await executeViaGuardian(
|
|
216
|
+
fuseProposalContracts,
|
|
217
|
+
fuseProposalEthValues,
|
|
218
|
+
fuseProposalFunctionSignatures,
|
|
219
|
+
fuseProposalFunctionInputs,
|
|
220
|
+
isForkSimulation ? await ethers.getImpersonatedSigner(dao[fuseNetwork].GuardiansSafe) : root,
|
|
221
|
+
fuseNetwork
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
if (isForkSimulation) {
|
|
226
|
+
//verify balance of avatar is 0
|
|
227
|
+
console.assert((await gd.balanceOf(dao[fuseNetwork].Avatar)).eq(0), await gd.balanceOf(dao[fuseNetwork].Avatar));
|
|
228
|
+
//verify multichain bridge did burn
|
|
229
|
+
console.assert((await gd.totalSupply()).lt(totalSupplyBefore), "bridge didnt burn G$s");
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
export const main = async () => {
|
|
234
|
+
prompt.start();
|
|
235
|
+
const { stepNumber } = await prompt.get(["stepNumber"]);
|
|
236
|
+
|
|
237
|
+
console.log("running step:", { stepNumber });
|
|
238
|
+
switch (stepNumber) {
|
|
239
|
+
case "1":
|
|
240
|
+
await reset("https://cloudflare-eth.com");
|
|
241
|
+
await step1();
|
|
242
|
+
break;
|
|
243
|
+
|
|
244
|
+
//to simulate run first
|
|
245
|
+
//npx hardhat node --fork https://rpc.fuse.io
|
|
246
|
+
//then run npx hardhat run scripts/proposals/gip-14_1.ts --network localhost
|
|
247
|
+
case "2":
|
|
248
|
+
await reset("https://rpc.fuse.io");
|
|
249
|
+
await step2();
|
|
250
|
+
break;
|
|
251
|
+
}
|
|
252
|
+
// await upgrade().catch(console.log);
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
main();
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## Mainnet on-chain proposal
|
|
2
|
+
|
|
3
|
+
- On mainnet we send 10% to community pool and 50% of the remaining 90% (ie 45%) to the Celo UBI Pool, so in total its 55% we distribute via the distribution helper.
|
|
4
|
+
- 10% of the 55% is 0.1818 or 1818 in bps
|
|
5
|
+
- 45% of the 55% is 0.8182 or 8182 in bps
|
|
6
|
+
|
|
7
|
+
| contract | method | arguments |
|
|
8
|
+
| -------------------------------------------------------------- | --------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
|
|
9
|
+
| Reserve: 0xa150a825d425B36329D8294eeF8bD0fE68f8F6E0 | setDistributionHelper(DistributionHelper \_helper, uin32 \_bps) | (DistributionHelper:"0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0",5500) |
|
|
10
|
+
| DistributionHelper: 0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0 | addOrUpdateRecipient(DistributionRecipient memory \_recipient) | {bps: 8182, chainId: 42220, addr: CeloUBIScheme:'0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1', transferType: 1} |
|
|
11
|
+
| DistributionHelper: 0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0 | addOrUpdateRecipient(DistributionRecipient memory \_recipient) | {bps: 1818, chainId: 122, addr: FuseCommunitySafe:'0x5Eb5f5fE13d1D5e6440DbD5913412299Bc5B5564', transferType: 0} |
|
|
12
|
+
|
|
13
|
+
## Fuse on-chain proposal
|
|
14
|
+
|
|
15
|
+
- On fuse we collect funds from FirstClaimPool and then transfer these funds + older funds in Avatar (also from older FirstClaimPool/Invite contracts funded by GoodLabs) to the UBI Pool on Celo via the multichain bridge
|
|
16
|
+
|
|
17
|
+
| contract | method | arguments |
|
|
18
|
+
| ------------------------------------------------------------ | ------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
19
|
+
| FirstClaimPool: 0x18BcdF79A724648bF34eb06701be81bD072A2384 | end() | |
|
|
20
|
+
| GoodDollar: 0x495d133B938596C9984d462F007B676bDc57eCEC | approve(address spender,uint256 amount) | (GoodDollarMintBurnWrapper:"0x031b2B7C7854dd8EE9C4A644D7e54aD17F56e3cB",128069283 + 463420500) |
|
|
21
|
+
| MultichainRouter: 0xAcadA0C9795fdBb6921AE96c4D7Db2F8B8c52Fd0 | function anySwapOut(address token,address to,uint256 amount,uint256 toChainID) | (GoodDollarMintBurnWrapper:"0x031b2B7C7854dd8EE9C4A644D7e54aD17F56e3cB",CeloUBIScheme:"0x43d72Ff17701B2DA814620735C39C620Ce0ea4A1",128069283 + 463420500,42220) |
|
|
22
|
+
|
|
23
|
+
## To Test/Simulate on a forked chain
|
|
24
|
+
|
|
25
|
+
- `npx hardhat node --fork https://rpc.fuse.io &`
|
|
26
|
+
- `npx hardhat run scripts/proposals/gip-14_1.ts --network localhost`
|
|
27
|
+
- Choose step:
|
|
28
|
+
1: run mainnet proposal
|
|
29
|
+
2: run fuse proposal
|
|
@@ -1,158 +1,194 @@
|
|
|
1
1
|
import hre, { ethers, upgrades } from "hardhat";
|
|
2
2
|
import { loadFixture } from "@nomicfoundation/hardhat-network-helpers";
|
|
3
3
|
import { expect } from "chai";
|
|
4
|
-
import { Faucet, IGoodDollar, IIdentity } from "../../types";
|
|
4
|
+
import { Faucet, FuseFaucetV2, IGoodDollar, IIdentity } from "../../types";
|
|
5
5
|
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/dist/src/signer-with-address";
|
|
6
6
|
import { createDAO } from "../helpers";
|
|
7
7
|
|
|
8
8
|
const BN = ethers.BigNumber;
|
|
9
|
-
|
|
10
|
-
describe(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
9
|
+
["FuseFaucetV2", "Faucet"].forEach(factory => {
|
|
10
|
+
describe(factory, () => {
|
|
11
|
+
let faucet: FuseFaucetV2 | Faucet, founder: SignerWithAddress, fuseFaucet: FuseFaucetV2, faucets;
|
|
12
|
+
let user1 = ethers.Wallet.createRandom().connect(ethers.provider);
|
|
13
|
+
let user2 = ethers.Wallet.createRandom().connect(ethers.provider);
|
|
14
|
+
let signers;
|
|
15
|
+
|
|
16
|
+
let avatar, gd: IGoodDollar, Controller, id: IIdentity;
|
|
17
|
+
|
|
18
|
+
const cleanFixture = async () => {};
|
|
19
|
+
before(async () => {
|
|
20
|
+
[founder, ...signers] = await ethers.getSigners();
|
|
21
|
+
|
|
22
|
+
const FuseFaucetF = await ethers.getContractFactory(factory);
|
|
23
|
+
|
|
24
|
+
let { daoCreator, controller, avatar: av, gd: gooddollar, identity, nameService } = await loadFixture(createDAO);
|
|
25
|
+
|
|
26
|
+
Controller = controller;
|
|
27
|
+
avatar = av;
|
|
28
|
+
|
|
29
|
+
// await daoCreator.setSchemes(
|
|
30
|
+
// avatar,
|
|
31
|
+
// [identity],
|
|
32
|
+
// [ethers.constants.HashZero],
|
|
33
|
+
// ["0x0000001F"],
|
|
34
|
+
// ""
|
|
35
|
+
// );
|
|
36
|
+
|
|
37
|
+
// faucet = (await upgrades.deployProxy(
|
|
38
|
+
// FuseFaucetF,
|
|
39
|
+
// [nameService.address, 1e10, signers[0].address, founder.address],
|
|
40
|
+
// {
|
|
41
|
+
// kind: "uups"
|
|
42
|
+
// }
|
|
43
|
+
// )) as Faucet;
|
|
44
|
+
|
|
45
|
+
faucet = (await upgrades.deployProxy(
|
|
46
|
+
await ethers.getContractFactory("FuseFaucetV2"),
|
|
47
|
+
[nameService.address, 1e10, signers[0].address, 1000000],
|
|
48
|
+
{
|
|
49
|
+
kind: "transparent"
|
|
50
|
+
}
|
|
51
|
+
)) as FuseFaucetV2;
|
|
52
|
+
|
|
53
|
+
gd = (await ethers.getContractAt("IGoodDollar", gooddollar, founder)) as IGoodDollar;
|
|
54
|
+
id = (await ethers.getContractAt("IIdentity", identity, founder)) as IIdentity;
|
|
55
|
+
|
|
56
|
+
await founder.sendTransaction({
|
|
57
|
+
value: ethers.utils.parseEther("1"),
|
|
58
|
+
to: faucet.address
|
|
59
|
+
});
|
|
60
|
+
faucets = [fuseFaucet, faucet];
|
|
61
|
+
await loadFixture(cleanFixture);
|
|
53
62
|
});
|
|
54
|
-
});
|
|
55
63
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
it("should not unauthorized to top new user", async () => {
|
|
62
|
-
expect(await faucet.canTop(user1.address)).to.true;
|
|
63
|
-
await expect(faucet.topWallet(user1.address)).revertedWith("not authorized");
|
|
64
|
-
});
|
|
64
|
+
it("should have balance", async () => {
|
|
65
|
+
const balance = await ethers.provider.getBalance(faucet.address);
|
|
66
|
+
expect(balance).to.equal(ethers.utils.parseEther("1"));
|
|
67
|
+
});
|
|
65
68
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
expect(balance).to.equal(await faucet.getToppingAmount());
|
|
71
|
-
});
|
|
69
|
+
it("should not unauthorized to top new user", async () => {
|
|
70
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
71
|
+
await expect(faucet.topWallet(user1.address)).revertedWith("not authorized");
|
|
72
|
+
});
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
74
|
+
it("should let new user top once", async () => {
|
|
75
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
76
|
+
const tx = await (await faucet.connect(signers[0]).topWallet(user1.address)).wait();
|
|
77
|
+
const balance = await ethers.provider.getBalance(user1.address);
|
|
78
|
+
expect(balance).to.equal(await faucet.getToppingAmount());
|
|
77
79
|
});
|
|
78
|
-
expect(await faucet.canTop(user1.address)).to.false;
|
|
79
|
-
await expect(faucet.connect(signers[0]).topWallet(user1.address)).to.revertedWith(
|
|
80
|
-
"User not whitelisted or not first time"
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
80
|
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
81
|
+
it("should not let new user top more than once", async () => {
|
|
82
|
+
await user1.sendTransaction({
|
|
83
|
+
to: ethers.constants.AddressZero,
|
|
84
|
+
value: ethers.utils.parseUnits("400000", "gwei")
|
|
85
|
+
});
|
|
86
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
87
|
+
await expect(faucet.connect(signers[0]).topWallet(user1.address)).to.revertedWith(
|
|
88
|
+
"User not whitelisted or not first time"
|
|
89
|
+
);
|
|
90
|
+
});
|
|
94
91
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
92
|
+
it("should not refund gas when reverted", async () => {
|
|
93
|
+
const balance = await ethers.provider.getBalance(founder.address);
|
|
94
|
+
const faucetBalance = await ethers.provider.getBalance(faucet.address);
|
|
95
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
96
|
+
await expect(faucet.topWallet(user1.address)).to.revertedWith("User not whitelisted or not first time");
|
|
97
|
+
const balanceAfter = await ethers.provider.getBalance(founder.address);
|
|
98
|
+
const faucetBalanceAfter = await ethers.provider.getBalance(faucet.address);
|
|
99
|
+
expect(faucetBalanceAfter).to.eq(faucetBalance);
|
|
100
|
+
expect(balanceAfter).to.lt(balance);
|
|
101
|
+
});
|
|
103
102
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
103
|
+
it("should let user top again once identified", async () => {
|
|
104
|
+
await user1.sendTransaction({
|
|
105
|
+
to: ethers.constants.AddressZero,
|
|
106
|
+
value: (await ethers.provider.getBalance(user1.address)).sub(ethers.utils.parseUnits("100000", "gwei"))
|
|
107
|
+
});
|
|
108
|
+
await id.addWhitelistedWithDID(user1.address, "did:1");
|
|
109
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
110
|
+
const tx = await (await faucet.topWallet(user1.address)).wait();
|
|
111
|
+
console.log(tx.gasUsed.toString());
|
|
112
|
+
const balance = await ethers.provider.getBalance(user1.address);
|
|
113
|
+
expect(balance).to.equal(await faucet.getToppingAmount());
|
|
108
114
|
});
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
115
|
+
|
|
116
|
+
it("should not let identified user top over daily limit", async () => {
|
|
117
|
+
await user1.sendTransaction({
|
|
118
|
+
to: ethers.constants.AddressZero,
|
|
119
|
+
value: (await ethers.provider.getBalance(user1.address)).sub(ethers.utils.parseUnits("100000", "gwei"))
|
|
120
|
+
});
|
|
121
|
+
const tx = await (await faucet.topWallet(user1.address)).wait();
|
|
122
|
+
await user1.sendTransaction({
|
|
123
|
+
to: ethers.constants.AddressZero,
|
|
124
|
+
value: ethers.utils.parseUnits("400000", "gwei")
|
|
125
|
+
});
|
|
126
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
127
|
+
await expect(faucet.topWallet(user1.address)).to.revertedWith("max daily toppings");
|
|
113
128
|
});
|
|
114
|
-
expect(await faucet.canTop(user1.address)).to.false;
|
|
115
|
-
await expect(faucet.topWallet(user1.address)).to.revertedWith("max daily toppings");
|
|
116
|
-
});
|
|
117
129
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
for (let i = 0; i < 5; i++) {
|
|
128
|
-
await ethers.provider.send("evm_increaseTime", [60 * 60 * 24]);
|
|
129
|
-
await (await faucet.topWallet(user1.address)).wait();
|
|
130
|
+
// it("should not top if wallet not half empty", async () => {
|
|
131
|
+
// expect(await faucet.canTop(founder.address)).to.false;
|
|
132
|
+
// await expect(faucet.topWallet(founder.address)).to.revertedWith(
|
|
133
|
+
// "User balance above minimum"
|
|
134
|
+
// );
|
|
135
|
+
// });
|
|
136
|
+
|
|
137
|
+
it("should not let user top over weekly limit", async () => {
|
|
138
|
+
const toppingAmount = await faucet.getToppingAmount();
|
|
130
139
|
await user1.sendTransaction({
|
|
131
140
|
to: ethers.constants.AddressZero,
|
|
132
141
|
value: toppingAmount.mul(80).div(100)
|
|
133
142
|
});
|
|
134
|
-
|
|
135
|
-
|
|
143
|
+
for (let i = 0; i < 2; i++) {
|
|
144
|
+
await ethers.provider.send("evm_increaseTime", [60 * 60 * 24]);
|
|
145
|
+
await (await faucet.topWallet(user1.address)).wait();
|
|
146
|
+
await user1.sendTransaction({
|
|
147
|
+
to: ethers.constants.AddressZero,
|
|
148
|
+
value: toppingAmount.mul(80).div(100)
|
|
149
|
+
});
|
|
150
|
+
console.log(toppingAmount.toString(), { i });
|
|
151
|
+
}
|
|
152
|
+
// await ethers.provider.send("evm_increaseTime", [60 * 60 * 24]);
|
|
136
153
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
154
|
+
await expect(faucet.topWallet(user1.address)).to.revertedWith(
|
|
155
|
+
"User wallet has been topped too many times this week"
|
|
156
|
+
);
|
|
157
|
+
expect(await faucet.canTop(user1.address)).to.false;
|
|
141
158
|
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
159
|
+
//should be able to top again after some days passed
|
|
160
|
+
await ethers.provider.send("evm_increaseTime", [60 * 60 * 24 * 5]);
|
|
161
|
+
await ethers.provider.send("evm_mine", []);
|
|
145
162
|
|
|
146
|
-
|
|
147
|
-
|
|
163
|
+
expect(await faucet.canTop(user1.address)).to.true;
|
|
164
|
+
});
|
|
165
|
+
|
|
166
|
+
it("should not top below minTopping", async () => {
|
|
167
|
+
await id.addWhitelistedWithDID(user2.address, "did:2");
|
|
148
168
|
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
const toppingAmount = await faucet.getToppingAmount();
|
|
170
|
+
console.log(toppingAmount.toString(), "topping amount");
|
|
171
|
+
const minTopping = await faucet.minTopping();
|
|
172
|
+
const balance = await ethers.provider.getBalance(founder.address);
|
|
173
|
+
await founder.sendTransaction({ to: user2.address, value: toppingAmount.mul(100 - minTopping + 1).div(100) });
|
|
174
|
+
|
|
175
|
+
expect(await faucet.canTop(user2.address)).to.be.false;
|
|
176
|
+
await expect(faucet.topWallet(user2.address)).to.revertedWith("low toTop");
|
|
177
|
+
await user2.sendTransaction({ to: founder.address, value: toppingAmount.mul(2).div(100) });
|
|
178
|
+
expect(await faucet.canTop(user2.address)).to.be.true;
|
|
179
|
+
await expect(faucet.topWallet(user2.address)).not.reverted;
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
it("should reimburse gas costs", async () => {
|
|
183
|
+
const tempUser = ethers.Wallet.createRandom().connect(ethers.provider);
|
|
184
|
+
|
|
185
|
+
const balance = await ethers.provider.getBalance(founder.address);
|
|
186
|
+
const tx = await (await faucet.connect(signers[0]).topWallet(tempUser.address, { gasPrice: 1e9 })).wait();
|
|
187
|
+
// const gasCosts = tx.gasUsed.mul(1e9);
|
|
188
|
+
// const afterRefund = gasCosts.sub(await faucet["gasRefund()"]());
|
|
189
|
+
const balanceAfter = await ethers.provider.getBalance(founder.address);
|
|
190
|
+
const diff = balance.sub(balanceAfter).toNumber();
|
|
191
|
+
expect(diff).to.lt(10000);
|
|
192
|
+
});
|
|
157
193
|
});
|
|
158
194
|
});
|