@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,939 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mainnet:
|
|
3
|
-
* 0. deploy nameService
|
|
4
|
-
* 1. deploy votingmachine + reputation
|
|
5
|
-
* 2. deploy Reserve, MarketMaker
|
|
6
|
-
* 3. deploy FundManager
|
|
7
|
-
* 4. deploy ubi staking contracts
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
11
|
-
import { isFunction, get, omitBy } from "lodash";
|
|
12
|
-
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
13
|
-
|
|
14
|
-
import pressAnyKey from "press-any-key";
|
|
15
|
-
import {
|
|
16
|
-
AaveStakingFactory,
|
|
17
|
-
CompoundStakingFactory,
|
|
18
|
-
ProxyFactory1967
|
|
19
|
-
} from "../../types";
|
|
20
|
-
import SchemeRegistrarABI from "@gooddollar/goodcontracts/build/contracts/SchemeRegistrar.json";
|
|
21
|
-
import releaser from "../releaser";
|
|
22
|
-
import {
|
|
23
|
-
GReputation,
|
|
24
|
-
SchemeRegistrar,
|
|
25
|
-
CompoundVotingMachine,
|
|
26
|
-
ProtocolUpgradeRecover,
|
|
27
|
-
ProtocolUpgradeFuseRecover,
|
|
28
|
-
NameService
|
|
29
|
-
} from "../../types";
|
|
30
|
-
import OldDAO from "../../releases/olddao.json";
|
|
31
|
-
|
|
32
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
33
|
-
import { keccak256 } from "@ethersproject/keccak256";
|
|
34
|
-
|
|
35
|
-
let GAS_SETTINGS: any = {
|
|
36
|
-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
|
|
37
|
-
maxFeePerGas: ethers.utils.parseUnits("50", "gwei"),
|
|
38
|
-
gasLimit: 30000000
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
let totalGas = 0;
|
|
42
|
-
const gasUsage = {};
|
|
43
|
-
const countTotalGas = async (tx, name) => {
|
|
44
|
-
let res = tx;
|
|
45
|
-
if (tx.deployTransaction) tx = tx.deployTransaction;
|
|
46
|
-
if (tx.wait) res = await tx.wait();
|
|
47
|
-
if (res.gasUsed) {
|
|
48
|
-
totalGas += parseInt(res.gasUsed);
|
|
49
|
-
gasUsage[name] = gasUsage[name] || 0;
|
|
50
|
-
gasUsage[name] += parseInt(res.gasUsed);
|
|
51
|
-
} else console.log("no gas data", { res, tx });
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
console.log({
|
|
55
|
-
network: network.name,
|
|
56
|
-
upgrade: process.env.UPGRADE
|
|
57
|
-
});
|
|
58
|
-
const { name } = network;
|
|
59
|
-
|
|
60
|
-
export const main = async (
|
|
61
|
-
networkName = name,
|
|
62
|
-
isPerformUpgrade = true,
|
|
63
|
-
olddao?
|
|
64
|
-
): Promise<{ [key: string]: any }> => {
|
|
65
|
-
const isProduction = networkName.startsWith("production");
|
|
66
|
-
if (isProduction && networkName.includes("mainnet")) {
|
|
67
|
-
GAS_SETTINGS.gasLimit = 6000000;
|
|
68
|
-
GAS_SETTINGS.maxFeePerGas = ethers.utils.parseUnits("80", "gwei");
|
|
69
|
-
} else if (network.config.chainId === 122) {
|
|
70
|
-
//case we are on fusefuse
|
|
71
|
-
GAS_SETTINGS = {
|
|
72
|
-
gasLimit: 6000000,
|
|
73
|
-
gasPrice: ethers.utils.parseUnits("1", "gwei")
|
|
74
|
-
};
|
|
75
|
-
} else if (network.config.chainId === 3 || network.config.chainId === 42) {
|
|
76
|
-
GAS_SETTINGS = {
|
|
77
|
-
maxPriorityFeePerGas: ethers.utils.parseUnits("1", "gwei"),
|
|
78
|
-
maxFeePerGas: ethers.utils.parseUnits("10", "gwei"),
|
|
79
|
-
gasLimit: 6000000
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
const isBackendTest = networkName.startsWith("dapptest");
|
|
84
|
-
const isTest = network.name === "hardhat" || isBackendTest;
|
|
85
|
-
const isCoverage = process.env.CODE_COVERAGE;
|
|
86
|
-
const isDevelop = !isProduction;
|
|
87
|
-
const isMainnet = networkName.includes("mainnet");
|
|
88
|
-
let protocolSettings = {
|
|
89
|
-
...ProtocolSettings["default"],
|
|
90
|
-
...ProtocolSettings[networkName]
|
|
91
|
-
};
|
|
92
|
-
console.log(`networkName ${networkName}`, {
|
|
93
|
-
isTest,
|
|
94
|
-
isBackendTest,
|
|
95
|
-
isCoverage,
|
|
96
|
-
isMainnet,
|
|
97
|
-
isDevelop
|
|
98
|
-
});
|
|
99
|
-
const dao = olddao || OldDAO[networkName];
|
|
100
|
-
const fse = require("fs-extra");
|
|
101
|
-
const ProtocolAddresses = await fse.readJson("releases/deployment.json");
|
|
102
|
-
const newfusedao = await ProtocolAddresses[
|
|
103
|
-
networkName.replace(/\-mainnet/, "")
|
|
104
|
-
];
|
|
105
|
-
const newdao = ProtocolAddresses[networkName] || {};
|
|
106
|
-
|
|
107
|
-
let [root, proxyDeployer] = await ethers.getSigners();
|
|
108
|
-
|
|
109
|
-
let avatar = dao.Avatar;
|
|
110
|
-
let controller = dao.Controller;
|
|
111
|
-
let repStateId = isMainnet ? "fuse" : "rootState";
|
|
112
|
-
|
|
113
|
-
const compoundTokens = [
|
|
114
|
-
{
|
|
115
|
-
name: "cdai",
|
|
116
|
-
address:
|
|
117
|
-
(protocolSettings.compound != undefined &&
|
|
118
|
-
protocolSettings.compound.cdai) ||
|
|
119
|
-
dao.cDAI,
|
|
120
|
-
usdOracle:
|
|
121
|
-
(protocolSettings.compound != undefined &&
|
|
122
|
-
protocolSettings.compound.daiUsdOracle) ||
|
|
123
|
-
dao.DAIUsdOracle,
|
|
124
|
-
compUsdOracle:
|
|
125
|
-
(protocolSettings.compound != undefined &&
|
|
126
|
-
protocolSettings.compound.compUsdOracle) ||
|
|
127
|
-
dao.COMPUsdOracle,
|
|
128
|
-
swapPath: []
|
|
129
|
-
}
|
|
130
|
-
];
|
|
131
|
-
|
|
132
|
-
const aaveTokens = [
|
|
133
|
-
{
|
|
134
|
-
name: "usdc",
|
|
135
|
-
address: protocolSettings.aave.usdc || dao.USDC,
|
|
136
|
-
usdOracle: protocolSettings.aave.usdcUsdOracle || dao.USDCUsdOracle,
|
|
137
|
-
aaveUsdOracle: protocolSettings.aave.aaveUsdOracle || dao.AAVEUsdOracle,
|
|
138
|
-
swapPath: [
|
|
139
|
-
get(protocolSettings, "aave.usdc", dao.USDC),
|
|
140
|
-
get(protocolSettings, "compound.dai", dao.DAI)
|
|
141
|
-
]
|
|
142
|
-
}
|
|
143
|
-
];
|
|
144
|
-
|
|
145
|
-
let release: { [key: string]: any } = newdao;
|
|
146
|
-
|
|
147
|
-
const toDeployUpgradable = [
|
|
148
|
-
{
|
|
149
|
-
network: "mainnet",
|
|
150
|
-
name: "NameService",
|
|
151
|
-
skip: true,
|
|
152
|
-
args: [
|
|
153
|
-
controller,
|
|
154
|
-
[
|
|
155
|
-
"CONTROLLER",
|
|
156
|
-
"AVATAR",
|
|
157
|
-
"IDENTITY",
|
|
158
|
-
"GOODDOLLAR",
|
|
159
|
-
"CONTRIBUTION_CALCULATION",
|
|
160
|
-
"BANCOR_FORMULA",
|
|
161
|
-
"DAI",
|
|
162
|
-
"CDAI",
|
|
163
|
-
"COMP",
|
|
164
|
-
"BRIDGE_CONTRACT",
|
|
165
|
-
"UNISWAP_ROUTER",
|
|
166
|
-
"GAS_PRICE_ORACLE",
|
|
167
|
-
"DAI_ETH_ORACLE",
|
|
168
|
-
"ETH_USD_ORACLE"
|
|
169
|
-
].map(_ => ethers.utils.keccak256(ethers.utils.toUtf8Bytes(_))),
|
|
170
|
-
[
|
|
171
|
-
controller,
|
|
172
|
-
avatar,
|
|
173
|
-
dao.Identity,
|
|
174
|
-
dao.GoodDollar,
|
|
175
|
-
dao.Contribution,
|
|
176
|
-
protocolSettings.bancor || dao.BancorFormula,
|
|
177
|
-
get(protocolSettings, "compound.dai", dao.DAI),
|
|
178
|
-
get(protocolSettings, "compound.cdai", dao.cDAI),
|
|
179
|
-
get(protocolSettings, "compound.comp", dao.COMP),
|
|
180
|
-
dao.ForeignBridge,
|
|
181
|
-
protocolSettings.uniswapRouter || dao.UniswapRouter,
|
|
182
|
-
!isMainnet ||
|
|
183
|
-
dao.GasPriceOracle ||
|
|
184
|
-
protocolSettings.chainlink.gasPrice, //should fail if missing only on mainnet
|
|
185
|
-
!isMainnet || dao.DAIEthOracle || protocolSettings.chainlink.dai_eth,
|
|
186
|
-
!isMainnet || dao.ETHUsdOracle || protocolSettings.chainlink.eth_usd
|
|
187
|
-
]
|
|
188
|
-
]
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
network: "fuse",
|
|
192
|
-
name: "NameService",
|
|
193
|
-
skip: true,
|
|
194
|
-
args: [
|
|
195
|
-
controller,
|
|
196
|
-
[
|
|
197
|
-
"CONTROLLER",
|
|
198
|
-
"AVATAR",
|
|
199
|
-
"IDENTITY",
|
|
200
|
-
"GOODDOLLAR",
|
|
201
|
-
"BRIDGE_CONTRACT"
|
|
202
|
-
].map(_ => ethers.utils.keccak256(ethers.utils.toUtf8Bytes(_))),
|
|
203
|
-
[controller, avatar, dao.Identity, dao.GoodDollar, dao.HomeBridge]
|
|
204
|
-
]
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
network: "both",
|
|
208
|
-
name: "GReputation",
|
|
209
|
-
skip: true,
|
|
210
|
-
initializer: "initialize(address, string, bytes32, uint256)",
|
|
211
|
-
args: [
|
|
212
|
-
() => get(release, "NameService", newdao.NameService),
|
|
213
|
-
"",
|
|
214
|
-
ethers.constants.HashZero, //should fail on real deploy if not set
|
|
215
|
-
0 //should fail on real deploy if not set
|
|
216
|
-
]
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
network: "both",
|
|
220
|
-
name: "CompoundVotingMachine",
|
|
221
|
-
skip: true,
|
|
222
|
-
args: [
|
|
223
|
-
() => get(release, "NameService", newdao.NameService),
|
|
224
|
-
protocolSettings.governance.proposalVotingPeriod,
|
|
225
|
-
protocolSettings.governance.guardian || root.address,
|
|
226
|
-
() => get(release, "GReputation", newdao.GReputation)
|
|
227
|
-
]
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
network: "mainnet",
|
|
231
|
-
name: "GoodMarketMaker",
|
|
232
|
-
skip: true,
|
|
233
|
-
args: [
|
|
234
|
-
() => get(release, "NameService", newdao.NameService),
|
|
235
|
-
protocolSettings.expansionRatio.nom,
|
|
236
|
-
protocolSettings.expansionRatio.denom
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
{
|
|
240
|
-
network: "mainnet",
|
|
241
|
-
name: "GoodReserveCDai",
|
|
242
|
-
skip: true,
|
|
243
|
-
initializer: "initialize(address, bytes32)",
|
|
244
|
-
args: [
|
|
245
|
-
() => get(release, "NameService", newdao.NameService),
|
|
246
|
-
ethers.constants.HashZero
|
|
247
|
-
]
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
network: "mainnet",
|
|
251
|
-
name: "ExchangeHelper",
|
|
252
|
-
skip: true,
|
|
253
|
-
initializer: "initialize(address)",
|
|
254
|
-
args: [() => get(release, "NameService", newdao.NameService)]
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
network: "mainnet",
|
|
258
|
-
skip: true,
|
|
259
|
-
name: "GoodFundManager",
|
|
260
|
-
args: [() => get(release, "NameService", newdao.NameService)]
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
network: "mainnet",
|
|
264
|
-
skip: true,
|
|
265
|
-
name: "StakersDistribution",
|
|
266
|
-
args: [() => get(release, "NameService", newdao.NameService)]
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
network: "fuse",
|
|
270
|
-
name: "ClaimersDistribution",
|
|
271
|
-
skip: true,
|
|
272
|
-
args: [() => get(release, "NameService", newdao.NameService)]
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
network: "fuse",
|
|
276
|
-
skip: true,
|
|
277
|
-
name: "GovernanceStaking",
|
|
278
|
-
args: [() => get(release, "NameService", newdao.NameService)],
|
|
279
|
-
isUpgradable: false
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
network: "fuse",
|
|
283
|
-
name: "UBIScheme",
|
|
284
|
-
skip: true,
|
|
285
|
-
initializer: "initialize(address, address, uint256)",
|
|
286
|
-
args: [
|
|
287
|
-
() => get(release, "NameService", newdao.NameService),
|
|
288
|
-
dao.FirstClaimPool,
|
|
289
|
-
14
|
|
290
|
-
]
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
network: "mainnet",
|
|
294
|
-
skip: true,
|
|
295
|
-
name: "ProtocolUpgradeRecover",
|
|
296
|
-
args: [dao.Controller, root.address],
|
|
297
|
-
isUpgradable: false,
|
|
298
|
-
initializer: null
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
network: "fuse",
|
|
302
|
-
skip: true,
|
|
303
|
-
name: "ProtocolUpgradeFuseRecover",
|
|
304
|
-
args: [dao.Controller, root.address],
|
|
305
|
-
isUpgradable: false
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
network: "mainnet",
|
|
309
|
-
skip: true,
|
|
310
|
-
name: "UniswapV2SwapHelper",
|
|
311
|
-
args: [],
|
|
312
|
-
isUpgradable: false
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
network: "mainnet",
|
|
316
|
-
skip: true,
|
|
317
|
-
name: "CompoundStakingFactory",
|
|
318
|
-
args: [],
|
|
319
|
-
isUpgradable: false,
|
|
320
|
-
libraries: ["UniswapV2SwapHelper"]
|
|
321
|
-
},
|
|
322
|
-
{
|
|
323
|
-
network: "mainnet",
|
|
324
|
-
skip: true,
|
|
325
|
-
name: "AaveStakingFactory",
|
|
326
|
-
args: [],
|
|
327
|
-
isUpgradable: false,
|
|
328
|
-
libraries: ["UniswapV2SwapHelper"]
|
|
329
|
-
}
|
|
330
|
-
];
|
|
331
|
-
|
|
332
|
-
let proxyFactory: ProxyFactory1967;
|
|
333
|
-
const getProxyFactory = async () => {
|
|
334
|
-
return (proxyFactory = (await ethers.getContractAt(
|
|
335
|
-
"ProxyFactory1967",
|
|
336
|
-
"0xDa85fceD9Bd193526b7667F2AD1fD4A0F900d3A7"
|
|
337
|
-
)) as unknown as ProxyFactory1967);
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
const deployDeterministic = async (
|
|
341
|
-
contract,
|
|
342
|
-
args: any[],
|
|
343
|
-
factoryOpts = {}
|
|
344
|
-
) => {
|
|
345
|
-
try {
|
|
346
|
-
const Contract = await ethers.getContractFactory(
|
|
347
|
-
contract.name,
|
|
348
|
-
factoryOpts
|
|
349
|
-
);
|
|
350
|
-
|
|
351
|
-
const salt = ethers.BigNumber.from(
|
|
352
|
-
keccak256(ethers.utils.toUtf8Bytes(contract.name))
|
|
353
|
-
);
|
|
354
|
-
|
|
355
|
-
if (contract.isUpgradable !== false) {
|
|
356
|
-
if (isCoverage) {
|
|
357
|
-
console.log("Deploying:", contract.name, "using proxy");
|
|
358
|
-
await pressAnyKey();
|
|
359
|
-
//coverage has large contracts doesnt work with proxy factory
|
|
360
|
-
const tx = await upgrades.deployProxy(Contract, args, {
|
|
361
|
-
initializer: contract.initializer,
|
|
362
|
-
kind: "uups",
|
|
363
|
-
unsafeAllowLinkedLibraries: true
|
|
364
|
-
});
|
|
365
|
-
await countTotalGas(tx, contract.name);
|
|
366
|
-
return tx;
|
|
367
|
-
}
|
|
368
|
-
console.log("Deploying:", contract.name, "using proxyfactory");
|
|
369
|
-
const encoded = Contract.interface.encodeFunctionData(
|
|
370
|
-
contract.initializer || "initialize",
|
|
371
|
-
args
|
|
372
|
-
);
|
|
373
|
-
await pressAnyKey();
|
|
374
|
-
const tx = await Contract.deploy(GAS_SETTINGS);
|
|
375
|
-
const impl = await tx.deployed();
|
|
376
|
-
await countTotalGas(tx, contract.name);
|
|
377
|
-
|
|
378
|
-
const tx2 = await proxyFactory.deployProxy(
|
|
379
|
-
salt,
|
|
380
|
-
impl.address,
|
|
381
|
-
encoded,
|
|
382
|
-
GAS_SETTINGS
|
|
383
|
-
);
|
|
384
|
-
await countTotalGas(tx2, contract.name);
|
|
385
|
-
const deployTx = await tx2
|
|
386
|
-
.wait()
|
|
387
|
-
.catch(e =>
|
|
388
|
-
console.error("failed to deploy proxy, assuming it exists...", e)
|
|
389
|
-
);
|
|
390
|
-
return ethers.getContractAt(
|
|
391
|
-
contract.name,
|
|
392
|
-
await proxyFactory["getDeploymentAddress(uint256,address)"](
|
|
393
|
-
salt,
|
|
394
|
-
root.address
|
|
395
|
-
)
|
|
396
|
-
);
|
|
397
|
-
} else {
|
|
398
|
-
//for some reason deploying with link library via proxy doesnt work on hardhat test env
|
|
399
|
-
if (isTest === false) {
|
|
400
|
-
console.log("Deploying:", contract.name, "using proxyfactory code");
|
|
401
|
-
await pressAnyKey();
|
|
402
|
-
const constructor = Contract.interface.encodeDeploy(args);
|
|
403
|
-
const bytecode = ethers.utils.solidityPack(
|
|
404
|
-
["bytes", "bytes"],
|
|
405
|
-
[Contract.bytecode, constructor]
|
|
406
|
-
);
|
|
407
|
-
const deployTx = await (
|
|
408
|
-
await proxyFactory.deployCode(salt, bytecode, GAS_SETTINGS)
|
|
409
|
-
).wait();
|
|
410
|
-
return ethers.getContractAt(
|
|
411
|
-
contract.name,
|
|
412
|
-
await proxyFactory["getDeploymentAddress(uint256,address,bytes32)"](
|
|
413
|
-
salt,
|
|
414
|
-
root.address,
|
|
415
|
-
keccak256(bytecode)
|
|
416
|
-
)
|
|
417
|
-
);
|
|
418
|
-
} else {
|
|
419
|
-
console.log("Deploying:", contract.name, "using regular");
|
|
420
|
-
await pressAnyKey();
|
|
421
|
-
const tx = await Contract.deploy(...args, GAS_SETTINGS);
|
|
422
|
-
await countTotalGas(tx, contract.name);
|
|
423
|
-
const impl = await tx.deployed();
|
|
424
|
-
return impl;
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
} catch (e) {
|
|
428
|
-
console.log("Failed deploying contract:", { contract });
|
|
429
|
-
throw e;
|
|
430
|
-
}
|
|
431
|
-
};
|
|
432
|
-
|
|
433
|
-
const deployContracts = async () => {
|
|
434
|
-
console.log({ dao, newdao, protocolSettings });
|
|
435
|
-
|
|
436
|
-
await getProxyFactory();
|
|
437
|
-
console.info("got proxyfactory at:", proxyFactory.address);
|
|
438
|
-
for (let contract of toDeployUpgradable) {
|
|
439
|
-
if (
|
|
440
|
-
contract.skip ||
|
|
441
|
-
(contract.network !== "both" &&
|
|
442
|
-
(contract.network === "mainnet") !== isMainnet)
|
|
443
|
-
) {
|
|
444
|
-
console.log(
|
|
445
|
-
contract,
|
|
446
|
-
" Skipping non mainnet/sidechain contract:",
|
|
447
|
-
contract.network,
|
|
448
|
-
contract.name
|
|
449
|
-
);
|
|
450
|
-
continue;
|
|
451
|
-
}
|
|
452
|
-
if (isDevelop === false && newdao[contract.name]) {
|
|
453
|
-
console.log(
|
|
454
|
-
contract.name,
|
|
455
|
-
" Skipping deployed contract at:",
|
|
456
|
-
newdao[contract.name],
|
|
457
|
-
"upgrading:",
|
|
458
|
-
!!process.env.UPGRADE
|
|
459
|
-
);
|
|
460
|
-
continue;
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
const args = await Promise.all(
|
|
464
|
-
contract.args.map(async _ => await (isFunction(_) ? _() : _))
|
|
465
|
-
);
|
|
466
|
-
|
|
467
|
-
console.log(`deploying contract upgrade ${contract.name}`, {
|
|
468
|
-
args
|
|
469
|
-
// release
|
|
470
|
-
// pf: ProxyFactory.factory.address
|
|
471
|
-
});
|
|
472
|
-
let opts = {};
|
|
473
|
-
if (contract.libraries) {
|
|
474
|
-
let libraries = {};
|
|
475
|
-
contract.libraries.forEach(l => (libraries[l] = release[l]));
|
|
476
|
-
opts = { libraries };
|
|
477
|
-
}
|
|
478
|
-
const Contract = await ethers.getContractFactory(contract.name, opts);
|
|
479
|
-
|
|
480
|
-
let deployed = await deployDeterministic(contract, args, opts);
|
|
481
|
-
|
|
482
|
-
console.log(`${contract.name} deployed to: ${deployed.address}`);
|
|
483
|
-
release[contract.name] = deployed.address;
|
|
484
|
-
await releaser(release, networkName, "deployment", false);
|
|
485
|
-
}
|
|
486
|
-
|
|
487
|
-
// if (!isProduction || get(release, "StakingContracts", []).length == 0) {
|
|
488
|
-
// const { DonationsStaking, StakingContracts } =
|
|
489
|
-
// isMainnet && (await deployStakingContracts(release));
|
|
490
|
-
// release["StakingContracts"] = StakingContracts;
|
|
491
|
-
// release["DonationsStaking"] = DonationsStaking;
|
|
492
|
-
// console.log("staking contracts result:", {
|
|
493
|
-
// StakingContracts,
|
|
494
|
-
// DonationsStaking
|
|
495
|
-
// });
|
|
496
|
-
// }
|
|
497
|
-
|
|
498
|
-
release["network"] = networkName;
|
|
499
|
-
release["networkId"] = network.config.chainId || 4447;
|
|
500
|
-
if (!isMainnet) {
|
|
501
|
-
release["HomeBridge"] = dao.HomeBridge;
|
|
502
|
-
release["SignupBonus"] = dao.SignupBonus;
|
|
503
|
-
release["OneTimePayments"] = dao.OneTimePayments;
|
|
504
|
-
release["Invites"] = dao.Invites;
|
|
505
|
-
release["AdminWallet"] = dao.AdminWallet;
|
|
506
|
-
} else {
|
|
507
|
-
release["ForeignBridge"] = dao.ForeignBridge;
|
|
508
|
-
release["Contribution"] = dao.Contribution;
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
release["Identity"] = dao.Identity;
|
|
512
|
-
release["GoodDollar"] = dao.GoodDollar;
|
|
513
|
-
release["Controller"] = dao.Controller;
|
|
514
|
-
release["Avatar"] = avatar;
|
|
515
|
-
release["FirstClaimPool"] = dao.FirstClaimPool;
|
|
516
|
-
release["ProxyAdmin"] = dao.ProxyAdmin;
|
|
517
|
-
release["BancorFormula"] = protocolSettings.bancor || dao.BancorFormula;
|
|
518
|
-
|
|
519
|
-
release["DAI"] = get(protocolSettings, "compound.dai", dao.DAI);
|
|
520
|
-
release["cDAI"] = get(protocolSettings, "compound.cdai", dao.cDAI);
|
|
521
|
-
release["COMP"] = get(protocolSettings, "compound.comp", dao.COMP);
|
|
522
|
-
|
|
523
|
-
release = omitBy(release, _ => _ === undefined);
|
|
524
|
-
let res = Object.assign(newdao, release);
|
|
525
|
-
await releaser(release, networkName);
|
|
526
|
-
return release;
|
|
527
|
-
};
|
|
528
|
-
|
|
529
|
-
// const proveNewRep = async () => {
|
|
530
|
-
// console.log("prooving new rep...");
|
|
531
|
-
// if (networkName.includes("production") === false) {
|
|
532
|
-
// const proofs = [
|
|
533
|
-
// [
|
|
534
|
-
// "0x23d8bd1cdfa398986bb91927d3011fb1ded1425b6ae3ff794e497235481fe57f",
|
|
535
|
-
// "0xe4ac4e67088f036e8dc535fee10a3ad42065e444d2b0bd3668e0df21e1590db3",
|
|
536
|
-
// ],
|
|
537
|
-
// ["0x4c01c2c86a047dc65fc8ff0a1d9ac11842597af9a363711e4db7dcabcfda307b"],
|
|
538
|
-
// [
|
|
539
|
-
// "0x235dc3126b01e763befb96ead059e3f19d0380e65e477e6ebb95c1d9fc90e0b7",
|
|
540
|
-
// "0xe4ac4e67088f036e8dc535fee10a3ad42065e444d2b0bd3668e0df21e1590db3",
|
|
541
|
-
// ],
|
|
542
|
-
// ];
|
|
543
|
-
// let proofResults = await Promise.all(
|
|
544
|
-
// founders.map((f, idx) =>
|
|
545
|
-
// grep
|
|
546
|
-
// .connect(f)
|
|
547
|
-
// .proveBalanceOfAtBlockchain(repStateId, f.address, 100, proofs[idx])
|
|
548
|
-
// .then((_) => _.wait())
|
|
549
|
-
// )
|
|
550
|
-
// );
|
|
551
|
-
// console.log(
|
|
552
|
-
// "proofs:",
|
|
553
|
-
// proofResults.map((_) => _.events)
|
|
554
|
-
// );
|
|
555
|
-
// } else {
|
|
556
|
-
// //prove foundation multi sig account
|
|
557
|
-
// const proof = [];
|
|
558
|
-
// const foundationAddress = protocolSettings.governance.foundationAddress;
|
|
559
|
-
// let proofResult = await grep
|
|
560
|
-
// .proveBalanceOfAtBlockchain(
|
|
561
|
-
// repStateId,
|
|
562
|
-
// foundationAddress,
|
|
563
|
-
// 12000000,
|
|
564
|
-
// proof
|
|
565
|
-
// )
|
|
566
|
-
// .then((_) => _.wait());
|
|
567
|
-
|
|
568
|
-
// console.log("proofs:", proofResult.events);
|
|
569
|
-
// }
|
|
570
|
-
// };
|
|
571
|
-
|
|
572
|
-
const performUpgrade = async release => {
|
|
573
|
-
const gasSettings = {
|
|
574
|
-
...GAS_SETTINGS,
|
|
575
|
-
maxFeePerGas: ethers.utils.parseUnits("70", "gwei"),
|
|
576
|
-
gasLimit: 600000
|
|
577
|
-
};
|
|
578
|
-
|
|
579
|
-
const isKovan = networkName.includes("kovan");
|
|
580
|
-
const upgrade: ProtocolUpgradeRecover = (await ethers.getContractAt(
|
|
581
|
-
"ProtocolUpgradeRecover",
|
|
582
|
-
release.ProtocolUpgradeRecover
|
|
583
|
-
)) as unknown as ProtocolUpgradeRecover;
|
|
584
|
-
|
|
585
|
-
console.log("performing protocol v2 recovery on Mainnet...", {
|
|
586
|
-
release,
|
|
587
|
-
dao
|
|
588
|
-
});
|
|
589
|
-
const basicArgs: [any, any, any] = [
|
|
590
|
-
release.NameService,
|
|
591
|
-
[
|
|
592
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("RESERVE")),
|
|
593
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MARKET_MAKER")),
|
|
594
|
-
// ethers.utils.keccak256(ethers.utils.toUtf8Bytes("FUND_MANAGER")),
|
|
595
|
-
// ethers.utils.keccak256(ethers.utils.toUtf8Bytes("REPUTATION")),
|
|
596
|
-
// ethers.utils.keccak256(ethers.utils.toUtf8Bytes("GDAO_STAKERS")),
|
|
597
|
-
// ethers.utils.keccak256(ethers.utils.toUtf8Bytes("UBI_RECIPIENT")),
|
|
598
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("BRIDGE_CONTRACT")),
|
|
599
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("EXCHANGE_HELPER"))
|
|
600
|
-
],
|
|
601
|
-
[
|
|
602
|
-
release.GoodReserveCDai,
|
|
603
|
-
release.GoodMarketMaker,
|
|
604
|
-
// release.GoodFundManager,
|
|
605
|
-
// release.GReputation,
|
|
606
|
-
// release.StakersDistribution,
|
|
607
|
-
// isKovan ? root.address : newfusedao.UBIScheme, //fake for kovan
|
|
608
|
-
dao.ForeignBridge,
|
|
609
|
-
release.ExchangeHelper
|
|
610
|
-
]
|
|
611
|
-
];
|
|
612
|
-
console.log("upgrading nameservice + staking rewards...", { basicArgs });
|
|
613
|
-
let tx;
|
|
614
|
-
await pressAnyKey();
|
|
615
|
-
|
|
616
|
-
tx = await (await upgrade.upgradeBasic(...basicArgs, gasSettings)).wait();
|
|
617
|
-
await countTotalGas(tx, "call upgrade basic");
|
|
618
|
-
|
|
619
|
-
const reserveArgs: [any] = [release.NameService];
|
|
620
|
-
console.log("upgrading reserve...", {
|
|
621
|
-
reserveArgs
|
|
622
|
-
});
|
|
623
|
-
await pressAnyKey();
|
|
624
|
-
tx = await upgrade.upgradeReserve(...reserveArgs, gasSettings);
|
|
625
|
-
await countTotalGas(tx, "call upgrade reserve");
|
|
626
|
-
console.log("upgrading donationstaking...", {
|
|
627
|
-
params: [
|
|
628
|
-
release.NameService,
|
|
629
|
-
dao.DonationsStaking, //old
|
|
630
|
-
release.DonationsStaking
|
|
631
|
-
]
|
|
632
|
-
});
|
|
633
|
-
// tx = await upgrade.upgradeDonationStaking(
|
|
634
|
-
// release.NameService,
|
|
635
|
-
// dao.DonationsStaking, //old
|
|
636
|
-
// release.DonationsStaking, //new
|
|
637
|
-
// dao.DAIStaking,
|
|
638
|
-
// GAS_SETTINGS
|
|
639
|
-
// );
|
|
640
|
-
// await countTotalGas(tx, "call upgrade donations");
|
|
641
|
-
// console.log("Donation staking upgraded");
|
|
642
|
-
//extract just the addresses without the rewards
|
|
643
|
-
// release.StakingContracts = release.StakingContracts.map((_) => _[0]);
|
|
644
|
-
|
|
645
|
-
if (isProduction) {
|
|
646
|
-
console.log(
|
|
647
|
-
"SKIPPING GOVERNANCE UPGRADE FOR PRODUCTION. RUN IT MANUALLY"
|
|
648
|
-
);
|
|
649
|
-
} else {
|
|
650
|
-
console.log("upgrading governance...");
|
|
651
|
-
|
|
652
|
-
tx = await upgrade.upgradeGovernance(release.CompoundVotingMachine);
|
|
653
|
-
await countTotalGas(tx, "call upgrade gov");
|
|
654
|
-
}
|
|
655
|
-
};
|
|
656
|
-
|
|
657
|
-
const performUpgradeFuse = async release => {
|
|
658
|
-
const upgrade: ProtocolUpgradeFuseRecover = (await ethers.getContractAt(
|
|
659
|
-
"ProtocolUpgradeFuseRecover",
|
|
660
|
-
release.ProtocolUpgradeFuseRecover
|
|
661
|
-
)) as unknown as ProtocolUpgradeFuseRecover;
|
|
662
|
-
|
|
663
|
-
console.log("performing protocol v2 upgrade on Fuse...", { release, dao });
|
|
664
|
-
await upgrade
|
|
665
|
-
.upgrade(
|
|
666
|
-
release.NameService,
|
|
667
|
-
dao.FirstClaimPool,
|
|
668
|
-
release.UBIScheme,
|
|
669
|
-
[
|
|
670
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("REPUTATION")),
|
|
671
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("BRIDGE_CONTRACT")),
|
|
672
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("UBISCHEME")),
|
|
673
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("GDAO_STAKING")),
|
|
674
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("GDAO_CLAIMERS"))
|
|
675
|
-
],
|
|
676
|
-
[
|
|
677
|
-
release.GReputation,
|
|
678
|
-
dao.HomeBridge,
|
|
679
|
-
release.UBIScheme,
|
|
680
|
-
release.GovernanceStaking,
|
|
681
|
-
release.ClaimersDistribution
|
|
682
|
-
],
|
|
683
|
-
GAS_SETTINGS
|
|
684
|
-
)
|
|
685
|
-
.then(_ => countTotalGas(_, "fuse basic upgrade"));
|
|
686
|
-
|
|
687
|
-
if (isProduction) {
|
|
688
|
-
console.log(
|
|
689
|
-
"SKIPPING GOVERNANCE UPGRADE FOR PRODUCTION. RUN IT MANUALLY"
|
|
690
|
-
);
|
|
691
|
-
} else {
|
|
692
|
-
console.log("upgrading governance...");
|
|
693
|
-
|
|
694
|
-
await upgrade.upgradeGovernance(
|
|
695
|
-
dao.SchemeRegistrar,
|
|
696
|
-
dao.UpgradeScheme,
|
|
697
|
-
release.CompoundVotingMachine,
|
|
698
|
-
GAS_SETTINGS
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
};
|
|
702
|
-
|
|
703
|
-
//give Avatar permissions to the upgrade process contract
|
|
704
|
-
const voteProtocolUpgrade = async release => {
|
|
705
|
-
const Upgrade =
|
|
706
|
-
release.ProtocolUpgradeRecover || release.ProtocolUpgradeFuseRecover;
|
|
707
|
-
const ctrl = await ethers.getContractAt("Controller", controller);
|
|
708
|
-
const tx = await ctrl.registerScheme(
|
|
709
|
-
Upgrade,
|
|
710
|
-
ethers.constants.HashZero,
|
|
711
|
-
"0x0000001f",
|
|
712
|
-
avatar,
|
|
713
|
-
{
|
|
714
|
-
...GAS_SETTINGS,
|
|
715
|
-
gasLimit: 300000
|
|
716
|
-
}
|
|
717
|
-
);
|
|
718
|
-
await countTotalGas(tx, "registerScheme voteProtocolUpgrade");
|
|
719
|
-
console.log("registerScheme recovery scheme in dao...", Upgrade);
|
|
720
|
-
};
|
|
721
|
-
|
|
722
|
-
const deployStakingContracts = async release => {
|
|
723
|
-
const isRopsten =
|
|
724
|
-
networkName === "fuse-mainnet" || networkName === "staging-mainnet";
|
|
725
|
-
console.log("deployStakingContracts", {
|
|
726
|
-
factory: release.CompoundStakingFactory,
|
|
727
|
-
ns: release.NameService
|
|
728
|
-
});
|
|
729
|
-
const compfactory = await ethers.getContractAt(
|
|
730
|
-
"CompoundStakingFactory",
|
|
731
|
-
release.CompoundStakingFactory
|
|
732
|
-
);
|
|
733
|
-
const aavefactory = await ethers.getContractAt(
|
|
734
|
-
"AaveStakingFactory",
|
|
735
|
-
release.AaveStakingFactory
|
|
736
|
-
);
|
|
737
|
-
const compps = compoundTokens.map(async token => {
|
|
738
|
-
let rewardsPerBlock = protocolSettings.staking.rewardsPerBlock;
|
|
739
|
-
console.log("deployStakingContracts", {
|
|
740
|
-
token,
|
|
741
|
-
settings: protocolSettings.staking,
|
|
742
|
-
rewardsPerBlock,
|
|
743
|
-
factory: compfactory.address,
|
|
744
|
-
params: [
|
|
745
|
-
token.address,
|
|
746
|
-
release.NameService,
|
|
747
|
-
protocolSettings.staking.fullRewardsThreshold, //blocks before switching for 0.5x rewards to 1x multiplier
|
|
748
|
-
token.usdOracle,
|
|
749
|
-
token.compUsdOracle
|
|
750
|
-
]
|
|
751
|
-
});
|
|
752
|
-
const tx = await (
|
|
753
|
-
await compfactory[
|
|
754
|
-
"cloneAndInit(address,address,uint64,address,address,address[])"
|
|
755
|
-
](
|
|
756
|
-
token.address,
|
|
757
|
-
release.NameService,
|
|
758
|
-
protocolSettings.staking.fullRewardsThreshold, //blocks before switching for 0.5x rewards to 1x multiplier
|
|
759
|
-
token.usdOracle,
|
|
760
|
-
token.compUsdOracle,
|
|
761
|
-
token.swapPath,
|
|
762
|
-
GAS_SETTINGS
|
|
763
|
-
)
|
|
764
|
-
).wait();
|
|
765
|
-
await countTotalGas(tx, "deploy comp staking");
|
|
766
|
-
const log = tx.events.find(_ => _.event === "Deployed");
|
|
767
|
-
if (!log.args.proxy)
|
|
768
|
-
throw new Error(`staking contract deploy failed ${token}`);
|
|
769
|
-
return [log.args.proxy, rewardsPerBlock];
|
|
770
|
-
});
|
|
771
|
-
|
|
772
|
-
await Promise.all(compps);
|
|
773
|
-
// const compps = [
|
|
774
|
-
// Promise.resolve(["0x9999c40c8b88c740076b15d2e708db6a7a071b53", 13888])
|
|
775
|
-
// ];
|
|
776
|
-
let deployed;
|
|
777
|
-
if (!isRopsten || isTest) {
|
|
778
|
-
const aaveps = aaveTokens.map(async token => {
|
|
779
|
-
let rewardsPerBlock = (protocolSettings.staking.rewardsPerBlock / 2) //aave gets half of the rewards
|
|
780
|
-
.toFixed(0);
|
|
781
|
-
console.log("deployStakingContracts", {
|
|
782
|
-
token,
|
|
783
|
-
settings: protocolSettings.staking,
|
|
784
|
-
rewardsPerBlock
|
|
785
|
-
});
|
|
786
|
-
const tx = await (
|
|
787
|
-
await aavefactory[
|
|
788
|
-
"cloneAndInit(address,address,address,uint64,address,address,address,address[])"
|
|
789
|
-
](
|
|
790
|
-
token.address,
|
|
791
|
-
get(protocolSettings, "aave.lendingPool", dao.AaveLendingPool),
|
|
792
|
-
release.NameService,
|
|
793
|
-
protocolSettings.staking.fullRewardsThreshold, //blocks before switching for 0.5x rewards to 1x multiplier
|
|
794
|
-
token.usdOracle,
|
|
795
|
-
|
|
796
|
-
get(
|
|
797
|
-
protocolSettings,
|
|
798
|
-
"aave.incentiveController",
|
|
799
|
-
dao.AaveIncentiveController
|
|
800
|
-
),
|
|
801
|
-
token.aaveUsdOracle,
|
|
802
|
-
token.swapPath,
|
|
803
|
-
GAS_SETTINGS
|
|
804
|
-
)
|
|
805
|
-
).wait();
|
|
806
|
-
await countTotalGas(tx, "deploy aave staking");
|
|
807
|
-
const log = tx.events.find(_ => _.event === "Deployed");
|
|
808
|
-
if (!log.args.proxy)
|
|
809
|
-
throw new Error(`staking contract deploy failed ${token}`);
|
|
810
|
-
return [log.args.proxy, rewardsPerBlock];
|
|
811
|
-
});
|
|
812
|
-
|
|
813
|
-
// const aaveps = [
|
|
814
|
-
// Promise.resolve(["0x8f0c4f59b4c593193e5b5e0224d848ac803ad1a2", 13888 / 2])
|
|
815
|
-
// ];
|
|
816
|
-
await Promise.all(aaveps);
|
|
817
|
-
deployed = await Promise.all(compps.concat(aaveps));
|
|
818
|
-
} else {
|
|
819
|
-
deployed = await Promise.all(compps);
|
|
820
|
-
}
|
|
821
|
-
|
|
822
|
-
console.log("deploying donation staking");
|
|
823
|
-
console.log(`release ${release}`);
|
|
824
|
-
const deployedDonationsStaking = await deployDeterministic(
|
|
825
|
-
{
|
|
826
|
-
network: "mainnet",
|
|
827
|
-
name: "DonationsStaking",
|
|
828
|
-
isUpgradable: true
|
|
829
|
-
},
|
|
830
|
-
[
|
|
831
|
-
release.NameService,
|
|
832
|
-
deployed[0][0],
|
|
833
|
-
[
|
|
834
|
-
"0x0000000000000000000000000000000000000000",
|
|
835
|
-
get(protocolSettings, "compound.dai", dao.DAI)
|
|
836
|
-
],
|
|
837
|
-
[
|
|
838
|
-
get(protocolSettings, "compound.dai", dao.DAI),
|
|
839
|
-
"0x0000000000000000000000000000000000000000"
|
|
840
|
-
]
|
|
841
|
-
],
|
|
842
|
-
{
|
|
843
|
-
libraries: {
|
|
844
|
-
UniswapV2SwapHelper: "0x62305662fA7c4BC442803b940d9192DbDC92D710"
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
);
|
|
848
|
-
// await countTotalGas(deployedDonationsStaking);
|
|
849
|
-
|
|
850
|
-
console.log(
|
|
851
|
-
`DonationsStaking deployed to: ${deployedDonationsStaking.address}`
|
|
852
|
-
);
|
|
853
|
-
|
|
854
|
-
return {
|
|
855
|
-
DonationsStaking: deployedDonationsStaking.address,
|
|
856
|
-
StakingContracts: deployed
|
|
857
|
-
};
|
|
858
|
-
};
|
|
859
|
-
const verifyContracts = async release => {
|
|
860
|
-
for (let contract of toDeployUpgradable) {
|
|
861
|
-
if (
|
|
862
|
-
contract.network !== "both" &&
|
|
863
|
-
(contract.network === "mainnet") !== isMainnet
|
|
864
|
-
) {
|
|
865
|
-
console.log(
|
|
866
|
-
contract,
|
|
867
|
-
" Skipping verification non mainnet/sidechain contract:",
|
|
868
|
-
contract.network,
|
|
869
|
-
contract.name
|
|
870
|
-
);
|
|
871
|
-
continue;
|
|
872
|
-
}
|
|
873
|
-
console.log(
|
|
874
|
-
"Running contract verification:",
|
|
875
|
-
{ contract },
|
|
876
|
-
release[contract.name]
|
|
877
|
-
);
|
|
878
|
-
if (contract.isUpgradable !== false) {
|
|
879
|
-
const implementationAddress = await getImplementationAddress(
|
|
880
|
-
network.provider,
|
|
881
|
-
release[contract.name]
|
|
882
|
-
);
|
|
883
|
-
try {
|
|
884
|
-
await run("verify:verify", {
|
|
885
|
-
address: implementationAddress
|
|
886
|
-
});
|
|
887
|
-
} catch (err) {
|
|
888
|
-
console.log("err", err);
|
|
889
|
-
}
|
|
890
|
-
} else {
|
|
891
|
-
try {
|
|
892
|
-
await run("verify:verify", {
|
|
893
|
-
address: release[contract.name],
|
|
894
|
-
constructorArguments: contract.args,
|
|
895
|
-
libraries: {
|
|
896
|
-
UniswapV2SwapHelper: "0x62305662fA7c4BC442803b940d9192DbDC92D710"
|
|
897
|
-
}
|
|
898
|
-
});
|
|
899
|
-
} catch (err) {
|
|
900
|
-
console.log("err", err);
|
|
901
|
-
}
|
|
902
|
-
}
|
|
903
|
-
}
|
|
904
|
-
};
|
|
905
|
-
|
|
906
|
-
await deployContracts();
|
|
907
|
-
|
|
908
|
-
if (isPerformUpgrade) {
|
|
909
|
-
console.log("deployed contracts", { totalGas, dao, release });
|
|
910
|
-
console.log("registering updrade scheme...");
|
|
911
|
-
await pressAnyKey();
|
|
912
|
-
await voteProtocolUpgrade(release);
|
|
913
|
-
await pressAnyKey();
|
|
914
|
-
console.log("voted contracts", { totalGas });
|
|
915
|
-
isMainnet && (await performUpgrade(release));
|
|
916
|
-
!isMainnet && (await performUpgradeFuse(release));
|
|
917
|
-
console.log("upgraded contracts", { totalGas });
|
|
918
|
-
}
|
|
919
|
-
if (isMainnet && !isTest && !isCoverage) {
|
|
920
|
-
await verifyContracts(release);
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
await releaser(release, networkName);
|
|
924
|
-
return release;
|
|
925
|
-
// await proveNewRep();
|
|
926
|
-
};
|
|
927
|
-
if (
|
|
928
|
-
network.name !== "hardhat" &&
|
|
929
|
-
process.argv[1].includes("upgradeToV2Recover.ts")
|
|
930
|
-
) {
|
|
931
|
-
main(name, true)
|
|
932
|
-
.catch(e => {
|
|
933
|
-
console.log(e);
|
|
934
|
-
throw e;
|
|
935
|
-
})
|
|
936
|
-
.finally(() => {
|
|
937
|
-
console.log({ totalGas, gasUsage });
|
|
938
|
-
});
|
|
939
|
-
}
|