@gooddollar/goodprotocol 1.0.29-beta.3 → 1.0.29
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/GoodDollarMintBurnWrapper.min.json +1 -1
- package/artifacts/abis/GoodDollarStaking.min.json +1 -1
- package/artifacts/abis/GoodDollarStakingMock.min.json +1 -1
- package/artifacts/abis/IGoodDollar.min.json +1 -1
- package/artifacts/abis/IIdentity.min.json +1 -1
- package/artifacts/abis/UBIScheme.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/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.json +0 -39
- 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 +0 -51
- 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/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 +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -15
- 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/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/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/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 -15
- 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 +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/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/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.json +22 -15
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +56 -76
- 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/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 -16
- 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/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/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 +0 -26
- package/contracts/governance/GoodDollarStaking.sol +9 -23
- package/contracts/ubi/UBIScheme.sol +40 -45
- package/contracts/utils/AdminWallet.sol +11 -42
- package/contracts/utils/GoodDollarMintBurnWrapper.sol +3 -13
- package/hardhat.config.ts +7 -21
- package/package.json +2 -3
- package/releases/deploy-settings.json +1 -36
- package/releases/deployment.json +53 -94
- package/scripts/analytics/gdinflow.ts +56 -0
- package/scripts/analytics/tokenInOutStats.ts +50 -0
- package/scripts/deployFullDAO.ts +19 -39
- package/scripts/multichain-deploy/{1_basicdao-deploy.ts → basicdao-deploy.ts} +52 -56
- package/scripts/multichain-deploy/{3_gdSavings-deploy.ts → gdSavings-deploy.ts} +76 -90
- package/scripts/multichain-deploy/helpers.ts +1 -0
- package/scripts/{upgrades → multichain-deploy}/nonubiDistribution-deploy.ts +5 -2
- package/scripts/test/localOldDaoDeploy.ts +3 -10
- package/test/helpers.ts +8 -12
- package/test/ubi/UBIScheme.test.ts +30 -30
- package/test/ubi/UBISchemeCycle.test.ts +7 -9
- package/test/utils/AdminWallet.test.ts +11 -33
- package/types/AdminWallet.ts +113 -124
- package/types/GoodDollarMintBurnWrapper.ts +0 -42
- package/types/GoodDollarStaking.ts +0 -34
- package/types/GoodDollarStakingMock.ts +0 -34
- package/types/IGoodDollar.ts +0 -54
- package/types/IIdentity.ts +0 -75
- package/types/UBIScheme.ts +40 -19
- package/types/factories/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/AdminWallet__factory.ts +55 -75
- package/types/factories/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/BaseShareField__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/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 -15
- package/types/factories/GoodDollarStakingMock__factory.ts +1 -14
- package/types/factories/GoodDollarStaking__factory.ts +1 -14
- 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/IGoodDollar__factory.ts +0 -39
- package/types/factories/IIdentity__factory.ts +0 -51
- package/types/factories/InvitesV1__factory.ts +1 -1
- package/types/factories/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/MultichainRouterMock__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/SwapHelperTest__factory.ts +1 -1
- package/types/factories/UBIScheme__factory.ts +21 -14
- 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 +0 -54
- package/types/index.ts +0 -12
- package/yarn.lock +4 -4
- package/artifacts/abis/Faucet.min.json +0 -1
- package/artifacts/abis/IGovernanceStaking.min.json +0 -1
- package/artifacts/abis/IIdentityV2.min.json +0 -1
- package/artifacts/abis/IdentityV2.min.json +0 -1
- package/artifacts/abis/InvitesV2.min.json +0 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +0 -4
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.json +0 -281
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +0 -4
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +0 -684
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +0 -4
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.json +0 -24
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +0 -4
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +0 -1000
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +0 -4
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +0 -586
- package/contracts/fuseFaucet/Faucet.sol +0 -245
- package/contracts/identity/IdentityV2.sol +0 -434
- package/contracts/invite/InvitesV2.sol +0 -316
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -45
- package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -143
- package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -121
- package/scripts/multichain-deploy/5_gov-deploy.ts +0 -123
- package/scripts/multichain-deploy/verifyEtherscan.ts +0 -84
- package/scripts/upgrades/identity-upgrade.ts +0 -153
- package/types/Faucet.ts +0 -1014
- package/types/IERC1271.ts +0 -109
- package/types/IGovernanceStaking.ts +0 -98
- package/types/IIdentityV2.ts +0 -526
- package/types/IdentityV2.ts +0 -1612
- package/types/InvitesV2.ts +0 -933
- package/types/factories/Faucet__factory.ts +0 -729
- package/types/factories/IERC1271__factory.ts +0 -47
- package/types/factories/IGovernanceStaking__factory.ts +0 -39
- package/types/factories/IIdentityV2__factory.ts +0 -293
- package/types/factories/IdentityV2__factory.ts +0 -1048
- package/types/factories/InvitesV2__factory.ts +0 -634
|
@@ -19,13 +19,8 @@
|
|
|
19
19
|
|
|
20
20
|
import { network, ethers, upgrades, run } from "hardhat";
|
|
21
21
|
import { Contract, Signer } from "ethers";
|
|
22
|
-
import { defaultsDeep } from "lodash";
|
|
23
22
|
|
|
24
|
-
import {
|
|
25
|
-
deployDeterministic,
|
|
26
|
-
printDeploy,
|
|
27
|
-
executeViaGuardian
|
|
28
|
-
} from "./helpers";
|
|
23
|
+
import { deployDeterministic, printDeploy } from "./helpers";
|
|
29
24
|
import releaser from "../../scripts/releaser";
|
|
30
25
|
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
31
26
|
import dao from "../../releases/deployment.json";
|
|
@@ -38,16 +33,18 @@ import {
|
|
|
38
33
|
} from "../../types";
|
|
39
34
|
const { name: networkName } = network;
|
|
40
35
|
|
|
36
|
+
const BLOCKS_PER_YEAR = (12 * 60 * 24 * 365).toString();
|
|
37
|
+
const BLOCK_APY = "1000000007735630000";
|
|
38
|
+
|
|
41
39
|
export const deploySidechain = async () => {
|
|
42
40
|
const isProduction = networkName.includes("production");
|
|
43
41
|
let release: { [key: string]: any } = dao[networkName];
|
|
44
|
-
let settings = defaultsDeep(
|
|
45
|
-
{},
|
|
46
|
-
ProtocolSettings[networkName],
|
|
47
|
-
ProtocolSettings["default"]
|
|
48
|
-
);
|
|
49
42
|
|
|
50
|
-
let [root] = await ethers.getSigners();
|
|
43
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
44
|
+
const proposer =
|
|
45
|
+
networkName !== "fuse"
|
|
46
|
+
? new ethers.Wallet(process.env.PROPOSER_KEY, ethers.provider)
|
|
47
|
+
: root; //need proposer with 0.3% of GOOD tokens
|
|
51
48
|
|
|
52
49
|
console.log("got signers:", {
|
|
53
50
|
networkName,
|
|
@@ -81,9 +78,9 @@ export const deploySidechain = async () => {
|
|
|
81
78
|
},
|
|
82
79
|
[
|
|
83
80
|
release.NameService,
|
|
84
|
-
ethers.BigNumber.from(
|
|
85
|
-
ethers.BigNumber.from(
|
|
86
|
-
|
|
81
|
+
ethers.BigNumber.from(BLOCK_APY),
|
|
82
|
+
ethers.BigNumber.from(BLOCKS_PER_YEAR),
|
|
83
|
+
networkName === "fuse" ? 7 : 30 //days until upgrade
|
|
87
84
|
]
|
|
88
85
|
).then(printDeploy)) as Contract;
|
|
89
86
|
|
|
@@ -98,32 +95,12 @@ export const deploySidechain = async () => {
|
|
|
98
95
|
release.GoodDollarStaking
|
|
99
96
|
);
|
|
100
97
|
}
|
|
101
|
-
if (networkName.includes("production"))
|
|
102
|
-
return console.log(
|
|
103
|
-
"Skipping proposal/upgrade for production, need to perform manually"
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
await executeProposal(GDSavings.address, Wrapper.address);
|
|
107
|
-
};
|
|
108
98
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
const isProduction = networkName.includes("production");
|
|
115
|
-
let release: { [key: string]: any } = dao[networkName];
|
|
116
|
-
savingsAddress = savingsAddress || release.GoodDollarStaking;
|
|
117
|
-
wrapperAddress = wrapperAddress || release.GoodDollarMintBurnWrapper;
|
|
118
|
-
|
|
119
|
-
let [root] = await ethers.getSigners();
|
|
120
|
-
//on celo we dont need voting yet to deploy it.
|
|
121
|
-
//dev env dont use voting for test purposes
|
|
122
|
-
const proposer =
|
|
123
|
-
!networkName.includes("celo") &&
|
|
124
|
-
(isProduction || networkName.includes("staging"))
|
|
125
|
-
? new ethers.Wallet(process.env.PROPOSER_KEY, ethers.provider)
|
|
126
|
-
: root; //need proposer with 0.3% of GOOD tokens
|
|
99
|
+
//create proposal
|
|
100
|
+
const vm = (await ethers.getContractAt(
|
|
101
|
+
"CompoundVotingMachine",
|
|
102
|
+
release.CompoundVotingMachine
|
|
103
|
+
)) as CompoundVotingMachine;
|
|
127
104
|
|
|
128
105
|
const ctrl = (await ethers.getContractAt(
|
|
129
106
|
"Controller",
|
|
@@ -136,7 +113,7 @@ const executeProposal = async (
|
|
|
136
113
|
)) as NameService;
|
|
137
114
|
|
|
138
115
|
const proposalContracts = [
|
|
139
|
-
|
|
116
|
+
Wrapper.address, //MinterWrapper -> add GDSavings
|
|
140
117
|
ctrl.address, //controller -> add MinterWrapper as scheme
|
|
141
118
|
ctrl.address, // controller -> add GDSavings as scheme
|
|
142
119
|
ns.address //nameservice add MinterWrapper
|
|
@@ -145,10 +122,10 @@ const executeProposal = async (
|
|
|
145
122
|
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
146
123
|
|
|
147
124
|
const proposalFunctionSignatures = [
|
|
148
|
-
"addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)",
|
|
149
|
-
"registerScheme(address,bytes32,bytes4,address)",
|
|
150
|
-
"registerScheme(address,bytes32,bytes4,address)",
|
|
151
|
-
"setAddress(string,address)"
|
|
125
|
+
"addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)",
|
|
126
|
+
"registerScheme(address,bytes32,bytes4,address)",
|
|
127
|
+
"registerScheme(address,bytes32,bytes4,address)",
|
|
128
|
+
"setAddress(string,address)"
|
|
152
129
|
];
|
|
153
130
|
|
|
154
131
|
const proposalFunctionInputs = [
|
|
@@ -163,12 +140,12 @@ const executeProposal = async (
|
|
|
163
140
|
"uint32",
|
|
164
141
|
"bool"
|
|
165
142
|
],
|
|
166
|
-
[
|
|
143
|
+
[GDSavings.address, 0, 0, 30, 0, 0, 0, true]
|
|
167
144
|
), //function addMinter(
|
|
168
145
|
ethers.utils.defaultAbiCoder.encode(
|
|
169
146
|
["address", "bytes32", "bytes4", "address"],
|
|
170
147
|
[
|
|
171
|
-
|
|
148
|
+
Wrapper.address, //scheme
|
|
172
149
|
ethers.constants.HashZero, //paramshash
|
|
173
150
|
"0x00000001", //permissions - minimal
|
|
174
151
|
release.Avatar
|
|
@@ -177,7 +154,7 @@ const executeProposal = async (
|
|
|
177
154
|
ethers.utils.defaultAbiCoder.encode(
|
|
178
155
|
["address", "bytes32", "bytes4", "address"],
|
|
179
156
|
[
|
|
180
|
-
|
|
157
|
+
GDSavings.address, //scheme
|
|
181
158
|
ethers.constants.HashZero, //paramshash
|
|
182
159
|
"0x000000f1", //permissions - genericcall
|
|
183
160
|
release.Avatar
|
|
@@ -185,62 +162,71 @@ const executeProposal = async (
|
|
|
185
162
|
),
|
|
186
163
|
ethers.utils.defaultAbiCoder.encode(
|
|
187
164
|
["string", "address"],
|
|
188
|
-
["MINTBURN_WRAPPER",
|
|
165
|
+
["MINTBURN_WRAPPER", Wrapper.address]
|
|
189
166
|
)
|
|
190
167
|
];
|
|
191
168
|
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
console.log("upgrading via guardian...");
|
|
195
|
-
|
|
196
|
-
await executeViaGuardian(
|
|
169
|
+
if (networkName === "fuse") {
|
|
170
|
+
return executeViaGuardian(
|
|
197
171
|
proposalContracts,
|
|
198
172
|
proposalEthValues,
|
|
199
173
|
proposalFunctionSignatures,
|
|
200
174
|
proposalFunctionInputs,
|
|
201
175
|
root
|
|
202
176
|
);
|
|
203
|
-
} else if (isProduction) {
|
|
204
|
-
console.log("creating proposal...");
|
|
205
|
-
//create proposal
|
|
206
|
-
const vm = (await ethers.getContractAt(
|
|
207
|
-
"CompoundVotingMachine",
|
|
208
|
-
release.CompoundVotingMachine
|
|
209
|
-
)) as CompoundVotingMachine;
|
|
210
|
-
|
|
211
|
-
await vm
|
|
212
|
-
.connect(proposer)
|
|
213
|
-
["propose(address[],uint256[],string[],bytes[],string)"](
|
|
214
|
-
proposalContracts,
|
|
215
|
-
proposalEthValues,
|
|
216
|
-
proposalFunctionSignatures,
|
|
217
|
-
proposalFunctionInputs,
|
|
218
|
-
"https://discourse.gooddollar.org/t/gip-5-allocating-part-of-ubi-inflation-towards-g-savings-account/114/20"
|
|
219
|
-
)
|
|
220
|
-
.then(printDeploy);
|
|
221
177
|
}
|
|
222
178
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
179
|
+
console.log("creating proposal...");
|
|
180
|
+
await vm
|
|
181
|
+
.connect(proposer)
|
|
182
|
+
["propose(address[],uint256[],string[],bytes[],string)"](
|
|
183
|
+
proposalContracts,
|
|
184
|
+
proposalEthValues,
|
|
185
|
+
proposalFunctionSignatures,
|
|
186
|
+
proposalFunctionInputs,
|
|
187
|
+
"https://discourse.gooddollar.org/t/gip-5-allocating-part-of-ubi-inflation-towards-g-savings-account/114/20"
|
|
188
|
+
)
|
|
189
|
+
.then(printDeploy);
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const executeViaGuardian = async (
|
|
193
|
+
contracts,
|
|
194
|
+
ethValues,
|
|
195
|
+
functionSigs,
|
|
196
|
+
functionInputs,
|
|
197
|
+
guardian: Signer
|
|
198
|
+
) => {
|
|
199
|
+
let release: { [key: string]: any } = dao[networkName];
|
|
200
|
+
const ctrl = await (
|
|
201
|
+
await ethers.getContractAt("Controller", release.Controller)
|
|
202
|
+
).connect(guardian);
|
|
203
|
+
|
|
204
|
+
for (let i = 0; i < contracts.length; i++) {
|
|
205
|
+
const contract = contracts[i];
|
|
206
|
+
console.log("executing:", contracts[i], functionSigs[i], functionInputs[i]);
|
|
207
|
+
const sigHash = ethers.utils
|
|
208
|
+
.keccak256(ethers.utils.toUtf8Bytes(functionSigs[i]))
|
|
209
|
+
.slice(0, 10);
|
|
210
|
+
const encoded = ethers.utils.solidityPack(
|
|
211
|
+
["bytes4", "bytes"],
|
|
212
|
+
[sigHash, functionInputs[i]]
|
|
213
|
+
);
|
|
214
|
+
if (contract === ctrl.address) {
|
|
215
|
+
console.log("executing directly on controller:", sigHash, encoded);
|
|
216
|
+
|
|
217
|
+
await guardian
|
|
218
|
+
.sendTransaction({ to: contract, data: encoded })
|
|
219
|
+
.then(printDeploy);
|
|
220
|
+
} else {
|
|
221
|
+
console.log("executing genericCall:", sigHash, encoded);
|
|
222
|
+
await ctrl
|
|
223
|
+
.genericCall(contract, encoded, release.Avatar, ethValues[i])
|
|
224
|
+
.then(printDeploy);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
240
227
|
};
|
|
241
228
|
|
|
242
229
|
export const main = async () => {
|
|
243
230
|
await deploySidechain().catch(console.log);
|
|
244
|
-
// await executeProposal(undefined, undefined);
|
|
245
231
|
};
|
|
246
232
|
if (process.argv[1].includes("gdSavings")) main();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Contract, ContractFactory, Signer } from "ethers";
|
|
2
2
|
import { network, ethers, upgrades, run } from "hardhat";
|
|
3
|
+
import { Contract } from "ethers";
|
|
3
4
|
import { TransactionResponse } from "@ethersproject/providers";
|
|
4
5
|
import dao from "../../releases/deployment.json";
|
|
5
6
|
|
|
@@ -11,15 +11,18 @@
|
|
|
11
11
|
* - add to the distributionHelper the GoodDollarMintBurnWrapper contract address on fuse as recipient with 100% bps
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
|
-
import { network, ethers } from "hardhat";
|
|
14
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
15
|
+
import { Contract, Signer } from "ethers";
|
|
15
16
|
|
|
16
17
|
import {
|
|
17
18
|
deployDeterministic,
|
|
18
19
|
printDeploy,
|
|
19
20
|
executeViaGuardian
|
|
20
|
-
} from "
|
|
21
|
+
} from "./helpers";
|
|
21
22
|
import releaser from "../releaser";
|
|
23
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
22
24
|
import dao from "../../releases/deployment.json";
|
|
25
|
+
import { deployWrapper } from "./multichainWrapper-deploy";
|
|
23
26
|
import {
|
|
24
27
|
CompoundVotingMachine,
|
|
25
28
|
DistributionHelper,
|
|
@@ -23,7 +23,6 @@ import FundManager from "@gooddollar/goodcontracts/stakingModel/build/contracts/
|
|
|
23
23
|
import SimpleDAIStaking from "@gooddollar/goodcontracts/stakingModel/build/contracts/SimpleDAIStaking.json";
|
|
24
24
|
import BridgeMock from "@gooddollar/goodcontracts/stakingModel/build/contracts/BridgeMock.json";
|
|
25
25
|
import DonationsStaking from "@gooddollar/goodcontracts/upgradables/build/contracts/DonationsStaking.json";
|
|
26
|
-
import AdminWalletABI from "@gooddollar/goodcontracts/build/contracts/AdminWallet.json";
|
|
27
26
|
import OTPABI from "@gooddollar/goodcontracts/build/contracts/OneTimePayments.json";
|
|
28
27
|
|
|
29
28
|
import releaser from "../releaser";
|
|
@@ -107,15 +106,9 @@ export const deploy = async (networkName = name, single = false) => {
|
|
|
107
106
|
|
|
108
107
|
const deployAdminWallet = async dao => {
|
|
109
108
|
const signers = await ethers.getSigners();
|
|
110
|
-
const adminWallet = await
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
signers[0]
|
|
114
|
-
).deploy(
|
|
115
|
-
signers.slice(0, 10).map(_ => _.address),
|
|
116
|
-
ethers.utils.parseUnits("1000000", "gwei"),
|
|
117
|
-
4,
|
|
118
|
-
dao.identity
|
|
109
|
+
const adminWallet = await upgrades.deployProxy(
|
|
110
|
+
await ethers.getContractFactory("AdminWallet"),
|
|
111
|
+
[signers.slice(0, 20).map(_ => _.address), signers[0].address, dao.identity]
|
|
119
112
|
);
|
|
120
113
|
|
|
121
114
|
const id = await ethers.getContractAt("IIdentity", dao.identity);
|
package/test/helpers.ts
CHANGED
|
@@ -55,8 +55,11 @@ export const createDAO = async () => {
|
|
|
55
55
|
root
|
|
56
56
|
);
|
|
57
57
|
|
|
58
|
-
const IdentityFactory =
|
|
59
|
-
|
|
58
|
+
const IdentityFactory = new ethers.ContractFactory(
|
|
59
|
+
IdentityABI.abi,
|
|
60
|
+
IdentityABI.bytecode,
|
|
61
|
+
root
|
|
62
|
+
);
|
|
60
63
|
const FeeFormulaFactory = new ethers.ContractFactory(
|
|
61
64
|
FeeFormulaABI.abi,
|
|
62
65
|
FeeFormulaABI.bytecode,
|
|
@@ -72,16 +75,11 @@ export const createDAO = async () => {
|
|
|
72
75
|
await ethers.getContractFactory("BancorFormula")
|
|
73
76
|
).deploy();
|
|
74
77
|
const AddFounders = await AddFoundersFactory.deploy();
|
|
75
|
-
const Identity = await
|
|
76
|
-
IdentityFactory,
|
|
77
|
-
[root.address, ethers.constants.AddressZero],
|
|
78
|
-
{ kind: "uups" }
|
|
79
|
-
);
|
|
80
|
-
|
|
78
|
+
const Identity = await IdentityFactory.deploy();
|
|
81
79
|
const daoCreator = await DAOCreatorFactory.deploy(AddFounders.address);
|
|
82
80
|
const FeeFormula = await FeeFormulaFactory.deploy(0);
|
|
83
81
|
|
|
84
|
-
|
|
82
|
+
await Identity.setAuthenticationPeriod(365);
|
|
85
83
|
await daoCreator.forgeOrg(
|
|
86
84
|
"GoodDollar",
|
|
87
85
|
"G$",
|
|
@@ -102,7 +100,7 @@ export const createDAO = async () => {
|
|
|
102
100
|
root
|
|
103
101
|
);
|
|
104
102
|
|
|
105
|
-
|
|
103
|
+
await Identity.setAvatar(Avatar.address);
|
|
106
104
|
const controller = await Avatar.owner();
|
|
107
105
|
|
|
108
106
|
const ccFactory = new ethers.ContractFactory(
|
|
@@ -161,8 +159,6 @@ export const createDAO = async () => {
|
|
|
161
159
|
}
|
|
162
160
|
);
|
|
163
161
|
|
|
164
|
-
await Identity.initDAO(nameService.address);
|
|
165
|
-
|
|
166
162
|
console.log("deploying reserve...");
|
|
167
163
|
let goodReserve = await upgrades.deployProxy(
|
|
168
164
|
await ethers.getContractFactory("GoodReserveCDai"),
|
|
@@ -127,11 +127,13 @@ describe("UBIScheme", () => {
|
|
|
127
127
|
|
|
128
128
|
it("should return zero entitlement before UBI started", async () => {
|
|
129
129
|
let blockTimestamp = (await ethers.provider.getBlock("latest")).timestamp;
|
|
130
|
-
const timeInDay = blockTimestamp % ONE_DAY;
|
|
130
|
+
const timeInDay = (blockTimestamp % (ONE_DAY));
|
|
131
131
|
// Move to before 12pm of the current day
|
|
132
132
|
if (timeInDay > 12 * ONE_HOUR) {
|
|
133
133
|
blockTimestamp += 12 * ONE_HOUR;
|
|
134
|
-
await ethers.provider.send("evm_setNextBlockTimestamp", [
|
|
134
|
+
await ethers.provider.send("evm_setNextBlockTimestamp", [
|
|
135
|
+
blockTimestamp
|
|
136
|
+
]);
|
|
135
137
|
await ethers.provider.send("evm_mine", []);
|
|
136
138
|
}
|
|
137
139
|
const ubiNew = await deployNewUbi();
|
|
@@ -198,26 +200,24 @@ describe("UBIScheme", () => {
|
|
|
198
200
|
expect(error.message).to.have.string("Only UBIScheme can call this method");
|
|
199
201
|
});
|
|
200
202
|
|
|
201
|
-
it("should estimate next daily UBI to
|
|
203
|
+
it("should estimate next daily UBI to default value when no claimers and not using first claim pool", async () => {
|
|
202
204
|
const nextDailyUBIBefore = await ubi.estimateNextDailyUBI();
|
|
203
|
-
const
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
let encodedCall = ubi.interface.encodeFunctionData("setUseFirstClaimPool", [
|
|
209
|
-
false
|
|
210
|
-
]);
|
|
205
|
+
const defaultDailyUbi = await ubi.defaultDailyUbi();
|
|
206
|
+
let encodedCall = ubi.interface.encodeFunctionData(
|
|
207
|
+
"setUseFirstClaimPool",
|
|
208
|
+
[false]
|
|
209
|
+
);
|
|
211
210
|
await genericCall(ubi.address, encodedCall);
|
|
212
211
|
const nextDailyUBIAfter = await ubi.estimateNextDailyUBI();
|
|
213
212
|
|
|
214
213
|
expect(nextDailyUBIBefore.eq(0));
|
|
215
214
|
expect(nextDailyUBIAfter.gt(nextDailyUBIBefore));
|
|
216
|
-
expect(nextDailyUBIAfter.eq(
|
|
215
|
+
expect(nextDailyUBIAfter.eq(defaultDailyUbi));
|
|
217
216
|
|
|
218
|
-
encodedCall = ubi.interface.encodeFunctionData(
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
encodedCall = ubi.interface.encodeFunctionData(
|
|
218
|
+
"setUseFirstClaimPool",
|
|
219
|
+
[true]
|
|
220
|
+
);
|
|
221
221
|
await genericCall(ubi.address, encodedCall);
|
|
222
222
|
});
|
|
223
223
|
|
|
@@ -315,8 +315,8 @@ describe("UBIScheme", () => {
|
|
|
315
315
|
await genericCall(ubi.address, encodedCall); // we should set cyclelength to one cause this tests was implemented according to it
|
|
316
316
|
const currentDay = await ubi.currentDayInCycle().then(_ => _.toNumber());
|
|
317
317
|
await increaseTime(ONE_DAY);
|
|
318
|
-
await goodDollar.mint(avatar, "
|
|
319
|
-
//ubi will have 902GD in pool so daily ubi is now
|
|
318
|
+
await goodDollar.mint(avatar, "901");
|
|
319
|
+
//ubi will have 902GD in pool so daily ubi is now 902/1(cycle)/3(claimers) = 300
|
|
320
320
|
await ubi.connect(claimer1).claim();
|
|
321
321
|
await increaseTime(ONE_DAY);
|
|
322
322
|
await goodDollar.mint(avatar, "1");
|
|
@@ -326,8 +326,8 @@ describe("UBIScheme", () => {
|
|
|
326
326
|
let avatarBalance = await goodDollar.balanceOf(avatar);
|
|
327
327
|
let claimer1Balance = await goodDollar.balanceOf(claimer1.address);
|
|
328
328
|
expect(avatarBalance.toString()).to.be.equal("0");
|
|
329
|
-
// 300 GD from first day and
|
|
330
|
-
expect(claimer1Balance.toString()).to.be.equal("
|
|
329
|
+
// 300 GD from first day and 201 from the second day claimed in this test
|
|
330
|
+
expect(claimer1Balance.toString()).to.be.equal("501");
|
|
331
331
|
});
|
|
332
332
|
|
|
333
333
|
it("should return the reward value for entitlement user", async () => {
|
|
@@ -519,11 +519,11 @@ describe("UBIScheme", () => {
|
|
|
519
519
|
});
|
|
520
520
|
|
|
521
521
|
it("distribute formula should return correct value", async () => {
|
|
522
|
-
await goodDollar.mint(avatar, "
|
|
522
|
+
await goodDollar.mint(avatar, "20");
|
|
523
523
|
await increaseTime(ONE_DAY);
|
|
524
524
|
let ubiBalance = await goodDollar.balanceOf(ubi.address);
|
|
525
525
|
let avatarBalance = await goodDollar.balanceOf(avatar);
|
|
526
|
-
let activeUsersCount = await ubi.
|
|
526
|
+
let activeUsersCount = await ubi.activeUsersCount();
|
|
527
527
|
let claimer4BalanceBefore = await goodDollar.balanceOf(claimer2.address);
|
|
528
528
|
await ubi.connect(claimer2).claim();
|
|
529
529
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer2.address);
|
|
@@ -539,7 +539,7 @@ describe("UBIScheme", () => {
|
|
|
539
539
|
await increaseTime(ONE_DAY);
|
|
540
540
|
let ubiBalance = await goodDollar.balanceOf(ubi.address);
|
|
541
541
|
let avatarBalance = await goodDollar.balanceOf(avatar);
|
|
542
|
-
let activeUsersCount = await ubi.
|
|
542
|
+
let activeUsersCount = await ubi.activeUsersCount();
|
|
543
543
|
let claimer4BalanceBefore = await goodDollar.balanceOf(claimer2.address);
|
|
544
544
|
await ubi.connect(claimer2).claim();
|
|
545
545
|
let claimer4BalanceAfter = await goodDollar.balanceOf(claimer2.address);
|
|
@@ -565,12 +565,12 @@ describe("UBIScheme", () => {
|
|
|
565
565
|
let claimer1Balance1 = await goodDollar.balanceOf(claimer1.address);
|
|
566
566
|
// regular claim
|
|
567
567
|
await ubi.connect(claimer1).claim();
|
|
568
|
+
const ubiGdBalance = await goodDollar.balanceOf(ubi.address);
|
|
568
569
|
let claimer1Balance2 = await goodDollar.balanceOf(claimer1.address);
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
// the dailyCyclePool divided by max(activeUser,minActiveUsers) should give the daily claim (diff between ubipool balances)
|
|
570
|
+
// there are 3 claimers and the total ubi balance after the minting include the previous balance and
|
|
571
|
+
// the dailyCyclePool is 948439324947 minting tokens. that divides into 3
|
|
572
572
|
expect(claimer1Balance2.sub(claimer1Balance1).toString()).to.be.equal(
|
|
573
|
-
|
|
573
|
+
BN.from("948439324947").div(3)
|
|
574
574
|
);
|
|
575
575
|
});
|
|
576
576
|
|
|
@@ -627,8 +627,8 @@ describe("UBIScheme", () => {
|
|
|
627
627
|
|
|
628
628
|
it("should award first claimer with default value when not using first claim pool", async () => {
|
|
629
629
|
const ubiNew = await deployNewUbi();
|
|
630
|
-
await
|
|
631
|
-
|
|
630
|
+
const defaultDailyUbi = await ubiNew.defaultDailyUbi();
|
|
631
|
+
await goodDollar.mint(ubiNew.address, defaultDailyUbi);
|
|
632
632
|
await addWhitelisted(claimer8.address, "claimer8");
|
|
633
633
|
const encodedCall = ubiNew.interface.encodeFunctionData(
|
|
634
634
|
"setUseFirstClaimPool",
|
|
@@ -638,8 +638,8 @@ describe("UBIScheme", () => {
|
|
|
638
638
|
const claimerBalanceBefore = await goodDollar.balanceOf(claimer8.address);
|
|
639
639
|
await (await ubiNew.connect(claimer8).claim()).wait();
|
|
640
640
|
const claimerBalanceAfter = await goodDollar.balanceOf(claimer8.address);
|
|
641
|
-
|
|
641
|
+
|
|
642
642
|
expect(claimerBalanceAfter.gt(claimerBalanceBefore));
|
|
643
|
-
expect(claimerBalanceAfter.sub(claimerBalanceBefore).eq(
|
|
643
|
+
expect(claimerBalanceAfter.sub(claimerBalanceBefore).eq(defaultDailyUbi));
|
|
644
644
|
});
|
|
645
645
|
});
|
|
@@ -125,13 +125,12 @@ describe("UBIScheme cycle", () => {
|
|
|
125
125
|
expect(
|
|
126
126
|
await ubiScheme.currentDayInCycle().then(_ => _.toNumber())
|
|
127
127
|
).to.be.equal(10); //10 days passed total
|
|
128
|
-
|
|
129
128
|
let transaction = await (await ubiScheme.connect(claimer1).claim()).wait(); //claims in new ubi cycle
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
);
|
|
129
|
+
expect(
|
|
130
|
+
await goodDollar.balanceOf(claimer1.address).then(_ => _.toNumber())
|
|
131
|
+
).to.be.equal(
|
|
132
|
+
1000 + 58593 //58 amount of new ubicycle
|
|
133
|
+
);
|
|
135
134
|
const cycleEvent = transaction.events.find(
|
|
136
135
|
e => e.event === "UBICycleCalculated"
|
|
137
136
|
);
|
|
@@ -141,8 +140,7 @@ describe("UBIScheme cycle", () => {
|
|
|
141
140
|
expect(
|
|
142
141
|
await ubiScheme.currentDayInCycle().then(_ => _.toNumber())
|
|
143
142
|
).to.be.equal(0); //new cycle started
|
|
144
|
-
//
|
|
145
|
-
expect(cycleEvent.args.dailyUBIPool).to.be.equal(124984);
|
|
143
|
+
expect(cycleEvent.args.dailyUBIPool).to.be.equal(117187); //pool balance: (1000000 - 62500 given to first claimer) divided by 8 days - only first claimer got 62500 in first cycle
|
|
146
144
|
});
|
|
147
145
|
|
|
148
146
|
it("should calculate cycle early if we can increase current daily pool", async () => {
|
|
@@ -179,7 +177,7 @@ describe("UBIScheme cycle", () => {
|
|
|
179
177
|
//increase ubi pool balance
|
|
180
178
|
let encoded = goodDollar.interface.encodeFunctionData("mint", [
|
|
181
179
|
ubiScheme.address,
|
|
182
|
-
|
|
180
|
+
1000
|
|
183
181
|
]);
|
|
184
182
|
await genericCall(goodDollar.address, encoded);
|
|
185
183
|
let balance = await goodDollar.balanceOf(ubiScheme.address);
|
|
@@ -39,19 +39,16 @@ describe("AdminWallet", () => {
|
|
|
39
39
|
admin2,
|
|
40
40
|
toWhitelist
|
|
41
41
|
] = signers.slice(10);
|
|
42
|
-
let { identity: id
|
|
43
|
-
identity = await ethers.getContractAt("
|
|
42
|
+
let { identity: id } = await createDAO();
|
|
43
|
+
identity = await ethers.getContractAt("IIdentity", id);
|
|
44
44
|
|
|
45
45
|
adminWallet = (await upgrades.deployProxy(
|
|
46
46
|
await ethers.getContractFactory("AdminWallet"),
|
|
47
|
-
[[],
|
|
47
|
+
[[], signers[0].address, id],
|
|
48
48
|
{ kind: "uups" }
|
|
49
49
|
)) as AdminWallet;
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")),
|
|
53
|
-
adminWallet.address
|
|
54
|
-
);
|
|
51
|
+
identity.addIdentityAdmin(adminWallet.address);
|
|
55
52
|
|
|
56
53
|
toppingTimes = await adminWallet.toppingTimes();
|
|
57
54
|
toppingAmount = await adminWallet.toppingAmount();
|
|
@@ -90,12 +87,6 @@ describe("AdminWallet", () => {
|
|
|
90
87
|
});
|
|
91
88
|
});
|
|
92
89
|
|
|
93
|
-
it("should have owner", async () => {
|
|
94
|
-
expect(
|
|
95
|
-
await adminWallet.hasRole(ethers.constants.HashZero, signers[0].address)
|
|
96
|
-
).to.eq(true);
|
|
97
|
-
});
|
|
98
|
-
|
|
99
90
|
it("should not top admin list when empty", async () => {
|
|
100
91
|
await expect(adminWallet["topAdmins(uint256)"](0)).revertedWith(
|
|
101
92
|
"Admin list is empty"
|
|
@@ -151,10 +142,7 @@ describe("AdminWallet", () => {
|
|
|
151
142
|
|
|
152
143
|
await adminWallet
|
|
153
144
|
.connect(admin2)
|
|
154
|
-
|
|
155
|
-
toWhitelist.address,
|
|
156
|
-
"did:test" + Math.random()
|
|
157
|
-
);
|
|
145
|
+
.whitelist(toWhitelist.address, "did:test" + Math.random());
|
|
158
146
|
const newBalance = await ethers.provider.getBalance(admin2.address);
|
|
159
147
|
expect(newBalance).to.be.gte(expectedTopping);
|
|
160
148
|
});
|
|
@@ -166,9 +154,7 @@ describe("AdminWallet", () => {
|
|
|
166
154
|
|
|
167
155
|
it("should allow admin to whitelist and remove whitelist", async () => {
|
|
168
156
|
expect(await identity.isWhitelisted(whitelisted.address)).to.false;
|
|
169
|
-
await adminWallet
|
|
170
|
-
.connect(admin)
|
|
171
|
-
["whitelist(address,string)"](whitelisted.address, "did:test");
|
|
157
|
+
await adminWallet.connect(admin).whitelist(whitelisted.address, "did:test");
|
|
172
158
|
|
|
173
159
|
expect(await identity.isWhitelisted(whitelisted.address)).to.true;
|
|
174
160
|
await adminWallet.connect(admin).removeWhitelist(whitelisted.address);
|
|
@@ -178,14 +164,10 @@ describe("AdminWallet", () => {
|
|
|
178
164
|
it("should not allow non-admin to whitelist and remove whitelist", async () => {
|
|
179
165
|
expect(await identity.isWhitelisted(whitelisted.address)).to.false;
|
|
180
166
|
await expect(
|
|
181
|
-
adminWallet
|
|
182
|
-
.connect(stranger)
|
|
183
|
-
["whitelist(address,string)"](whitelisted.address, "did:test")
|
|
167
|
+
adminWallet.connect(stranger).whitelist(whitelisted.address, "did:test")
|
|
184
168
|
).revertedWith("Caller is not admin");
|
|
185
169
|
expect(await identity.isWhitelisted(whitelisted.address)).to.false;
|
|
186
|
-
await adminWallet
|
|
187
|
-
.connect(admin)
|
|
188
|
-
["whitelist(address,string)"](whitelisted.address, "did:test");
|
|
170
|
+
await adminWallet.connect(admin).whitelist(whitelisted.address, "did:test");
|
|
189
171
|
expect(await identity.isWhitelisted(whitelisted.address)).to.true;
|
|
190
172
|
await expect(
|
|
191
173
|
adminWallet.connect(stranger).removeWhitelist(whitelisted.address)
|
|
@@ -263,24 +245,20 @@ describe("AdminWallet", () => {
|
|
|
263
245
|
|
|
264
246
|
it("should whitelist user", async () => {
|
|
265
247
|
expect(await identity.isWhitelisted(stranger2.address)).to.false;
|
|
266
|
-
await adminWallet
|
|
267
|
-
.connect(admin2)
|
|
268
|
-
["whitelist(address,string)"](stranger2.address, "did:test3");
|
|
248
|
+
await adminWallet.connect(admin2).whitelist(stranger2.address, "did:test3");
|
|
269
249
|
expect(await identity.isWhitelisted(stranger2.address)).to.true;
|
|
270
250
|
});
|
|
271
251
|
|
|
272
252
|
it("should not allow whitelisting with existing did", async () => {
|
|
273
253
|
await expect(
|
|
274
|
-
adminWallet
|
|
275
|
-
.connect(admin2)
|
|
276
|
-
["whitelist(address,string)"](stranger.address, "did:test")
|
|
254
|
+
adminWallet.connect(admin2).whitelist(stranger.address, "did:test")
|
|
277
255
|
).revertedWith("DID already registered");
|
|
278
256
|
});
|
|
279
257
|
|
|
280
258
|
it("should not allow anyone to upgrade", async () => {
|
|
281
259
|
await expect(
|
|
282
260
|
adminWallet.connect(admin2).upgradeTo(adminWallet.address)
|
|
283
|
-
).revertedWith("not owner");
|
|
261
|
+
).revertedWith("Ownable: caller is not the owner");
|
|
284
262
|
});
|
|
285
263
|
|
|
286
264
|
it("should allow owner to upgrade", async () => {
|