@gooddollar/goodprotocol 2.1.3 → 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/README.md +0 -2
- 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/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/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/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/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/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/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/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/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/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +2 -2
- 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/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/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/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.json +2 -2
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/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/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.json +2 -2
- 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/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 -2
- package/types/factories/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking__factory.ts +1 -1
- 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/mocks/DistributionBridgeMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/StakingMockFixedAPY__factory.ts +1 -1
- package/types/factories/contracts/utils/LastauthReduction__factory.ts +1 -1
- package/types/factories/contracts/utils/ReserveRestore__factory.ts +1 -1
- 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 -1
- package/types/hardhat.d.ts +13 -4
- package/types/index.ts +4 -2
- 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,120 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* This script will deploy a fixed goodfundmanager that doenst disable staking contracts if rewards=0
|
|
3
|
-
* It will also then re submit the staking contracts
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { network, ethers } from "hardhat";
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
executeViaGuardian,
|
|
10
|
-
executeViaSafe
|
|
11
|
-
} from "../multichain-deploy/helpers";
|
|
12
|
-
|
|
13
|
-
import releaser from "../releaser";
|
|
14
|
-
import dao from "../../releases/deployment.json";
|
|
15
|
-
const { name: networkName } = network;
|
|
16
|
-
|
|
17
|
-
export const deployMainnet = async () => {
|
|
18
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
19
|
-
|
|
20
|
-
let executionMethod = networkName === "localhost" ? "guardians" : "safe";
|
|
21
|
-
|
|
22
|
-
const networkKey =
|
|
23
|
-
networkName === "localhost" ? "production-mainnet" : networkName;
|
|
24
|
-
let release: { [key: string]: any } = dao[networkKey];
|
|
25
|
-
|
|
26
|
-
let safeOwner = new ethers.Wallet(
|
|
27
|
-
process.env.SAFEOWNER_PRIVATE_KEY || ethers.constants.HashZero,
|
|
28
|
-
ethers.provider
|
|
29
|
-
);
|
|
30
|
-
|
|
31
|
-
//test with guardians safe on hardhat mainnet fork
|
|
32
|
-
if (network.name === "localhost") {
|
|
33
|
-
root = await ethers.getImpersonatedSigner(
|
|
34
|
-
"0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec"
|
|
35
|
-
);
|
|
36
|
-
await signers[0].sendTransaction({
|
|
37
|
-
to: root.address,
|
|
38
|
-
value: ethers.constants.WeiPerEther
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
console.log("got signers:", {
|
|
43
|
-
networkName,
|
|
44
|
-
networkKey,
|
|
45
|
-
root: root.address,
|
|
46
|
-
safeOwner: safeOwner.address,
|
|
47
|
-
balance: await ethers.provider
|
|
48
|
-
.getBalance(root.address)
|
|
49
|
-
.then(_ => _.toString())
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
console.log("deploying goodfundmanager implementation");
|
|
53
|
-
const gfmImpl = await (
|
|
54
|
-
await ethers.getContractFactory("GoodFundManager")
|
|
55
|
-
).deploy();
|
|
56
|
-
|
|
57
|
-
const proposalContracts = [
|
|
58
|
-
release.GoodFundManager, //Fundmanager -> upgrade to new version
|
|
59
|
-
release.GoodFundManager, //Fundmanager -> set staking rewards compound to 0
|
|
60
|
-
release.GoodFundManager //Fundmanager -> set staking rewards aave to 0
|
|
61
|
-
];
|
|
62
|
-
|
|
63
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
64
|
-
|
|
65
|
-
const proposalFunctionSignatures = [
|
|
66
|
-
"upgradeTo(address)",
|
|
67
|
-
"setStakingReward(uint32,address,uint32,uint32,bool)",
|
|
68
|
-
"setStakingReward(uint32,address,uint32,uint32,bool)"
|
|
69
|
-
];
|
|
70
|
-
|
|
71
|
-
const proposalFunctionInputs = [
|
|
72
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [gfmImpl.address]), //upgradeTo(address)
|
|
73
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
74
|
-
["uint32", "address", "uint32", "uint32", "bool"],
|
|
75
|
-
[
|
|
76
|
-
"0",
|
|
77
|
-
"0x7b7246c78e2f900d17646ff0cb2ec47d6ba10754",
|
|
78
|
-
"14338692",
|
|
79
|
-
"4294967295",
|
|
80
|
-
false
|
|
81
|
-
]
|
|
82
|
-
), //setstakingrewards to 0
|
|
83
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
84
|
-
["uint32", "address", "uint32", "uint32", "bool"],
|
|
85
|
-
[
|
|
86
|
-
"0",
|
|
87
|
-
"0x3ff2d8eb2573819a9ef7167d2ba6fd6d31b17f4f",
|
|
88
|
-
"14338692",
|
|
89
|
-
"4294967295",
|
|
90
|
-
false
|
|
91
|
-
]
|
|
92
|
-
) //setstakingrewards to 0
|
|
93
|
-
];
|
|
94
|
-
|
|
95
|
-
if (executionMethod === "safe") {
|
|
96
|
-
return executeViaSafe(
|
|
97
|
-
proposalContracts,
|
|
98
|
-
proposalEthValues,
|
|
99
|
-
proposalFunctionSignatures,
|
|
100
|
-
proposalFunctionInputs,
|
|
101
|
-
networkName === "localhost"
|
|
102
|
-
? "0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec"
|
|
103
|
-
: release.GuardiansSafe,
|
|
104
|
-
safeOwner
|
|
105
|
-
);
|
|
106
|
-
} else {
|
|
107
|
-
return executeViaGuardian(
|
|
108
|
-
proposalContracts,
|
|
109
|
-
proposalEthValues,
|
|
110
|
-
proposalFunctionSignatures,
|
|
111
|
-
proposalFunctionInputs,
|
|
112
|
-
root
|
|
113
|
-
);
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
export const main = async () => {
|
|
118
|
-
await deployMainnet().catch(console.log);
|
|
119
|
-
};
|
|
120
|
-
if (process.argv[1].includes("v3-fix")) main();
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* This script will deploy a reserve upgrade and the DistributionHelper so that some of the expansion can be allocated
|
|
3
|
-
* for non-ubi purposes
|
|
4
|
-
* Upgrade process:
|
|
5
|
-
* mainnet:
|
|
6
|
-
* - deploy reserve
|
|
7
|
-
* - deploy distributionHelper
|
|
8
|
-
* - create proposal that:
|
|
9
|
-
* - upgrades the reserve
|
|
10
|
-
* - sets the distributionHelper at reserve with the agreed bps
|
|
11
|
-
* - add to the distributionHelper the contracts addresses to receive part of the UBI
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { network, ethers } from "hardhat";
|
|
15
|
-
import { defaultsDeep } from "lodash";
|
|
16
|
-
import {
|
|
17
|
-
deployDeterministic,
|
|
18
|
-
printDeploy,
|
|
19
|
-
executeViaGuardian,
|
|
20
|
-
executeViaSafe,
|
|
21
|
-
verifyProductionSigner
|
|
22
|
-
} from "../multichain-deploy/helpers";
|
|
23
|
-
import { deployWrapper } from "../multichain-deploy/multichainWrapper-deploy";
|
|
24
|
-
|
|
25
|
-
import releaser from "../releaser";
|
|
26
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
27
|
-
import dao from "../../releases/deployment.json";
|
|
28
|
-
import { BigNumber } from "ethers";
|
|
29
|
-
const { name: networkName } = network;
|
|
30
|
-
|
|
31
|
-
export const deployFuse = async () => {
|
|
32
|
-
const isProduction = networkName.includes("production");
|
|
33
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
34
|
-
|
|
35
|
-
if (isProduction) verifyProductionSigner(root);
|
|
36
|
-
|
|
37
|
-
let executionMethod = "safe";
|
|
38
|
-
|
|
39
|
-
const networkKey = networkName === "localhost" ? "production-mainnet" : networkName;
|
|
40
|
-
let release: { [key: string]: any } = dao[networkKey];
|
|
41
|
-
let settings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
42
|
-
|
|
43
|
-
console.log("got signers:", {
|
|
44
|
-
networkName,
|
|
45
|
-
networkKey,
|
|
46
|
-
root: root.address,
|
|
47
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const Wrapper = await deployWrapper();
|
|
51
|
-
// const Wrapper = await ethers.getContractAt("GoodDollarMintBurnWrapper", release.GoodDollarMintBurnWrapper);
|
|
52
|
-
|
|
53
|
-
const proposalContracts = [
|
|
54
|
-
release.NameService, //nameservice add Wrapper,MultiChainRouter
|
|
55
|
-
release.GoodDollar, // give mint rights to Wrapper
|
|
56
|
-
Wrapper.address //add multichainrouter as minter
|
|
57
|
-
];
|
|
58
|
-
|
|
59
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
60
|
-
|
|
61
|
-
const proposalFunctionSignatures = [
|
|
62
|
-
"setAddresses(bytes32[],address[])",
|
|
63
|
-
"addMinter(address)",
|
|
64
|
-
"addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)"
|
|
65
|
-
];
|
|
66
|
-
|
|
67
|
-
const proposalFunctionInputs = [
|
|
68
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
69
|
-
["bytes32[]", "address[]"],
|
|
70
|
-
[
|
|
71
|
-
[
|
|
72
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MINTBURN_WRAPPER")),
|
|
73
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MULTICHAIN_ROUTER"))
|
|
74
|
-
],
|
|
75
|
-
[Wrapper.address, release.MultichainRouter]
|
|
76
|
-
]
|
|
77
|
-
), //setAddresses(bytes32[],address[])"
|
|
78
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [Wrapper.address]), //addMinter(address)
|
|
79
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
80
|
-
["address", "uint256", "uint256", "uint32", "uint256", "uint256", "uint32", "bool"],
|
|
81
|
-
[
|
|
82
|
-
release.MultichainRouter,
|
|
83
|
-
0,
|
|
84
|
-
0,
|
|
85
|
-
0,
|
|
86
|
-
0,
|
|
87
|
-
300 * 1e6 * 100, //300M G$ 2 decimals
|
|
88
|
-
1000, //10%
|
|
89
|
-
false
|
|
90
|
-
]
|
|
91
|
-
) //addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)
|
|
92
|
-
];
|
|
93
|
-
|
|
94
|
-
if (executionMethod === "safe") {
|
|
95
|
-
return executeViaSafe(
|
|
96
|
-
proposalContracts,
|
|
97
|
-
proposalEthValues,
|
|
98
|
-
proposalFunctionSignatures,
|
|
99
|
-
proposalFunctionInputs,
|
|
100
|
-
networkName === "localhost" ? "0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec" : release.GuardiansSafe,
|
|
101
|
-
"fuse"
|
|
102
|
-
);
|
|
103
|
-
} else {
|
|
104
|
-
return executeViaGuardian(
|
|
105
|
-
proposalContracts,
|
|
106
|
-
proposalEthValues,
|
|
107
|
-
proposalFunctionSignatures,
|
|
108
|
-
proposalFunctionInputs,
|
|
109
|
-
root
|
|
110
|
-
);
|
|
111
|
-
}
|
|
112
|
-
};
|
|
113
|
-
|
|
114
|
-
export const main = async () => {
|
|
115
|
-
await deployFuse().catch(console.log);
|
|
116
|
-
};
|
|
117
|
-
if (process.argv[1].includes("v3-fuse-multichain")) main();
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* This script will deploy a reserve upgrade and the DistributionHelper so that some of the expansion can be allocated
|
|
3
|
-
* for non-ubi purposes
|
|
4
|
-
* Upgrade process:
|
|
5
|
-
* mainnet:
|
|
6
|
-
* - deploy reserve
|
|
7
|
-
* - deploy distributionHelper
|
|
8
|
-
* - create proposal that:
|
|
9
|
-
* - upgrades the reserve
|
|
10
|
-
* - sets the distributionHelper at reserve with the agreed bps
|
|
11
|
-
* - add to the distributionHelper the contracts addresses to receive part of the UBI
|
|
12
|
-
*/
|
|
13
|
-
|
|
14
|
-
import { network, ethers } from "hardhat";
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
deployDeterministic,
|
|
18
|
-
printDeploy,
|
|
19
|
-
executeViaGuardian,
|
|
20
|
-
executeViaSafe
|
|
21
|
-
} from "../multichain-deploy/helpers";
|
|
22
|
-
|
|
23
|
-
import releaser from "../releaser";
|
|
24
|
-
import dao from "../../releases/deployment.json";
|
|
25
|
-
import {
|
|
26
|
-
CompoundVotingMachine,
|
|
27
|
-
DistributionHelper,
|
|
28
|
-
Controller,
|
|
29
|
-
NameService
|
|
30
|
-
} from "../../types";
|
|
31
|
-
const { name: networkName } = network;
|
|
32
|
-
|
|
33
|
-
export const deployMainnet = async () => {
|
|
34
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
35
|
-
|
|
36
|
-
let executionMethod = "safe";
|
|
37
|
-
let communitySafe = "0x5Eb5f5fE13d1D5e6440DbD5913412299Bc5B5564";
|
|
38
|
-
|
|
39
|
-
const networkKey =
|
|
40
|
-
networkName === "localhost" ? "production-mainnet" : networkName;
|
|
41
|
-
let release: { [key: string]: any } = dao[networkKey];
|
|
42
|
-
|
|
43
|
-
let safeOwner = new ethers.Wallet(
|
|
44
|
-
process.env.SAFEOWNER_PRIVATE_KEY || ethers.constants.HashZero,
|
|
45
|
-
ethers.provider
|
|
46
|
-
);
|
|
47
|
-
//test with guardians safe on hardhat mainnet fork
|
|
48
|
-
if (network.name === "localhost") {
|
|
49
|
-
root = await ethers.getImpersonatedSigner(
|
|
50
|
-
"0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec"
|
|
51
|
-
);
|
|
52
|
-
await signers[0].sendTransaction({
|
|
53
|
-
to: root.address,
|
|
54
|
-
value: ethers.constants.WeiPerEther
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
console.log("got signers:", {
|
|
59
|
-
networkName,
|
|
60
|
-
networkKey,
|
|
61
|
-
root: root.address,
|
|
62
|
-
safeOwner: safeOwner.address,
|
|
63
|
-
balance: await ethers.provider
|
|
64
|
-
.getBalance(root.address)
|
|
65
|
-
.then(_ => _.toString())
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
console.log("deploying reserve implementation");
|
|
69
|
-
const reserveImpl = await (
|
|
70
|
-
await ethers.getContractFactory("GoodReserveCDai")
|
|
71
|
-
).deploy();
|
|
72
|
-
|
|
73
|
-
console.log("deploying DistributionHelper");
|
|
74
|
-
|
|
75
|
-
let DHelper: DistributionHelper;
|
|
76
|
-
if (!release.DistributionHelper) {
|
|
77
|
-
DHelper = (await deployDeterministic(
|
|
78
|
-
{
|
|
79
|
-
name: "DistributionHelper",
|
|
80
|
-
salt: "DistributionHelper",
|
|
81
|
-
isUpgradeable: true
|
|
82
|
-
},
|
|
83
|
-
[release.NameService]
|
|
84
|
-
).then(printDeploy)) as DistributionHelper;
|
|
85
|
-
|
|
86
|
-
let torelease = {
|
|
87
|
-
DistributionHelper: DHelper.address
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
await releaser(torelease, networkName, "deployment", false);
|
|
91
|
-
} else {
|
|
92
|
-
DHelper = (await ethers.getContractAt(
|
|
93
|
-
"DistributionHelper",
|
|
94
|
-
release.DistributionHelper
|
|
95
|
-
)) as DistributionHelper;
|
|
96
|
-
}
|
|
97
|
-
DHelper;
|
|
98
|
-
|
|
99
|
-
const ns = (await ethers.getContractAt(
|
|
100
|
-
"NameService",
|
|
101
|
-
release.NameService
|
|
102
|
-
)) as NameService;
|
|
103
|
-
|
|
104
|
-
const proposalContracts = [
|
|
105
|
-
ns.address, //nameservice add DistributionHelper,MultiChainRouter,MultiChain AnyGoodDollar,
|
|
106
|
-
DHelper.address, //update addresses from nameservice
|
|
107
|
-
DHelper.address, //distribution helper -> add fuse community pool as recipient with 100%
|
|
108
|
-
release.GoodReserveCDai, //upgradeTo
|
|
109
|
-
release.GoodReserveCDai, //Reserve -> set distribution helper + non ubi bps
|
|
110
|
-
release.GoodReserveCDai, //Reserve -> set new decline rate
|
|
111
|
-
release.GoodFundManager, //Fundmanager -> set staking rewards compound to 0
|
|
112
|
-
release.GoodFundManager //Fundmanager -> set staking rewards aave to 0
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
116
|
-
|
|
117
|
-
const proposalFunctionSignatures = [
|
|
118
|
-
"setAddresses(bytes32[],address[])",
|
|
119
|
-
"updateAddresses()",
|
|
120
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))",
|
|
121
|
-
"upgradeTo(address)",
|
|
122
|
-
"setDistributionHelper(address,uint32)",
|
|
123
|
-
"setReserveRatioDailyExpansion(uint256,uint256)",
|
|
124
|
-
"setStakingReward(uint32,address,uint32,uint32,bool)",
|
|
125
|
-
"setStakingReward(uint32,address,uint32,uint32,bool)"
|
|
126
|
-
];
|
|
127
|
-
|
|
128
|
-
const proposalFunctionInputs = [
|
|
129
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
130
|
-
["bytes32[]", "address[]"],
|
|
131
|
-
[
|
|
132
|
-
[
|
|
133
|
-
ethers.utils.keccak256(
|
|
134
|
-
ethers.utils.toUtf8Bytes("DISTRIBUTION_HELPER")
|
|
135
|
-
),
|
|
136
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MULTICHAIN_ROUTER")),
|
|
137
|
-
ethers.utils.keccak256(
|
|
138
|
-
ethers.utils.toUtf8Bytes("MULTICHAIN_ANYGOODDOLLAR")
|
|
139
|
-
)
|
|
140
|
-
],
|
|
141
|
-
[DHelper.address, release.MultichainRouter, release.AnyGoodDollar]
|
|
142
|
-
]
|
|
143
|
-
), //setAddresses(bytes32[],address[])"
|
|
144
|
-
ethers.utils.defaultAbiCoder.encode([], []), //updateAddresses()
|
|
145
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
146
|
-
["uint32", "uint32", "address", "uint8"],
|
|
147
|
-
[
|
|
148
|
-
10000, //100% bps
|
|
149
|
-
122, //chainid
|
|
150
|
-
communitySafe, //recipient address,
|
|
151
|
-
0 //recipient type via fuse bridge
|
|
152
|
-
]
|
|
153
|
-
), //addOrUpdateRecipient((uint32,uint32,address,uint8))
|
|
154
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [reserveImpl.address]), //upgradeTo(address)
|
|
155
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
156
|
-
["address", "uint32"],
|
|
157
|
-
[DHelper.address, 1000]
|
|
158
|
-
), //setDistributionHelper(address,uint32)
|
|
159
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
160
|
-
["uint256", "uint256"],
|
|
161
|
-
["999554841771249", "1000000000000000"] //15% a year
|
|
162
|
-
), //setReserveRatioDailyExpansion(uint,uint)
|
|
163
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
164
|
-
["uint32", "address", "uint32", "uint32", "bool"],
|
|
165
|
-
[
|
|
166
|
-
"0",
|
|
167
|
-
"0x7b7246c78e2f900d17646ff0cb2ec47d6ba10754",
|
|
168
|
-
"14338692",
|
|
169
|
-
"4294967295",
|
|
170
|
-
false
|
|
171
|
-
]
|
|
172
|
-
), //setstakingrewards to 0
|
|
173
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
174
|
-
["uint32", "address", "uint32", "uint32", "bool"],
|
|
175
|
-
[
|
|
176
|
-
"0",
|
|
177
|
-
"0x3ff2d8eb2573819a9ef7167d2ba6fd6d31b17f4f",
|
|
178
|
-
"14338692",
|
|
179
|
-
"4294967295",
|
|
180
|
-
false
|
|
181
|
-
]
|
|
182
|
-
) //setstakingrewards to 0
|
|
183
|
-
];
|
|
184
|
-
|
|
185
|
-
//make sure rewards accumulated before we set them to 0
|
|
186
|
-
const staking = await ethers.getContractAt(
|
|
187
|
-
"SimpleStakingV2",
|
|
188
|
-
"0x7b7246c78e2f900d17646ff0cb2ec47d6ba10754"
|
|
189
|
-
);
|
|
190
|
-
(await staking.withdrawRewards()).wait();
|
|
191
|
-
staking.attach("0x3ff2d8eb2573819a9ef7167d2ba6fd6d31b17f4f");
|
|
192
|
-
(await staking.withdrawRewards()).wait();
|
|
193
|
-
|
|
194
|
-
if (executionMethod === "safe") {
|
|
195
|
-
return executeViaSafe(
|
|
196
|
-
proposalContracts,
|
|
197
|
-
proposalEthValues,
|
|
198
|
-
proposalFunctionSignatures,
|
|
199
|
-
proposalFunctionInputs,
|
|
200
|
-
networkName === "localhost"
|
|
201
|
-
? "0xE0c5daa7CC6F88d29505f702a53bb5E67600e7Ec"
|
|
202
|
-
: release.GuardiansSafe,
|
|
203
|
-
safeOwner
|
|
204
|
-
);
|
|
205
|
-
} else {
|
|
206
|
-
return executeViaGuardian(
|
|
207
|
-
proposalContracts,
|
|
208
|
-
proposalEthValues,
|
|
209
|
-
proposalFunctionSignatures,
|
|
210
|
-
proposalFunctionInputs,
|
|
211
|
-
root
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
export const main = async () => {
|
|
217
|
-
await deployMainnet().catch(console.log);
|
|
218
|
-
};
|
|
219
|
-
if (process.argv[1].includes("v3-upgrade")) main();
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Step 1:
|
|
3
|
-
* - upgrade Identity on Fuse to support whitelisting with chainid
|
|
4
|
-
*
|
|
5
|
-
* Step 2:
|
|
6
|
-
* - deploy 2_helpers on Celo
|
|
7
|
-
* - add 1000 celo to adminwallet and faucet
|
|
8
|
-
* - monitor adminwallet + faucet on defender
|
|
9
|
-
*
|
|
10
|
-
* Step 3: (once guardians sign Identity upgrade)
|
|
11
|
-
* - upgrade AdminWallet+Invites+Faucet on Fuse to support whitelisting chainid
|
|
12
|
-
* - upgrade backend server to support whitelisting with chainid
|
|
13
|
-
*
|
|
14
|
-
* Step 4:
|
|
15
|
-
* 0. deploy 3_gdStaking, deploy 4_ubi
|
|
16
|
-
* 1. guardians vote send X% to celo ubi pool
|
|
17
|
-
* 2. guardians vote on celo set new GOOD distribution for gdstaking + claiming ubi
|
|
18
|
-
* 3. guardians vote on fuse set new GOOD distribution for gdstaking + claiming ubi
|
|
19
|
-
*
|
|
20
|
-
* NOTICE: decide if to remove "upgrade" method from gdStaking before deploying it. based on GOOD distribution decision
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
import { network, ethers, upgrades } from "hardhat";
|
|
24
|
-
import { defaultsDeep } from "lodash";
|
|
25
|
-
import prompt from "prompt";
|
|
26
|
-
|
|
27
|
-
import {
|
|
28
|
-
executeViaGuardian,
|
|
29
|
-
executeViaSafe,
|
|
30
|
-
verifyProductionSigner,
|
|
31
|
-
verifyContract
|
|
32
|
-
} from "../multichain-deploy/helpers";
|
|
33
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
34
|
-
import dao from "../../releases/deployment.json";
|
|
35
|
-
import { upgrade as identityUpgrade } from "./identity-upgrade";
|
|
36
|
-
import { SignerWithAddress } from "@nomiclabs/hardhat-ethers/signers";
|
|
37
|
-
import { deployHelpers } from "../multichain-deploy/2_helpers-deploy";
|
|
38
|
-
|
|
39
|
-
const { name: networkName } = network;
|
|
40
|
-
const isProduction = networkName.includes("production");
|
|
41
|
-
|
|
42
|
-
let settings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
43
|
-
|
|
44
|
-
const step1 = async () => {
|
|
45
|
-
await identityUpgrade();
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
const step2 = async () => {
|
|
49
|
-
await deployHelpers();
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const step3 = async () => {
|
|
53
|
-
let release: { [key: string]: any } = dao[networkName];
|
|
54
|
-
let [root] = await ethers.getSigners();
|
|
55
|
-
|
|
56
|
-
if (isProduction) verifyProductionSigner(root);
|
|
57
|
-
|
|
58
|
-
const adminimpl = await (await ethers.getContractFactory("AdminWalletFuse")).deploy();
|
|
59
|
-
const curadmin = adminimpl.attach(release.AdminWallet);
|
|
60
|
-
console.log("deployed admin impl", adminimpl.address);
|
|
61
|
-
const encodedAdmin = adminimpl.interface.encodeFunctionData("upgrade", [release.NameService]);
|
|
62
|
-
const upgradetx = await (await curadmin.upgradeToAndCall(adminimpl.address, encodedAdmin)).wait();
|
|
63
|
-
const impl = adminimpl.address;
|
|
64
|
-
console.log("AdminWallet upgraded", { impl, txhash: upgradetx.transactionHash });
|
|
65
|
-
await verifyContract(impl, "AdminWalletFuse", networkName);
|
|
66
|
-
|
|
67
|
-
const faucetimpl = await (await ethers.getContractFactory("FuseFaucetV2")).deploy();
|
|
68
|
-
const proxyAdmin = await ethers.getContractAt("ProxyAdmin", release.ProxyAdmin);
|
|
69
|
-
const encoded = faucetimpl.interface.encodeFunctionData("upgrade", [
|
|
70
|
-
release.AdminWallet,
|
|
71
|
-
root.address,
|
|
72
|
-
release.NameService
|
|
73
|
-
]);
|
|
74
|
-
const faucettx = await (await proxyAdmin.upgradeAndCall(release.FuseFaucet, faucetimpl.address, encoded)).wait();
|
|
75
|
-
console.log("Faucet upgraded", faucettx.transactionHash);
|
|
76
|
-
await verifyContract(faucetimpl.address, "FuseFaucetV2", networkName);
|
|
77
|
-
|
|
78
|
-
const invitesimpl = await (await ethers.getContractFactory("InvitesFuseV2")).deploy();
|
|
79
|
-
const invitestx = await (await proxyAdmin.upgrade(release.Invites, invitesimpl.address)).wait();
|
|
80
|
-
console.log("Invites upgraded", invitestx.transactionHash);
|
|
81
|
-
await verifyContract(invitesimpl.address, "InvitesFuseV2", networkName);
|
|
82
|
-
|
|
83
|
-
console.log("upgrade backend contracts abi + call whitelist with chainid....");
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const step4 = async () => {
|
|
87
|
-
// let [root, ...signers] = await ethers.getSigners();
|
|
88
|
-
|
|
89
|
-
const isSafeSimulation = process.env.SAFE_SIMULATION === "true";
|
|
90
|
-
const celoSigner = ethers.Wallet.fromMnemonic(process.env.MNEMONIC)
|
|
91
|
-
.connect(ethers.provider)
|
|
92
|
-
.connect(new ethers.providers.JsonRpcProvider("https://forno.celo.org"));
|
|
93
|
-
const fuseSigner = ethers.Wallet.fromMnemonic(process.env.MNEMONIC)
|
|
94
|
-
.connect(ethers.provider)
|
|
95
|
-
.connect(new ethers.providers.JsonRpcProvider("https://rpc.fuse.io"));
|
|
96
|
-
let networkEnv = networkName.split("-")[0];
|
|
97
|
-
if (networkEnv === "fuse") networkEnv = "development";
|
|
98
|
-
|
|
99
|
-
const celoNetwork = networkEnv + "-celo";
|
|
100
|
-
const mainnetNetwork = "production-mainnet"; //simulate production on localhost requires running hardhat node in fork mode
|
|
101
|
-
|
|
102
|
-
console.log("updating dao on networks:", { isSafeSimulation, celoNetwork, mainnetNetwork, networkName });
|
|
103
|
-
let release: { [key: string]: any } = dao[networkName];
|
|
104
|
-
|
|
105
|
-
const mainnetDeploy: [any, any, any, any] = [
|
|
106
|
-
[dao[mainnetNetwork].DistributionHelper],
|
|
107
|
-
[0],
|
|
108
|
-
["addOrUpdateRecipient((uint32,uint32,address,uint8))"],
|
|
109
|
-
[
|
|
110
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
111
|
-
["uint32", "uint32", "address", "uint8"],
|
|
112
|
-
[1000, 42220, dao[celoNetwork].UBIScheme, 1]
|
|
113
|
-
)
|
|
114
|
-
]
|
|
115
|
-
];
|
|
116
|
-
const fuseDeploy: [any, any, any, any] = [
|
|
117
|
-
[release.ClaimersDistribution, release.GovernanceStakingV2 || release.GovernanceStaking],
|
|
118
|
-
[0, 0],
|
|
119
|
-
["setMonthlyReputationDistribution(uint256)", "setMonthlyRewards(uint256)"],
|
|
120
|
-
[
|
|
121
|
-
ethers.utils.defaultAbiCoder.encode(["uint256"], [settings.governance.claimersGOODMonthly]),
|
|
122
|
-
ethers.utils.defaultAbiCoder.encode(["uint256"], [settings.governance.stakersGOODMonthly])
|
|
123
|
-
]
|
|
124
|
-
];
|
|
125
|
-
const celoDeploy: [any, any, any, any] = [
|
|
126
|
-
[dao[celoNetwork].ClaimersDistribution, dao[celoNetwork].GoodDollarStaking],
|
|
127
|
-
[0, 0],
|
|
128
|
-
["setMonthlyReputationDistribution(uint256)", "setMonthlyGOODRewards(uint256)"],
|
|
129
|
-
[
|
|
130
|
-
ethers.utils.defaultAbiCoder.encode(["uint256"], [ProtocolSettings[celoNetwork].governance.claimersGOODMonthly]),
|
|
131
|
-
ethers.utils.defaultAbiCoder.encode(["uint256"], [ProtocolSettings[celoNetwork].governance.stakersGOODMonthly])
|
|
132
|
-
]
|
|
133
|
-
];
|
|
134
|
-
if (isProduction || isSafeSimulation) {
|
|
135
|
-
console.log("executing dao updates on mainnet via guardianssafe...", { isProduction, isSafeSimulation });
|
|
136
|
-
await executeViaSafe(
|
|
137
|
-
...mainnetDeploy,
|
|
138
|
-
isSafeSimulation ? "0xF0652a820dd39EC956659E0018Da022132f2f40a" : dao[mainnetNetwork].GuardiansSafe,
|
|
139
|
-
"mainnet",
|
|
140
|
-
isSafeSimulation
|
|
141
|
-
);
|
|
142
|
-
console.log("executing dao updates on fuse via guardianssafe...", dao[networkName].GuardiansSafe);
|
|
143
|
-
await executeViaSafe(...fuseDeploy, dao[networkName].GuardiansSafe, "fuse", isSafeSimulation);
|
|
144
|
-
console.log("executing dao updates on celo via guardianssafe...", dao[celoNetwork].GuardiansSafe);
|
|
145
|
-
await executeViaSafe(...celoDeploy, dao[celoNetwork].GuardiansSafe, "celo", isSafeSimulation);
|
|
146
|
-
} else {
|
|
147
|
-
const forkProvider = new ethers.providers.JsonRpcProvider("http://localhost:8545");
|
|
148
|
-
const ethSigner = await SignerWithAddress.create(
|
|
149
|
-
forkProvider.getSigner("0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266")
|
|
150
|
-
);
|
|
151
|
-
await forkProvider.send("hardhat_impersonateAccount", [dao[mainnetNetwork].GuardiansSafe]);
|
|
152
|
-
const guardiansSigner = await SignerWithAddress.create(forkProvider.getSigner(dao[mainnetNetwork].GuardiansSafe));
|
|
153
|
-
await ethSigner.sendTransaction({ value: ethers.constants.WeiPerEther, to: guardiansSigner.address });
|
|
154
|
-
|
|
155
|
-
console.log("executing dao updates on mainnet...");
|
|
156
|
-
await executeViaGuardian(...mainnetDeploy, guardiansSigner, "production-mainnet"); //simulate production on localhost requires running hardhat node in fork mode
|
|
157
|
-
console.log("executing dao updates on fuse...");
|
|
158
|
-
await executeViaGuardian(...fuseDeploy, fuseSigner, networkName);
|
|
159
|
-
console.log("executing dao updates on celo...");
|
|
160
|
-
await executeViaGuardian(...celoDeploy, celoSigner, celoNetwork);
|
|
161
|
-
}
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
const main = async () => {
|
|
165
|
-
prompt.start();
|
|
166
|
-
const { stepNumber } = await prompt.get(["stepNumber"]);
|
|
167
|
-
|
|
168
|
-
console.log("running step:", { stepNumber });
|
|
169
|
-
switch (stepNumber) {
|
|
170
|
-
case "1":
|
|
171
|
-
await step1();
|
|
172
|
-
break;
|
|
173
|
-
case "2":
|
|
174
|
-
await step2();
|
|
175
|
-
break;
|
|
176
|
-
case "3":
|
|
177
|
-
await step3();
|
|
178
|
-
break;
|
|
179
|
-
case "4":
|
|
180
|
-
await step4();
|
|
181
|
-
break;
|
|
182
|
-
}
|
|
183
|
-
};
|
|
184
|
-
main().catch(e => console.error(e));
|