@gooddollar/goodprotocol 2.1.3 → 2.2.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/artifacts/abis/IdentityV4.min.json +1 -0
- package/artifacts/contracts/DAOStackInterfaces.sol/Avatar.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/Controller.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/GlobalConstraintInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/IntVoteInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/ReputationInterface.dbg.json +1 -1
- package/artifacts/contracts/DAOStackInterfaces.sol/SchemeRegistrar.dbg.json +1 -1
- package/artifacts/contracts/IUniswapV3.sol/INonfungiblePositionManager.dbg.json +1 -1
- package/artifacts/contracts/IUniswapV3.sol/IUniswapV3Pool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/AggregatorV3Interface.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ERC20.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAaveIncentivesController.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IAdminWallet.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IDonationStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IERC2917.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IFirstClaimPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IGoodStaking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IHasRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentity.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IIdentityV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ILendingPool.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IMultichainRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/INameService.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IQuoterV2.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ISwapRouter.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/IUBIScheme.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/ProxyAdmin.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Reserve.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Staking.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/Uniswap.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapFactory.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/UniswapPair.dbg.json +1 -1
- package/artifacts/contracts/Interfaces.sol/cERC20.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBancorExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IBroker.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExchangeProvider.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IGoodDollarExpansionController.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/IMentoReserve.dbg.json +1 -1
- package/artifacts/contracts/MentoInterfaces.sol/ITradingLimits.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/Faucet.sol/Faucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucet.sol/FuseFaucet.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/FuseFaucetV2.sol/FuseFaucetV2.dbg.json +1 -1
- package/artifacts/contracts/fuseFaucet/SuperfluidFacuet.sol/SuperfluidFaucet.dbg.json +1 -1
- package/artifacts/contracts/governance/ClaimersDistribution.sol/ClaimersDistribution.dbg.json +1 -1
- package/artifacts/contracts/governance/CompoundVotingMachine.sol/CompoundVotingMachine.dbg.json +1 -1
- package/artifacts/contracts/governance/GReputation.sol/GReputation.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking.json +2 -2
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IGovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/IStakingUpgrade.dbg.json +1 -1
- package/artifacts/contracts/governance/GoodDollarStaking.sol/RewardsMinter.dbg.json +1 -1
- package/artifacts/contracts/governance/GovernanceStaking.sol/GovernanceStaking.dbg.json +1 -1
- package/artifacts/contracts/governance/MultiBaseGovernanceShareField.sol/MultiBaseGovernanceShareField.dbg.json +1 -1
- package/artifacts/contracts/governance/Reputation.sol/Reputation.dbg.json +1 -1
- package/artifacts/contracts/governance/StakersDistribution.sol/StakersDistribution.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV2.sol/IdentityV2.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.dbg.json +1 -1
- package/artifacts/contracts/identity/IdentityV3.sol/IdentityV3.json +2 -2
- package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.dbg.json +4 -0
- package/artifacts/contracts/identity/IdentityV4.sol/IdentityV4.json +1162 -0
- package/artifacts/contracts/invite/InvitesFuseV2.sol/InvitesFuseV2.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV1.sol/InvitesV1.dbg.json +1 -1
- package/artifacts/contracts/invite/InvitesV2.sol/InvitesV2.dbg.json +1 -1
- package/artifacts/contracts/invite/OneTimeReward.sol/OneTimeReward.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveMock.sol/AaveMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/AaveUSDMockOracle.sol/AaveUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/BatUSDMockOracle.sol/BatUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/CeloDistributionHelperTest.sol/CeloDistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/CompUsdMockOracle.sol/CompUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DAIMock.sol/DAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DaiEthPriceMockOracle.sol/DaiEthPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/DecimalsMock.sol/DecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionBridgeMock.sol/DistributionBridgeMock.json +2 -2
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/DistributionHelperTest.sol/DistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/EthUSDMockOracle.sol/EthUSDMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/FeesFormularMock.sol/FeesFormulaMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GasPriceMockOracle.sol/GasPriceMockOracle.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GenericDistributionHelperTest.sol/GenericDistributionHelperTestHelper.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodCompoundStakingTest.sol/GoodCompoundStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/GoodDollarStakingMock.sol/GoodDollarStakingMock.json +2 -2
- package/artifacts/contracts/mocks/GoodFundManagerTest.sol/GoodFundManagerTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/IdentityMock.sol/IdentityMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/IncentiveControllerMock.sol/IncentiveControllerMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/LendingPoolMock.sol/LendingPoolMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/IWrapper.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock.json +2 -2
- package/artifacts/contracts/mocks/OverMintTester.sol/IGoodDollarStakingTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTester.sol/OverMintTester.dbg.json +1 -1
- package/artifacts/contracts/mocks/OverMintTesterRegularStake.sol/OverMintTesterRegularStake.dbg.json +1 -1
- package/artifacts/contracts/mocks/PayableMock.sol/PayableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/SixteenDecimalsTokenMock.sol/SixteenDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/mocks/StakingMockFixedAPY.sol/StakingMockFixedAPY.json +2 -2
- package/artifacts/contracts/mocks/SwapHelperTest.sol/SwapHelperTest.dbg.json +1 -1
- package/artifacts/contracts/mocks/TwentyDecimalsTokenMock.sol/TwentyDecimalsTokenMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock2.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock3.dbg.json +1 -1
- package/artifacts/contracts/mocks/UpgradableMocks.sol/UpgradableMock4.dbg.json +1 -1
- package/artifacts/contracts/mocks/UsdcMock.sol/USDCMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cBATMock.sol/cBATMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAILowWorthMock.sol/cDAILowWorthMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAIMock.sol/cDAIMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDAINonMintableMock.sol/cDAINonMintableMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cDecimalsMock.sol/cDecimalsMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cSDTMock.sol/cSDTMock.dbg.json +1 -1
- package/artifacts/contracts/mocks/cUSDCMock.sol/cUSDCMock.dbg.json +1 -1
- package/artifacts/contracts/reserve/CeloDistributionHelper.sol/CeloDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/DistributionHelper.sol/DistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/ExchangeHelper.sol/ExchangeHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GenericDistributionHelper.sol/GenericDistributionHelper.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodMarketMaker.sol/GoodMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/ContributionCalc.dbg.json +1 -1
- package/artifacts/contracts/reserve/GoodReserveCDai.sol/GoodReserveCDai.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareField.sol/BaseShareField.dbg.json +1 -1
- package/artifacts/contracts/staking/BaseShareFieldV2.sol/BaseShareFieldV2.dbg.json +1 -1
- package/artifacts/contracts/staking/DonationsStaking.sol/DonationsStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/FuseStakingV3.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/IConsensus.dbg.json +1 -1
- package/artifacts/contracts/staking/FuseStakingV3.sol/PegSwap.dbg.json +1 -1
- package/artifacts/contracts/staking/GoodFundManager.sol/GoodFundManager.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStaking.sol/SimpleStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/SimpleStakingV2.sol/SimpleStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/UniswapV2SwapHelper.sol/UniswapV2SwapHelper.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/AaveStakingFactory.sol/AaveStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStaking.sol/GoodAaveStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/aave/GoodAaveStakingV2.sol/GoodAaveStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/CompoundStakingFactory.sol/CompoundStakingFactory.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStaking.sol/GoodCompoundStaking.dbg.json +1 -1
- package/artifacts/contracts/staking/compound/GoodCompoundStakingV2.sol/GoodCompoundStakingV2.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/Math64X64.sol/Math64x64.dbg.json +1 -1
- package/artifacts/contracts/staking/utils/StakingRewardsFixedAPY.sol/StakingRewardsFixedAPY.dbg.json +1 -1
- package/artifacts/contracts/token/ERC20PresetMinterPauserUpgradeable.sol/ERC20PresetMinterPauserUpgradeable.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677.dbg.json +1 -1
- package/artifacts/contracts/token/ERC677.sol/ERC677Receiver.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar.sol/GoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/GoodDollar2.sol/GoodDollar2.dbg.json +1 -1
- package/artifacts/contracts/token/IFeesFormula.sol/IFeesFormula.dbg.json +1 -1
- package/artifacts/contracts/token/MultichainFeeFormula.sol/MultichainFeeFormula.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/ERC20Permit.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ERC20Permit.sol/SelfApprove.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/IGoodDollarCustom.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperGoodDollar.sol/ISuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/ISuperToken.sol/ISuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperGoodDollar.sol/SuperGoodDollar.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperToken.sol/SuperToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/SuperfluidToken.sol/SuperfluidToken.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxiable.sol/UUPSProxiable.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/Proxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSProxy.dbg.json +1 -1
- package/artifacts/contracts/token/superfluid/UUPSProxy.sol/UUPSUtils.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBIScheme.sol/UBIScheme.dbg.json +1 -1
- package/artifacts/contracts/ubi/UBISchemeV2.sol/UBISchemeV2.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWallet.sol/AdminWallet.dbg.json +1 -1
- package/artifacts/contracts/utils/AdminWalletFuse.sol/AdminWalletFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/BancorFormula.sol/BancorFormula.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkProof.sol/BulkProof.dbg.json +1 -1
- package/artifacts/contracts/utils/BulkWhitelist.sol/BulkWhitelist.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyAndBridgeHelper.sol/BuyAndBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyFromReserveHelper.sol/BuyFromReserveHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/BuyGDCloneFactory.dbg.json +1 -1
- package/artifacts/contracts/utils/BuyGDClone.sol/DonateGDClone.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOContract.sol/DAOContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DAOUpgradeableContract.sol/DAOUpgradeableContract.dbg.json +1 -1
- package/artifacts/contracts/utils/DSMath.sol/DSMath.dbg.json +1 -1
- package/artifacts/contracts/utils/DataTypes.sol/DataTypes.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/EternalStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/FuseOldBridgeKill.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/IUpgradeabilityOwnerStorage.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Initializable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Ownable.dbg.json +1 -1
- package/artifacts/contracts/utils/FuseOldBridgeKill.sol/Upgradeable.dbg.json +1 -1
- package/artifacts/contracts/utils/GDFaucet.sol/GDFaucet.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/GoodDollarMintBurnWrapper.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/IRouter.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/PausableControl.dbg.json +1 -1
- package/artifacts/contracts/utils/GoodDollarMintBurnWrapper.sol/TokenOperation.dbg.json +1 -1
- package/artifacts/contracts/utils/IdentityFix.sol/IdentityFix.dbg.json +1 -1
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.dbg.json +1 -1
- package/artifacts/contracts/utils/LastauthReduction.sol/LastauthReduction.json +2 -2
- package/artifacts/contracts/utils/MultiCall.sol/Multicall.dbg.json +1 -1
- package/artifacts/contracts/utils/MultichainBridgeHelper.sol/MultichainBridgeHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/NameService.sol/NameService.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePayments.sol/OneTimePayments.dbg.json +1 -1
- package/artifacts/contracts/utils/OneTimePaymentsV2.sol/OneTimePaymentsV2.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/MentoExchange.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtoclUpgradeV4Mento.sol/ProtocolUpgradeV4Mento.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/OldMarketMaker.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgrade.sol/ProtocolUpgrade.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuse.sol/ProtocolUpgradeFuse.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeFuseRecover.sol/ProtocolUpgradeFuseRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProtocolUpgradeRecover.sol/ProtocolUpgradeRecover.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ERC1967Proxy.dbg.json +1 -1
- package/artifacts/contracts/utils/ProxyFactory1967.sol/ProxyFactory1967.dbg.json +1 -1
- package/artifacts/contracts/utils/ReputationTestHelper.sol/ReputationTestHelper.dbg.json +1 -1
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.dbg.json +1 -1
- package/artifacts/contracts/utils/ReserveRestore.sol/ReserveRestore.json +2 -2
- package/contracts/identity/IdentityV3.sol +0 -3
- package/contracts/identity/IdentityV4.sol +578 -0
- package/hardhat.config.ts +3 -4
- package/package.json +8 -4
- package/test/governance/ClaimersDistribution.test.ts +1 -1
- package/test/governance/CompoundVotingMachine.castvote.test.ts +30 -30
- package/test/helpers.ts +76 -195
- package/test/identity/IdentityV3.test.ts +53 -129
- package/test/identity/IdentityV4.test.ts +454 -0
- package/test/reserve/GenericDistributionHelper.e2e.test.ts +445 -0
- package/test/utils/AdminWallet.test.ts +14 -15
- package/types/contracts/identity/IdentityV4.ts +2001 -0
- package/types/contracts/identity/index.ts +1 -0
- package/types/contracts/utils/UpdateReserveRatio.sol/MentoExchange.ts +81 -0
- package/types/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio.ts +134 -0
- package/types/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
- package/types/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC.ts +7 -2
- package/types/contracts/utils/index.ts +2 -2
- package/types/factories/contracts/governance/GoodDollarStaking.sol/GoodDollarStaking__factory.ts +1 -1
- package/types/factories/contracts/identity/IdentityV3__factory.ts +1 -1
- package/types/factories/contracts/identity/IdentityV4__factory.ts +1213 -0
- package/types/factories/contracts/identity/index.ts +1 -0
- package/types/factories/contracts/mocks/DistributionBridgeMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/GoodDollarStakingMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/MultichainRouterMock.sol/MultichainRouterMock__factory.ts +1 -1
- package/types/factories/contracts/mocks/StakingMockFixedAPY__factory.ts +1 -1
- package/types/factories/contracts/utils/LastauthReduction__factory.ts +1 -1
- package/types/factories/contracts/utils/ReserveRestore__factory.ts +1 -1
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/MentoExchange__factory.ts +39 -0
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/UpdateReserveRatio__factory.ts +113 -0
- package/types/factories/contracts/utils/UpdateReserveRatio.sol/index.ts +5 -0
- package/types/factories/contracts/utils/UpdateReserveRatioAfterXDC.sol/UpdateReserveRatioAfterXDC__factory.ts +9 -15
- package/types/factories/contracts/utils/index.ts +1 -1
- package/types/hardhat.d.ts +13 -4
- package/types/index.ts +4 -2
- package/scripts/ProxyFactory.json +0 -4425
- package/scripts/analytics/activeGDStakers.ts +0 -188
- package/scripts/analytics/activeStakers.ts +0 -25
- package/scripts/analytics/activeUsersCount.ts +0 -156
- package/scripts/analytics/activeWalletsStats.ts +0 -301
- package/scripts/analytics/checkActiveWallets.ts +0 -60
- package/scripts/analytics/checkBridgeBalances.ts +0 -442
- package/scripts/analytics/claimIncidentStats.ts +0 -98
- package/scripts/analytics/faucetStats.ts +0 -130
- package/scripts/analytics/gdinflow.ts +0 -57
- package/scripts/analytics/goodHolders.ts +0 -46
- package/scripts/analytics/goodgiveback.ts +0 -64
- package/scripts/analytics/p2pTxs.ts +0 -564
- package/scripts/analytics/stuckgd.ts +0 -70
- package/scripts/analytics/tokenInOutStats.ts +0 -48
- package/scripts/analytics/whitelistsyncIssue.ts +0 -87
- package/scripts/bulkProof.ts +0 -202
- package/scripts/bulkWhitelist.ts +0 -31
- package/scripts/deployGnosisSafe.ts +0 -111
- package/scripts/fetchOrDeployProxyFactory.ts +0 -46
- package/scripts/fv.ts +0 -263
- package/scripts/gdx/gdxAirdropCalculation.ts +0 -479
- package/scripts/getFounders.ts +0 -32
- package/scripts/governance/README.md +0 -70
- package/scripts/governance/airdropCalculation.ts +0 -1119
- package/scripts/governance/airdropCalculationRecover.ts +0 -416
- package/scripts/governance/airdropCalculationSorted.ts +0 -438
- package/scripts/governance/goodCheckpointSorted.ts +0 -300
- package/scripts/keeper/fishInactive.ts +0 -47
- package/scripts/minimize.sh +0 -17
- package/scripts/multichain-deploy/0_proxyFactory-deploy.ts +0 -131
- package/scripts/multichain-deploy/1_basicdao-deploy.ts +0 -294
- package/scripts/multichain-deploy/2_helpers-deploy.ts +0 -152
- package/scripts/multichain-deploy/2b_otp-deploy.ts +0 -73
- package/scripts/multichain-deploy/3_gdSavings-deploy.ts +0 -190
- package/scripts/multichain-deploy/4_ubi-deploy.ts +0 -129
- package/scripts/multichain-deploy/5_gov-deploy.ts +0 -179
- package/scripts/multichain-deploy/6_testnetFaucet.ts +0 -85
- package/scripts/multichain-deploy/7_superfluidfaucet-deploy.ts +0 -123
- package/scripts/multichain-deploy/8_disthelper-deploy.ts +0 -152
- package/scripts/multichain-deploy/createUniswapTestPools.ts +0 -163
- package/scripts/multichain-deploy/flattened/Avatar.sol +0 -913
- package/scripts/multichain-deploy/flattened/Controller.sol +0 -1891
- package/scripts/multichain-deploy/flattened/FeeFormula.sol +0 -1290
- package/scripts/multichain-deploy/fulldeploy.sh +0 -26
- package/scripts/multichain-deploy/helpers.ts +0 -647
- package/scripts/multichain-deploy/multichainWrapper-deploy.ts +0 -59
- package/scripts/multichain-deploy/verifyEtherscan.ts +0 -177
- package/scripts/proposals/gip-14_1.ts +0 -251
- package/scripts/proposals/gip-15.ts +0 -427
- package/scripts/proposals/gip-25-xdc-upgrade-ubi.ts +0 -746
- package/scripts/proposals/gips-14_1.md +0 -29
- package/scripts/proposals/hack-ubi-recovery.ts +0 -414
- package/scripts/proposals/identityAuthPeriod.ts +0 -229
- package/scripts/proposals/reserveRestore.ts +0 -474
- package/scripts/proposals/updateDistHelper.ts +0 -180
- package/scripts/proposals/v4Upgrade.ts +0 -845
- package/scripts/releaser.js +0 -24
- package/scripts/staking/stakersGdRewardsCalculation.ts +0 -64
- package/scripts/upgradeScheme.ts +0 -97
- package/scripts/upgradeToV2/upgradeToV2.ts +0 -853
- package/scripts/upgradeToV2/upgradeToV2Recover.ts +0 -939
- package/scripts/upgradeToV3/v3-fix.ts +0 -120
- package/scripts/upgradeToV3/v3-fuse-multichain.ts +0 -117
- package/scripts/upgradeToV3/v3-upgrade.ts +0 -219
- package/scripts/upgrades/celo-defi-ubi-deploy.ts +0 -184
- package/scripts/upgrades/identity-upgrade.ts +0 -126
- package/scripts/upgrades/multichain-formula-upgrade.ts +0 -143
- package/scripts/upgrades/multichain-temp-fix.ts +0 -129
- package/scripts/upgrades/restoreFunds.ts +0 -91
- package/scripts/upgrades/superfluid-nft-celo-gas-token.ts +0 -159
- package/scripts/upgrades/transferDaoToGuardians.ts +0 -80
- package/scripts/upgrades/upgradeAdminWallet.ts +0 -29
- package/scripts/upgrades/upgradeFaucet.ts +0 -46
- package/scripts/utils.ts +0 -50
- package/scripts/verify.ts +0 -67
- package/scripts/voltageswaps.ts +0 -46
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/***
|
|
2
|
-
* to get same addresses as on Celo
|
|
3
|
-
* deploy proxyfactory with 0x271cd5391016eb621aB3f9c0c70F5cF91DFd3FB0 with nonce 2
|
|
4
|
-
* create a gnosissafe with 0x3de7216149f12d8f51540d9a870149560fc11bfb with nonce 3
|
|
5
|
-
* run this script with 0x3de7216149f12d8f51540d9a870149560fc11bfb with nonce 7
|
|
6
|
-
*/
|
|
7
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
8
|
-
import { Contract } from "ethers";
|
|
9
|
-
import { defaultsDeep } from "lodash";
|
|
10
|
-
// import DAOCreatorABI from "@gooddollar/goodcontracts/build/contracts/DaoCreatorGoodDollar.json";
|
|
11
|
-
import DAOCreatorABI from "@gooddollar/goodcontracts/build/contracts/DaoCreatorGoodDollarWithTokens.json";
|
|
12
|
-
// import IdentityABI from "@gooddollar/goodcontracts/build/contracts/Identity.json";
|
|
13
|
-
import FeeFormulaABI from "@gooddollar/goodcontracts/build/contracts/FeeFormula.json";
|
|
14
|
-
|
|
15
|
-
import {
|
|
16
|
-
deployDeterministic,
|
|
17
|
-
deploySuperGoodDollar,
|
|
18
|
-
verifyProductionSigner,
|
|
19
|
-
verifyContract,
|
|
20
|
-
verifyOnEtherscan
|
|
21
|
-
} from "./helpers";
|
|
22
|
-
import releaser from "../releaser";
|
|
23
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
24
|
-
import dao from "../../releases/deployment.json";
|
|
25
|
-
import { TransactionResponse } from "@ethersproject/providers";
|
|
26
|
-
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
27
|
-
import { IdentityV3 } from "../../types";
|
|
28
|
-
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
29
|
-
if (c instanceof Contract) {
|
|
30
|
-
await c.deployed();
|
|
31
|
-
console.log("deployed to: ", c.address);
|
|
32
|
-
}
|
|
33
|
-
if (c.wait) {
|
|
34
|
-
await c.wait();
|
|
35
|
-
console.log("tx done:", c.hash);
|
|
36
|
-
}
|
|
37
|
-
return c;
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
export const createDAO = async () => {
|
|
41
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
42
|
-
|
|
43
|
-
let release: { [key: string]: any } = dao[network.name] || {};
|
|
44
|
-
const isProduction = network.name.includes("production");
|
|
45
|
-
|
|
46
|
-
let [root] = await ethers.getSigners();
|
|
47
|
-
|
|
48
|
-
const daoOwner = root.address;
|
|
49
|
-
if (isProduction) verifyProductionSigner(root);
|
|
50
|
-
|
|
51
|
-
console.log("got signers:", {
|
|
52
|
-
network,
|
|
53
|
-
daoOwner,
|
|
54
|
-
root: root.address,
|
|
55
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
|
|
56
|
-
release
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
const DAOCreatorFactory = new ethers.ContractFactory(DAOCreatorABI.abi, DAOCreatorABI.bytecode, root);
|
|
60
|
-
|
|
61
|
-
const FeeFormulaFactory = new ethers.ContractFactory(FeeFormulaABI.abi, FeeFormulaABI.bytecode, root);
|
|
62
|
-
|
|
63
|
-
console.log("deploying identity");
|
|
64
|
-
let Identity: IdentityV3;
|
|
65
|
-
if (release.Identity) Identity = (await ethers.getContractAt("IdentityV3", release.Identity)) as IdentityV3;
|
|
66
|
-
else
|
|
67
|
-
Identity = (await deployDeterministic(
|
|
68
|
-
{
|
|
69
|
-
name: "IdentityV3",
|
|
70
|
-
salt: "Identity",
|
|
71
|
-
isUpgradeable: true
|
|
72
|
-
},
|
|
73
|
-
[root.address, ethers.constants.AddressZero]
|
|
74
|
-
).then(printDeploy)) as IdentityV3;
|
|
75
|
-
|
|
76
|
-
let daoCreator;
|
|
77
|
-
if (release.DAOCreator) daoCreator = await DAOCreatorFactory.attach(release.DAOCreator);
|
|
78
|
-
else {
|
|
79
|
-
daoCreator = await deployDeterministic(
|
|
80
|
-
{
|
|
81
|
-
name: "DAOCreator",
|
|
82
|
-
factory: DAOCreatorFactory,
|
|
83
|
-
isUpgradeable: false
|
|
84
|
-
},
|
|
85
|
-
[]
|
|
86
|
-
);
|
|
87
|
-
// daoCreator = (await DAOCreatorFactory.deploy().then(printDeploy)) as Contract;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let FeeFormula;
|
|
91
|
-
if (release.FeeFormula) FeeFormula = await FeeFormulaFactory.attach(release.FeeFormula);
|
|
92
|
-
else
|
|
93
|
-
FeeFormula = (await deployDeterministic({ name: "FeeFormula", factory: FeeFormulaFactory }, [0]).then(
|
|
94
|
-
printDeploy
|
|
95
|
-
)) as Contract;
|
|
96
|
-
|
|
97
|
-
let GoodDollar;
|
|
98
|
-
let { superfluidHost, superfluidInflowNFTLogic, superfluidOutflowNFTLogic } = protocolSettings;
|
|
99
|
-
if (protocolSettings.superfluidHost) {
|
|
100
|
-
GoodDollar = await deploySuperGoodDollar(
|
|
101
|
-
{
|
|
102
|
-
superfluidHost,
|
|
103
|
-
superfluidInflowNFTLogic,
|
|
104
|
-
superfluidOutflowNFTLogic
|
|
105
|
-
},
|
|
106
|
-
[
|
|
107
|
-
isProduction ? "GoodDollar" : "GoodDollar Dev",
|
|
108
|
-
"G$",
|
|
109
|
-
0,
|
|
110
|
-
FeeFormula.address,
|
|
111
|
-
Identity.address,
|
|
112
|
-
ethers.constants.AddressZero,
|
|
113
|
-
daoCreator.address
|
|
114
|
-
]
|
|
115
|
-
);
|
|
116
|
-
} else {
|
|
117
|
-
GoodDollar = (await deployDeterministic(
|
|
118
|
-
{
|
|
119
|
-
name: "GoodDollar",
|
|
120
|
-
isUpgradeable: true,
|
|
121
|
-
initializer: "initialize(string, string, uint256, address, address, address,address)"
|
|
122
|
-
},
|
|
123
|
-
[
|
|
124
|
-
isProduction ? "GoodDollar" : "GoodDollar Dev",
|
|
125
|
-
"G$",
|
|
126
|
-
0,
|
|
127
|
-
FeeFormula.address,
|
|
128
|
-
Identity.address,
|
|
129
|
-
ethers.constants.AddressZero,
|
|
130
|
-
daoCreator.address
|
|
131
|
-
]
|
|
132
|
-
).then(printDeploy)) as Contract;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const avatar = release.Avatar || (await daoCreator.avatar());
|
|
136
|
-
let Avatar = new ethers.Contract(
|
|
137
|
-
avatar,
|
|
138
|
-
["function owner() view returns (address)", "function nativeToken() view returns (address)"],
|
|
139
|
-
root
|
|
140
|
-
);
|
|
141
|
-
if (avatar === ethers.constants.AddressZero) {
|
|
142
|
-
console.log("creating dao");
|
|
143
|
-
await daoCreator.forgeOrg(GoodDollar.address, ethers.constants.AddressZero, [], 0, []).then(printDeploy);
|
|
144
|
-
console.log("forgeOrg done ");
|
|
145
|
-
console.log("Done deploying DAO, setting schemes permissions");
|
|
146
|
-
|
|
147
|
-
Avatar = new ethers.Contract(
|
|
148
|
-
await daoCreator.avatar(),
|
|
149
|
-
["function owner() view returns (address)", "function nativeToken() view returns (address)"],
|
|
150
|
-
root
|
|
151
|
-
);
|
|
152
|
-
let schemes = [daoOwner, release.GuardiansSafe];
|
|
153
|
-
|
|
154
|
-
console.log("setting schemes", schemes);
|
|
155
|
-
|
|
156
|
-
await daoCreator
|
|
157
|
-
.setSchemes(
|
|
158
|
-
Avatar.address,
|
|
159
|
-
schemes,
|
|
160
|
-
schemes.map(_ => ethers.constants.HashZero),
|
|
161
|
-
["0x0000001f", "0x0000001f"],
|
|
162
|
-
""
|
|
163
|
-
)
|
|
164
|
-
.then(printDeploy);
|
|
165
|
-
} else {
|
|
166
|
-
console.log("dao already exists, avatar is", avatar);
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
const gd = await Avatar.nativeToken();
|
|
170
|
-
|
|
171
|
-
const controller = await Avatar.owner();
|
|
172
|
-
|
|
173
|
-
console.log("deploying nameservice");
|
|
174
|
-
const NameService = await deployDeterministic({ name: "NameService", isUpgradeable: true }, [
|
|
175
|
-
controller,
|
|
176
|
-
["CONTROLLER", "AVATAR", "IDENTITY", "GOODDOLLAR"].map(_ => ethers.utils.keccak256(ethers.utils.toUtf8Bytes(_))),
|
|
177
|
-
[controller, Avatar.address, Identity.address, gd]
|
|
178
|
-
]);
|
|
179
|
-
|
|
180
|
-
console.log("set Identity nameservice..");
|
|
181
|
-
|
|
182
|
-
if ((await Identity.nameService()) == ethers.constants.AddressZero) {
|
|
183
|
-
await Identity.initDAO(NameService.address).then(printDeploy);
|
|
184
|
-
}
|
|
185
|
-
//verifications
|
|
186
|
-
const Controller = await ethers.getContractAt("Controller", controller);
|
|
187
|
-
|
|
188
|
-
if (isProduction) {
|
|
189
|
-
console.log("renouncing minting rights on production env");
|
|
190
|
-
await GoodDollar.renounceMinter().then(printDeploy);
|
|
191
|
-
const ctrl = await ethers.getContractAt("Controller", await Avatar.owner());
|
|
192
|
-
console.log("setting identity authentication period to 180 days");
|
|
193
|
-
await ctrl
|
|
194
|
-
.genericCall(
|
|
195
|
-
Identity.address,
|
|
196
|
-
Identity.interface.encodeFunctionData("setAuthenticationPeriod", [180]),
|
|
197
|
-
Avatar.address,
|
|
198
|
-
0
|
|
199
|
-
)
|
|
200
|
-
.then(printDeploy);
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
const daoOwnerDaoPermissions = await Controller.getSchemePermissions(daoOwner, Avatar.address);
|
|
204
|
-
|
|
205
|
-
const deployerIsNotGDMinter = (await GoodDollar.isMinter(root.address)) === false;
|
|
206
|
-
|
|
207
|
-
const avatarIsGDMinter = await GoodDollar.isMinter(Avatar.address);
|
|
208
|
-
|
|
209
|
-
const deployerIsNotGDPauser = (await GoodDollar.isPauser(root.address)) === false;
|
|
210
|
-
|
|
211
|
-
const deployerIsIdentityOwner = await Identity.hasRole(ethers.constants.HashZero, root.address);
|
|
212
|
-
|
|
213
|
-
const avatarIsIdentityOwner = (await Identity.hasRole(ethers.constants.HashZero, Avatar.address)) === true;
|
|
214
|
-
|
|
215
|
-
const factoryIsNotGDMinter = (await GoodDollar.isMinter(release.ProxyFactory)) === false;
|
|
216
|
-
|
|
217
|
-
const factoryIsNotGDPauser = (await GoodDollar.isPauser(root.address)) === false;
|
|
218
|
-
const identityNameService = (await Identity.nameService()) === NameService.address;
|
|
219
|
-
console.log({
|
|
220
|
-
daoOwnerDaoPermissions,
|
|
221
|
-
deployerIsNotGDMinter,
|
|
222
|
-
deployerIsNotGDPauser,
|
|
223
|
-
factoryIsNotGDMinter,
|
|
224
|
-
factoryIsNotGDPauser,
|
|
225
|
-
deployerIsIdentityOwner,
|
|
226
|
-
avatarIsIdentityOwner,
|
|
227
|
-
avatarIsGDMinter,
|
|
228
|
-
identityNameService
|
|
229
|
-
});
|
|
230
|
-
|
|
231
|
-
release = {
|
|
232
|
-
// ProxyFactory: "0x99C22e78A579e2176311c736C4c9F0b0D5A47806",
|
|
233
|
-
GoodDollar: gd,
|
|
234
|
-
Avatar: Avatar.address,
|
|
235
|
-
Controller: controller,
|
|
236
|
-
Identity: Identity.address,
|
|
237
|
-
NameService: NameService.address,
|
|
238
|
-
FeeFormula: FeeFormula.address,
|
|
239
|
-
DAOCreator: daoCreator.address
|
|
240
|
-
};
|
|
241
|
-
await releaser(release, network.name, "deployment", false);
|
|
242
|
-
|
|
243
|
-
await verifyOnEtherscan(
|
|
244
|
-
network.config.chainId,
|
|
245
|
-
"scripts/multichain-deploy/flattened/Avatar.sol",
|
|
246
|
-
"Avatar",
|
|
247
|
-
Avatar.address,
|
|
248
|
-
"v0.5.16+commit.9c3226ce",
|
|
249
|
-
{
|
|
250
|
-
types: ["string", "address", "address"],
|
|
251
|
-
values: ["GoodDollar", GoodDollar.address, ethers.constants.AddressZero]
|
|
252
|
-
}
|
|
253
|
-
);
|
|
254
|
-
await verifyOnEtherscan(
|
|
255
|
-
network.config.chainId,
|
|
256
|
-
"scripts/multichain-deploy/flattened/Controller.sol",
|
|
257
|
-
"Controller",
|
|
258
|
-
Controller.address,
|
|
259
|
-
"v0.5.16+commit.9c3226ce",
|
|
260
|
-
{
|
|
261
|
-
types: ["address"],
|
|
262
|
-
values: [Avatar.address]
|
|
263
|
-
}
|
|
264
|
-
);
|
|
265
|
-
await verifyOnEtherscan(
|
|
266
|
-
network.config.chainId,
|
|
267
|
-
"scripts/multichain-deploy/flattened/FeeFormula.sol",
|
|
268
|
-
"FeeFormula",
|
|
269
|
-
FeeFormula.address,
|
|
270
|
-
"v0.5.16+commit.9c3226ce",
|
|
271
|
-
{
|
|
272
|
-
types: ["uint256"],
|
|
273
|
-
values: [0]
|
|
274
|
-
}
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
let impl = await getImplementationAddress(ethers.provider, Identity.address);
|
|
278
|
-
await verifyContract(impl, "contracts/identity/IdentityV3.sol:IdentityV3", network.name);
|
|
279
|
-
impl = await getImplementationAddress(ethers.provider, NameService.address);
|
|
280
|
-
await verifyContract(impl, "contracts/utils/NameService.sol:NameService", network.name);
|
|
281
|
-
if (protocolSettings.superfluidHost) {
|
|
282
|
-
impl = await getImplementationAddress(ethers.provider, GoodDollar.address);
|
|
283
|
-
await verifyContract(GoodDollar.address, "contracts/token/superfluid/UUPSProxy.sol:UUPSProxy", network.name);
|
|
284
|
-
await verifyContract(impl, "contracts/token/superfluid/SuperGoodDollar.sol:SuperGoodDollar", network.name);
|
|
285
|
-
} else {
|
|
286
|
-
impl = await getImplementationAddress(ethers.provider, GoodDollar.address);
|
|
287
|
-
await verifyContract(impl, "contracts/token/GoodDollar.sol:GoodDollar", network.name);
|
|
288
|
-
}
|
|
289
|
-
};
|
|
290
|
-
|
|
291
|
-
export const main = async () => {
|
|
292
|
-
await createDAO();
|
|
293
|
-
};
|
|
294
|
-
main();
|
|
@@ -1,152 +0,0 @@
|
|
|
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
|
-
import { AdminWallet, Faucet } from "../../types";
|
|
15
|
-
|
|
16
|
-
const { name } = network;
|
|
17
|
-
|
|
18
|
-
const printDeploy = async (c: Contract | TransactionResponse): Promise<Contract | TransactionResponse> => {
|
|
19
|
-
if (c instanceof Contract) {
|
|
20
|
-
await c.deployed();
|
|
21
|
-
console.log("deployed to: ", c.address);
|
|
22
|
-
}
|
|
23
|
-
if (c.wait) {
|
|
24
|
-
await c.wait();
|
|
25
|
-
console.log("tx done:", c.hash);
|
|
26
|
-
}
|
|
27
|
-
return c;
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const deployHelpers = async () => {
|
|
31
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
32
|
-
|
|
33
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
34
|
-
|
|
35
|
-
let [root] = await ethers.getSigners();
|
|
36
|
-
const isProduction = network.name.includes("production");
|
|
37
|
-
|
|
38
|
-
if (isProduction) verifyProductionSigner(root);
|
|
39
|
-
|
|
40
|
-
//generic call permissions
|
|
41
|
-
let schemeMock = root;
|
|
42
|
-
|
|
43
|
-
console.log("got signers:", {
|
|
44
|
-
network,
|
|
45
|
-
root: root.address,
|
|
46
|
-
schemeMock: schemeMock.address,
|
|
47
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
const walletAdmins = [];
|
|
51
|
-
for (let i = 0; i < protocolSettings.walletAdminsCount; i++) {
|
|
52
|
-
const wallet = ethers.Wallet.fromMnemonic(process.env.ADMIN_WALLET_MNEMONIC, `m/44'/60'/0'/0/${i}`);
|
|
53
|
-
walletAdmins.push(wallet.address);
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
console.log("deploying adminwallet", { walletAdmins, gasprice: protocolSettings.gasPrice });
|
|
57
|
-
const AdminWallet = (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, release.NameService, root.address, protocolSettings.gasPrice]
|
|
68
|
-
).then(printDeploy)) as AdminWallet;
|
|
69
|
-
|
|
70
|
-
await AdminWallet.setDefaults(1e6, 9e6, 3, protocolSettings.gasPrice);
|
|
71
|
-
// const AdminWallet = await ethers.getContractAt("AdminWallet", release.AdminWallet);
|
|
72
|
-
|
|
73
|
-
const gd = await ethers.getContractAt("IGoodDollar", release.GoodDollar);
|
|
74
|
-
|
|
75
|
-
const decimals = await gd.decimals();
|
|
76
|
-
|
|
77
|
-
const Faucet = (await deployDeterministic({ name: "Faucet", salt: "Faucet", isUpgradeable: true }, [
|
|
78
|
-
release.NameService,
|
|
79
|
-
protocolSettings.gasPrice,
|
|
80
|
-
AdminWallet.address,
|
|
81
|
-
root.address
|
|
82
|
-
])) as Faucet;
|
|
83
|
-
|
|
84
|
-
await Faucet.setGasTopping(1.5e6);
|
|
85
|
-
// const Faucet = await ethers.getContractAt("Faucet", release.Faucet);
|
|
86
|
-
|
|
87
|
-
const Invites = await deployDeterministic({ name: "InvitesV2", salt: "InvitesV2", isUpgradeable: true }, [
|
|
88
|
-
release.NameService,
|
|
89
|
-
ethers.utils.parseUnits("100", decimals),
|
|
90
|
-
root.address
|
|
91
|
-
]);
|
|
92
|
-
|
|
93
|
-
// const Invites = await ethers.getContractAt("AdminWallet", release.Invites);
|
|
94
|
-
|
|
95
|
-
const torelease = {
|
|
96
|
-
AdminWallet: AdminWallet.address,
|
|
97
|
-
Faucet: Faucet.address,
|
|
98
|
-
Invites: Invites.address
|
|
99
|
-
};
|
|
100
|
-
await releaser(torelease, network.name, "deployment", false);
|
|
101
|
-
|
|
102
|
-
const adminWalletOwner = await AdminWallet.hasRole(ethers.constants.HashZero, root.address);
|
|
103
|
-
const faucetOwner = await Faucet.hasRole(ethers.constants.HashZero, root.address);
|
|
104
|
-
|
|
105
|
-
console.log("giving AdminWallet identity_admin permissions");
|
|
106
|
-
const identity = await ethers.getContractAt("IdentityV2", release.Identity);
|
|
107
|
-
await identity
|
|
108
|
-
.grantRole(ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")), AdminWallet.address)
|
|
109
|
-
.then(printDeploy);
|
|
110
|
-
|
|
111
|
-
const walletIsIdentityAdmin = await identity.hasRole(
|
|
112
|
-
ethers.utils.keccak256(ethers.utils.toUtf8Bytes("identity_admin")),
|
|
113
|
-
AdminWallet.address
|
|
114
|
-
);
|
|
115
|
-
|
|
116
|
-
console.log("topping adminwallet and faucet with 1 native token");
|
|
117
|
-
await root
|
|
118
|
-
.sendTransaction({
|
|
119
|
-
to: AdminWallet.address,
|
|
120
|
-
value: ethers.constants.WeiPerEther
|
|
121
|
-
})
|
|
122
|
-
.then(printDeploy);
|
|
123
|
-
await root
|
|
124
|
-
.sendTransaction({
|
|
125
|
-
to: Faucet.address,
|
|
126
|
-
value: ethers.constants.WeiPerEther
|
|
127
|
-
})
|
|
128
|
-
.then(printDeploy);
|
|
129
|
-
|
|
130
|
-
if (!network.name.includes("production")) {
|
|
131
|
-
console.log("minting G$s to invites on dev envs");
|
|
132
|
-
await gd.mint(Invites.address, ethers.utils.parseUnits("1000000", decimals)); //1million GD
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
console.log({
|
|
136
|
-
walletIsIdentityAdmin,
|
|
137
|
-
adminWalletOwner,
|
|
138
|
-
faucetOwner
|
|
139
|
-
});
|
|
140
|
-
|
|
141
|
-
let impl = await getImplementationAddress(ethers.provider, AdminWallet.address);
|
|
142
|
-
await verifyContract(impl, "contracts/utils/AdminWallet.sol:AdminWallet", network.name);
|
|
143
|
-
impl = await getImplementationAddress(ethers.provider, Faucet.address);
|
|
144
|
-
await verifyContract(impl, "contracts/fuseFaucet/Faucet.sol:Faucet", network.name);
|
|
145
|
-
impl = await getImplementationAddress(ethers.provider, Invites.address);
|
|
146
|
-
await verifyContract(impl, "contracts/invite/InvitesV2.sol:InvitesV2", network.name);
|
|
147
|
-
};
|
|
148
|
-
|
|
149
|
-
export const main = async () => {
|
|
150
|
-
await deployHelpers();
|
|
151
|
-
};
|
|
152
|
-
if (process.argv[1].includes("2_helpers-deploy")) main();
|
|
@@ -1,73 +0,0 @@
|
|
|
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 protocolSettings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
31
|
-
|
|
32
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
33
|
-
|
|
34
|
-
let [root] = await ethers.getSigners();
|
|
35
|
-
const isProduction = network.name.includes("production");
|
|
36
|
-
|
|
37
|
-
if (isProduction) verifyProductionSigner(root);
|
|
38
|
-
|
|
39
|
-
//generic call permissions
|
|
40
|
-
let schemeMock = root;
|
|
41
|
-
|
|
42
|
-
console.log("got signers:", {
|
|
43
|
-
network,
|
|
44
|
-
root: root.address,
|
|
45
|
-
schemeMock: schemeMock.address,
|
|
46
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
console.log("deploying onetime payments", { gasprice: protocolSettings.gasPrice });
|
|
50
|
-
const OTP = (await deployDeterministic(
|
|
51
|
-
{
|
|
52
|
-
name: "OneTimePaymentsV2",
|
|
53
|
-
salt: "OneTimePaymentsV2",
|
|
54
|
-
isUpgradeable: false
|
|
55
|
-
},
|
|
56
|
-
[release.NameService]
|
|
57
|
-
).then(printDeploy)) as Contract;
|
|
58
|
-
|
|
59
|
-
// const OTP = await ethers.getContractAt("OneTimePayments", release.OneTimePayments);
|
|
60
|
-
|
|
61
|
-
const torelease = {
|
|
62
|
-
OneTimePaymentsV2: OTP.address
|
|
63
|
-
};
|
|
64
|
-
await releaser(torelease, network.name, "deployment", false);
|
|
65
|
-
|
|
66
|
-
const constructorArgs = ethers.utils.defaultAbiCoder.encode(["address"], [release.NameService]);
|
|
67
|
-
await verifyContract(OTP.address, "OneTimePaymentsV2", network.name, undefined, constructorArgs);
|
|
68
|
-
};
|
|
69
|
-
|
|
70
|
-
export const main = async () => {
|
|
71
|
-
await deployHelpers();
|
|
72
|
-
};
|
|
73
|
-
if (process.argv[1].includes("2b_otp-deploy")) main();
|