@gooddollar/goodprotocol 2.1.4 → 2.2.0-beta.1
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/IdentityV4.min.json +1 -0
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
- package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ISwapRouter.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/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +2 -2
- package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +4 -0
- package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +1162 -0
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/contracts/identity/IdentityV3.sol +0 -3
- package/contracts/identity/IdentityV4.sol +578 -0
- package/hardhat.config.ts +3 -4
- package/package.json +8 -4
- package/releases/deployment.json +691 -1
- package/test/governance/ClaimersDistribution.test.ts +1 -1
- package/test/governance/CompoundVotingMachine.castvote.test.ts +30 -30
- package/test/helpers.ts +76 -195
- package/test/identity/IdentityV3.test.ts +53 -129
- package/test/identity/IdentityV4.test.ts +454 -0
- package/test/reserve/GenericDistributionHelper.e2e.test.ts +445 -0
- package/test/utils/AdminWallet.test.ts +14 -15
- package/types/contracts/identity/IdentityV4.ts +2001 -0
- package/types/contracts/identity/index.ts +1 -0
- package/types/contracts/utils/UpdateReserveRatio.sol/MentoExchange.ts +81 -0
- package/types/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.ts +134 -0
- package/types/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
- package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts +7 -2
- package/types/contracts/utils/index.ts +2 -0
- package/types/factories/contracts/identity/IdentityV3__factory.ts +1 -1
- package/types/factories/contracts/identity/IdentityV4__factory.ts +1213 -0
- package/types/factories/contracts/identity/index.ts +1 -0
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/MentoExchange__factory.ts +39 -0
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +113 -0
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
- package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +9 -15
- package/types/factories/contracts/utils/index.ts +1 -0
- package/types/hardhat.d.ts +27 -0
- package/types/index.ts +4 -0
- package/scripts/ProxyFactory.json +0 -4425
- package/scripts/analytics/activeGDStakers.ts +0 -188
- package/scripts/analytics/activeStakers.ts +0 -25
- package/scripts/analytics/activeUsersCount.ts +0 -156
- package/scripts/analytics/activeWalletsStats.ts +0 -301
- package/scripts/analytics/checkActiveWallets.ts +0 -60
- package/scripts/analytics/checkBridgeBalances.ts +0 -442
- package/scripts/analytics/claimIncidentStats.ts +0 -98
- package/scripts/analytics/faucetStats.ts +0 -130
- package/scripts/analytics/gdinflow.ts +0 -57
- package/scripts/analytics/goodHolders.ts +0 -46
- package/scripts/analytics/goodgiveback.ts +0 -64
- package/scripts/analytics/p2pTxs.ts +0 -564
- package/scripts/analytics/stuckgd.ts +0 -70
- package/scripts/analytics/tokenInOutStats.ts +0 -48
- package/scripts/analytics/whitelistsyncIssue.ts +0 -87
- package/scripts/bulkProof.ts +0 -202
- package/scripts/bulkWhitelist.ts +0 -31
- package/scripts/deployGnosisSafe.ts +0 -111
- package/scripts/fetchOrDeployProxyFactory.ts +0 -46
- package/scripts/fv.ts +0 -263
- package/scripts/gdx/gdxAirdropCalculation.ts +0 -479
- package/scripts/getFounders.ts +0 -32
- package/scripts/governance/README.md +0 -70
- package/scripts/governance/airdropCalculation.ts +0 -1119
- package/scripts/governance/airdropCalculationRecover.ts +0 -416
- package/scripts/governance/airdropCalculationSorted.ts +0 -438
- package/scripts/governance/goodCheckpointSorted.ts +0 -300
- package/scripts/keeper/fishInactive.ts +0 -47
- package/scripts/minimize.sh +0 -17
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -131
- package/scripts/multichain-deploy/1_basicdao-deploy.ts +0 -294
- package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -152
- package/scripts/multichain-deploy/2b_otp-deploy.ts +0 -73
- package/scripts/multichain-deploy/3_gdSavings-deploy.ts +0 -190
- package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -129
- package/scripts/multichain-deploy/5_gov-deploy.ts +0 -179
- package/scripts/multichain-deploy/6_testnetFaucet.ts +0 -85
- package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +0 -123
- package/scripts/multichain-deploy/8_disthelper-deploy.ts +0 -152
- package/scripts/multichain-deploy/createUniswapTestPools.ts +0 -163
- package/scripts/multichain-deploy/flattened/Avatar.sol +0 -913
- package/scripts/multichain-deploy/flattened/Controller.sol +0 -1891
- package/scripts/multichain-deploy/flattened/FeeFormula.sol +0 -1290
- package/scripts/multichain-deploy/fulldeploy.sh +0 -26
- package/scripts/multichain-deploy/helpers.ts +0 -647
- package/scripts/multichain-deploy/multichainWrapper-deploy.ts +0 -59
- package/scripts/multichain-deploy/verifyEtherscan.ts +0 -177
- package/scripts/proposals/gip-14_1.ts +0 -251
- package/scripts/proposals/gip-15.ts +0 -427
- package/scripts/proposals/gip-25-xdc-upgrade-ubi.ts +0 -746
- package/scripts/proposals/gips-14_1.md +0 -29
- package/scripts/proposals/hack-ubi-recovery.ts +0 -414
- package/scripts/proposals/identityAuthPeriod.ts +0 -229
- package/scripts/proposals/reserveRestore.ts +0 -474
- package/scripts/proposals/updateDistHelper.ts +0 -180
- package/scripts/proposals/v4Upgrade.ts +0 -845
- package/scripts/releaser.js +0 -24
- package/scripts/staking/stakersGdRewardsCalculation.ts +0 -64
- package/scripts/upgradeScheme.ts +0 -97
- package/scripts/upgradeToV2/upgradeToV2.ts +0 -853
- package/scripts/upgradeToV2/upgradeToV2Recover.ts +0 -939
- package/scripts/upgradeToV3/v3-fix.ts +0 -120
- package/scripts/upgradeToV3/v3-fuse-multichain.ts +0 -117
- package/scripts/upgradeToV3/v3-upgrade.ts +0 -219
- package/scripts/upgrades/celo-defi-ubi-deploy.ts +0 -184
- package/scripts/upgrades/identity-upgrade.ts +0 -126
- package/scripts/upgrades/multichain-formula-upgrade.ts +0 -143
- package/scripts/upgrades/multichain-temp-fix.ts +0 -129
- package/scripts/upgrades/restoreFunds.ts +0 -91
- package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +0 -159
- package/scripts/upgrades/transferDaoToGuardians.ts +0 -80
- package/scripts/upgrades/upgradeAdminWallet.ts +0 -29
- package/scripts/upgrades/upgradeFaucet.ts +0 -46
- package/scripts/utils.ts +0 -50
- package/scripts/verify.ts +0 -67
- package/scripts/voltageswaps.ts +0 -46
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* complete deploy of the new G$ savings concept
|
|
3
|
-
* steps required:
|
|
4
|
-
* sidechain
|
|
5
|
-
* 1. deploy GoodDollarMintBurnWrapper
|
|
6
|
-
* 2. deploy G$Savings
|
|
7
|
-
* 3. create proposal to:
|
|
8
|
-
* - add G$Savings as rewards minter on GoodDollarMintBurnWraper
|
|
9
|
-
* - register GoodDollarMintBurnWrapper as scheme so it can call mint on controller
|
|
10
|
-
* - register G$Savings as scheme so it can handle upgrade from GovernanceStaking
|
|
11
|
-
* - add GoodDollarMintBurnWraper to name service
|
|
12
|
-
*
|
|
13
|
-
* mainnet:
|
|
14
|
-
* 1. deploy new reserve implementation
|
|
15
|
-
* 2. deploy DistributionHelper
|
|
16
|
-
* 3. create proposal to upgrade reserve
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
21
|
-
import { Contract, Signer } from "ethers";
|
|
22
|
-
import { defaultsDeep } from "lodash";
|
|
23
|
-
|
|
24
|
-
import {
|
|
25
|
-
deployDeterministic,
|
|
26
|
-
printDeploy,
|
|
27
|
-
executeViaGuardian,
|
|
28
|
-
executeViaSafe,
|
|
29
|
-
verifyProductionSigner
|
|
30
|
-
} from "./helpers";
|
|
31
|
-
import releaser from "../../scripts/releaser";
|
|
32
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
33
|
-
import dao from "../../releases/deployment.json";
|
|
34
|
-
import { deployWrapper } from "./multichainWrapper-deploy";
|
|
35
|
-
import { GoodDollarMintBurnWrapper, Controller, NameService } from "../../types";
|
|
36
|
-
const { name: networkName } = network;
|
|
37
|
-
|
|
38
|
-
export const deploySidechain = async () => {
|
|
39
|
-
const isProduction = networkName.includes("production");
|
|
40
|
-
let [root] = await ethers.getSigners();
|
|
41
|
-
|
|
42
|
-
if (isProduction) verifyProductionSigner(root);
|
|
43
|
-
|
|
44
|
-
let release: { [key: string]: any } = dao[networkName];
|
|
45
|
-
let settings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
46
|
-
|
|
47
|
-
console.log("got signers:", {
|
|
48
|
-
networkName,
|
|
49
|
-
root: root.address,
|
|
50
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
let Wrapper;
|
|
54
|
-
if (!release.GoodDollarMintBurnWrapper) Wrapper = (await deployWrapper(release.Avatar)) as GoodDollarMintBurnWrapper;
|
|
55
|
-
else {
|
|
56
|
-
Wrapper = await ethers.getContractAt("GoodDollarMintBurnWrapper", release.GoodDollarMintBurnWrapper);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
console.log("deploying savings...");
|
|
60
|
-
|
|
61
|
-
let GDSavings;
|
|
62
|
-
if (!release.GoodDollarStaking) {
|
|
63
|
-
GDSavings = (await deployDeterministic(
|
|
64
|
-
{
|
|
65
|
-
name: "GoodDollarStaking",
|
|
66
|
-
isUpgradeable: false
|
|
67
|
-
},
|
|
68
|
-
[
|
|
69
|
-
release.NameService,
|
|
70
|
-
ethers.BigNumber.from(settings.savings.blockAPY),
|
|
71
|
-
ethers.BigNumber.from(settings.savings.blocksPerYear),
|
|
72
|
-
settings.savings.daysUntilUpgrade
|
|
73
|
-
]
|
|
74
|
-
).then(printDeploy)) as Contract;
|
|
75
|
-
|
|
76
|
-
let torelease = {
|
|
77
|
-
GoodDollarStaking: GDSavings.address
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
await releaser(torelease, networkName, "deployment", false);
|
|
81
|
-
} else {
|
|
82
|
-
GDSavings = await ethers.getContractAt("GoodDollarStaking", release.GoodDollarStaking);
|
|
83
|
-
}
|
|
84
|
-
if (networkName.includes("production"))
|
|
85
|
-
return console.log("Skipping proposal/upgrade for production, need to perform manually");
|
|
86
|
-
|
|
87
|
-
await executeProposal(GDSavings.address, Wrapper.address, settings.guardiansSafe);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
const executeProposal = async (savingsAddress: string, wrapperAddress: string, guardiansSafe: string) => {
|
|
91
|
-
console.log("executing savings + wrapper proposal");
|
|
92
|
-
const isProduction = networkName.includes("production");
|
|
93
|
-
const viaGuardians = false;
|
|
94
|
-
let release: { [key: string]: any } = dao[networkName];
|
|
95
|
-
savingsAddress = savingsAddress || release.GoodDollarStaking;
|
|
96
|
-
wrapperAddress = wrapperAddress || release.GoodDollarMintBurnWrapper;
|
|
97
|
-
|
|
98
|
-
let [root] = await ethers.getSigners();
|
|
99
|
-
/// we now use guardians and not direct onchain voting, so no need for proposer
|
|
100
|
-
//on celo we dont need voting yet to deploy it.
|
|
101
|
-
//dev env dont use voting for test purposes
|
|
102
|
-
// const proposer =
|
|
103
|
-
// !networkName.includes("celo") &&
|
|
104
|
-
// (isProduction || networkName.includes("staging"))
|
|
105
|
-
// ? new ethers.Wallet(process.env.PROPOSER_KEY, ethers.provider)
|
|
106
|
-
// : root; //need proposer with 0.3% of GOOD tokens
|
|
107
|
-
|
|
108
|
-
const ctrl = (await ethers.getContractAt("Controller", release.Controller)) as Controller;
|
|
109
|
-
|
|
110
|
-
const ns = (await ethers.getContractAt("NameService", release.NameService)) as NameService;
|
|
111
|
-
|
|
112
|
-
const proposalContracts = [
|
|
113
|
-
wrapperAddress, //MinterWrapper -> add GDSavings
|
|
114
|
-
ctrl.address, //controller -> add MinterWrapper as scheme
|
|
115
|
-
ctrl.address, // controller -> add GDSavings as scheme
|
|
116
|
-
ns.address //nameservice add MinterWrapper
|
|
117
|
-
];
|
|
118
|
-
|
|
119
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
120
|
-
|
|
121
|
-
const proposalFunctionSignatures = [
|
|
122
|
-
"addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)", //add gooddollarstaking as minter in gooddollarwrapper
|
|
123
|
-
"registerScheme(address,bytes32,bytes4,address)", //make sure gooddollarwrapper is a registered scheme so it can mint G$ tokens
|
|
124
|
-
"registerScheme(address,bytes32,bytes4,address)", //make sure gdsavings has generic call so it can perform the upgrade process
|
|
125
|
-
"setAddress(string,address)" //add gooddollarwrapper in nameservice
|
|
126
|
-
];
|
|
127
|
-
|
|
128
|
-
const proposalFunctionInputs = [
|
|
129
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
130
|
-
["address", "uint256", "uint256", "uint32", "uint256", "uint256", "uint32", "bool"],
|
|
131
|
-
[savingsAddress, 0, 0, 30, 0, 0, 0, true]
|
|
132
|
-
), //function addMinter(
|
|
133
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
134
|
-
["address", "bytes32", "bytes4", "address"],
|
|
135
|
-
[
|
|
136
|
-
wrapperAddress, //scheme
|
|
137
|
-
ethers.constants.HashZero, //paramshash
|
|
138
|
-
"0x00000001", //permissions - minimal
|
|
139
|
-
release.Avatar
|
|
140
|
-
]
|
|
141
|
-
),
|
|
142
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
143
|
-
["address", "bytes32", "bytes4", "address"],
|
|
144
|
-
[
|
|
145
|
-
savingsAddress, //scheme
|
|
146
|
-
ethers.constants.HashZero, //paramshash
|
|
147
|
-
"0x000000f1", //permissions - genericcall
|
|
148
|
-
release.Avatar
|
|
149
|
-
]
|
|
150
|
-
),
|
|
151
|
-
ethers.utils.defaultAbiCoder.encode(["string", "address"], ["MINTBURN_WRAPPER", wrapperAddress])
|
|
152
|
-
];
|
|
153
|
-
|
|
154
|
-
if (!viaGuardians) {
|
|
155
|
-
console.log("upgrading via owner...");
|
|
156
|
-
|
|
157
|
-
await executeViaGuardian(
|
|
158
|
-
proposalContracts,
|
|
159
|
-
proposalEthValues,
|
|
160
|
-
proposalFunctionSignatures,
|
|
161
|
-
proposalFunctionInputs,
|
|
162
|
-
root
|
|
163
|
-
);
|
|
164
|
-
} else {
|
|
165
|
-
console.log("upgrading via guardians safe...");
|
|
166
|
-
//create proposal
|
|
167
|
-
await executeViaSafe(
|
|
168
|
-
proposalContracts,
|
|
169
|
-
proposalEthValues,
|
|
170
|
-
proposalFunctionSignatures,
|
|
171
|
-
proposalFunctionInputs,
|
|
172
|
-
guardiansSafe
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
const Controller = await ethers.getContractAt("Controller", release.Controller);
|
|
177
|
-
const wrapperDaoPermissions = await Controller.getSchemePermissions(wrapperAddress, release.Avatar);
|
|
178
|
-
const savingsDaoPermissions = await Controller.getSchemePermissions(savingsAddress, release.Avatar);
|
|
179
|
-
|
|
180
|
-
console.log({
|
|
181
|
-
wrapperDaoPermissions,
|
|
182
|
-
savingsDaoPermissions
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
|
|
186
|
-
export const main = async () => {
|
|
187
|
-
await deploySidechain();
|
|
188
|
-
// await executeProposal(undefined, undefined);
|
|
189
|
-
};
|
|
190
|
-
if (process.argv[1].includes("gdSavings")) main();
|
|
@@ -1,129 +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 { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
-
import {
|
|
10
|
-
deployDeterministic,
|
|
11
|
-
executeViaGuardian,
|
|
12
|
-
executeViaSafe,
|
|
13
|
-
verifyContract,
|
|
14
|
-
verifyProductionSigner
|
|
15
|
-
} from "./helpers";
|
|
16
|
-
import releaser from "../releaser";
|
|
17
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
18
|
-
import dao from "../../releases/deployment.json";
|
|
19
|
-
import { TransactionResponse } from "@ethersproject/providers";
|
|
20
|
-
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
|
|
21
|
-
|
|
22
|
-
const { name } = network;
|
|
23
|
-
|
|
24
|
-
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
25
|
-
if (c instanceof Contract) {
|
|
26
|
-
await c.deployed();
|
|
27
|
-
console.log("deployed to: ", c.address);
|
|
28
|
-
}
|
|
29
|
-
if (c.wait) {
|
|
30
|
-
await c.wait();
|
|
31
|
-
console.log("tx done:", c.hash);
|
|
32
|
-
}
|
|
33
|
-
return c;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const deployHelpers = async () => {
|
|
37
|
-
const viaGuardians = false;
|
|
38
|
-
|
|
39
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
40
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
41
|
-
|
|
42
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
43
|
-
const isProduction = network.name.includes("production");
|
|
44
|
-
|
|
45
|
-
if (isProduction) verifyProductionSigner(root);
|
|
46
|
-
//generic call permissions
|
|
47
|
-
let schemeMock = root;
|
|
48
|
-
|
|
49
|
-
console.log("got signers:", {
|
|
50
|
-
network,
|
|
51
|
-
root: root.address,
|
|
52
|
-
schemeMock: schemeMock.address,
|
|
53
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
console.log("deploying ubi pool");
|
|
57
|
-
const UBIScheme = (await deployDeterministic(
|
|
58
|
-
{
|
|
59
|
-
name: "UBISchemeV2",
|
|
60
|
-
factory: await ethers.getContractFactory("UBISchemeV2"),
|
|
61
|
-
isUpgradeable: true
|
|
62
|
-
},
|
|
63
|
-
[release.NameService, protocolSettings.ubi.minActiveUsers]
|
|
64
|
-
).then(printDeploy)) as Contract;
|
|
65
|
-
|
|
66
|
-
const torelease = {
|
|
67
|
-
UBIScheme: UBIScheme.address
|
|
68
|
-
};
|
|
69
|
-
release = {
|
|
70
|
-
...release,
|
|
71
|
-
...torelease
|
|
72
|
-
};
|
|
73
|
-
await releaser(torelease, network.name, "deployment", false);
|
|
74
|
-
|
|
75
|
-
console.log("setting nameservice addresses via guardian");
|
|
76
|
-
const proposalContracts = [
|
|
77
|
-
release.NameService //nameservice
|
|
78
|
-
];
|
|
79
|
-
|
|
80
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
81
|
-
|
|
82
|
-
const proposalFunctionSignatures = [
|
|
83
|
-
"setAddresses(bytes32[],address[])" //add ubischeme
|
|
84
|
-
];
|
|
85
|
-
|
|
86
|
-
const proposalFunctionInputs = [
|
|
87
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
88
|
-
["bytes32[]", "address[]"],
|
|
89
|
-
[[keccak256(toUtf8Bytes("UBISCHEME"))], [UBIScheme.address]]
|
|
90
|
-
)
|
|
91
|
-
];
|
|
92
|
-
|
|
93
|
-
if (!name.includes("production")) {
|
|
94
|
-
console.log("minting G$s to pool on dev envs");
|
|
95
|
-
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
96
|
-
const decimals = await gd.decimals();
|
|
97
|
-
await gd.mint(UBIScheme.address, ethers.BigNumber.from(1e6).mul(ethers.BigNumber.from("10").pow(decimals))); //1million GD
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
try {
|
|
101
|
-
if (viaGuardians) {
|
|
102
|
-
await executeViaSafe(
|
|
103
|
-
proposalContracts,
|
|
104
|
-
proposalEthValues,
|
|
105
|
-
proposalFunctionSignatures,
|
|
106
|
-
proposalFunctionInputs,
|
|
107
|
-
protocolSettings.guardiansSafe
|
|
108
|
-
);
|
|
109
|
-
} else {
|
|
110
|
-
await executeViaGuardian(
|
|
111
|
-
proposalContracts,
|
|
112
|
-
proposalEthValues,
|
|
113
|
-
proposalFunctionSignatures,
|
|
114
|
-
proposalFunctionInputs,
|
|
115
|
-
root
|
|
116
|
-
);
|
|
117
|
-
}
|
|
118
|
-
} catch (e) {
|
|
119
|
-
console.error("proposal execution failed...", e.message);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
let impl = await getImplementationAddress(ethers.provider, UBIScheme.address);
|
|
123
|
-
await verifyContract(impl, "contracts/ubi/UBISchemeV2.sol:UBISchemeV2", network.name);
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
export const main = async (networkName = name) => {
|
|
127
|
-
await deployHelpers();
|
|
128
|
-
};
|
|
129
|
-
main();
|
|
@@ -1,179 +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 { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
-
import {
|
|
10
|
-
deployDeterministic,
|
|
11
|
-
executeViaGuardian,
|
|
12
|
-
executeViaSafe,
|
|
13
|
-
verifyProductionSigner,
|
|
14
|
-
verifyContract
|
|
15
|
-
} from "./helpers";
|
|
16
|
-
import releaser from "../releaser";
|
|
17
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
18
|
-
import dao from "../../releases/deployment.json";
|
|
19
|
-
import { TransactionResponse } from "@ethersproject/providers";
|
|
20
|
-
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
|
|
21
|
-
|
|
22
|
-
const { name } = network;
|
|
23
|
-
|
|
24
|
-
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
25
|
-
if (c instanceof Contract) {
|
|
26
|
-
await c.deployed();
|
|
27
|
-
console.log("deployed to: ", c.address);
|
|
28
|
-
}
|
|
29
|
-
if (c.wait) {
|
|
30
|
-
await c.wait();
|
|
31
|
-
console.log("tx done:", c.hash);
|
|
32
|
-
}
|
|
33
|
-
return c;
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export const deployGov = async () => {
|
|
37
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
38
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
39
|
-
|
|
40
|
-
let [root] = await ethers.getSigners();
|
|
41
|
-
const isProduction = name.includes("production");
|
|
42
|
-
const viaGuardians = false;
|
|
43
|
-
|
|
44
|
-
if (isProduction) verifyProductionSigner(root);
|
|
45
|
-
|
|
46
|
-
const daoOwner = isProduction ? protocolSettings.guardiansSafe : root.address;
|
|
47
|
-
|
|
48
|
-
console.log("got signers:", {
|
|
49
|
-
network,
|
|
50
|
-
root: root.address,
|
|
51
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
const GReputation = (await deployDeterministic(
|
|
55
|
-
{
|
|
56
|
-
name: "GReputation",
|
|
57
|
-
isUpgradeable: true,
|
|
58
|
-
initializer: "initialize(address, string, bytes32, uint256)"
|
|
59
|
-
},
|
|
60
|
-
[
|
|
61
|
-
release.NameService,
|
|
62
|
-
"fuse",
|
|
63
|
-
protocolSettings.governance.gdaoAirdrop, //should fail on real deploy if not set
|
|
64
|
-
protocolSettings.governance.gdaoTotalSupply //should fail on real deploy if not set
|
|
65
|
-
]
|
|
66
|
-
).then(printDeploy)) as Contract;
|
|
67
|
-
|
|
68
|
-
console.log("deploying voting machine");
|
|
69
|
-
|
|
70
|
-
const VotingMachine = (await deployDeterministic(
|
|
71
|
-
{
|
|
72
|
-
name: "CompoundVotingMachine",
|
|
73
|
-
isUpgradeable: true
|
|
74
|
-
},
|
|
75
|
-
[
|
|
76
|
-
release.NameService,
|
|
77
|
-
protocolSettings.governance.proposalVotingPeriod,
|
|
78
|
-
protocolSettings.governance.guardian,
|
|
79
|
-
release.GReputation
|
|
80
|
-
]
|
|
81
|
-
).then(printDeploy)) as Contract;
|
|
82
|
-
|
|
83
|
-
console.log("deploying claimers distribution");
|
|
84
|
-
|
|
85
|
-
const ClaimersDistribution = (await deployDeterministic({ name: "ClaimersDistribution", isUpgradeable: true }, [
|
|
86
|
-
release.NameService
|
|
87
|
-
]).then(printDeploy)) as Contract;
|
|
88
|
-
|
|
89
|
-
const torelease = {
|
|
90
|
-
CompoundVotingMachine: VotingMachine.address,
|
|
91
|
-
GReputation: GReputation.address,
|
|
92
|
-
ClaimersDistribution: ClaimersDistribution.address
|
|
93
|
-
};
|
|
94
|
-
release = {
|
|
95
|
-
...release,
|
|
96
|
-
...torelease
|
|
97
|
-
};
|
|
98
|
-
await releaser(torelease, network.name, "deployment", false);
|
|
99
|
-
|
|
100
|
-
const deployerIsNotRepMinter = (await GReputation.hasRole(GReputation.MINTER_ROLE(), root.address)) === false;
|
|
101
|
-
const avatarIsRepMinter = await GReputation.hasRole(GReputation.MINTER_ROLE(), release.Avatar);
|
|
102
|
-
const grepHasDAOSet = (await GReputation.nameService()) === release.NameService;
|
|
103
|
-
const factoryIsNotGoodOwner = (await GReputation.hasRole(ethers.constants.HashZero, release.ProxyFactory)) === false;
|
|
104
|
-
console.log("verify GReputation permissions", {
|
|
105
|
-
deployerIsNotRepMinter,
|
|
106
|
-
avatarIsRepMinter,
|
|
107
|
-
grepHasDAOSet,
|
|
108
|
-
factoryIsNotGoodOwner
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
console.log("adding genericcall permissions to voting contract.");
|
|
112
|
-
const proposalContracts = [
|
|
113
|
-
release.NameService,
|
|
114
|
-
release.Controller //nameservice add MinterWrapper
|
|
115
|
-
];
|
|
116
|
-
|
|
117
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
118
|
-
|
|
119
|
-
const proposalFunctionSignatures = [
|
|
120
|
-
"setAddresses(bytes32[],address[])", //add reputation
|
|
121
|
-
"registerScheme(address,bytes32,bytes4,address)" //make sure compoundvotingmachine has generic call so it can control the DAO
|
|
122
|
-
];
|
|
123
|
-
|
|
124
|
-
const proposalFunctionInputs = [
|
|
125
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
126
|
-
["bytes32[]", "address[]"],
|
|
127
|
-
[
|
|
128
|
-
[keccak256(toUtf8Bytes("REPUTATION")), keccak256(toUtf8Bytes("GDAO_CLAIMERS"))],
|
|
129
|
-
[GReputation.address, ClaimersDistribution.address]
|
|
130
|
-
]
|
|
131
|
-
),
|
|
132
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
133
|
-
["address", "bytes32", "bytes4", "address"],
|
|
134
|
-
[release.CompoundVotingMachine, ethers.constants.HashZero, "0x000000f1", release.Avatar]
|
|
135
|
-
)
|
|
136
|
-
];
|
|
137
|
-
|
|
138
|
-
let impl = await getImplementationAddress(ethers.provider, ClaimersDistribution.address);
|
|
139
|
-
await verifyContract(impl, "ClaimersDistribution", network.name);
|
|
140
|
-
impl = await getImplementationAddress(ethers.provider, VotingMachine.address);
|
|
141
|
-
await verifyContract(impl, "CompoundVotingMachine", network.name);
|
|
142
|
-
impl = await getImplementationAddress(ethers.provider, GReputation.address);
|
|
143
|
-
await verifyContract(impl, "GReputation", network.name);
|
|
144
|
-
|
|
145
|
-
try {
|
|
146
|
-
if (viaGuardians) {
|
|
147
|
-
await executeViaSafe(
|
|
148
|
-
proposalContracts,
|
|
149
|
-
proposalEthValues,
|
|
150
|
-
proposalFunctionSignatures,
|
|
151
|
-
proposalFunctionInputs,
|
|
152
|
-
protocolSettings.guardiansSafe
|
|
153
|
-
);
|
|
154
|
-
} else {
|
|
155
|
-
await executeViaGuardian(
|
|
156
|
-
proposalContracts,
|
|
157
|
-
proposalEthValues,
|
|
158
|
-
proposalFunctionSignatures,
|
|
159
|
-
proposalFunctionInputs,
|
|
160
|
-
root
|
|
161
|
-
);
|
|
162
|
-
}
|
|
163
|
-
} catch (e) {
|
|
164
|
-
console.error("proposal execution failed...", e.message);
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
const Controller = await ethers.getContractAt("Controller", release.Controller);
|
|
168
|
-
|
|
169
|
-
const votingMachineDaoPermissions = await Controller.getSchemePermissions(daoOwner, release.Avatar);
|
|
170
|
-
|
|
171
|
-
console.log({
|
|
172
|
-
votingMachineDaoPermissions
|
|
173
|
-
});
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
export const main = async (networkName = name) => {
|
|
177
|
-
await deployGov();
|
|
178
|
-
};
|
|
179
|
-
main();
|
|
@@ -1,85 +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 { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
-
import { deployDeterministic, verifyProductionSigner, verifyContract } from "./helpers";
|
|
10
|
-
import releaser from "../releaser";
|
|
11
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
12
|
-
import dao from "../../releases/deployment.json";
|
|
13
|
-
import { TransactionResponse } from "@ethersproject/providers";
|
|
14
|
-
|
|
15
|
-
const { name } = network;
|
|
16
|
-
|
|
17
|
-
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
18
|
-
if (c instanceof Contract) {
|
|
19
|
-
await c.deployed();
|
|
20
|
-
console.log("deployed to: ", c.address);
|
|
21
|
-
}
|
|
22
|
-
if (c.wait) {
|
|
23
|
-
await c.wait();
|
|
24
|
-
console.log("tx done:", c.hash);
|
|
25
|
-
}
|
|
26
|
-
return c;
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
export const deployHelpers = async () => {
|
|
30
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
31
|
-
|
|
32
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
33
|
-
|
|
34
|
-
let [root] = await ethers.getSigners();
|
|
35
|
-
const isProduction = network.name.includes("production");
|
|
36
|
-
|
|
37
|
-
if (isProduction) verifyProductionSigner(root);
|
|
38
|
-
|
|
39
|
-
//generic call permissions
|
|
40
|
-
let schemeMock = root;
|
|
41
|
-
|
|
42
|
-
console.log("got signers:", {
|
|
43
|
-
network,
|
|
44
|
-
root: root.address,
|
|
45
|
-
schemeMock: schemeMock.address,
|
|
46
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const GDFaucet = release.GDFaucet
|
|
50
|
-
? await ethers.getContractAt("GDFaucet", release.GDFaucet)
|
|
51
|
-
: ((await deployDeterministic(
|
|
52
|
-
{
|
|
53
|
-
name: "GDFaucet",
|
|
54
|
-
salt: "GDFaucet",
|
|
55
|
-
isUpgradeable: false
|
|
56
|
-
},
|
|
57
|
-
[release.NameService, 10000]
|
|
58
|
-
).then(printDeploy)) as Contract);
|
|
59
|
-
|
|
60
|
-
const torelease = {
|
|
61
|
-
GDFaucet: GDFaucet.address
|
|
62
|
-
};
|
|
63
|
-
await releaser(torelease, network.name, "deployment", false);
|
|
64
|
-
|
|
65
|
-
const controller = await ethers.getContractAt("Controller", release.Controller);
|
|
66
|
-
|
|
67
|
-
const tx = await controller
|
|
68
|
-
.registerScheme(GDFaucet.address, ethers.constants.HashZero, "0x00000001", release.Avatar)
|
|
69
|
-
.then(printDeploy);
|
|
70
|
-
|
|
71
|
-
console.log("TokenFaucet deployed and registered as a scheme via the controller");
|
|
72
|
-
|
|
73
|
-
await verifyContract(
|
|
74
|
-
GDFaucet.address,
|
|
75
|
-
"GDFaucet",
|
|
76
|
-
network.name,
|
|
77
|
-
undefined,
|
|
78
|
-
ethers.utils.defaultAbiCoder.encode(["address", "uint"], [release.NameService, 10000])
|
|
79
|
-
);
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const main = async () => {
|
|
83
|
-
await deployHelpers();
|
|
84
|
-
};
|
|
85
|
-
if (process.argv[1].includes("6_testnetFaucet")) main();
|