@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,427 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* Upgrade Reserve to fix distribution bug and use only disthelper for distribution
|
|
3
|
-
* Upgrade fundmanager to allow minting of ubi even without collecting interest, removing ubi distribution
|
|
4
|
-
* Upgrade distribution helper to work with new bridge replacing multichain
|
|
5
|
-
* Deploy fee formula to prevent usage of multichain bridge
|
|
6
|
-
* Mint G$s to new bridge to provide exit liquidity instead of multichain
|
|
7
|
-
* Upgrade Plan:
|
|
8
|
-
* - fuse: give mint permissions to new bridge (upgradeSidechain)
|
|
9
|
-
* - celo: give mint permissions to new bridge (upgradeSidechain)
|
|
10
|
-
* Mainnet:
|
|
11
|
-
* - deploy new impl, fund manager, distribution helper, fee formula
|
|
12
|
-
* - call disthelper updateAddresses
|
|
13
|
-
* - create guardians safe proposal to upgrade reserve + fundmanager + distribution helper
|
|
14
|
-
* - create guardians safe proposal to set the new distribution helper amounts,recipients, and bridges * ** THIS SHOULD BE DONE ONLY AFTER BRIDGE WAS DEPLOYED **
|
|
15
|
-
* - create guardians safe proposal to set the disthelper fee settings
|
|
16
|
-
* - create guardians safe proposal to mint G$s to bridge
|
|
17
|
-
* - create guardians safe proposal to set new fee formula
|
|
18
|
-
* - create guardians safe action to move UBI held in escrow to bridge (to balance manually minting UBI on celo)
|
|
19
|
-
*/
|
|
20
|
-
|
|
21
|
-
/** NOTICE **/
|
|
22
|
-
/**
|
|
23
|
-
* To test it on a fork make sure to first deploy the messagepassingbridge @gooddollar/GoodBridge deployMessagePassingBridge.ts
|
|
24
|
-
* to the same fork
|
|
25
|
-
*/
|
|
26
|
-
import { network, ethers } from "hardhat";
|
|
27
|
-
import { Contract } from "ethers";
|
|
28
|
-
import { defaultsDeep } from "lodash";
|
|
29
|
-
import prompt from "prompt";
|
|
30
|
-
import { reset } from "@nomicfoundation/hardhat-network-helpers";
|
|
31
|
-
|
|
32
|
-
import {
|
|
33
|
-
deployDeterministic,
|
|
34
|
-
printDeploy,
|
|
35
|
-
executeViaGuardian,
|
|
36
|
-
executeViaSafe,
|
|
37
|
-
verifyProductionSigner
|
|
38
|
-
} from "../multichain-deploy/helpers";
|
|
39
|
-
|
|
40
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
41
|
-
|
|
42
|
-
import dao from "../../releases/deployment.json";
|
|
43
|
-
import { verifyContract } from "../multichain-deploy/helpers";
|
|
44
|
-
import { IStaticOracle } from "../../types";
|
|
45
|
-
let { name: networkName } = network;
|
|
46
|
-
|
|
47
|
-
export const upgrade = async () => {
|
|
48
|
-
const isProduction = networkName.includes("production");
|
|
49
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
50
|
-
|
|
51
|
-
if (isProduction) verifyProductionSigner(root);
|
|
52
|
-
|
|
53
|
-
let guardian = root;
|
|
54
|
-
|
|
55
|
-
//simulate produciton on fork
|
|
56
|
-
if (network.name === "hardhat" || network.name === "fork") {
|
|
57
|
-
networkName = "production-mainnet";
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
let release: { [key: string]: any } = dao[networkName];
|
|
61
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
62
|
-
|
|
63
|
-
//simulate on fork, make sure safe has enough eth to simulate txs
|
|
64
|
-
if (network.name === "hardhat" || network.name === "fork") {
|
|
65
|
-
guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
|
|
66
|
-
networkName = "production-mainnet";
|
|
67
|
-
|
|
68
|
-
await root.sendTransaction({ value: ethers.constants.WeiPerEther.mul(3), to: protocolSettings.guardiansSafe });
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
const rootBalance = await ethers.provider.getBalance(root.address).then(_ => _.toString());
|
|
72
|
-
const guardianBalance = await ethers.provider.getBalance(guardian.address).then(_ => _.toString());
|
|
73
|
-
const MULTICHAIN_BALANCE = "51098079793";
|
|
74
|
-
const NEWBRIDGE = release["MpbBridge"];
|
|
75
|
-
const gd = await ethers.getContractAt("IERC20", release["GoodDollar"]);
|
|
76
|
-
|
|
77
|
-
const GUARDIANS_BALANCE = await gd.balanceOf(guardian.address);
|
|
78
|
-
|
|
79
|
-
const bridgeDeployed = await ethers.provider.getCode(NEWBRIDGE).then(_ => _ != "0x");
|
|
80
|
-
if (!bridgeDeployed) throw new Error("bridge not deployed yet");
|
|
81
|
-
|
|
82
|
-
console.log("got signers:", {
|
|
83
|
-
networkName,
|
|
84
|
-
root: root.address,
|
|
85
|
-
guardian: guardian.address,
|
|
86
|
-
balance: rootBalance,
|
|
87
|
-
guardianBalance: guardianBalance
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
let networkEnv = networkName.split("-")[0];
|
|
91
|
-
const fuseNetwork = networkEnv;
|
|
92
|
-
if (networkEnv === "fuse") networkEnv = "development";
|
|
93
|
-
const celoNetwork = networkEnv + "-celo";
|
|
94
|
-
|
|
95
|
-
console.log("deploying new implementatios...");
|
|
96
|
-
|
|
97
|
-
let newReserveImpl = (await ethers.deployContract("GoodReserveCDai").then(printDeploy)) as Contract;
|
|
98
|
-
let newFundmanagerImpl = (await ethers.deployContract("GoodFundManager").then(printDeploy)) as Contract;
|
|
99
|
-
let newDisthelperImpl = (await ethers.deployContract("DistributionHelper").then(printDeploy)) as Contract;
|
|
100
|
-
let newFeeFormula = (await ethers.deployContract("MultichainFeeFormula").then(printDeploy)) as Contract;
|
|
101
|
-
|
|
102
|
-
if (isProduction) {
|
|
103
|
-
await verifyContract(newReserveImpl.address, "GoodReserveCDai", networkName);
|
|
104
|
-
await verifyContract(newFundmanagerImpl.address, "GoodFundManager", networkName);
|
|
105
|
-
await verifyContract(newDisthelperImpl.address, "DistributionHelper", networkName);
|
|
106
|
-
await verifyContract(newFeeFormula.address, "MultichainFeeFormula", networkName);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// make sure price oracle for fuse/celo/eth has enough observations
|
|
110
|
-
console.log("preparing price oracle...");
|
|
111
|
-
const oracle = (await ethers.getContractAt(
|
|
112
|
-
"IStaticOracle",
|
|
113
|
-
"0xB210CE856631EeEB767eFa666EC7C1C57738d438"
|
|
114
|
-
)) as IStaticOracle;
|
|
115
|
-
const [celoPool] = await oracle.callStatic.prepareSpecificFeeTiersWithTimePeriod(
|
|
116
|
-
await newDisthelperImpl.CELO_TOKEN(),
|
|
117
|
-
await newDisthelperImpl.WETH_TOKEN(),
|
|
118
|
-
[3000],
|
|
119
|
-
60
|
|
120
|
-
);
|
|
121
|
-
const [fusePool] = await oracle.callStatic.prepareSpecificFeeTiersWithTimePeriod(
|
|
122
|
-
await newDisthelperImpl.FUSE_TOKEN(),
|
|
123
|
-
await newDisthelperImpl.WETH_TOKEN(),
|
|
124
|
-
[3000],
|
|
125
|
-
60
|
|
126
|
-
);
|
|
127
|
-
const [usdcPool] = await oracle.callStatic.prepareSpecificFeeTiersWithTimePeriod(
|
|
128
|
-
await newDisthelperImpl.USDC_TOKEN(),
|
|
129
|
-
await newDisthelperImpl.WETH_TOKEN(),
|
|
130
|
-
[3000],
|
|
131
|
-
60
|
|
132
|
-
);
|
|
133
|
-
|
|
134
|
-
const pool = await ethers.getContractAt(
|
|
135
|
-
[
|
|
136
|
-
"function slot0() view returns (uint160 sqrtPriceX96,int24 sqrtPriceX96,uint16 observationIndex,uint16 observationCardinality,uint16 observationCardinalityNext,uint8 feeProtocol,bool unlocked)"
|
|
137
|
-
],
|
|
138
|
-
celoPool
|
|
139
|
-
);
|
|
140
|
-
const validPools: Array<[string, boolean]> = await Promise.all(
|
|
141
|
-
[celoPool, fusePool, usdcPool].map(async _ => {
|
|
142
|
-
const { observationCardinalityNext } = await pool.attach(_).slot0();
|
|
143
|
-
return [_, observationCardinalityNext < 5];
|
|
144
|
-
})
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
console.log({ celoPool, fusePool, usdcPool, validPools });
|
|
148
|
-
await oracle
|
|
149
|
-
.prepareSpecificPoolsWithTimePeriod(
|
|
150
|
-
validPools.filter(_ => _[1]).map(_ => _[0]),
|
|
151
|
-
60
|
|
152
|
-
)
|
|
153
|
-
.then(printDeploy);
|
|
154
|
-
|
|
155
|
-
console.log("executing proposals");
|
|
156
|
-
|
|
157
|
-
const proposalContracts = [
|
|
158
|
-
release.NameService, //controller -> set bridge contract in nameservice
|
|
159
|
-
release.GoodReserveCDai, //controller -> upgrade reserve
|
|
160
|
-
release.GoodFundManager, //controller -> upgrade fundmanager
|
|
161
|
-
release.DistributionHelper, //controller -> upgrade disthelper
|
|
162
|
-
release.DistributionHelper, //update addresses
|
|
163
|
-
release.DistributionHelper, //set fee settings
|
|
164
|
-
release.DistributionHelper, //remove distribution to guardians
|
|
165
|
-
release.DistributionHelper, //remove distribution to community pool on fuse
|
|
166
|
-
release.DistributionHelper, //set new distribution params
|
|
167
|
-
release.DistributionHelper, //set new distribution params
|
|
168
|
-
// release.DistributionHelper, //set new distribution params
|
|
169
|
-
release.DistributionHelper, //set new distribution params
|
|
170
|
-
release.Controller, //mint G$s to bridge
|
|
171
|
-
release.GoodDollar, // upgrade feeformula
|
|
172
|
-
protocolSettings.guardiansSafe + "_" + release.GoodDollar //transfer G$s from guardians to bridge
|
|
173
|
-
];
|
|
174
|
-
|
|
175
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
176
|
-
|
|
177
|
-
const proposalFunctionSignatures = [
|
|
178
|
-
"setAddresses(bytes32[],address[])", // set new bridge name
|
|
179
|
-
"upgradeTo(address)", //upgrade reserve
|
|
180
|
-
"upgradeTo(address)", //upgrade fundmanager
|
|
181
|
-
"upgradeTo(address)", //upgrade disthelper
|
|
182
|
-
"updateAddresses()", //upgrade disthelper
|
|
183
|
-
"setFeeSettings((uint128,uint128,uint128,uint128,uint128,uint8))",
|
|
184
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))", // remove guardians distribution
|
|
185
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))", // remove fuse community distribution
|
|
186
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))", // fuse distribution
|
|
187
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))", // celo distribution
|
|
188
|
-
// "addOrUpdateRecipient((uint32,uint32,address,uint8))", // savings rewards distribution
|
|
189
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))", // community pool distribution on celo
|
|
190
|
-
"mintTokens(uint256,address,address)", //mint G$ to bridge
|
|
191
|
-
"setFormula(address)", // upgrade feeformula
|
|
192
|
-
"transfer(address,uint256)" // transfer G$s from guardians to bridge
|
|
193
|
-
];
|
|
194
|
-
|
|
195
|
-
const proposalFunctionInputs = [
|
|
196
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
197
|
-
["bytes32[]", "address[]"],
|
|
198
|
-
[
|
|
199
|
-
[
|
|
200
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MPBBRIDGE_CONTRACT")),
|
|
201
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MULTICHAIN_ROUTER")),
|
|
202
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MULTICHAIN_ANYGOODDOLLAR"))
|
|
203
|
-
],
|
|
204
|
-
[NEWBRIDGE, ethers.constants.AddressZero, ethers.constants.AddressZero]
|
|
205
|
-
]
|
|
206
|
-
), //setAddresses(bytes32[],address[])"
|
|
207
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [newReserveImpl.address]),
|
|
208
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [newFundmanagerImpl.address]),
|
|
209
|
-
ethers.utils.defaultAbiCoder.encode(["address"], [newDisthelperImpl.address]),
|
|
210
|
-
ethers.constants.HashZero,
|
|
211
|
-
//uint128 axelarBaseFeeUSD;uint128 bridgeExecuteGas;uint128 targetChainGasPrice;uint128 maxFee;uint128 minBalanceForFees;uint8 percentageToSellForFee;
|
|
212
|
-
//0.1$ base fee, 400000 bridge execute, 5 gwei gas price, 5e15 eth max fee, min balance 1e16, percentage 5%
|
|
213
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
214
|
-
["uint128", "uint128", "uint128", "uint128", "uint128", "uint8"],
|
|
215
|
-
["100000000000000000", "400000", "5000000000", "5000000000000000", "10000000000000000", "5"]
|
|
216
|
-
),
|
|
217
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
218
|
-
["uint32", "uint32", "address", "uint8"],
|
|
219
|
-
[0, 1, dao[networkName].GuardiansSafe, 3] //0% to guardians (contract transfer)
|
|
220
|
-
),
|
|
221
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
222
|
-
["uint32", "uint32", "address", "uint8"],
|
|
223
|
-
[0, 122, dao[fuseNetwork].CommunitySafe, 0] //0% to community safe on celo(Fuse bridge)
|
|
224
|
-
),
|
|
225
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
226
|
-
["uint32", "uint32", "address", "uint8"],
|
|
227
|
-
[4000, 122, dao[fuseNetwork].UBIScheme, 0] //40% chainId 122 ubischeme 0-fuse bridge
|
|
228
|
-
),
|
|
229
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
230
|
-
["uint32", "uint32", "address", "uint8"],
|
|
231
|
-
[4000, 42220, dao[celoNetwork].UBIScheme, 2] //40% chainId 42220 ubischeme 2-axelar bridge
|
|
232
|
-
),
|
|
233
|
-
// ethers.utils.defaultAbiCoder.encode(
|
|
234
|
-
// ["uint32", "uint32", "address", "uint8"],
|
|
235
|
-
// [1000, 42220, dao[celoNetwork].GoodDollarMintBurnWrapper, 2] //10% chainId 42220 mintburnwrapper 2-axelar bridge
|
|
236
|
-
// ),
|
|
237
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
238
|
-
["uint32", "uint32", "address", "uint8"],
|
|
239
|
-
[1000, 42220, dao[celoNetwork].CommunitySafe, 2] //10% chainId 42220 community treasury 2-axelar bridge
|
|
240
|
-
),
|
|
241
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
242
|
-
["uint256", "address", "address"],
|
|
243
|
-
[MULTICHAIN_BALANCE, NEWBRIDGE, release["Avatar"]] // mint same amount locked on multichain to new bridge
|
|
244
|
-
),
|
|
245
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
246
|
-
["address"],
|
|
247
|
-
[newFeeFormula.address] // set the new formula
|
|
248
|
-
),
|
|
249
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
250
|
-
["address", "uint256"],
|
|
251
|
-
[NEWBRIDGE, GUARDIANS_BALANCE] // transfer G$ to bridge
|
|
252
|
-
)
|
|
253
|
-
];
|
|
254
|
-
|
|
255
|
-
if (isProduction) {
|
|
256
|
-
await executeViaSafe(
|
|
257
|
-
proposalContracts,
|
|
258
|
-
proposalEthValues,
|
|
259
|
-
proposalFunctionSignatures,
|
|
260
|
-
proposalFunctionInputs,
|
|
261
|
-
protocolSettings.guardiansSafe,
|
|
262
|
-
"mainnet"
|
|
263
|
-
);
|
|
264
|
-
} else {
|
|
265
|
-
//simulation or dev envs
|
|
266
|
-
await executeViaGuardian(
|
|
267
|
-
proposalContracts,
|
|
268
|
-
proposalEthValues,
|
|
269
|
-
proposalFunctionSignatures,
|
|
270
|
-
proposalFunctionInputs,
|
|
271
|
-
guardian,
|
|
272
|
-
networkName
|
|
273
|
-
);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
//perform sanity checks on fork, for production we need to wait until everything executed
|
|
277
|
-
if (!isProduction) {
|
|
278
|
-
let fm = await ethers.getContractAt("GoodFundManager", release.GoodFundManager);
|
|
279
|
-
let dh = await ethers.getContractAt("DistributionHelper", release.DistributionHelper);
|
|
280
|
-
let r = await ethers.getContractAt("GoodReserveCDai", release.GoodReserveCDai);
|
|
281
|
-
|
|
282
|
-
console.log(await dh.distributionRecipients(0));
|
|
283
|
-
console.log(await dh.distributionRecipients(1));
|
|
284
|
-
console.log(await dh.distributionRecipients(2));
|
|
285
|
-
console.log(await dh.distributionRecipients(3));
|
|
286
|
-
console.log(await dh.distributionRecipients(4));
|
|
287
|
-
// console.log(await dh.distributionRecipients(5));
|
|
288
|
-
|
|
289
|
-
console.log(
|
|
290
|
-
"gd balances: guardians:",
|
|
291
|
-
await gd.balanceOf(guardian.address),
|
|
292
|
-
" bridge:",
|
|
293
|
-
await gd.balanceOf(NEWBRIDGE)
|
|
294
|
-
);
|
|
295
|
-
console.log("gdx/discount disabled", await r.gdxDisabled(), await r.discountDisabled());
|
|
296
|
-
|
|
297
|
-
let tx = await (await fm.collectInterest([], true)).wait();
|
|
298
|
-
console.log(tx.events);
|
|
299
|
-
}
|
|
300
|
-
};
|
|
301
|
-
|
|
302
|
-
export const upgradeSidechain = async sidechain => {
|
|
303
|
-
let [root] = await ethers.getSigners();
|
|
304
|
-
|
|
305
|
-
const isProduction = networkName.includes("production");
|
|
306
|
-
|
|
307
|
-
const isForkSimulation = networkName === "localhost";
|
|
308
|
-
|
|
309
|
-
let networkEnv = networkName.split("-")[0];
|
|
310
|
-
if (isForkSimulation) networkEnv = "production";
|
|
311
|
-
|
|
312
|
-
if (networkEnv === "fuse") networkEnv = "development";
|
|
313
|
-
|
|
314
|
-
if (sidechain === "celo") networkEnv = networkEnv + "-celo";
|
|
315
|
-
|
|
316
|
-
let release: { [key: string]: any } = dao[networkEnv];
|
|
317
|
-
|
|
318
|
-
let guardian = root;
|
|
319
|
-
//simulate on fork, make sure safe has enough eth to simulate txs
|
|
320
|
-
if (network.name === "localhost" || network.name === "fork") {
|
|
321
|
-
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
322
|
-
|
|
323
|
-
await root.sendTransaction({ value: ethers.constants.WeiPerEther.mul(3), to: guardian.address });
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
const NEWBRIDGE = release["MpbBridge"];
|
|
327
|
-
|
|
328
|
-
console.log({ networkEnv, NEWBRIDGE, guardian: guardian.address, isForkSimulation, isProduction });
|
|
329
|
-
const proposalContracts = [
|
|
330
|
-
release.NameService,
|
|
331
|
-
release.GoodDollarMintBurnWrapper, // give new bridge mint permissions
|
|
332
|
-
release.GoodDollarMintBurnWrapper, // remove multichain as minter
|
|
333
|
-
release.GoodDollarMintBurnWrapper, // unpause minting
|
|
334
|
-
release.GoodDollarMintBurnWrapper // set guardian
|
|
335
|
-
];
|
|
336
|
-
|
|
337
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
338
|
-
|
|
339
|
-
const proposalFunctionSignatures = [
|
|
340
|
-
"setAddresses(bytes32[],address[])", // set new bridge name
|
|
341
|
-
"addMinter(address,uint256,uint256,uint32,uint256,uint256,uint32,bool)",
|
|
342
|
-
"revokeRole(bytes32,address)",
|
|
343
|
-
"unpause(bytes32)",
|
|
344
|
-
"grantRole(bytes32,address)"
|
|
345
|
-
];
|
|
346
|
-
|
|
347
|
-
const proposalFunctionInputs = [
|
|
348
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
349
|
-
["bytes32[]", "address[]"],
|
|
350
|
-
[
|
|
351
|
-
[
|
|
352
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MPBBRIDGE_CONTRACT")),
|
|
353
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("MULTICHAIN_ROUTER"))
|
|
354
|
-
],
|
|
355
|
-
[NEWBRIDGE, ethers.constants.AddressZero]
|
|
356
|
-
]
|
|
357
|
-
), //setAddresses(bytes32[],address[])"
|
|
358
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
359
|
-
["address", "uint256", "uint256", "uint32", "uint256", "uint256", "uint32", "bool"],
|
|
360
|
-
[
|
|
361
|
-
NEWBRIDGE,
|
|
362
|
-
0,
|
|
363
|
-
sidechain === "celo" ? ethers.constants.WeiPerEther.mul(300).mul(1e6) : "30000000000",
|
|
364
|
-
5000,
|
|
365
|
-
0,
|
|
366
|
-
0,
|
|
367
|
-
0,
|
|
368
|
-
false
|
|
369
|
-
]
|
|
370
|
-
),
|
|
371
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
372
|
-
["bytes32", "address"],
|
|
373
|
-
["0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6", release.MultichainRouter]
|
|
374
|
-
),
|
|
375
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
376
|
-
["bytes32"],
|
|
377
|
-
["0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6"]
|
|
378
|
-
),
|
|
379
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
380
|
-
["bytes32", "address"],
|
|
381
|
-
[
|
|
382
|
-
"0x55435dd261a4b9b3364963f7738a7a662ad9c84396d64be3365284bb7f0a5041",
|
|
383
|
-
"0x66582D24FEaD72555adaC681Cc621caCbB208324"
|
|
384
|
-
]
|
|
385
|
-
)
|
|
386
|
-
];
|
|
387
|
-
|
|
388
|
-
if (isProduction) {
|
|
389
|
-
await executeViaSafe(
|
|
390
|
-
proposalContracts,
|
|
391
|
-
proposalEthValues,
|
|
392
|
-
proposalFunctionSignatures,
|
|
393
|
-
proposalFunctionInputs,
|
|
394
|
-
release.GuardiansSafe,
|
|
395
|
-
sidechain
|
|
396
|
-
);
|
|
397
|
-
} else {
|
|
398
|
-
await executeViaGuardian(
|
|
399
|
-
proposalContracts,
|
|
400
|
-
proposalEthValues,
|
|
401
|
-
proposalFunctionSignatures,
|
|
402
|
-
proposalFunctionInputs,
|
|
403
|
-
guardian,
|
|
404
|
-
networkEnv
|
|
405
|
-
);
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
|
|
409
|
-
export const main = async () => {
|
|
410
|
-
prompt.start();
|
|
411
|
-
const { network } = await prompt.get(["network"]);
|
|
412
|
-
|
|
413
|
-
console.log("running step:", { network });
|
|
414
|
-
switch (network) {
|
|
415
|
-
case "celo":
|
|
416
|
-
await upgradeSidechain("celo");
|
|
417
|
-
break;
|
|
418
|
-
case "fuse":
|
|
419
|
-
await upgradeSidechain("fuse");
|
|
420
|
-
break;
|
|
421
|
-
case "mainnet":
|
|
422
|
-
await upgrade();
|
|
423
|
-
|
|
424
|
-
break;
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
if (process.argv[1].includes("gip-15")) main().catch(console.log);
|