@gooddollar/goodprotocol 2.0.25-beta.9 → 2.0.26-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/abis/AdminWallet.min.json +1 -1
- package/artifacts/abis/CompoundVotingMachine.min.json +1 -1
- package/artifacts/abis/DistributionHelper.min.json +1 -1
- package/artifacts/abis/DistributionHelperTest.min.json +1 -1
- package/artifacts/abis/DistributionHelperTestHelper.min.json +1 -1
- package/artifacts/abis/EternalStorage.min.json +1 -0
- package/artifacts/abis/FuseOldBridgeKill.min.json +1 -0
- package/artifacts/abis/GoodFundManager.min.json +1 -1
- package/artifacts/abis/GoodFundManagerTest.min.json +1 -1
- package/artifacts/abis/GoodMarketMaker.min.json +1 -1
- package/artifacts/abis/GoodReserveCDai.min.json +1 -1
- package/artifacts/abis/IQuoterV2.min.json +1 -1
- package/artifacts/abis/ISwapRouter.min.json +1 -1
- package/artifacts/abis/IUpgradeabilityOwnerStorage.min.json +1 -0
- package/artifacts/abis/Initializable.min.json +1 -0
- package/artifacts/abis/Ownable.min.json +1 -0
- package/artifacts/abis/ReserveRestore.min.json +1 -0
- package/artifacts/abis/SuperfluidFaucet.min.json +1 -0
- package/artifacts/abis/Upgradeable.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/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 +4 -0
- package/artifacts/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +4 -0
- package/artifacts/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.json +2 -2
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.json +2 -2
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +4 -0
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.json +536 -0
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.json +2 -2
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.json +20 -2
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -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/GovernanceStaking.sol/GovernanceStaking.json +2 -2
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.json +2 -2
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.json +2 -2
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.json +2 -2
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.json +2 -2
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.json +2 -2
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.json +2 -2
- 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/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/DistributionHelperTest.json +21 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.json +21 -2
- 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/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.json +2 -2
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.json +21 -2
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.json +2 -2
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.json +2 -2
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.json +2 -2
- package/artifacts/contracts/mocks/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/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.json +2 -2
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.json +2 -2
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.json +2 -2
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.json +21 -2
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.json +2 -2
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.json +6 -6
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.json +3 -3
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.json +2 -2
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.json +2 -2
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.json +2 -2
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.json +2 -2
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.json +21 -2
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.json +2 -2
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.json +2 -2
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.json +2 -2
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.json +2 -2
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.json +2 -2
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/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/GoodDollar.sol/GoodDollar.json +2 -2
- 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/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
- 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/UBIScheme.sol/UBIScheme.json +2 -2
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.json +2 -2
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.json +2 -22
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.json +2 -2
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.json +2 -2
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.json +2 -2
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.json +2 -2
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.json +2 -2
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.json +2 -2
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.json +2 -2
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.json +10 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.json +31 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.json +24 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.json +24 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.json +56 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +4 -0
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.json +10 -0
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.json +2 -2
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.json +2 -2
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.json +2 -2
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.json +2 -2
- 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/MultichainBridgeHelper.sol/MultichainBridgeHelper.json +2 -2
- 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/OneTimePayments.sol/OneTimePayments.json +2 -2
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.json +2 -2
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.json +2 -2
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.json +2 -2
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +4 -0
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.json +91 -0
- package/contracts/Interfaces.sol +122 -0
- package/contracts/fuseFaucet/SuperfluidFacuet.sol +129 -0
- package/contracts/governance/CompoundVotingMachine.sol +26 -11
- package/contracts/governance/StakersDistribution.sol +13 -13
- package/contracts/reserve/DistributionHelper.sol +29 -10
- package/contracts/reserve/ExchangeHelper.sol +16 -7
- package/contracts/reserve/GoodMarketMaker.sol +43 -53
- package/contracts/reserve/GoodReserveCDai.sol +44 -16
- package/contracts/staking/GoodFundManager.sol +44 -4
- package/contracts/utils/AdminWallet.sol +4 -6
- package/contracts/utils/BuyGDClone.sol +0 -122
- package/contracts/utils/FuseOldBridgeKill.sol +123 -0
- package/contracts/utils/ReserveRestore.sol +157 -0
- package/dist/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +2 -2
- package/hardhat.config.ts +21 -39
- package/package.json +3 -3
- package/releases/deployment.json +6 -0
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +20 -15
- package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +95 -0
- package/scripts/multichain-deploy/helpers.ts +8 -8
- package/scripts/proposals/reserveRestore.ts +429 -0
- package/scripts/test/localOldDaoDeploy.ts +2 -1
- package/test/governance/CompoundVotingMachine.daoscheme.ts +3 -0
- package/test/governance/CompoundVotingMachine.guardian.test.ts +76 -21
- package/test/governance/CompoundVotingMachine.state.test.ts +31 -28
- package/test/governance/StakersDistribution.test.ts +79 -5
- package/test/helpers.ts +7 -0
- package/test/reserve/DistributionHelper.test.ts +10 -10
- package/test/reserve/GoodMarketMaker.test.ts +75 -26
- package/test/staking/StakingRewards.test.ts +106 -29
- package/test/utils/ProtocolUpgrade.test.ts +1 -0
- package/types/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2.ts +1 -1
- package/types/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter.ts +1 -1
- package/types/contracts/Interfaces.sol/index.ts +2 -0
- package/types/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.ts +867 -0
- package/types/contracts/fuseFaucet/SuperfluidFacuet.sol/index.ts +4 -0
- package/types/contracts/fuseFaucet/index.ts +2 -0
- package/types/contracts/governance/CompoundVotingMachine.ts +44 -3
- package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.ts +35 -0
- package/types/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.ts +35 -0
- package/types/contracts/mocks/GoodFundManagerTest.ts +35 -0
- package/types/contracts/reserve/DistributionHelper.ts +35 -0
- package/types/contracts/reserve/GoodMarketMaker.ts +3 -3
- package/types/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.ts +5 -5
- package/types/contracts/staking/GoodFundManager.ts +35 -0
- package/types/contracts/utils/AdminWallet.ts +0 -34
- package/types/contracts/utils/BuyGDClone.sol/index.ts +0 -2
- package/types/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.ts +108 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.ts +89 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/Initializable.ts +87 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/Ownable.ts +148 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/index.ts +7 -0
- package/types/contracts/utils/ReserveRestore.ts +201 -0
- package/types/contracts/utils/index.ts +3 -0
- package/types/factories/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/IQuoterV2__factory.ts +1 -1
- package/types/factories/contracts/{utils/BuyGDClone.sol → Interfaces.sol}/ISwapRouter__factory.ts +1 -1
- package/types/factories/contracts/Interfaces.sol/index.ts +2 -0
- package/types/factories/contracts/fuseFaucet/Faucet__factory.ts +1 -1
- package/types/factories/contracts/fuseFaucet/FuseFaucetV2__factory.ts +1 -1
- package/types/factories/contracts/fuseFaucet/FuseFaucet__factory.ts +1 -1
- package/types/factories/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet__factory.ts +587 -0
- package/types/factories/contracts/fuseFaucet/SuperfluidFacuet.sol/index.ts +4 -0
- package/types/factories/contracts/fuseFaucet/index.ts +1 -0
- package/types/factories/contracts/governance/ClaimersDistribution__factory.ts +1 -1
- package/types/factories/contracts/governance/CompoundVotingMachine__factory.ts +19 -1
- package/types/factories/contracts/governance/GReputation__factory.ts +1 -1
- package/types/factories/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking__factory.ts +1 -1
- package/types/factories/contracts/governance/GovernanceStaking__factory.ts +1 -1
- package/types/factories/contracts/governance/Reputation__factory.ts +1 -1
- package/types/factories/contracts/governance/StakersDistribution__factory.ts +1 -1
- package/types/factories/contracts/identity/IdentityV2__factory.ts +1 -1
- package/types/factories/contracts/invite/InvitesFuseV2__factory.ts +1 -1
- package/types/factories/contracts/invite/InvitesV1__factory.ts +1 -1
- package/types/factories/contracts/invite/InvitesV2__factory.ts +1 -1
- package/types/factories/contracts/invite/OneTimeReward__factory.ts +1 -1
- package/types/factories/contracts/mocks/DistributionBridgeMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +20 -1
- package/types/factories/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest__factory.ts +20 -1
- package/types/factories/contracts/mocks/GoodCompoundStakingTest__factory.ts +1 -1
- package/types/factories/contracts/mocks/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/GoodFundManagerTest__factory.ts +20 -1
- package/types/factories/contracts/mocks/IdentityMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/OverMintTester.sol/OverMintTester__factory.ts +1 -1
- package/types/factories/contracts/mocks/OverMintTesterRegularStake__factory.ts +1 -1
- package/types/factories/contracts/mocks/SwapHelperTest__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock2__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock3__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock4__factory.ts +1 -1
- package/types/factories/contracts/mocks/UpgradableMocks.sol/UpgradableMock__factory.ts +1 -1
- package/types/factories/contracts/reserve/DistributionHelper__factory.ts +20 -1
- package/types/factories/contracts/reserve/ExchangeHelper__factory.ts +1 -1
- package/types/factories/contracts/reserve/GoodMarketMaker__factory.ts +5 -5
- package/types/factories/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai__factory.ts +2 -2
- package/types/factories/contracts/staking/BaseShareFieldV2__factory.ts +1 -1
- package/types/factories/contracts/staking/BaseShareField__factory.ts +1 -1
- package/types/factories/contracts/staking/DonationsStaking__factory.ts +1 -1
- package/types/factories/contracts/staking/FuseStakingV3.sol/FuseStakingV3__factory.ts +1 -1
- package/types/factories/contracts/staking/GoodFundManager__factory.ts +20 -1
- package/types/factories/contracts/staking/UniswapV2SwapHelper__factory.ts +1 -1
- package/types/factories/contracts/staking/aave/AaveStakingFactory__factory.ts +1 -1
- package/types/factories/contracts/staking/aave/GoodAaveStakingV2__factory.ts +1 -1
- package/types/factories/contracts/staking/aave/GoodAaveStaking__factory.ts +1 -1
- package/types/factories/contracts/staking/compound/CompoundStakingFactory__factory.ts +1 -1
- package/types/factories/contracts/staking/compound/GoodCompoundStakingV2__factory.ts +1 -1
- package/types/factories/contracts/staking/compound/GoodCompoundStaking__factory.ts +1 -1
- package/types/factories/contracts/token/GoodDollar__factory.ts +1 -1
- package/types/factories/contracts/token/superfluid/SuperGoodDollar__factory.ts +1 -1
- package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +1 -1
- package/types/factories/contracts/ubi/UBIScheme__factory.ts +1 -1
- package/types/factories/contracts/utils/AdminWalletFuse__factory.ts +1 -1
- package/types/factories/contracts/utils/AdminWallet__factory.ts +1 -21
- package/types/factories/contracts/utils/BulkWhitelist__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyAndBridgeHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/BuyGDClone__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/DonateGDClone__factory.ts +1 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/index.ts +0 -2
- package/types/factories/contracts/utils/DAOContract__factory.ts +1 -1
- package/types/factories/contracts/utils/DAOUpgradeableContract__factory.ts +1 -1
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill__factory.ts +82 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage__factory.ts +43 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Initializable__factory.ts +75 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/Ownable__factory.ts +105 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/index.ts +7 -0
- package/types/factories/contracts/utils/GDFaucet__factory.ts +1 -1
- package/types/factories/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper__factory.ts +1 -1
- package/types/factories/contracts/utils/IdentityFix__factory.ts +1 -1
- package/types/factories/contracts/utils/LastauthReduction__factory.ts +1 -1
- package/types/factories/contracts/utils/MultichainBridgeHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/OneTimePaymentsV2__factory.ts +1 -1
- package/types/factories/contracts/utils/OneTimePayments__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgradeFuseRecover__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgradeFuse__factory.ts +1 -1
- package/types/factories/contracts/utils/ProtocolUpgradeRecover__factory.ts +1 -1
- package/types/factories/contracts/utils/ReputationTestHelper__factory.ts +1 -1
- package/types/factories/contracts/utils/ReserveRestore__factory.ts +144 -0
- package/types/factories/contracts/utils/index.ts +2 -0
- package/types/hardhat.d.ts +70 -16
- package/types/index.ts +12 -4
- package/artifacts/contracts/utils/BuyGDClone.sol/IQuoterV2.dbg.json +0 -4
- package/artifacts/contracts/utils/BuyGDClone.sol/ISwapRouter.dbg.json +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gooddollar/goodprotocol",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.26-beta.0",
|
|
4
4
|
"description": "GoodDollar Protocol",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=16.x"
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
"fs-extra": "9.0.0",
|
|
108
108
|
"graphql": "^15.5.0",
|
|
109
109
|
"graphql-request": "^3.4.0",
|
|
110
|
-
"hardhat": "^2
|
|
110
|
+
"hardhat": "^2.*",
|
|
111
111
|
"hardhat-contract-sizer": "^2.6.1",
|
|
112
112
|
"hardhat-gas-reporter": "^1.0.8",
|
|
113
113
|
"hardhat-storage-layout": "^0.1.7",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"typechain": "^8.3.1",
|
|
134
134
|
"typescript": "^5.3.3"
|
|
135
135
|
},
|
|
136
|
-
"packageManager": "yarn@3.6.
|
|
136
|
+
"packageManager": "yarn@3.6.1",
|
|
137
137
|
"resolutions": {
|
|
138
138
|
"@swc/core": "1.3.96"
|
|
139
139
|
},
|
package/releases/deployment.json
CHANGED
|
@@ -434,6 +434,7 @@
|
|
|
434
434
|
"StaticOracle": "0x00851A91a3c4E9a4c1B48df827Bacc1f884bdE28",
|
|
435
435
|
"BuyGDFactory": "0x00e533B7d6255D05b7f15034B1c989c21F51b91C",
|
|
436
436
|
"BuyGDFactoryV2": "0x1F60C4C7037C6766924A43666B781ED1479587a2",
|
|
437
|
+
"CUSD": "0x765DE816845861e75A25fCA122bb6898B8B1282a",
|
|
437
438
|
"BulkWhitelist": "0x30Afd0534dAA29135308d048103b40dc1BA4518d"
|
|
438
439
|
},
|
|
439
440
|
"gnosis": { "GuardiansSafe": "0x84c10b45fe51bfb4f86c19a47fdbc187d4572fb8" },
|
|
@@ -608,5 +609,10 @@
|
|
|
608
609
|
"DAI": "0xfcDB4564c18A9134002b9771816092C9693622e3",
|
|
609
610
|
"cDAI": "0x32EEce76C2C2e8758584A83Ee2F522D4788feA0f",
|
|
610
611
|
"COMP": "0x927b167526bAbB9be047421db732C663a0b77B11"
|
|
612
|
+
},
|
|
613
|
+
"development-base": {
|
|
614
|
+
"ProxyFactory": "0x5B22F5623ECB00E288539346F389E05f65e226ae",
|
|
615
|
+
"AdminWallet": "0x6672C998C49635aA6825Be355fF2e731f417B674",
|
|
616
|
+
"SuperfluidFaucet": "0x0c86C82eb8d6a8E991bbc37C58e23344b20520a2"
|
|
611
617
|
}
|
|
612
618
|
}
|
|
@@ -23,6 +23,9 @@ export const deployUniversalProxyFactory = async () => {
|
|
|
23
23
|
s: "0x2222222222222222222222222222222222222222222222222222222222222222"
|
|
24
24
|
};
|
|
25
25
|
//modify tx data a little so we get different contract address for different envs
|
|
26
|
+
if (name.includes("development-base")) {
|
|
27
|
+
deployTx.gasPrice = 7e7;
|
|
28
|
+
}
|
|
26
29
|
if (name.includes("staging")) {
|
|
27
30
|
deployTx.gasLimit = 892000;
|
|
28
31
|
} else if (name.includes("production")) {
|
|
@@ -34,12 +37,18 @@ export const deployUniversalProxyFactory = async () => {
|
|
|
34
37
|
const deployer = ethers.utils.recoverAddress(txHash, signer);
|
|
35
38
|
let [funder] = await ethers.getSigners();
|
|
36
39
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
const curBalance = await ethers.provider.getBalance(deployer);
|
|
41
|
+
const deployCost = ethers.BigNumber.from(deployTx.gasPrice).mul(deployTx.gasLimit);
|
|
42
|
+
|
|
43
|
+
let tx = {};
|
|
44
|
+
if (curBalance.lt(deployCost)) {
|
|
45
|
+
tx = await (
|
|
46
|
+
await funder.sendTransaction({
|
|
47
|
+
to: deployer,
|
|
48
|
+
value: deployCost.sub(curBalance)
|
|
49
|
+
})
|
|
50
|
+
).wait();
|
|
51
|
+
}
|
|
43
52
|
|
|
44
53
|
if (isProduction) verifyProductionSigner(funder);
|
|
45
54
|
|
|
@@ -47,23 +56,19 @@ export const deployUniversalProxyFactory = async () => {
|
|
|
47
56
|
fundingTx: tx.transactionHash,
|
|
48
57
|
deployer,
|
|
49
58
|
funder: funder.address,
|
|
50
|
-
deployerBalance: ethers.utils.formatUnits(
|
|
51
|
-
await ethers.provider.getBalance(deployer)
|
|
52
|
-
)
|
|
59
|
+
deployerBalance: ethers.utils.formatUnits(await ethers.provider.getBalance(deployer))
|
|
53
60
|
});
|
|
54
61
|
const signedTx = ethers.utils.serializeTransaction(deployTx, signer);
|
|
55
|
-
const
|
|
56
|
-
console.log({
|
|
62
|
+
const proxyTx = await ethers.provider.sendTransaction(signedTx);
|
|
63
|
+
console.log({ proxyTx });
|
|
64
|
+
const result = await proxyTx.wait();
|
|
57
65
|
return ethers.getContractAt("ProxyFactory1967", result.contractAddress);
|
|
58
66
|
};
|
|
59
67
|
|
|
60
68
|
export const deployProxy = async (defaultAdmin = null) => {
|
|
61
69
|
let release: { [key: string]: any } = dao[network.name] || {};
|
|
62
70
|
|
|
63
|
-
if (
|
|
64
|
-
network.name.match(/production|staging|fuse|development/) &&
|
|
65
|
-
release.ProxyFactory
|
|
66
|
-
) {
|
|
71
|
+
if (network.name.match(/production|staging|fuse|development/) && release.ProxyFactory) {
|
|
67
72
|
throw new Error("ProxyFactory already exists for env");
|
|
68
73
|
}
|
|
69
74
|
// let [root] = await ethers.getSigners();
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Deploy helper contracts
|
|
3
|
+
* AdminWallet, Faucet, Invites
|
|
4
|
+
*/
|
|
5
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
|
+
import { Contract } from "ethers";
|
|
7
|
+
import { defaultsDeep } from "lodash";
|
|
8
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
+
import { deployDeterministic, verifyProductionSigner, verifyContract } from "./helpers";
|
|
10
|
+
import releaser from "../releaser";
|
|
11
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
12
|
+
import dao from "../../releases/deployment.json";
|
|
13
|
+
import { TransactionResponse } from "@ethersproject/providers";
|
|
14
|
+
|
|
15
|
+
const { name } = network;
|
|
16
|
+
|
|
17
|
+
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
18
|
+
if (c instanceof Contract) {
|
|
19
|
+
await c.deployed();
|
|
20
|
+
console.log("deployed to: ", c.address);
|
|
21
|
+
}
|
|
22
|
+
if (c.wait) {
|
|
23
|
+
await c.wait();
|
|
24
|
+
console.log("tx done:", c.hash);
|
|
25
|
+
}
|
|
26
|
+
return c;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const deployHelpers = async () => {
|
|
30
|
+
let release: { [key: string]: any } = dao[network.name] || {};
|
|
31
|
+
|
|
32
|
+
let [root] = await ethers.getSigners();
|
|
33
|
+
const isProduction = network.name.includes("production");
|
|
34
|
+
|
|
35
|
+
if (isProduction) verifyProductionSigner(root);
|
|
36
|
+
|
|
37
|
+
//generic call permissions
|
|
38
|
+
let schemeMock = root;
|
|
39
|
+
|
|
40
|
+
console.log("got signers:", {
|
|
41
|
+
network,
|
|
42
|
+
root: root.address,
|
|
43
|
+
schemeMock: schemeMock.address,
|
|
44
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
const walletAdmins = [];
|
|
48
|
+
for (let i = 0; i < 10; i++) {
|
|
49
|
+
const wallet = ethers.Wallet.fromMnemonic(process.env.ADMIN_WALLET_MNEMONIC, `m/44'/60'/0'/0/${i}`);
|
|
50
|
+
walletAdmins.push(wallet.address);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const gasprice = 1e8;
|
|
54
|
+
console.log("deploying adminwallet", { walletAdmins });
|
|
55
|
+
const AdminWallet = release.AdminWallet
|
|
56
|
+
? await ethers.getContractAt("AdminWallet", release.AdminWallet)
|
|
57
|
+
: ((await deployDeterministic(
|
|
58
|
+
{
|
|
59
|
+
// address payable[] memory _admins,
|
|
60
|
+
// NameService _ns,
|
|
61
|
+
// address _owner,
|
|
62
|
+
// uint256 _gasPrice
|
|
63
|
+
name: "AdminWallet",
|
|
64
|
+
salt: "AdminWallet",
|
|
65
|
+
isUpgradeable: true
|
|
66
|
+
},
|
|
67
|
+
[walletAdmins, ethers.constants.AddressZero, root.address, gasprice]
|
|
68
|
+
).then(printDeploy)) as Contract);
|
|
69
|
+
|
|
70
|
+
const Faucet = release.SuperfluidFaucet
|
|
71
|
+
? await ethers.getContractAt("SuperfluidFaucet", release.SuperfluidFaucet)
|
|
72
|
+
: ((await upgrades
|
|
73
|
+
.deployProxy(
|
|
74
|
+
await ethers.getContractFactory("SuperfluidFaucet"),
|
|
75
|
+
[ethers.utils.parseEther("0.000003"), ethers.utils.parseEther("0.000003"), 30, AdminWallet.address],
|
|
76
|
+
{ kind: "uups" }
|
|
77
|
+
)
|
|
78
|
+
.then(printDeploy)) as Contract);
|
|
79
|
+
|
|
80
|
+
const torelease = {
|
|
81
|
+
SuperfluidFaucet: Faucet.address,
|
|
82
|
+
AdminWallet: AdminWallet.address
|
|
83
|
+
};
|
|
84
|
+
await releaser(torelease, network.name, "deployment", false);
|
|
85
|
+
|
|
86
|
+
let impl = await getImplementationAddress(ethers.provider, AdminWallet.address);
|
|
87
|
+
await verifyContract(impl, "contracts/utils/AdminWallet.sol:AdminWallet", network.name);
|
|
88
|
+
impl = await getImplementationAddress(ethers.provider, Faucet.address);
|
|
89
|
+
await verifyContract(impl, "contracts/fuseFaucet/SuperfluidFaucet.sol:SuperfluidFaucet", network.name);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export const main = async () => {
|
|
93
|
+
await deployHelpers();
|
|
94
|
+
};
|
|
95
|
+
if (process.argv[1].includes("7_superfluidfaucet")) main();
|
|
@@ -193,6 +193,10 @@ export const executeViaGuardian = async (
|
|
|
193
193
|
const results = [];
|
|
194
194
|
for (let i = 0; i < contracts.length; i++) {
|
|
195
195
|
const contract = contracts[i];
|
|
196
|
+
if (!contract) {
|
|
197
|
+
console.warn("skipping executing missing contract", i, contracts[i], functionSigs[i], functionInputs[i]);
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
196
200
|
console.log("executing:", contracts[i], functionSigs[i], functionInputs[i]);
|
|
197
201
|
const sigHash = ethers.utils.keccak256(ethers.utils.toUtf8Bytes(functionSigs[i])).slice(0, 10);
|
|
198
202
|
const encoded = ethers.utils.solidityPack(["bytes4", "bytes"], [sigHash, functionInputs[i]]);
|
|
@@ -395,18 +399,14 @@ export const executeViaSafe = async (
|
|
|
395
399
|
|
|
396
400
|
export const verifyContract = async (
|
|
397
401
|
address,
|
|
398
|
-
|
|
402
|
+
contractPath,
|
|
399
403
|
networkName = network.name,
|
|
400
404
|
proxyName?: string,
|
|
401
405
|
forcedConstructorArguments?: string
|
|
402
406
|
) => {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
await exec("npx truffle compile");
|
|
407
|
-
const cmd = `npx truffle run verify ${proxyName ? "--custom-proxy " + proxyName : ""} ${contractName}@${address} ${
|
|
408
|
-
forcedConstructorArguments ? "--forceConstructorArgs string:" + forcedConstructorArguments.slice(2) : ""
|
|
409
|
-
} --network ${networkProvider}`;
|
|
407
|
+
const cmd = `yarn hardhat verify --contract ${contractPath} ${address} ${
|
|
408
|
+
forcedConstructorArguments ?? ""
|
|
409
|
+
} --network ${networkName}`;
|
|
410
410
|
console.log("running...:", cmd);
|
|
411
411
|
await exec(cmd).then(({ stdout, stderr }) => {
|
|
412
412
|
console.log("Result for:", cmd);
|
|
@@ -0,0 +1,429 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Mainnet:
|
|
3
|
+
* FIXES:
|
|
4
|
+
* - prevent hacked funds burnFrom
|
|
5
|
+
* - set GOOD rewards to 0
|
|
6
|
+
* - prevent untrusted contracts in goodfundmanager
|
|
7
|
+
* - use bonding curve for actual cDAI balance (prevent the "buy" instead of "transferTo" used in hack to trick reserve into minting UBI from interest)
|
|
8
|
+
* - set exit contribution to 10%
|
|
9
|
+
* - disable gdx
|
|
10
|
+
* - fix reserve calculations of expansion/currentprice
|
|
11
|
+
* - add requirement of guardians to approve on-chain proposals
|
|
12
|
+
* - reserve should not trust exchange helper
|
|
13
|
+
* - resere should not trust fundmanager for its starting balance
|
|
14
|
+
*
|
|
15
|
+
* PLAN:
|
|
16
|
+
* - pause staking
|
|
17
|
+
* - prevent fusebridge usage
|
|
18
|
+
* - set GOOD rewards to 0
|
|
19
|
+
* - blacklist hacked accounts to prevent burn (transfer already blocked done via tax)
|
|
20
|
+
* - withdraw funds from fuse
|
|
21
|
+
* - transfer to MPB bridge
|
|
22
|
+
* - upgrade reserve
|
|
23
|
+
* - set new reserve ratio, supply(minus hacked funds) and reserve
|
|
24
|
+
* - set contribution to 10%
|
|
25
|
+
* - unpause reserve
|
|
26
|
+
* - upgrade exchangeHelper
|
|
27
|
+
* - upgrade goodfundmanager
|
|
28
|
+
* - upgrade governance
|
|
29
|
+
* - unpause reserve
|
|
30
|
+
* - unpause goodfundmanager
|
|
31
|
+
* - switch fuse distribution to use lz bridge insted of deprecated fuse bridge
|
|
32
|
+
*
|
|
33
|
+
*
|
|
34
|
+
* Fuse:
|
|
35
|
+
* PLAN:
|
|
36
|
+
* - prevent old fuse bridge usage
|
|
37
|
+
* - upgrade governance
|
|
38
|
+
*
|
|
39
|
+
**/
|
|
40
|
+
|
|
41
|
+
import { network, ethers } from "hardhat";
|
|
42
|
+
import { reset, time } from "@nomicfoundation/hardhat-network-helpers";
|
|
43
|
+
import { defaultsDeep, last } from "lodash";
|
|
44
|
+
import prompt from "prompt";
|
|
45
|
+
// import mpbDeployments from "@gooddollar/bridge-contracts/release/mpb.json"
|
|
46
|
+
|
|
47
|
+
import { executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
|
|
48
|
+
|
|
49
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
50
|
+
|
|
51
|
+
import dao from "../../releases/deployment.json";
|
|
52
|
+
import { ExchangeHelper, FuseOldBridgeKill, GoodFundManager, GoodMarketMaker, GoodReserveCDai, IGoodDollar, ReserveRestore } from "../../types";
|
|
53
|
+
let { name: networkName } = network;
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
const isSimulation = network.name === "hardhat" || network.name === "fork" || network.name === "localhost";
|
|
57
|
+
|
|
58
|
+
// hacker and hacked multichain bridge accounts
|
|
59
|
+
const LOCKED_ACCOUNTS = ["0xeC577447D314cf1e443e9f4488216651450DBE7c", "0xD17652350Cfd2A37bA2f947C910987a3B1A1c60d", "0x6738fA889fF31F82d9Fe8862ec025dbE318f3Fde"]
|
|
60
|
+
const INITIAL_DAI = ethers.utils.parseEther("100000") // 100k
|
|
61
|
+
// reserve funder (goodlabs safe)
|
|
62
|
+
const funder = "0xF0652a820dd39EC956659E0018Da022132f2f40a"
|
|
63
|
+
|
|
64
|
+
export const upgradeMainnet = async network => {
|
|
65
|
+
const isProduction = networkName.includes("production");
|
|
66
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
67
|
+
|
|
68
|
+
if (isProduction) verifyProductionSigner(root);
|
|
69
|
+
|
|
70
|
+
let guardian = root;
|
|
71
|
+
|
|
72
|
+
//simulate produciton on fork
|
|
73
|
+
if (isSimulation) {
|
|
74
|
+
networkName = "production-mainnet";
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let release: { [key: string]: any } = dao[networkName];
|
|
78
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
79
|
+
|
|
80
|
+
//simulate on fork, make sure safe has enough eth to simulate txs
|
|
81
|
+
if (isSimulation) {
|
|
82
|
+
await reset("https://eth.drpc.org");
|
|
83
|
+
guardian = await ethers.getImpersonatedSigner(protocolSettings.guardiansSafe);
|
|
84
|
+
|
|
85
|
+
await root.sendTransaction({
|
|
86
|
+
value: ethers.utils.parseEther("1"),
|
|
87
|
+
to: protocolSettings.guardiansSafe
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
const rootBalance = await ethers.provider.getBalance(root.address).then(_ => _.toString());
|
|
92
|
+
const guardianBalance = await ethers.provider.getBalance(guardian.address).then(_ => _.toString());
|
|
93
|
+
|
|
94
|
+
console.log("got signers:", {
|
|
95
|
+
networkName,
|
|
96
|
+
root: root.address,
|
|
97
|
+
guardian: guardian.address,
|
|
98
|
+
balance: rootBalance,
|
|
99
|
+
guardianBalance: guardianBalance
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
const reserveImpl = await ethers.deployContract("GoodReserveCDai");
|
|
103
|
+
const goodFundManagerImpl = await ethers.deployContract("GoodFundManager");
|
|
104
|
+
const exchangeHelperImpl = await ethers.deployContract("ExchangeHelper");
|
|
105
|
+
const stakersDistImpl = await ethers.deployContract("StakersDistribution");
|
|
106
|
+
const govImpl = await ethers.deployContract("CompoundVotingMachine");
|
|
107
|
+
const distHelperImplt = await ethers.deployContract("DistributionHelper");
|
|
108
|
+
const marketMakerImpl = await ethers.deployContract("GoodMarketMaker");
|
|
109
|
+
const upgradeImpl = await ethers.deployContract("ReserveRestore", [release.NameService]) as ReserveRestore;
|
|
110
|
+
|
|
111
|
+
const gd = (await ethers.getContractAt("IGoodDollar", release.GoodDollar)) as IGoodDollar;
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
// test blacklisting to prevent burn by hacker
|
|
115
|
+
if (isSimulation) {
|
|
116
|
+
|
|
117
|
+
const locked = await ethers.getImpersonatedSigner(LOCKED_ACCOUNTS[0]);
|
|
118
|
+
const tx = await gd
|
|
119
|
+
.connect(locked)
|
|
120
|
+
.burn("10")
|
|
121
|
+
.then(_ => _.wait())
|
|
122
|
+
.then(_ => _.status)
|
|
123
|
+
.catch(e => e);
|
|
124
|
+
|
|
125
|
+
console.log("Burn tx before:", tx);
|
|
126
|
+
|
|
127
|
+
const funderSigner = await ethers.getImpersonatedSigner(funder)
|
|
128
|
+
const dai = await ethers.getContractAt("IGoodDollar", release.DAI)
|
|
129
|
+
await dai.connect(funderSigner).approve(upgradeImpl.address, ethers.utils.parseEther("200000"))
|
|
130
|
+
const whale = await ethers.getImpersonatedSigner("0xa359Fc83C48277EedF375a5b6DC9Ec7D093aD3f2")
|
|
131
|
+
await dai.connect(whale).transfer(root.address, ethers.utils.parseEther("100000"))
|
|
132
|
+
|
|
133
|
+
const lockedFunds = await Promise.all(LOCKED_ACCOUNTS.map(_ => gd.balanceOf(_)))
|
|
134
|
+
const totalLocked = lockedFunds.reduce((acc, cur) => acc.add(cur), ethers.constants.Zero)
|
|
135
|
+
console.log({ totalLocked })
|
|
136
|
+
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const startSupply = await gd.totalSupply();
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
console.log("executing proposals");
|
|
143
|
+
|
|
144
|
+
const proposalContracts = [
|
|
145
|
+
release.StakingContractsV3[0][0], // pause staking
|
|
146
|
+
release.StakingContractsV3[1][0], // pause staking
|
|
147
|
+
release.StakersDistribution, //set GOOD rewards to 0
|
|
148
|
+
release.GoodReserveCDai, //expansion ratio
|
|
149
|
+
release.ForeignBridge, // prevent from using
|
|
150
|
+
release.Identity, // set locked G$ accounts as blacklisted so cant do burn from
|
|
151
|
+
release.Identity, // set locked G$ accounts as blacklisted so cant do burn from
|
|
152
|
+
release.Identity, // set locked G$ accounts as blacklisted so cant do burnfrom
|
|
153
|
+
release.ForeignBridge, // claim bridge tokens to mpb bridge
|
|
154
|
+
release.GoodReserveCDai, //upgrade reserve
|
|
155
|
+
release.GoodFundManager, //upgrade fundmanager
|
|
156
|
+
release.ExchangeHelper, //upgrade exchangehelper
|
|
157
|
+
release.DistributionHelper, //upgrade disthelper
|
|
158
|
+
release.StakersDistribution, //upgrade stakers dist
|
|
159
|
+
release.GoodMarketMaker, //upgrade mm
|
|
160
|
+
release.CompoundVotingMachine, // upgrade gov
|
|
161
|
+
release.DistributionHelper, // switch to lz bridge for fuse
|
|
162
|
+
release.ExchangeHelper, // activate upgrade changes
|
|
163
|
+
release.Controller,
|
|
164
|
+
// upgradeImpl.address,
|
|
165
|
+
release.GuardiansSafe + "_" + release.GoodReserveCDai
|
|
166
|
+
];
|
|
167
|
+
|
|
168
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
169
|
+
|
|
170
|
+
const proposalFunctionSignatures = [
|
|
171
|
+
"pause(bool)",
|
|
172
|
+
"pause(bool)",
|
|
173
|
+
"setMonthlyReputationDistribution(uint256)",
|
|
174
|
+
"setReserveRatioDailyExpansion(uint256,uint256)",
|
|
175
|
+
"setExecutionDailyLimit(uint256)", // set limit to 0 so old bridge cant be used
|
|
176
|
+
"addBlacklisted(address)",
|
|
177
|
+
"addBlacklisted(address)",
|
|
178
|
+
"addBlacklisted(address)",
|
|
179
|
+
"claimTokens(address,address)",
|
|
180
|
+
"upgradeTo(address)",
|
|
181
|
+
"upgradeTo(address)",
|
|
182
|
+
"upgradeTo(address)",
|
|
183
|
+
"upgradeTo(address)",
|
|
184
|
+
"upgradeTo(address)",
|
|
185
|
+
"upgradeTo(address)",
|
|
186
|
+
"upgradeTo(address)",
|
|
187
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))",
|
|
188
|
+
"setAddresses()",
|
|
189
|
+
"registerScheme(address,bytes32,bytes4,address)", // give upgrade contract permissions
|
|
190
|
+
// "upgrade(address, uint256)",
|
|
191
|
+
"unpause()"
|
|
192
|
+
];
|
|
193
|
+
|
|
194
|
+
const proposalFunctionInputs = [
|
|
195
|
+
ethers.utils.defaultAbiCoder.encode(["bool"], [true]),
|
|
196
|
+
ethers.utils.defaultAbiCoder.encode(["bool"], [true]),
|
|
197
|
+
ethers.utils.defaultAbiCoder.encode(["uint256"], [0]),
|
|
198
|
+
ethers.utils.defaultAbiCoder.encode(["uint256", "uint256"], [999711382710978, 1e15]),
|
|
199
|
+
ethers.utils.defaultAbiCoder.encode(["uint256"], [0]),
|
|
200
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [LOCKED_ACCOUNTS[0]]),
|
|
201
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [LOCKED_ACCOUNTS[1]]),
|
|
202
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [LOCKED_ACCOUNTS[2]]),
|
|
203
|
+
ethers.utils.defaultAbiCoder.encode(["address", "address"], [release.GoodDollar, release.MpbBridge]),
|
|
204
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [reserveImpl.address]),
|
|
205
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [goodFundManagerImpl.address]),
|
|
206
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [exchangeHelperImpl.address]),
|
|
207
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [distHelperImplt.address]),
|
|
208
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [stakersDistImpl.address]),
|
|
209
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [marketMakerImpl.address]),
|
|
210
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [govImpl.address]),
|
|
211
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
212
|
+
["uint32", "uint32", "address", "uint8"],
|
|
213
|
+
[1000, 122, dao["production"].UBIScheme, 1] //10% chainId 122 ubischeme 1-lz bridge
|
|
214
|
+
),
|
|
215
|
+
"0x", //setAddresses
|
|
216
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
217
|
+
["address", "bytes32", "bytes4", "address"],
|
|
218
|
+
[
|
|
219
|
+
upgradeImpl.address, //scheme
|
|
220
|
+
ethers.constants.HashZero, //paramshash
|
|
221
|
+
"0x000000f1", //permissions - minimal
|
|
222
|
+
release.Avatar
|
|
223
|
+
]
|
|
224
|
+
),
|
|
225
|
+
"0x"
|
|
226
|
+
];
|
|
227
|
+
|
|
228
|
+
if (isProduction) {
|
|
229
|
+
await executeViaSafe(
|
|
230
|
+
proposalContracts,
|
|
231
|
+
proposalEthValues,
|
|
232
|
+
proposalFunctionSignatures,
|
|
233
|
+
proposalFunctionInputs,
|
|
234
|
+
protocolSettings.guardiansSafe,
|
|
235
|
+
"mainnet"
|
|
236
|
+
);
|
|
237
|
+
} else {
|
|
238
|
+
//simulation or dev envs
|
|
239
|
+
await executeViaGuardian(
|
|
240
|
+
proposalContracts,
|
|
241
|
+
proposalEthValues,
|
|
242
|
+
proposalFunctionSignatures,
|
|
243
|
+
proposalFunctionInputs,
|
|
244
|
+
guardian,
|
|
245
|
+
networkName
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
if (isSimulation) {
|
|
250
|
+
await mainnetPostChecks(upgradeImpl)
|
|
251
|
+
}
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
const mainnetPostChecks = async (upgradeImpl: ReserveRestore) => {
|
|
255
|
+
networkName = "production-mainnet";
|
|
256
|
+
let release: { [key: string]: any } = dao[networkName];
|
|
257
|
+
|
|
258
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
259
|
+
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
260
|
+
|
|
261
|
+
//execute the reserve initialization
|
|
262
|
+
(await upgradeImpl.upgrade(funder, INITIAL_DAI)).wait()
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
const locked = await ethers.getImpersonatedSigner(LOCKED_ACCOUNTS[0]);
|
|
266
|
+
const tx = await gd
|
|
267
|
+
.connect(locked)
|
|
268
|
+
.burn("10", { maxFeePerGas: 30e9, maxPriorityFeePerGas: 1e9, gasLimit: 200000 })
|
|
269
|
+
.then(_ => _.wait())
|
|
270
|
+
.then(_ => _.status)
|
|
271
|
+
.catch(e => e);
|
|
272
|
+
console.log("Burn tx after should fail:", tx);
|
|
273
|
+
|
|
274
|
+
const dai = await ethers.getContractAt("IGoodDollar", release.DAI);
|
|
275
|
+
const cdai = await ethers.getContractAt("IGoodDollar", release.cDAI);
|
|
276
|
+
const reserve = await ethers.getContractAt("GoodReserveCDai", release.GoodReserveCDai) as GoodReserveCDai
|
|
277
|
+
const mm = await ethers.getContractAt("GoodMarketMaker", release.GoodMarketMaker) as GoodMarketMaker
|
|
278
|
+
const newExpansion = await mm.reserveRatioDailyExpansion()
|
|
279
|
+
console.log("new expansion set:", newExpansion, newExpansion.mul(1e15).div(ethers.utils.parseEther("1000000000")).toNumber() / 1e15 === 0.999711382710978)
|
|
280
|
+
console.log("discount should be disabled:", await reserve.discountDisabled(), " gdx should be disabled:", await reserve.gdxDisabled());
|
|
281
|
+
const resereState = await mm.reserveTokens(release.cDAI)
|
|
282
|
+
console.log({ resereState })
|
|
283
|
+
const finalSupply = await gd.totalSupply();
|
|
284
|
+
const distHelper = await ethers.getContractAt("DistributionHelper", release.DistributionHelper)
|
|
285
|
+
const result = await distHelper.calcGDToSell(1e9)
|
|
286
|
+
console.log("how much G$ to sell to cover distribution fees out of 1M:", result.toNumber() / 100)
|
|
287
|
+
const [cdaiPriceBefore, daiPriceBefore] = await (await Promise.all([reserve.currentPrice(), reserve.currentPriceDAI()])).map(_ => _.toNumber())
|
|
288
|
+
console.log({ cdaiPriceBefore, daiPriceBefore })
|
|
289
|
+
const dex = await ethers.getContractAt("ExchangeHelper", release.ExchangeHelper) as ExchangeHelper
|
|
290
|
+
await dai.approve(dex.address, ethers.utils.parseEther("10000"))
|
|
291
|
+
await dex.buy([release.DAI], ethers.utils.parseEther("10000"), 0, 0, root.address);
|
|
292
|
+
// check g$ prices
|
|
293
|
+
const [cdaiPriceAfter, daiPriceAfter] = await (await Promise.all([reserve.currentPrice(), reserve.currentPriceDAI()])).map(_ => _.toNumber())
|
|
294
|
+
console.log("prices after buying form reserve with 10k DAI", { cdaiPriceAfter, daiPriceAfter })
|
|
295
|
+
await gd.approve(dex.address, await gd.balanceOf(root.address))
|
|
296
|
+
await dex.sell([release.DAI], await gd.balanceOf(root.address), 0, 0, root.address);
|
|
297
|
+
const daiBalanceAfterSell = await dai.balanceOf(root.address)
|
|
298
|
+
// expect a 10% sell fee
|
|
299
|
+
console.log("expect 10% sell fee (selling 10K gets only 9K of dai, balance should be ~99K):", { daiBalanceAfterSell })
|
|
300
|
+
const cdaiReserveBalance = await cdai.balanceOf(reserve.address)
|
|
301
|
+
console.log({ cdaiReserveBalance })
|
|
302
|
+
|
|
303
|
+
const [mpbBalance, fuseBalance] = await Promise.all([gd.balanceOf(release.MpbBridge), gd.balanceOf(release.ForeignBridge)])
|
|
304
|
+
console.log("fuse bridge should have 0 balance and Mpb should be >6B", { mpbBalance, fuseBalance })
|
|
305
|
+
const gfm = await ethers.getContractAt("GoodFundManager", release.GoodFundManager) as GoodFundManager
|
|
306
|
+
const stakingContracts = await gfm.callStatic.calcSortedContracts()
|
|
307
|
+
console.log({ stakingContracts })
|
|
308
|
+
const interesTX = await (await gfm.collectInterest(stakingContracts.map(_ => _[0]), false)).wait()
|
|
309
|
+
const ubiEvents = last(await reserve.queryFilter(reserve.filters.UBIMinted(), -1))
|
|
310
|
+
console.log("collectinterest gfm events:", interesTX.events?.find(_ => _.event === 'FundsTransferred'))
|
|
311
|
+
console.log("ubiEvents after collect interest:", ubiEvents)
|
|
312
|
+
// check expansion after some time
|
|
313
|
+
await time.increase(365 * 60 * 60 * 24)
|
|
314
|
+
const gdSupplyBeforeExpansion = await gd.totalSupply();
|
|
315
|
+
const reserveStateBeforeYearExpansion = await mm.reserveTokens(release.cDAI)
|
|
316
|
+
|
|
317
|
+
const expansionTX = await (await gfm.collectInterest([], false)).wait()
|
|
318
|
+
const ubiExpansionEvents = last(await reserve.queryFilter(reserve.filters.UBIMinted(), -1))
|
|
319
|
+
console.log("gfm events after 1 year expansion:", expansionTX.events?.filter(_ => _.event === 'FundsTransferred'))
|
|
320
|
+
console.log("ubiEvents after 1 year expansion:", ubiExpansionEvents)
|
|
321
|
+
const reserveStateAfterYearExpansion = await mm.reserveTokens(release.cDAI)
|
|
322
|
+
const gdSupplyAfterExpansion = await gd.totalSupply();
|
|
323
|
+
console.log({ reserveStateAfterYearExpansion, gdSupplyAfterExpansion, gdSupplyBeforeExpansion, reserveStateBeforeYearExpansion })
|
|
324
|
+
|
|
325
|
+
//execute the reserve initialization
|
|
326
|
+
await (await upgradeImpl.donate(funder, INITIAL_DAI)).wait()
|
|
327
|
+
const [cdaiPriceAfterDonation, daiPriceAfterDonation] = await (await Promise.all([reserve.currentPrice(), reserve.currentPriceDAI()])).map(_ => _.toNumber())
|
|
328
|
+
console.log("price after dai donation:", { cdaiPriceAfterDonation, daiPriceAfterDonation })
|
|
329
|
+
const reserveStateAfterDonation = await mm.reserveTokens(release.cDAI)
|
|
330
|
+
console.log({ reserveStateAfterDonation })
|
|
331
|
+
|
|
332
|
+
await (await upgradeImpl.end()).wait()
|
|
333
|
+
}
|
|
334
|
+
export const upgradeFuse = async network => {
|
|
335
|
+
let [root] = await ethers.getSigners();
|
|
336
|
+
|
|
337
|
+
const isProduction = networkName.includes("production");
|
|
338
|
+
|
|
339
|
+
let networkEnv = networkName.split("-")[0];
|
|
340
|
+
if (isSimulation) networkEnv = "production";
|
|
341
|
+
|
|
342
|
+
let release: { [key: string]: any } = dao[networkEnv];
|
|
343
|
+
|
|
344
|
+
let guardian = root;
|
|
345
|
+
//simulate on fork, make sure safe has enough eth to simulate txs
|
|
346
|
+
if (isSimulation) {
|
|
347
|
+
await reset("https://fuse.liquify.com");
|
|
348
|
+
guardian = await ethers.getImpersonatedSigner(release.GuardiansSafe);
|
|
349
|
+
|
|
350
|
+
await root.sendTransaction({ value: ethers.constants.WeiPerEther.mul(3), to: guardian.address });
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
const gd = (await ethers.getContractAt("IGoodDollar", release.GoodDollar)) as IGoodDollar;
|
|
356
|
+
|
|
357
|
+
const isMinter = await gd.isMinter(release.HomeBridge);
|
|
358
|
+
|
|
359
|
+
console.log({ networkEnv, guardian: guardian.address, isSimulation, isProduction, isMinter });
|
|
360
|
+
|
|
361
|
+
const govImpl = await ethers.deployContract("CompoundVotingMachine");
|
|
362
|
+
const killBridge = await ethers.deployContract("FuseOldBridgeKill") as FuseOldBridgeKill
|
|
363
|
+
|
|
364
|
+
const proposalContracts = [
|
|
365
|
+
release.HomeBridge, // prevent from using by upgrading to empty contract and removing minting rights
|
|
366
|
+
release.CompoundVotingMachine, //upgrade gov
|
|
367
|
+
];
|
|
368
|
+
|
|
369
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
370
|
+
|
|
371
|
+
const proposalFunctionSignatures = [
|
|
372
|
+
"upgradeToAndCall(uint256,address,bytes)", // upgrade and call end
|
|
373
|
+
"upgradeTo(address)"
|
|
374
|
+
];
|
|
375
|
+
|
|
376
|
+
|
|
377
|
+
const proposalFunctionInputs = [
|
|
378
|
+
ethers.utils.defaultAbiCoder.encode(["uint256", "address", "bytes"], [2, killBridge.address, killBridge.interface.encodeFunctionData("end")]),
|
|
379
|
+
ethers.utils.defaultAbiCoder.encode(["address"], [govImpl.address]),
|
|
380
|
+
|
|
381
|
+
];
|
|
382
|
+
|
|
383
|
+
if (isProduction) {
|
|
384
|
+
await executeViaSafe(
|
|
385
|
+
proposalContracts,
|
|
386
|
+
proposalEthValues,
|
|
387
|
+
proposalFunctionSignatures,
|
|
388
|
+
proposalFunctionInputs,
|
|
389
|
+
release.GuardiansSafe,
|
|
390
|
+
"fuse"
|
|
391
|
+
);
|
|
392
|
+
} else {
|
|
393
|
+
await executeViaGuardian(
|
|
394
|
+
proposalContracts,
|
|
395
|
+
proposalEthValues,
|
|
396
|
+
proposalFunctionSignatures,
|
|
397
|
+
proposalFunctionInputs,
|
|
398
|
+
guardian,
|
|
399
|
+
networkEnv
|
|
400
|
+
);
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
if (isSimulation) {
|
|
404
|
+
|
|
405
|
+
const isMinter = await gd.isMinter(release.HomeBridge);
|
|
406
|
+
console.log("Fuse bridge scheme registration check:", isMinter ? "Failed" : "Success");
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
|
|
410
|
+
export const main = async () => {
|
|
411
|
+
prompt.start();
|
|
412
|
+
const { network } = await prompt.get(["network"]);
|
|
413
|
+
|
|
414
|
+
console.log("running step:", { network });
|
|
415
|
+
const chain = last(network.split("-"));
|
|
416
|
+
switch (chain) {
|
|
417
|
+
case "mainnet":
|
|
418
|
+
// await mainnetPostChecks()
|
|
419
|
+
await upgradeMainnet(network);
|
|
420
|
+
|
|
421
|
+
break;
|
|
422
|
+
case "fuse":
|
|
423
|
+
await upgradeFuse(network);
|
|
424
|
+
|
|
425
|
+
break;
|
|
426
|
+
}
|
|
427
|
+
};
|
|
428
|
+
|
|
429
|
+
main().catch(console.log);
|
|
@@ -650,7 +650,6 @@ export const deployUBI = async deployedDAO => {
|
|
|
650
650
|
const lastBlock = await ethers.provider.getBlock("latest");
|
|
651
651
|
const periodStart = await ubiScheme.periodStart().then(_ => _.toNumber());
|
|
652
652
|
const diff = periodStart - lastBlock.timestamp;
|
|
653
|
-
await increaseTime(diff); //make sure period start has reached
|
|
654
653
|
console.log("ubischeme start:", {
|
|
655
654
|
now: now.timestamp,
|
|
656
655
|
blockTime: lastBlock.timestamp,
|
|
@@ -658,6 +657,8 @@ export const deployUBI = async deployedDAO => {
|
|
|
658
657
|
periodEnd: await ubiScheme.periodEnd().then(_ => _.toString()),
|
|
659
658
|
diff
|
|
660
659
|
});
|
|
660
|
+
if (diff > 0 && diff < 2 ** 64)
|
|
661
|
+
await increaseTime(diff); //make sure period start has reached
|
|
661
662
|
const tx = await firstClaim.start();
|
|
662
663
|
console.log("firstclaim started");
|
|
663
664
|
await ubiScheme.start();
|