@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
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
|
|
3
|
-
pragma solidity >=0.8;
|
|
4
|
-
|
|
5
|
-
import "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol";
|
|
6
|
-
import "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol";
|
|
7
|
-
import "@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol";
|
|
8
|
-
import "../Interfaces.sol";
|
|
9
|
-
import "../utils/NameService.sol";
|
|
10
|
-
|
|
11
|
-
// import "hardhat/console.sol";
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* @title InvitesV1 contract that handles invites with pre allocated bounty pool
|
|
15
|
-
* 1.1 adds invitee bonus
|
|
16
|
-
* 2 uses uups upgradeable - not compatible upgrade for v1
|
|
17
|
-
*/
|
|
18
|
-
contract InvitesV2 is Initializable, UUPSUpgradeable {
|
|
19
|
-
using SafeMathUpgradeable for uint256;
|
|
20
|
-
|
|
21
|
-
struct Stats {
|
|
22
|
-
uint256 totalApprovedInvites;
|
|
23
|
-
uint256 totalBountiesPaid;
|
|
24
|
-
uint256 totalInvited;
|
|
25
|
-
uint256[5] __reserevedSpace;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
struct User {
|
|
29
|
-
address invitedBy;
|
|
30
|
-
bytes32 inviteCode;
|
|
31
|
-
bool bountyPaid;
|
|
32
|
-
address[] invitees;
|
|
33
|
-
address[] pending;
|
|
34
|
-
uint256 level;
|
|
35
|
-
uint256 levelStarted;
|
|
36
|
-
uint256 totalApprovedInvites;
|
|
37
|
-
uint256 totalEarned;
|
|
38
|
-
uint256 joinedAt;
|
|
39
|
-
uint256[5] __reserevedSpace;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
struct Level {
|
|
43
|
-
uint256 toNext;
|
|
44
|
-
uint256 bounty; //in G$ cents ie 2 decimals
|
|
45
|
-
uint256 daysToComplete;
|
|
46
|
-
uint256[5] __reserevedSpace;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
mapping(bytes32 => address) public codeToUser;
|
|
50
|
-
mapping(address => User) public users;
|
|
51
|
-
address payable public avatar;
|
|
52
|
-
|
|
53
|
-
mapping(uint256 => Level) public levels;
|
|
54
|
-
|
|
55
|
-
address public owner;
|
|
56
|
-
NameService public nameService;
|
|
57
|
-
cERC20 public goodDollar;
|
|
58
|
-
bool public active;
|
|
59
|
-
Stats public stats;
|
|
60
|
-
|
|
61
|
-
bool public levelExpirationEnabled;
|
|
62
|
-
|
|
63
|
-
event InviteeJoined(address indexed inviter, address indexed invitee);
|
|
64
|
-
event InviterBounty(
|
|
65
|
-
address indexed inviter,
|
|
66
|
-
address indexed invitee,
|
|
67
|
-
uint256 bountyPaid,
|
|
68
|
-
uint256 inviterLevel,
|
|
69
|
-
bool earnedLevel
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
modifier ownerOrAvatar() {
|
|
73
|
-
require(
|
|
74
|
-
msg.sender == owner || msg.sender == avatar,
|
|
75
|
-
"Only owner or avatar can perform this action"
|
|
76
|
-
);
|
|
77
|
-
_;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
modifier onlyAvatar() {
|
|
81
|
-
require(msg.sender == avatar, "Only DAO avatar can perform this action");
|
|
82
|
-
_;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
modifier isActive() {
|
|
86
|
-
require(active);
|
|
87
|
-
_;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
function initialize(
|
|
91
|
-
address payable _avatar,
|
|
92
|
-
address _ns,
|
|
93
|
-
address _gd,
|
|
94
|
-
uint256 _level0Bounty,
|
|
95
|
-
address _owner
|
|
96
|
-
) public initializer {
|
|
97
|
-
owner = _owner;
|
|
98
|
-
nameService = NameService(_ns);
|
|
99
|
-
active = true;
|
|
100
|
-
Level storage lvl = levels[0];
|
|
101
|
-
lvl.bounty = _level0Bounty;
|
|
102
|
-
goodDollar = cERC20(_gd);
|
|
103
|
-
avatar = _avatar;
|
|
104
|
-
levelExpirationEnabled = false;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
function _authorizeUpgrade(address newImplementation)
|
|
108
|
-
internal
|
|
109
|
-
override
|
|
110
|
-
ownerOrAvatar
|
|
111
|
-
{}
|
|
112
|
-
|
|
113
|
-
function getIdentity() public view returns (IIdentityV2) {
|
|
114
|
-
return IIdentityV2(nameService.getAddress("IDENTITY"));
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
function setLevelExpirationEnabled(bool _isEnabled) public ownerOrAvatar {
|
|
118
|
-
levelExpirationEnabled = _isEnabled;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
function join(bytes32 _myCode, bytes32 _inviterCode) public isActive {
|
|
122
|
-
require(
|
|
123
|
-
codeToUser[_myCode] == address(0) || codeToUser[_myCode] == msg.sender,
|
|
124
|
-
"invite code already in use"
|
|
125
|
-
);
|
|
126
|
-
User storage user = users[msg.sender]; // this is not expensive as user is new
|
|
127
|
-
address inviter = codeToUser[_inviterCode];
|
|
128
|
-
//allow user to set inviter if doesnt have one
|
|
129
|
-
require(
|
|
130
|
-
user.inviteCode == 0x0 ||
|
|
131
|
-
(user.invitedBy == address(0) && inviter != address(0)),
|
|
132
|
-
"user already joined"
|
|
133
|
-
);
|
|
134
|
-
if (user.inviteCode == 0x0) {
|
|
135
|
-
user.inviteCode = _myCode;
|
|
136
|
-
user.levelStarted = block.timestamp;
|
|
137
|
-
user.joinedAt = block.timestamp;
|
|
138
|
-
codeToUser[_myCode] = msg.sender;
|
|
139
|
-
}
|
|
140
|
-
if (inviter != address(0)) {
|
|
141
|
-
user.invitedBy = inviter;
|
|
142
|
-
users[inviter].invitees.push(msg.sender);
|
|
143
|
-
users[inviter].pending.push(msg.sender);
|
|
144
|
-
stats.totalInvited += 1;
|
|
145
|
-
}
|
|
146
|
-
emit InviteeJoined(inviter, msg.sender);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
function canCollectBountyFor(address _invitee) public view returns (bool) {
|
|
150
|
-
address invitedBy = users[_invitee].invitedBy;
|
|
151
|
-
uint256 daysToComplete = levels[users[invitedBy].level].daysToComplete;
|
|
152
|
-
bool isLevelExpired = levelExpirationEnabled == true &&
|
|
153
|
-
daysToComplete > 0 &&
|
|
154
|
-
daysToComplete <
|
|
155
|
-
users[_invitee].joinedAt.sub(users[invitedBy].levelStarted).div(1 days);
|
|
156
|
-
|
|
157
|
-
return
|
|
158
|
-
invitedBy != address(0) &&
|
|
159
|
-
!users[_invitee].bountyPaid &&
|
|
160
|
-
getIdentity().isWhitelisted(_invitee) &&
|
|
161
|
-
getIdentity().isWhitelisted(invitedBy) &&
|
|
162
|
-
isLevelExpired == false;
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
function getInvitees(address _inviter)
|
|
166
|
-
public
|
|
167
|
-
view
|
|
168
|
-
returns (address[] memory)
|
|
169
|
-
{
|
|
170
|
-
return users[_inviter].invitees;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
function getPendingInvitees(address _inviter)
|
|
174
|
-
public
|
|
175
|
-
view
|
|
176
|
-
returns (address[] memory)
|
|
177
|
-
{
|
|
178
|
-
address[] memory pending = users[_inviter].pending;
|
|
179
|
-
uint256 cur = 0;
|
|
180
|
-
uint256 total = 0;
|
|
181
|
-
for (uint256 i; i < pending.length; i++) {
|
|
182
|
-
if (!users[pending[i]].bountyPaid) {
|
|
183
|
-
total++;
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
address[] memory result = new address[](total);
|
|
188
|
-
|
|
189
|
-
for (uint256 i; i < pending.length; i++) {
|
|
190
|
-
if (!users[pending[i]].bountyPaid) {
|
|
191
|
-
result[cur] = pending[i];
|
|
192
|
-
cur++;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
return result;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
function getPendingBounties(address _inviter) public view returns (uint256) {
|
|
200
|
-
address[] memory pending = users[_inviter].pending;
|
|
201
|
-
uint256 total = 0;
|
|
202
|
-
for (uint256 i; i < pending.length; i++) {
|
|
203
|
-
if (canCollectBountyFor(pending[i])) {
|
|
204
|
-
total++;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
return total;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
/**
|
|
211
|
-
* @dev pay bounty for the inviter of _invitee
|
|
212
|
-
* invitee need to be whitelisted
|
|
213
|
-
*/
|
|
214
|
-
function bountyFor(address _invitee)
|
|
215
|
-
public
|
|
216
|
-
isActive
|
|
217
|
-
returns (uint256 bounty)
|
|
218
|
-
{
|
|
219
|
-
require(canCollectBountyFor(_invitee), "user not elligble for bounty yet");
|
|
220
|
-
return _bountyFor(_invitee, true);
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
function _bountyFor(address _invitee, bool isSingleBounty)
|
|
224
|
-
internal
|
|
225
|
-
returns (uint256 bounty)
|
|
226
|
-
{
|
|
227
|
-
address invitedBy = users[_invitee].invitedBy;
|
|
228
|
-
uint256 joinedAt = users[_invitee].joinedAt;
|
|
229
|
-
Level memory level = levels[users[invitedBy].level];
|
|
230
|
-
|
|
231
|
-
bool isLevelExpired = level.daysToComplete > 0 &&
|
|
232
|
-
joinedAt > users[invitedBy].levelStarted && //prevent overflow in subtraction
|
|
233
|
-
level.daysToComplete <
|
|
234
|
-
joinedAt.sub(users[invitedBy].levelStarted).div(1 days); //how long after level started did invitee join
|
|
235
|
-
|
|
236
|
-
users[_invitee].bountyPaid = true;
|
|
237
|
-
users[invitedBy].totalApprovedInvites += 1;
|
|
238
|
-
users[invitedBy].totalEarned += level.bounty;
|
|
239
|
-
stats.totalApprovedInvites += 1;
|
|
240
|
-
stats.totalBountiesPaid += level.bounty;
|
|
241
|
-
|
|
242
|
-
bool earnedLevel = false;
|
|
243
|
-
if (
|
|
244
|
-
level.toNext > 0 &&
|
|
245
|
-
users[invitedBy].totalApprovedInvites >= level.toNext &&
|
|
246
|
-
isLevelExpired == false
|
|
247
|
-
) {
|
|
248
|
-
users[invitedBy].level += 1;
|
|
249
|
-
users[invitedBy].levelStarted = block.timestamp;
|
|
250
|
-
earnedLevel = true;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
if (isSingleBounty) goodDollar.transfer(invitedBy, level.bounty);
|
|
254
|
-
goodDollar.transfer(_invitee, level.bounty.div(2)); //pay invitee half the bounty
|
|
255
|
-
emit InviterBounty(
|
|
256
|
-
invitedBy,
|
|
257
|
-
_invitee,
|
|
258
|
-
level.bounty,
|
|
259
|
-
users[invitedBy].level,
|
|
260
|
-
earnedLevel
|
|
261
|
-
);
|
|
262
|
-
|
|
263
|
-
return level.bounty;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
@dev collect bounties for invitees by msg.sender that are now whitelisted
|
|
268
|
-
*/
|
|
269
|
-
function collectBounties() public isActive {
|
|
270
|
-
address[] storage pendings = users[msg.sender].pending;
|
|
271
|
-
uint256 totalBounties = 0;
|
|
272
|
-
for (int256 i = int256(pendings.length) - 1; i >= 0; i--) {
|
|
273
|
-
if (gasleft() < 100000) break;
|
|
274
|
-
address pending = pendings[uint256(i)];
|
|
275
|
-
if (canCollectBountyFor(pending)) {
|
|
276
|
-
totalBounties += _bountyFor(pending, false);
|
|
277
|
-
pendings.pop();
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
if (totalBounties > 0) goodDollar.transfer(msg.sender, totalBounties);
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
function setLevel(
|
|
284
|
-
uint256 _lvl,
|
|
285
|
-
uint256 _toNext,
|
|
286
|
-
uint256 _bounty,
|
|
287
|
-
uint256 _daysToComplete
|
|
288
|
-
) public ownerOrAvatar {
|
|
289
|
-
Level storage lvl = levels[_lvl];
|
|
290
|
-
lvl.toNext = _toNext;
|
|
291
|
-
lvl.daysToComplete = _daysToComplete;
|
|
292
|
-
lvl.bounty = _bounty;
|
|
293
|
-
}
|
|
294
|
-
|
|
295
|
-
function setActive(bool _active) public ownerOrAvatar {
|
|
296
|
-
active = _active;
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
function end() public ownerOrAvatar isActive {
|
|
300
|
-
uint256 gdBalance = goodDollar.balanceOf(address(this));
|
|
301
|
-
goodDollar.transfer(avatar, gdBalance);
|
|
302
|
-
avatar.transfer(address(this).balance);
|
|
303
|
-
active = false;
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* @dev
|
|
308
|
-
* 1.2.0 - final changes before release
|
|
309
|
-
* 1.3.0 - allow to set inviter later
|
|
310
|
-
* 1.4.0 - improve gas for bounty collection
|
|
311
|
-
* 1.5.0 - more gas improvements
|
|
312
|
-
*/
|
|
313
|
-
function version() public pure returns (string memory) {
|
|
314
|
-
return "1.5.0";
|
|
315
|
-
}
|
|
316
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
2
|
-
import { Contract } from "ethers";
|
|
3
|
-
|
|
4
|
-
import { deployDeterministic, printDeploy } from "./helpers";
|
|
5
|
-
import releaser from "../../scripts/releaser";
|
|
6
|
-
import dao from "../../releases/deployment.json";
|
|
7
|
-
|
|
8
|
-
const { name } = network;
|
|
9
|
-
|
|
10
|
-
export const deployProxy = async (defaultAdmin = null) => {
|
|
11
|
-
let release: { [key: string]: any } = dao[network.name] || {};
|
|
12
|
-
|
|
13
|
-
if (network.name.match(/production|staging|fuse/) && release.ProxyFactory) {
|
|
14
|
-
throw new Error("ProxyFactory already exists for env");
|
|
15
|
-
}
|
|
16
|
-
let [root] = await ethers.getSigners();
|
|
17
|
-
//generic call permissions
|
|
18
|
-
let schemeMock = root;
|
|
19
|
-
|
|
20
|
-
console.log("got signers:", {
|
|
21
|
-
network,
|
|
22
|
-
root: root.address,
|
|
23
|
-
schemeMock: schemeMock.address,
|
|
24
|
-
balance: await ethers.provider
|
|
25
|
-
.getBalance(root.address)
|
|
26
|
-
.then(_ => _.toString())
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const proxyFactory = await (
|
|
30
|
-
await ethers.getContractFactory("ProxyFactory1967")
|
|
31
|
-
).deploy();
|
|
32
|
-
|
|
33
|
-
release = {
|
|
34
|
-
ProxyFactory: proxyFactory.address
|
|
35
|
-
};
|
|
36
|
-
await releaser(release, network.name, "deployment", false);
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const main = async (networkName = name) => {
|
|
40
|
-
await deployProxy().catch(console.log);
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
if (process.argv[1].includes("proxyFactory-deploy")) {
|
|
44
|
-
main();
|
|
45
|
-
}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Deploy helper contracts
|
|
3
|
-
* AdminWallet, Faucet, Invites
|
|
4
|
-
*/
|
|
5
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
|
-
import { Contract } from "ethers";
|
|
7
|
-
import { defaultsDeep } from "lodash";
|
|
8
|
-
import { deployDeterministic } from "./helpers";
|
|
9
|
-
import releaser from "../releaser";
|
|
10
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
11
|
-
import dao from "../../releases/deployment.json";
|
|
12
|
-
import { TransactionResponse } from "@ethersproject/providers";
|
|
13
|
-
|
|
14
|
-
const { name } = network;
|
|
15
|
-
|
|
16
|
-
const printDeploy = async (
|
|
17
|
-
c: Contract | TransactionResponse
|
|
18
|
-
): Promise<Contract | TransactionResponse> => {
|
|
19
|
-
if (c instanceof Contract) {
|
|
20
|
-
await c.deployed();
|
|
21
|
-
console.log("deployed to: ", c.address);
|
|
22
|
-
}
|
|
23
|
-
if (c.wait) {
|
|
24
|
-
await c.wait();
|
|
25
|
-
console.log("tx done:", c.hash);
|
|
26
|
-
}
|
|
27
|
-
return c;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const deployHelpers = async () => {
|
|
31
|
-
let protocolSettings = defaultsDeep(
|
|
32
|
-
{},
|
|
33
|
-
ProtocolSettings[network.name],
|
|
34
|
-
ProtocolSettings["default"]
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
38
|
-
|
|
39
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
40
|
-
//generic call permissions
|
|
41
|
-
let schemeMock = root;
|
|
42
|
-
|
|
43
|
-
console.log("got signers:", {
|
|
44
|
-
network,
|
|
45
|
-
root: root.address,
|
|
46
|
-
schemeMock: schemeMock.address,
|
|
47
|
-
balance: await ethers.provider
|
|
48
|
-
.getBalance(root.address)
|
|
49
|
-
.then(_ => _.toString())
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
const walletAdmins = [];
|
|
53
|
-
for (let i = 0; i < protocolSettings.walletAdminsCount; i++) {
|
|
54
|
-
const wallet = ethers.Wallet.fromMnemonic(
|
|
55
|
-
process.env.ADMIN_WALLET_MNEMONIC,
|
|
56
|
-
`m/44'/60'/0'/0/${i}`
|
|
57
|
-
);
|
|
58
|
-
walletAdmins.push(wallet.address);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
console.log("deploying adminwallet", { walletAdmins });
|
|
62
|
-
const AdminWallet = (await deployDeterministic(
|
|
63
|
-
{
|
|
64
|
-
// address payable[] memory _admins,
|
|
65
|
-
// address _owner,
|
|
66
|
-
// IIdentityV2 _identity
|
|
67
|
-
name: "AdminWallet",
|
|
68
|
-
salt: "AdminWallet",
|
|
69
|
-
isUpgradeable: true
|
|
70
|
-
},
|
|
71
|
-
[walletAdmins, release.NameService, root.address, protocolSettings.gasPrice]
|
|
72
|
-
).then(printDeploy)) as Contract;
|
|
73
|
-
|
|
74
|
-
console.log("giving AdminWallet identity_admin permissions");
|
|
75
|
-
const identity = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
76
|
-
await identity.grantRole(
|
|
77
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")),
|
|
78
|
-
AdminWallet.address
|
|
79
|
-
);
|
|
80
|
-
|
|
81
|
-
const Faucet = await deployDeterministic(
|
|
82
|
-
{ name: "Faucet", salt: "Faucet", isUpgradeable: true },
|
|
83
|
-
[
|
|
84
|
-
release.NameService,
|
|
85
|
-
protocolSettings.gasPrice,
|
|
86
|
-
AdminWallet.address,
|
|
87
|
-
root.address
|
|
88
|
-
]
|
|
89
|
-
);
|
|
90
|
-
|
|
91
|
-
const Invites = await deployDeterministic(
|
|
92
|
-
{ name: "InvitesV2", salt: "InvitesV2", isUpgradeable: true },
|
|
93
|
-
[
|
|
94
|
-
release.Avatar,
|
|
95
|
-
release.NameService,
|
|
96
|
-
release.GoodDollar,
|
|
97
|
-
10000,
|
|
98
|
-
root.address
|
|
99
|
-
]
|
|
100
|
-
);
|
|
101
|
-
|
|
102
|
-
const adminWalletOwner = await AdminWallet.hasRole(
|
|
103
|
-
ethers.constants.HashZero,
|
|
104
|
-
root.address
|
|
105
|
-
);
|
|
106
|
-
const faucetOwner = await Faucet.hasRole(
|
|
107
|
-
ethers.constants.HashZero,
|
|
108
|
-
root.address
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
console.log("topping adminwallet and faucet with 1 native token");
|
|
112
|
-
await root.sendTransaction({
|
|
113
|
-
to: AdminWallet.address,
|
|
114
|
-
value: ethers.constants.WeiPerEther
|
|
115
|
-
});
|
|
116
|
-
await root.sendTransaction({
|
|
117
|
-
to: Faucet.address,
|
|
118
|
-
value: ethers.constants.WeiPerEther
|
|
119
|
-
});
|
|
120
|
-
|
|
121
|
-
if (!network.name.includes("production")) {
|
|
122
|
-
console.log("minting G$s to invites on dev envs");
|
|
123
|
-
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
124
|
-
await gd.mint(Invites.address, 1e8); //1million GD (2 decimals)
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
console.log({
|
|
128
|
-
adminWalletOwner,
|
|
129
|
-
faucetOwner
|
|
130
|
-
});
|
|
131
|
-
|
|
132
|
-
release = {
|
|
133
|
-
AdminWallet: AdminWallet.address,
|
|
134
|
-
Faucet: Faucet.address,
|
|
135
|
-
Invites: Invites.address
|
|
136
|
-
};
|
|
137
|
-
await releaser(release, network.name, "deployment", false);
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export const main = async (networkName = name) => {
|
|
141
|
-
await deployHelpers().catch(console.log);
|
|
142
|
-
};
|
|
143
|
-
main();
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Deploy helper contracts
|
|
3
|
-
* AdminWallet, Faucet, Invites
|
|
4
|
-
*/
|
|
5
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
|
-
import { Contract } from "ethers";
|
|
7
|
-
import { defaultsDeep } from "lodash";
|
|
8
|
-
import { deployDeterministic, executeViaGuardian } from "./helpers";
|
|
9
|
-
import releaser from "../releaser";
|
|
10
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
11
|
-
import dao from "../../releases/deployment.json";
|
|
12
|
-
import { TransactionResponse } from "@ethersproject/providers";
|
|
13
|
-
import { InvitesV1__factory } from "../../types";
|
|
14
|
-
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
|
|
15
|
-
|
|
16
|
-
const { name } = network;
|
|
17
|
-
|
|
18
|
-
const printDeploy = async (
|
|
19
|
-
c: Contract | TransactionResponse
|
|
20
|
-
): Promise<Contract | TransactionResponse> => {
|
|
21
|
-
if (c instanceof Contract) {
|
|
22
|
-
await c.deployed();
|
|
23
|
-
console.log("deployed to: ", c.address);
|
|
24
|
-
}
|
|
25
|
-
if (c.wait) {
|
|
26
|
-
await c.wait();
|
|
27
|
-
console.log("tx done:", c.hash);
|
|
28
|
-
}
|
|
29
|
-
return c;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const deployHelpers = async () => {
|
|
33
|
-
let protocolSettings = defaultsDeep(
|
|
34
|
-
{},
|
|
35
|
-
ProtocolSettings[network.name],
|
|
36
|
-
ProtocolSettings["default"]
|
|
37
|
-
);
|
|
38
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
39
|
-
|
|
40
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
41
|
-
//generic call permissions
|
|
42
|
-
let schemeMock = root;
|
|
43
|
-
|
|
44
|
-
console.log("got signers:", {
|
|
45
|
-
network,
|
|
46
|
-
root: root.address,
|
|
47
|
-
schemeMock: schemeMock.address,
|
|
48
|
-
balance: await ethers.provider
|
|
49
|
-
.getBalance(root.address)
|
|
50
|
-
.then(_ => _.toString())
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
console.log("deploying ubi pool");
|
|
54
|
-
const UBIScheme = (await deployDeterministic(
|
|
55
|
-
{
|
|
56
|
-
name: "UBIScheme",
|
|
57
|
-
isUpgradeable: true
|
|
58
|
-
},
|
|
59
|
-
[
|
|
60
|
-
release.NameService,
|
|
61
|
-
ethers.constants.AddressZero,
|
|
62
|
-
protocolSettings.ubi.maxInactiveDays
|
|
63
|
-
]
|
|
64
|
-
).then(printDeploy)) as Contract;
|
|
65
|
-
|
|
66
|
-
console.log("deploying claimers distribution");
|
|
67
|
-
|
|
68
|
-
const ClaimersDistribution = (await deployDeterministic(
|
|
69
|
-
{ name: "ClaimersDistribution", isUpgradeable: true },
|
|
70
|
-
[release.NameService]
|
|
71
|
-
).then(printDeploy)) as Contract;
|
|
72
|
-
|
|
73
|
-
console.log("setting nameservice addresses via guardian");
|
|
74
|
-
const proposalContracts = [
|
|
75
|
-
release.NameService //nameservice add MinterWrapper
|
|
76
|
-
];
|
|
77
|
-
|
|
78
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
79
|
-
|
|
80
|
-
const proposalFunctionSignatures = [
|
|
81
|
-
"setAddresses(bytes32[],address[])" //add ubischeme and claimersdistribution in nameservice
|
|
82
|
-
];
|
|
83
|
-
|
|
84
|
-
const proposalFunctionInputs = [
|
|
85
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
86
|
-
["bytes32[]", "address[]"],
|
|
87
|
-
[
|
|
88
|
-
[
|
|
89
|
-
keccak256(toUtf8Bytes("UBISCHEME")),
|
|
90
|
-
keccak256(toUtf8Bytes("GDAO_CLAIMERS"))
|
|
91
|
-
],
|
|
92
|
-
[UBIScheme.address, ClaimersDistribution.address]
|
|
93
|
-
]
|
|
94
|
-
)
|
|
95
|
-
];
|
|
96
|
-
|
|
97
|
-
await executeViaGuardian(
|
|
98
|
-
proposalContracts,
|
|
99
|
-
proposalEthValues,
|
|
100
|
-
proposalFunctionSignatures,
|
|
101
|
-
proposalFunctionInputs,
|
|
102
|
-
root
|
|
103
|
-
);
|
|
104
|
-
|
|
105
|
-
if (!network.name.includes("production")) {
|
|
106
|
-
console.log("minting G$s to pool on dev envs");
|
|
107
|
-
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
108
|
-
await gd.mint(UBIScheme.address, 1e8); //1million GD (2 decimals)
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
release = {
|
|
112
|
-
UBIScheme: UBIScheme.address,
|
|
113
|
-
ClaimersDistribution: ClaimersDistribution.address
|
|
114
|
-
};
|
|
115
|
-
await releaser(release, network.name, "deployment", false);
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const main = async (networkName = name) => {
|
|
119
|
-
await deployHelpers().catch(console.log);
|
|
120
|
-
};
|
|
121
|
-
main();
|