@gooddollar/goodprotocol 2.0.34-beta.2 → 2.0.34-beta.4
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/GenericDistributionHelper.min.json +1 -0
- package/artifacts/abis/INonfungiblePositionManager.min.json +1 -0
- package/artifacts/abis/IUniswapV3Pool.min.json +1 -0
- package/artifacts/abis/UBISchemeV2.min.json +1 -1
- 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/IQuoter.sol/IQuoterV2.dbg.json +4 -0
- package/artifacts/contracts/IQuoter.sol/IQuoterV2.json +211 -0
- package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +4 -0
- package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.json +102 -0
- package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +4 -0
- package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.json +93 -0
- 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/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/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/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/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +4 -0
- package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.json +931 -0
- 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/ubi/UBISchemeV2.sol/UBISchemeV2.json +7 -2
- 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/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/contracts/IQuoter.sol +108 -0
- package/contracts/IUniswapV3.sol +51 -0
- package/contracts/reserve/GenericDistributionHelper.sol +319 -0
- package/contracts/ubi/UBISchemeV2.sol +8 -4
- package/dist/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.json +2 -2
- package/dist/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.json +179 -186
- package/dist/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.json +2 -2
- package/dist/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.json +2 -2
- package/dist/test-sdk/deploySuperGoodDollar.d.ts +1 -1
- package/dist/test-sdk/deploySuperGoodDollar.js +4 -8
- package/dist/test-sdk/index.js +1 -5
- package/hardhat.config.ts +14 -6
- package/package.json +1 -1
- package/releases/deploy-settings.json +15 -2
- package/releases/deployment.json +66 -45
- package/releases/olddao.json +1 -1
- package/scripts/fv.ts +19 -1
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +4 -3
- package/scripts/multichain-deploy/1_basicdao-deploy.ts +18 -9
- package/scripts/multichain-deploy/4_ubi-deploy.ts +1 -1
- package/scripts/multichain-deploy/8_disthelper-deploy.ts +152 -0
- package/scripts/multichain-deploy/createUniswapTestPools.ts +163 -0
- package/scripts/multichain-deploy/fulldeploy.sh +17 -17
- package/scripts/multichain-deploy/helpers.ts +76 -6
- package/scripts/multichain-deploy/verify.ts +41 -0
- package/scripts/proposals/gip-25-xdc-upgrade.ts +438 -0
- package/test/helpers.ts +1 -1
- package/test/ubi/UBISchemeV2.test.ts +35 -108
- package/types/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.ts +108 -0
- package/types/@openzeppelin/contracts/proxy/ERC1967/index.ts +1 -0
- package/types/@uniswap/index.ts +2 -0
- package/types/@uniswap/v2-periphery/contracts/index.ts +5 -0
- package/types/@uniswap/v2-periphery/contracts/interfaces/IWETH.ts +159 -0
- package/types/@uniswap/v2-periphery/contracts/interfaces/index.ts +4 -0
- package/types/@uniswap/v2-periphery/index.ts +5 -0
- package/types/contracts/IQuoter.sol/IQuoterV2.ts +297 -0
- package/types/contracts/IQuoter.sol/index.ts +4 -0
- package/types/contracts/IUniswapV3.sol/INonfungiblePositionManager.ts +151 -0
- package/types/contracts/IUniswapV3.sol/IUniswapV3Factory.ts +155 -0
- package/types/contracts/IUniswapV3.sol/IUniswapV3Pool.ts +179 -0
- package/types/contracts/IUniswapV3.sol/index.ts +5 -0
- package/types/contracts/Interfaces.sol/AToken.ts +81 -0
- package/types/contracts/Interfaces.sol/IAaveIncentivesControllerV3.ts +156 -0
- package/types/contracts/Interfaces.sol/ILendingPoolV3.ts +254 -0
- package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor.ts +648 -0
- package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable.ts +843 -0
- package/types/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +4 -0
- package/types/contracts/index.ts +4 -0
- package/types/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper.ts +1252 -0
- package/types/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper.ts +1247 -0
- package/types/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +4 -0
- package/types/contracts/reserve/GenericDistributionHelper.ts +1304 -0
- package/types/contracts/reserve/GoodReserveADai.ts +2212 -0
- package/types/contracts/reserve/index.ts +1 -0
- package/types/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2.ts +1808 -0
- package/types/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +4 -0
- package/types/contracts/token/GoodDollar18.ts +1871 -0
- package/types/contracts/ubi/UBISchemeV2.ts +14 -3
- package/types/contracts/utils/BuyGDClone.sol/IQuoterV2.ts +184 -0
- package/types/contracts/utils/BuyGDClone.sol/ISwapRouter.ts +306 -0
- package/types/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677.ts +108 -0
- package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange.ts +81 -0
- package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.ts +161 -0
- package/types/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +5 -0
- package/types/contracts/utils/ReserveRestore.sol/MentoExchange.ts +81 -0
- package/types/contracts/utils/ReserveRestore.sol/ReserveRestore.ts +112 -0
- package/types/contracts/utils/ReserveRestore.sol/index.ts +5 -0
- package/types/factories/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy__factory.ts +146 -0
- package/types/factories/@openzeppelin/contracts/proxy/ERC1967/index.ts +1 -0
- package/types/factories/@uniswap/index.ts +1 -0
- package/types/factories/@uniswap/v2-periphery/contracts/index.ts +4 -0
- package/types/factories/@uniswap/v2-periphery/contracts/interfaces/IWETH__factory.ts +67 -0
- package/types/factories/@uniswap/v2-periphery/contracts/interfaces/index.ts +4 -0
- package/types/factories/@uniswap/v2-periphery/index.ts +4 -0
- package/types/factories/contracts/IQuoter.sol/IQuoterV2__factory.ts +226 -0
- package/types/factories/contracts/IQuoter.sol/index.ts +4 -0
- package/types/factories/contracts/IUniswapV3.sol/INonfungiblePositionManager__factory.ts +121 -0
- package/types/factories/contracts/IUniswapV3.sol/IUniswapV3Factory__factory.ts +84 -0
- package/types/factories/contracts/IUniswapV3.sol/IUniswapV3Pool__factory.ts +108 -0
- package/types/factories/contracts/IUniswapV3.sol/index.ts +5 -0
- package/types/factories/contracts/Interfaces.sol/AToken__factory.ts +36 -0
- package/types/factories/contracts/Interfaces.sol/IAaveIncentivesControllerV3__factory.ts +88 -0
- package/types/factories/contracts/Interfaces.sol/ILendingPoolV3__factory.ts +186 -0
- package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributorUpgradeable__factory.ts +572 -0
- package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/EthDistributor__factory.ts +482 -0
- package/types/factories/contracts/fuseFaucet/SuperfluidBaseFacuet.sol/index.ts +4 -0
- package/types/factories/contracts/index.ts +2 -0
- package/types/factories/contracts/mocks/CeloDistributionHelperTest.sol/DistributionHelperTestHelper__factory.ts +929 -0
- package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/GenericDistributionHelper__factory.ts +935 -0
- package/types/factories/contracts/reserve/GenericDistributionHelper copy.sol/index.ts +4 -0
- package/types/factories/contracts/reserve/GenericDistributionHelper__factory.ts +987 -0
- package/types/factories/contracts/reserve/GoodReserveADai__factory.ts +1502 -0
- package/types/factories/contracts/reserve/index.ts +1 -0
- package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/GoodAaveStakingV2__factory.ts +1240 -0
- package/types/factories/contracts/staking/aave/GoodAave3StakingV2.sol/index.ts +4 -0
- package/types/factories/contracts/token/GoodDollar18__factory.ts +1257 -0
- package/types/factories/contracts/ubi/UBISchemeV2__factory.ts +6 -1
- package/types/factories/contracts/utils/BuyGDClone.sol/IQuoterV2__factory.ts +126 -0
- package/types/factories/contracts/utils/BuyGDClone.sol/ISwapRouter__factory.ts +220 -0
- package/types/factories/contracts/utils/FuseOldBridgeKill.sol/BasicAMBErc677ToErc677__factory.ts +86 -0
- package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/MentoExchange__factory.ts +39 -0
- package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/ProtocolUpgradeV4Mento__factory.ts +152 -0
- package/types/factories/contracts/utils/ProtocolUpgradeV4Mento.sol/index.ts +5 -0
- package/types/factories/contracts/utils/ReserveRestore.sol/MentoExchange__factory.ts +39 -0
- package/types/factories/contracts/utils/ReserveRestore.sol/ReserveRestore__factory.ts +95 -0
- package/types/factories/contracts/utils/ReserveRestore.sol/index.ts +5 -0
- package/types/hardhat.d.ts +54 -0
- package/types/index.ts +10 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/***
|
|
2
|
+
* Deploy helper contracts
|
|
3
|
+
* AdminWallet, Faucet, Invites
|
|
4
|
+
*/
|
|
5
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
6
|
+
import { Contract } from "ethers";
|
|
7
|
+
import { defaultsDeep } from "lodash";
|
|
8
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
9
|
+
import {
|
|
10
|
+
deployDeterministic,
|
|
11
|
+
executeViaGuardian,
|
|
12
|
+
executeViaSafe,
|
|
13
|
+
verifyContract,
|
|
14
|
+
verifyProductionSigner
|
|
15
|
+
} from "./helpers";
|
|
16
|
+
import releaser from "../releaser";
|
|
17
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
18
|
+
import dao from "../../releases/deployment.json";
|
|
19
|
+
import { TransactionResponse } from "@ethersproject/providers";
|
|
20
|
+
import { keccak256, toUtf8Bytes } from "ethers/lib/utils";
|
|
21
|
+
|
|
22
|
+
const { name } = network;
|
|
23
|
+
|
|
24
|
+
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
25
|
+
if (c instanceof Contract) {
|
|
26
|
+
await c.deployed();
|
|
27
|
+
console.log("deployed to: ", c.address);
|
|
28
|
+
}
|
|
29
|
+
if (c.wait) {
|
|
30
|
+
await c.wait();
|
|
31
|
+
console.log("tx done:", c.hash);
|
|
32
|
+
}
|
|
33
|
+
return c;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const deployHelpers = async () => {
|
|
37
|
+
const viaGuardians = false;
|
|
38
|
+
|
|
39
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
40
|
+
let release: { [key: string]: any } = dao[network.name];
|
|
41
|
+
|
|
42
|
+
let [root, ...signers] = await ethers.getSigners();
|
|
43
|
+
const isProduction = network.name.includes("production");
|
|
44
|
+
let networkEnv = network.name.split("-")[0];
|
|
45
|
+
const celoNetwork = networkEnv + "-celo";
|
|
46
|
+
|
|
47
|
+
if (isProduction) verifyProductionSigner(root);
|
|
48
|
+
//generic call permissions
|
|
49
|
+
let schemeMock = root;
|
|
50
|
+
|
|
51
|
+
console.log("got signers:", {
|
|
52
|
+
network,
|
|
53
|
+
root: root.address,
|
|
54
|
+
schemeMock: schemeMock.address,
|
|
55
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
console.log("deploying dist helper");
|
|
59
|
+
const DistHelper = (await deployDeterministic(
|
|
60
|
+
{
|
|
61
|
+
name: "DistributionHelper",
|
|
62
|
+
factory: await ethers.getContractFactory("GenericDistributionHelper"),
|
|
63
|
+
isUpgradeable: true
|
|
64
|
+
},
|
|
65
|
+
[
|
|
66
|
+
release.NameService,
|
|
67
|
+
release.StaticOracle,
|
|
68
|
+
protocolSettings.reserve.gasToken,
|
|
69
|
+
protocolSettings.reserve.reserveToken,
|
|
70
|
+
release.UniswapV3Router,
|
|
71
|
+
[ethers.utils.parseEther("100"), ethers.utils.parseEther("100"), 5, 5]
|
|
72
|
+
]
|
|
73
|
+
).then(printDeploy)) as Contract;
|
|
74
|
+
|
|
75
|
+
const torelease = {
|
|
76
|
+
DistributionHelper: DistHelper.address
|
|
77
|
+
};
|
|
78
|
+
release = {
|
|
79
|
+
...release,
|
|
80
|
+
...torelease
|
|
81
|
+
};
|
|
82
|
+
await releaser(torelease, network.name, "deployment", false);
|
|
83
|
+
|
|
84
|
+
console.log("setting nameservice addresses via guardian");
|
|
85
|
+
const proposalActions = [
|
|
86
|
+
[
|
|
87
|
+
release.NameService, //nameservice
|
|
88
|
+
"setAddresses(bytes32[],address[])", //add ubischeme
|
|
89
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
90
|
+
["bytes32[]", "address[]"],
|
|
91
|
+
[[keccak256(toUtf8Bytes("DISTRIBUTION_HELPER"))], [DistHelper.address]]
|
|
92
|
+
),
|
|
93
|
+
0
|
|
94
|
+
],
|
|
95
|
+
[
|
|
96
|
+
DistHelper.address,
|
|
97
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))",
|
|
98
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
99
|
+
["uint32", "uint32", "address", "uint8"],
|
|
100
|
+
[dao[celoNetwork].CommunitySafe ? 9000 : 10000, network.config.chainId, release.UBIScheme, 1] //90% to ubi scheme
|
|
101
|
+
),
|
|
102
|
+
0
|
|
103
|
+
]
|
|
104
|
+
];
|
|
105
|
+
|
|
106
|
+
if (dao[celoNetwork].CommunitySafe) {
|
|
107
|
+
proposalActions.push([
|
|
108
|
+
DistHelper.address,
|
|
109
|
+
"addOrUpdateRecipient((uint32,uint32,address,uint8))",
|
|
110
|
+
ethers.utils.defaultAbiCoder.encode(
|
|
111
|
+
["uint32", "uint32", "address", "uint8"],
|
|
112
|
+
[1000, 42220, dao[celoNetwork].CommunitySafe, network.name === celoNetwork ? 1 : 0] //10% to celo community safe, use LZ bridge if not on celo
|
|
113
|
+
),
|
|
114
|
+
0
|
|
115
|
+
]);
|
|
116
|
+
}
|
|
117
|
+
const [proposalContracts, proposalFunctionSignatures, proposalFunctionInputs, proposalEthValues] = [
|
|
118
|
+
proposalActions.map(_ => _[0]),
|
|
119
|
+
proposalActions.map(_ => _[1]),
|
|
120
|
+
proposalActions.map(_ => _[2]),
|
|
121
|
+
proposalActions.map(_ => _[3])
|
|
122
|
+
];
|
|
123
|
+
try {
|
|
124
|
+
if (viaGuardians) {
|
|
125
|
+
await executeViaSafe(
|
|
126
|
+
proposalContracts,
|
|
127
|
+
proposalEthValues,
|
|
128
|
+
proposalFunctionSignatures,
|
|
129
|
+
proposalFunctionInputs,
|
|
130
|
+
protocolSettings.guardiansSafe
|
|
131
|
+
);
|
|
132
|
+
} else {
|
|
133
|
+
await executeViaGuardian(
|
|
134
|
+
proposalContracts,
|
|
135
|
+
proposalEthValues,
|
|
136
|
+
proposalFunctionSignatures,
|
|
137
|
+
proposalFunctionInputs,
|
|
138
|
+
root
|
|
139
|
+
);
|
|
140
|
+
}
|
|
141
|
+
} catch (e) {
|
|
142
|
+
console.error("proposal execution failed...", e.message);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
let impl = await getImplementationAddress(ethers.provider, DistHelper.address);
|
|
146
|
+
await verifyContract(impl, "contracts/reserve/GenericDistributionHelper.sol:GenericDistributionHelper", network.name);
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const main = async (networkName = name) => {
|
|
150
|
+
await deployHelpers();
|
|
151
|
+
};
|
|
152
|
+
main();
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
2
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
3
|
+
import dao from "../../releases/deployment.json";
|
|
4
|
+
import { defaultsDeep } from "lodash";
|
|
5
|
+
|
|
6
|
+
import { IUniswapV3Factory, IUniswapV3Pool, INonfungiblePositionManager, IERC20 } from "../../types";
|
|
7
|
+
const V3Factory = "0x30f317a9ec0f0d06d5de0f8d248ec3506b7e4a8a";
|
|
8
|
+
const NFPM = "0x6d22833398772d7da9a7cbcfdee98342cce154d4";
|
|
9
|
+
const STABLE_DECIMALS = 6; //USDC
|
|
10
|
+
const GASPRICE_STABLE = 0.08;
|
|
11
|
+
const POOL_FEE = 100; // 0.01%
|
|
12
|
+
const main = async () => {
|
|
13
|
+
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
14
|
+
let release: { [key: string]: any } = dao[network.name];
|
|
15
|
+
let [root] = await ethers.getSigners();
|
|
16
|
+
console.log("got signers:", {
|
|
17
|
+
root: root.address,
|
|
18
|
+
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const v3Factory = (await ethers.getContractAt("IUniswapV3Factory", V3Factory)) as IUniswapV3Factory;
|
|
22
|
+
const nfpm = (await ethers.getContractAt("INonfungiblePositionManager", NFPM)) as INonfungiblePositionManager;
|
|
23
|
+
|
|
24
|
+
// create G$<>Stable pool
|
|
25
|
+
console.log("creating G$<>Stable pool", {
|
|
26
|
+
gd: release.GoodDollar,
|
|
27
|
+
stable: protocolSettings.reserve.reserveToken,
|
|
28
|
+
fee: POOL_FEE
|
|
29
|
+
});
|
|
30
|
+
const poolExists = await v3Factory.getPool(protocolSettings.reserve.reserveToken, release.GoodDollar, POOL_FEE);
|
|
31
|
+
if (poolExists !== ethers.constants.AddressZero) {
|
|
32
|
+
console.log("pool already exists at:", poolExists);
|
|
33
|
+
} else {
|
|
34
|
+
await (
|
|
35
|
+
await v3Factory.createPool(protocolSettings.reserve.reserveToken, release.GoodDollar, POOL_FEE, {
|
|
36
|
+
gasLimit: 5000000
|
|
37
|
+
})
|
|
38
|
+
).wait();
|
|
39
|
+
}
|
|
40
|
+
const gdstablePool = (await ethers.getContractAt(
|
|
41
|
+
"IUniswapV3Pool",
|
|
42
|
+
await v3Factory.getPool(release.GoodDollar, protocolSettings.reserve.reserveToken, POOL_FEE)
|
|
43
|
+
)) as IUniswapV3Pool;
|
|
44
|
+
|
|
45
|
+
//get pool price
|
|
46
|
+
const { sqrtPriceX96 } = await gdstablePool.slot0();
|
|
47
|
+
|
|
48
|
+
const existingPrice = (Number(sqrtPriceX96.toString()) / 2 ** 96) ** 2;
|
|
49
|
+
console.log("created pool at:", gdstablePool.address, { existingPrice });
|
|
50
|
+
let price = BigInt(Math.sqrt(10000 * (10 ** (18 - STABLE_DECIMALS))) * 2 ** 96); //1 G$ = 0.0001 Stable
|
|
51
|
+
let amount1 = ethers.utils.parseUnits("50000", 18);
|
|
52
|
+
let amount0 = ethers.utils.parseUnits("5", STABLE_DECIMALS);
|
|
53
|
+
|
|
54
|
+
if ((await gdstablePool.token0()).toLowerCase() === release.GoodDollar.toLowerCase()) {
|
|
55
|
+
price = BigInt(Math.sqrt(0.0001 * (10 ** (STABLE_DECIMALS - 18))) * 2 ** 96);
|
|
56
|
+
amount0 = ethers.utils.parseUnits("50000", 18);
|
|
57
|
+
amount1 = ethers.utils.parseUnits("5", STABLE_DECIMALS);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (existingPrice > 0) {
|
|
61
|
+
console.log("pool already initialized");
|
|
62
|
+
price = BigInt(Math.sqrt(existingPrice) * 2 ** 96); //1 G$ = 0.0001 Stable
|
|
63
|
+
} else {
|
|
64
|
+
await (await gdstablePool.initialize(price)).wait();
|
|
65
|
+
console.log("initialized pool with price:", price.toString(), { amount0, amount1 });
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// print allowance for nfpm
|
|
69
|
+
const stable = (await ethers.getContractAt("IERC20", protocolSettings.reserve.reserveToken)) as IERC20;
|
|
70
|
+
const gd = (await ethers.getContractAt("IERC20", release.GoodDollar)) as IERC20;
|
|
71
|
+
let stableAllowance = await stable.allowance(root.address, NFPM);
|
|
72
|
+
const gdAllowance = await gd.allowance(root.address, NFPM);
|
|
73
|
+
console.log("stable allowance for NFPM:", ethers.utils.formatUnits(stableAllowance, STABLE_DECIMALS));
|
|
74
|
+
console.log("G$ allowance for NFPM:", ethers.utils.formatUnits(gdAllowance, 18));
|
|
75
|
+
|
|
76
|
+
await (
|
|
77
|
+
await nfpm.mint({
|
|
78
|
+
token0: await gdstablePool.token0(),
|
|
79
|
+
token1: await gdstablePool.token1(),
|
|
80
|
+
fee: POOL_FEE,
|
|
81
|
+
tickLower: -887220,
|
|
82
|
+
tickUpper: 887220,
|
|
83
|
+
amount0Desired: amount0,
|
|
84
|
+
amount1Desired: amount1,
|
|
85
|
+
amount0Min: amount0.mul(8).div(10),
|
|
86
|
+
amount1Min: amount1.mul(8).div(10),
|
|
87
|
+
recipient: root.address,
|
|
88
|
+
deadline: Math.floor(Date.now() / 1000) + 60 * 10
|
|
89
|
+
})
|
|
90
|
+
).wait();
|
|
91
|
+
|
|
92
|
+
console.log("creating gastoken<>Stable pool", {
|
|
93
|
+
gasToken: protocolSettings.reserve.gasToken,
|
|
94
|
+
stable: protocolSettings.reserve.reserveToken,
|
|
95
|
+
fee: POOL_FEE
|
|
96
|
+
});
|
|
97
|
+
const gaspoolExists = await v3Factory.getPool(
|
|
98
|
+
protocolSettings.reserve.gasToken,
|
|
99
|
+
protocolSettings.reserve.reserveToken,
|
|
100
|
+
POOL_FEE
|
|
101
|
+
);
|
|
102
|
+
if (gaspoolExists !== ethers.constants.AddressZero) {
|
|
103
|
+
console.log("pool already exists at:", gaspoolExists);
|
|
104
|
+
} else {
|
|
105
|
+
await (
|
|
106
|
+
await v3Factory.createPool(protocolSettings.reserve.gasToken, protocolSettings.reserve.reserveToken, POOL_FEE, {
|
|
107
|
+
gasLimit: 5000000
|
|
108
|
+
})
|
|
109
|
+
).wait();
|
|
110
|
+
}
|
|
111
|
+
const gasstablePool = (await ethers.getContractAt(
|
|
112
|
+
"IUniswapV3Pool",
|
|
113
|
+
await v3Factory.getPool(protocolSettings.reserve.gasToken, protocolSettings.reserve.reserveToken, POOL_FEE)
|
|
114
|
+
)) as IUniswapV3Pool;
|
|
115
|
+
|
|
116
|
+
//get pool price
|
|
117
|
+
const { sqrtPriceX96: gasSqrtPriceX96 } = await gasstablePool.slot0();
|
|
118
|
+
|
|
119
|
+
const gasexistingPrice = (Number(gasSqrtPriceX96.toString()) / 2 ** 96) ** 2;
|
|
120
|
+
console.log("created pool at:", gasstablePool.address, { gasexistingPrice });
|
|
121
|
+
price = BigInt(Math.sqrt(GASPRICE_STABLE * (10 ** (18 - STABLE_DECIMALS))) * 2 ** 96); //1 G$ = 0.0001 Stable
|
|
122
|
+
amount1 = ethers.utils.parseUnits((5 / GASPRICE_STABLE).toString(), 18);
|
|
123
|
+
amount0 = ethers.utils.parseUnits("5", STABLE_DECIMALS);
|
|
124
|
+
|
|
125
|
+
if ((await gasstablePool.token0()).toLowerCase() === protocolSettings.reserve.gasToken.toLowerCase()) {
|
|
126
|
+
price = BigInt(Math.sqrt(1 / GASPRICE_STABLE / (10 ** (18 - STABLE_DECIMALS))) * 2 ** 96);
|
|
127
|
+
let temp = amount0;
|
|
128
|
+
amount0 = amount1;
|
|
129
|
+
amount1 = temp;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (gasexistingPrice > 0) {
|
|
133
|
+
console.log("pool already initialized");
|
|
134
|
+
price = BigInt(Math.sqrt(gasexistingPrice) * 2 ** 96); //1 G$ = 0.0001 Stable
|
|
135
|
+
} else {
|
|
136
|
+
await (await gasstablePool.initialize(price)).wait();
|
|
137
|
+
console.log("initialized pool with price:", price.toString(), { amount0, amount1 });
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
// print allowance for nfpm
|
|
141
|
+
const gasToken = (await ethers.getContractAt("IERC20", protocolSettings.reserve.gasToken)) as IERC20;
|
|
142
|
+
stableAllowance = await stable.allowance(root.address, NFPM);
|
|
143
|
+
const gasAllowance = await gasToken.allowance(root.address, NFPM);
|
|
144
|
+
console.log("stable allowance for NFPM:", ethers.utils.formatUnits(stableAllowance, STABLE_DECIMALS));
|
|
145
|
+
console.log("weth allowance for NFPM:", ethers.utils.formatUnits(gasAllowance, 18));
|
|
146
|
+
|
|
147
|
+
await (
|
|
148
|
+
await nfpm.mint({
|
|
149
|
+
token0: await gasstablePool.token0(),
|
|
150
|
+
token1: await gasstablePool.token1(),
|
|
151
|
+
fee: POOL_FEE,
|
|
152
|
+
tickLower: -887220,
|
|
153
|
+
tickUpper: 887220,
|
|
154
|
+
amount0Desired: amount0,
|
|
155
|
+
amount1Desired: amount1,
|
|
156
|
+
amount0Min: amount0.mul(8).div(10),
|
|
157
|
+
amount1Min: amount1.mul(8).div(10),
|
|
158
|
+
recipient: root.address,
|
|
159
|
+
deadline: Math.floor(Date.now() / 1000) + 60 * 10
|
|
160
|
+
})
|
|
161
|
+
).wait();
|
|
162
|
+
};
|
|
163
|
+
main();
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
#run with source .env && ./scripts/multichain-deploy/fulldeploy.sh
|
|
2
2
|
NETWORK=$1
|
|
3
3
|
npx hardhat run ./scripts/multichain-deploy/0_proxyFactory-deploy.ts --network $NETWORK
|
|
4
|
-
if [ $? != 0 ]; then
|
|
5
|
-
|
|
6
|
-
fi
|
|
4
|
+
# if [ $? != 0 ]; then
|
|
5
|
+
# exit 1;
|
|
6
|
+
# fi
|
|
7
7
|
npx hardhat run ./scripts/multichain-deploy/1_basicdao-deploy.ts --network $NETWORK
|
|
8
|
-
if [ $? != 0 ]; then
|
|
9
|
-
|
|
10
|
-
fi
|
|
8
|
+
# if [ $? != 0 ]; then
|
|
9
|
+
# exit 1;
|
|
10
|
+
# fi
|
|
11
11
|
npx hardhat run ./scripts/multichain-deploy/2_helpers-deploy.ts --network $NETWORK
|
|
12
|
-
if [ $? != 0 ]; then
|
|
13
|
-
|
|
14
|
-
fi
|
|
15
|
-
npx hardhat run ./scripts/multichain-deploy/3_gdSavings-deploy.ts --network $NETWORK
|
|
16
|
-
if [ $? != 0 ]; then
|
|
17
|
-
|
|
18
|
-
fi
|
|
12
|
+
# # if [ $? != 0 ]; then
|
|
13
|
+
# # exit 1;
|
|
14
|
+
# # fi
|
|
15
|
+
# npx hardhat run ./scripts/multichain-deploy/3_gdSavings-deploy.ts --network $NETWORK
|
|
16
|
+
# if [ $? != 0 ]; then
|
|
17
|
+
# exit 1;
|
|
18
|
+
# fi
|
|
19
19
|
npx hardhat run ./scripts/multichain-deploy/4_ubi-deploy.ts --network $NETWORK
|
|
20
20
|
if [ $? != 0 ]; then
|
|
21
21
|
exit 1;
|
|
22
22
|
fi
|
|
23
|
-
npx hardhat run ./scripts/multichain-deploy/5_gov-deploy.ts --network $NETWORK
|
|
24
|
-
if [ $? != 0 ]; then
|
|
25
|
-
|
|
26
|
-
fi
|
|
23
|
+
# npx hardhat run ./scripts/multichain-deploy/5_gov-deploy.ts --network $NETWORK
|
|
24
|
+
# if [ $? != 0 ]; then
|
|
25
|
+
# exit 1;
|
|
26
|
+
# fi
|
|
@@ -67,6 +67,7 @@ export const deploySuperGoodDollar = async (
|
|
|
67
67
|
[superfluidHost]
|
|
68
68
|
).then(printDeploy)) as Contract;
|
|
69
69
|
|
|
70
|
+
console.log("supergoodollar logic deployed:", SuperGoodDollar.address);
|
|
70
71
|
const uupsFactory = await ethers.getContractFactory("UUPSProxy");
|
|
71
72
|
const GoodDollarProxy = (await deployDeterministic(
|
|
72
73
|
{
|
|
@@ -75,9 +76,13 @@ export const deploySuperGoodDollar = async (
|
|
|
75
76
|
},
|
|
76
77
|
[]
|
|
77
78
|
).then(printDeploy)) as Contract;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
console.log("supergoodollar proxy deployed:", GoodDollarProxy.address);
|
|
80
|
+
try {
|
|
81
|
+
await GoodDollarProxy.initializeProxy(SuperGoodDollar.address).then(printDeploy);
|
|
82
|
+
} catch (e) {
|
|
83
|
+
console.log("failed initialized supergd proxy. probably already was init");
|
|
84
|
+
}
|
|
85
|
+
console.log("supergoodollar proxy initialized:", GoodDollarProxy.address);
|
|
81
86
|
let OutFlowNFT = await ethers.getContractAt("ConstantOutflowNFT", ethers.constants.AddressZero);
|
|
82
87
|
let InFlowNFT = await ethers.getContractAt("ConstantOutflowNFT", ethers.constants.AddressZero);
|
|
83
88
|
|
|
@@ -103,9 +108,13 @@ export const deploySuperGoodDollar = async (
|
|
|
103
108
|
await InFlowNFT.initializeProxy(superfluidInflowNFTLogic);
|
|
104
109
|
}
|
|
105
110
|
console.log("initializing supergooddollar");
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
try {
|
|
112
|
+
await SuperGoodDollar.attach(GoodDollarProxy.address)[
|
|
113
|
+
"initialize(string,string,uint256,address,address,address,address)"
|
|
114
|
+
](...tokenArgs);
|
|
115
|
+
} catch (e) {
|
|
116
|
+
console.log("failed initializing supergd. probably already was init");
|
|
117
|
+
}
|
|
109
118
|
|
|
110
119
|
const GoodDollar = await ethers.getContractAt("ISuperGoodDollar", GoodDollarProxy.address);
|
|
111
120
|
|
|
@@ -224,6 +233,67 @@ export const deployDeterministic = async (contract, args: any[], factoryOpts = {
|
|
|
224
233
|
}
|
|
225
234
|
};
|
|
226
235
|
|
|
236
|
+
export const upgradeDeterministicToNewImplViaGuardian = async (contract, factoryOpts = {}) => {
|
|
237
|
+
try {
|
|
238
|
+
let proxyFactory: ProxyFactory1967;
|
|
239
|
+
proxyFactory = (await ethers.getContractAt("ProxyFactory1967", release.ProxyFactory)) as ProxyFactory1967;
|
|
240
|
+
const Contract =
|
|
241
|
+
(contract.factory as ContractFactory) || (await ethers.getContractFactory(contract.name, factoryOpts));
|
|
242
|
+
|
|
243
|
+
const salt = ethers.BigNumber.from(
|
|
244
|
+
ethers.utils.keccak256(ethers.utils.toUtf8Bytes(contract.salt || contract.name))
|
|
245
|
+
);
|
|
246
|
+
|
|
247
|
+
if (contract.isUpgradeable === true) {
|
|
248
|
+
const proxyAddr = await proxyFactory["getDeploymentAddress(uint256,address)"](
|
|
249
|
+
salt,
|
|
250
|
+
await proxyFactory.signer.getAddress()
|
|
251
|
+
);
|
|
252
|
+
const code = await ethers.provider.getCode(proxyAddr);
|
|
253
|
+
if (code && code !== "0x") {
|
|
254
|
+
const implAddr = await getImplementationAddress(ethers.provider, proxyAddr).catch(e => "0x");
|
|
255
|
+
if (implAddr && implAddr !== "0x") {
|
|
256
|
+
console.log("proxy exists and impl set already:", contract.name, proxyAddr, implAddr);
|
|
257
|
+
console.log("Deploying:", contract.name, " implementation", {
|
|
258
|
+
proxyAddr
|
|
259
|
+
});
|
|
260
|
+
|
|
261
|
+
const tx = await Contract.deploy(GAS_SETTINGS);
|
|
262
|
+
const impl = await tx.deployed();
|
|
263
|
+
console.log("implementation deployed:", contract.name, impl.address);
|
|
264
|
+
await countTotalGas(tx, contract.name);
|
|
265
|
+
|
|
266
|
+
const proposalContracts = [release.DistributionHelper];
|
|
267
|
+
|
|
268
|
+
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
269
|
+
|
|
270
|
+
const proposalFunctionSignatures = [
|
|
271
|
+
"upgradeTo(address)" //add ubischeme
|
|
272
|
+
];
|
|
273
|
+
|
|
274
|
+
const proposalFunctionInputs = [ethers.utils.defaultAbiCoder.encode(["address"], [impl.address])];
|
|
275
|
+
let [root] = await ethers.getSigners();
|
|
276
|
+
await executeViaGuardian(
|
|
277
|
+
proposalContracts,
|
|
278
|
+
proposalEthValues,
|
|
279
|
+
proposalFunctionSignatures,
|
|
280
|
+
proposalFunctionInputs,
|
|
281
|
+
root
|
|
282
|
+
);
|
|
283
|
+
|
|
284
|
+
console.log("proxy upgraded:", contract.name, { proxyAddr, implAddr: impl.address });
|
|
285
|
+
return Contract.attach(proxyAddr);
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
} else {
|
|
289
|
+
console.log("This contract is not upgradeable");
|
|
290
|
+
}
|
|
291
|
+
} catch (e) {
|
|
292
|
+
console.log("Failed deploying contract:", { contract });
|
|
293
|
+
throw e;
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
|
|
227
297
|
export const executeViaGuardian = async (
|
|
228
298
|
contracts,
|
|
229
299
|
ethValues,
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { network, ethers, upgrades, run } from "hardhat";
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
deployDeterministic,
|
|
5
|
+
deploySuperGoodDollar,
|
|
6
|
+
verifyProductionSigner,
|
|
7
|
+
verifyContract,
|
|
8
|
+
verifyOnEtherscan
|
|
9
|
+
} from "./helpers";
|
|
10
|
+
import releaser from "../releaser";
|
|
11
|
+
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
12
|
+
import dao from "../../releases/deployment.json";
|
|
13
|
+
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
14
|
+
|
|
15
|
+
const main = async () => {
|
|
16
|
+
const release = dao[network.name] || {};
|
|
17
|
+
console.log("verifying network:", network.name, release);
|
|
18
|
+
const protocolSettings = ProtocolSettings[network.name] || ProtocolSettings["default"];
|
|
19
|
+
// await verifyContract(release.ProxyFactory, "contracts/utils/ProxyFactory1967.sol:ProxyFactory1967");
|
|
20
|
+
// await verifyContract(release.Identity, "contracts/utils/ProxyFactory1967.sol:ERC1967Proxy", false);
|
|
21
|
+
// await verifyContract(release.Identity, "contracts/identity/IdentityV3.sol:IdentityV3", network.name);
|
|
22
|
+
// await verifyContract(release.NameService, "contracts/utils/NameService.sol:NameService", network.name);
|
|
23
|
+
// if (protocolSettings.superfluidHost) {
|
|
24
|
+
// await verifyContract(release.GoodDollar, "contracts/token/superfluid/UUPSProxy.sol:UUPSProxy", network.name, false);
|
|
25
|
+
// await verifyContract(
|
|
26
|
+
// release.GoodDollar,
|
|
27
|
+
// "contracts/token/superfluid/SuperGoodDollar.sol:SuperGoodDollar",
|
|
28
|
+
// network.name,
|
|
29
|
+
// true,
|
|
30
|
+
// ethers.constants.AddressZero
|
|
31
|
+
// );
|
|
32
|
+
// } else {
|
|
33
|
+
// await verifyContract(release.GoodDollar, "contracts/token/GoodDollar.sol:GoodDollar", network.name);
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
// await verifyContract(release.AdminWallet, "contracts/utils/AdminWallet.sol:AdminWallet", network.name);
|
|
37
|
+
// await verifyContract(release.Faucet, "contracts/fuseFaucet/Faucet.sol:Faucet", network.name);
|
|
38
|
+
// await verifyContract(release.Invites, "contracts/invite/InvitesV2.sol:InvitesV2", network.name);
|
|
39
|
+
await verifyContract(release.UBIScheme, "contracts/ubi/UBISchemeV2.sol:UBISchemeV2", network.name);
|
|
40
|
+
};
|
|
41
|
+
main();
|