@gooddollar/goodprotocol 2.1.4 → 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/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/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/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/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/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/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/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/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/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/releases/deployment.json +691 -1
- 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 -0
- 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/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 -0
- package/types/hardhat.d.ts +27 -0
- package/types/index.ts +4 -0
- 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,59 +0,0 @@
|
|
|
1
|
-
import { network, ethers, upgrades, run } from "hardhat";
|
|
2
|
-
import { Contract } from "ethers";
|
|
3
|
-
import { getImplementationAddress } from "@openzeppelin/upgrades-core";
|
|
4
|
-
|
|
5
|
-
import { deployDeterministic, printDeploy, verifyContract } from "./helpers";
|
|
6
|
-
import releaser from "../../scripts/releaser";
|
|
7
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
8
|
-
import dao from "../../releases/deployment.json";
|
|
9
|
-
|
|
10
|
-
const INITIAL_CAP = 100000000000; //1B G$s
|
|
11
|
-
const { name } = network;
|
|
12
|
-
|
|
13
|
-
export const deployWrapper = async (defaultAdmin = null) => {
|
|
14
|
-
let release: { [key: string]: any } = dao[network.name];
|
|
15
|
-
|
|
16
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
17
|
-
//generic call permissions
|
|
18
|
-
let schemeMock = root;
|
|
19
|
-
|
|
20
|
-
console.log("got signers:", {
|
|
21
|
-
network,
|
|
22
|
-
root: root.address,
|
|
23
|
-
schemeMock: schemeMock.address,
|
|
24
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString())
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
console.log("MintBurnWrapper deploy params:", [
|
|
28
|
-
release.GoodDollar,
|
|
29
|
-
defaultAdmin || release.GuardiansSafe,
|
|
30
|
-
release.NameService
|
|
31
|
-
]);
|
|
32
|
-
|
|
33
|
-
const Wrapper = (await deployDeterministic(
|
|
34
|
-
{
|
|
35
|
-
name: "GoodDollarMintBurnWrapper",
|
|
36
|
-
salt: "MintBurnWrapper",
|
|
37
|
-
isUpgradeable: true
|
|
38
|
-
},
|
|
39
|
-
[defaultAdmin || release.GuardiansSafe, release.NameService]
|
|
40
|
-
).then(printDeploy)) as Contract;
|
|
41
|
-
|
|
42
|
-
release = {
|
|
43
|
-
GoodDollarMintBurnWrapper: Wrapper.address
|
|
44
|
-
};
|
|
45
|
-
await releaser(release, network.name, "deployment", false);
|
|
46
|
-
|
|
47
|
-
const impl = await getImplementationAddress(ethers.provider, Wrapper.address);
|
|
48
|
-
await verifyContract(impl, "GoodDollarMintBurnWrapper", network.name);
|
|
49
|
-
|
|
50
|
-
return Wrapper;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
|
-
export const main = async (networkName = name) => {
|
|
54
|
-
await deployWrapper().catch(console.log);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
if (process.argv[1].includes("multichainWrapper")) {
|
|
58
|
-
main();
|
|
59
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import { run, network, ethers } from "hardhat";
|
|
2
|
-
import { omit, pick, defaultsDeep } from "lodash";
|
|
3
|
-
import dao from "../../releases/deployment.json";
|
|
4
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
5
|
-
import util from "util";
|
|
6
|
-
|
|
7
|
-
const exec = util.promisify(require("child_process").exec);
|
|
8
|
-
|
|
9
|
-
const delay = ms => new Promise(res => setTimeout(res, 1000));
|
|
10
|
-
|
|
11
|
-
const getImplementationAddress = async addr => {
|
|
12
|
-
console.log("finding impl for:", addr);
|
|
13
|
-
let proxy = await ethers.provider.getStorageAt(
|
|
14
|
-
addr,
|
|
15
|
-
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc"
|
|
16
|
-
);
|
|
17
|
-
let res = addr;
|
|
18
|
-
if (proxy != ethers.constants.HashZero) res = "0x" + proxy.slice(-40);
|
|
19
|
-
else {
|
|
20
|
-
const code = await ethers.getDefaultProvider().getCode(addr);
|
|
21
|
-
if (code.startsWith("0x363d3d373d3d3d363d73")) res = "0x" + code.slice(22, 62);
|
|
22
|
-
}
|
|
23
|
-
console.log("impl address for:", addr, res);
|
|
24
|
-
return res;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const main = async () => {
|
|
28
|
-
let withTruffle = true;
|
|
29
|
-
let ps = [];
|
|
30
|
-
const release = dao[network.name];
|
|
31
|
-
let settings = defaultsDeep({}, ProtocolSettings[network.name], ProtocolSettings["default"]);
|
|
32
|
-
|
|
33
|
-
const networkProvider = network.name.includes("-") ? network.name.split("-")[1] : network.name;
|
|
34
|
-
|
|
35
|
-
// const impl = await getImplementationAddress(release.AdminWallet);
|
|
36
|
-
// console.log({ impl, aw: release.AdminWallet });
|
|
37
|
-
|
|
38
|
-
let toVerify = omit(release, [
|
|
39
|
-
"Avatar",
|
|
40
|
-
"Controller",
|
|
41
|
-
"DAOCreator",
|
|
42
|
-
"AddFounders",
|
|
43
|
-
"FeeFormula",
|
|
44
|
-
"network",
|
|
45
|
-
"networkId",
|
|
46
|
-
"GuardiansSafe",
|
|
47
|
-
"GuardiansSafeOld",
|
|
48
|
-
"MultichainRouter",
|
|
49
|
-
"SuperFluidResolver",
|
|
50
|
-
"SuperFluidHost",
|
|
51
|
-
"UniswapV3Router"
|
|
52
|
-
]);
|
|
53
|
-
|
|
54
|
-
console.log("verifying:", Object.keys(toVerify));
|
|
55
|
-
if (withTruffle) {
|
|
56
|
-
console.log("truffle compile....");
|
|
57
|
-
const { stdout, stderr } = await exec("npx truffle compile");
|
|
58
|
-
} else {
|
|
59
|
-
//verify the first proxy
|
|
60
|
-
const identityProxy = toVerify["Identity"];
|
|
61
|
-
await run("verify:verify", {
|
|
62
|
-
address: identityProxy,
|
|
63
|
-
contract: "contracts/utils/ProxyFactory1967.sol:ERC1967Proxy"
|
|
64
|
-
}).catch(e => console.log("failed verifying proxy:", identityProxy, e.message));
|
|
65
|
-
|
|
66
|
-
const uupsProxy = toVerify["GoodDollar"];
|
|
67
|
-
await run("verify:verify", {
|
|
68
|
-
address: uupsProxy,
|
|
69
|
-
contract: "contracts/token/superfluid/UUPSProxy.sol:UUPSProxy"
|
|
70
|
-
}).catch(e => console.log("failed verifying uups proxy:", uupsProxy, e.message));
|
|
71
|
-
}
|
|
72
|
-
// toVerify = pick(release, ["GoodDollarStaking"]);
|
|
73
|
-
for (let key in toVerify) {
|
|
74
|
-
let constructorArguments = [];
|
|
75
|
-
let forcedConstructorArguments = "";
|
|
76
|
-
const address = toVerify[key];
|
|
77
|
-
// }
|
|
78
|
-
// const ps = Object.entries(toVerify).map(([key, address]) => {
|
|
79
|
-
let contract;
|
|
80
|
-
let contractName = key;
|
|
81
|
-
let proxy = "--custom-proxy ERC1967Proxy";
|
|
82
|
-
switch (key) {
|
|
83
|
-
case "AdminWallet":
|
|
84
|
-
contract = "contracts/utils/AdminWallet.sol:AdminWallet";
|
|
85
|
-
break;
|
|
86
|
-
case "Faucet":
|
|
87
|
-
contract = "contracts/fuseFaucet/Faucet.sol:Faucet";
|
|
88
|
-
break;
|
|
89
|
-
case "Invites":
|
|
90
|
-
contractName = "InvitesV2";
|
|
91
|
-
contract = "contracts/invite/InvitesV2.sol:InvitesV2";
|
|
92
|
-
break;
|
|
93
|
-
case "ProxyFactory":
|
|
94
|
-
proxy = "";
|
|
95
|
-
contractName = "ProxyFactory1967";
|
|
96
|
-
contract = "contracts/utils/ProxyFactory1967.sol:ProxyFactory1967";
|
|
97
|
-
break;
|
|
98
|
-
case "NameService":
|
|
99
|
-
contract = "contracts/utils/NameService.sol:NameService";
|
|
100
|
-
break;
|
|
101
|
-
case "GReputation":
|
|
102
|
-
contract = "contracts/governance/GReputation.sol:GReputation";
|
|
103
|
-
break;
|
|
104
|
-
case "Identity":
|
|
105
|
-
contractName = "IdentityV2";
|
|
106
|
-
contract = "contracts/identity/IdentityV2.sol:IdentityV2";
|
|
107
|
-
break;
|
|
108
|
-
case "GoodDollarStaking":
|
|
109
|
-
proxy = "";
|
|
110
|
-
contract = "contracts/governance/GoodDollarStaking.sol:GoodDollarStaking";
|
|
111
|
-
constructorArguments = [
|
|
112
|
-
release.NameService,
|
|
113
|
-
ethers.BigNumber.from(settings.savings.blockAPY),
|
|
114
|
-
ethers.BigNumber.from(settings.savings.blocksPerYear),
|
|
115
|
-
settings.savings.daysUntilUpgrade
|
|
116
|
-
];
|
|
117
|
-
forcedConstructorArguments = ethers.utils.defaultAbiCoder.encode(
|
|
118
|
-
["address", "uint128", "uint128", "uint32"],
|
|
119
|
-
constructorArguments
|
|
120
|
-
);
|
|
121
|
-
break;
|
|
122
|
-
case "GoodDollar":
|
|
123
|
-
proxy = "--custom-proxy UUPSProxy";
|
|
124
|
-
contractName = "SuperGoodDollar";
|
|
125
|
-
contract = "contracts/token/superfluid/SuperGoodDollar.sol:SuperGoodDollar";
|
|
126
|
-
constructorArguments = [settings.superfluidHost];
|
|
127
|
-
forcedConstructorArguments = ethers.utils.defaultAbiCoder.encode(["address"], constructorArguments);
|
|
128
|
-
break;
|
|
129
|
-
default:
|
|
130
|
-
contract = undefined;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
if (withTruffle) {
|
|
134
|
-
if (key === "GoodDollar") {
|
|
135
|
-
//verify the proxy first without constructor args (truffle verify plugin bug)
|
|
136
|
-
const cmd = `npx truffle run verify ${proxy} ${contractName}@${address} --network ${networkProvider}`;
|
|
137
|
-
console.log("running...:", cmd);
|
|
138
|
-
await exec(cmd).then(({ stdout, stderr }) => {
|
|
139
|
-
console.log("Result for:", cmd);
|
|
140
|
-
console.log(stdout);
|
|
141
|
-
console.log(stderr);
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
const cmd = `npx truffle run verify ${proxy} ${contractName}@${address} ${
|
|
145
|
-
forcedConstructorArguments ? "--forceConstructorArgs string:" + forcedConstructorArguments.slice(2) : ""
|
|
146
|
-
} --network ${networkProvider}`;
|
|
147
|
-
|
|
148
|
-
console.log("running...:", cmd);
|
|
149
|
-
|
|
150
|
-
ps.push(
|
|
151
|
-
exec(cmd).then(({ stdout, stderr }) => {
|
|
152
|
-
console.log("Result for:", cmd);
|
|
153
|
-
console.log(stdout);
|
|
154
|
-
console.log(stderr);
|
|
155
|
-
})
|
|
156
|
-
);
|
|
157
|
-
await delay(1000);
|
|
158
|
-
} else {
|
|
159
|
-
let task = "verify";
|
|
160
|
-
let params = {
|
|
161
|
-
address,
|
|
162
|
-
contract
|
|
163
|
-
};
|
|
164
|
-
if (constructorArguments.length > 0 && contract.includes("SuperGoodDollar") === false) {
|
|
165
|
-
task = "verify:verify";
|
|
166
|
-
params["constructorArguments"] = constructorArguments;
|
|
167
|
-
}
|
|
168
|
-
console.log("verifying:", task, params);
|
|
169
|
-
|
|
170
|
-
await run(task, params).catch(e => console.log("failed verifying:", address, contract, e.message));
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
await Promise.all(ps);
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
main().catch(e => console.log(e));
|
|
@@ -1,251 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* increase rate of UBI distribution on Celo
|
|
3
|
-
* also includes old foundation funds transfers from firstclaimpool and avatar towards initial topping of the UBI pool for the launch campaign
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import { ethers, network } from "hardhat";
|
|
7
|
-
import { defaultsDeep } from "lodash";
|
|
8
|
-
import prompt from "prompt";
|
|
9
|
-
import { reset } from "@nomicfoundation/hardhat-network-helpers";
|
|
10
|
-
|
|
11
|
-
import { executeViaGuardian, executeViaSafe, verifyProductionSigner } from "../multichain-deploy/helpers";
|
|
12
|
-
|
|
13
|
-
import ProtocolSettings from "../../releases/deploy-settings.json";
|
|
14
|
-
|
|
15
|
-
import dao from "../../releases/deployment.json";
|
|
16
|
-
|
|
17
|
-
const { name: networkName } = network;
|
|
18
|
-
const isForkSimulation = networkName === "localhost";
|
|
19
|
-
|
|
20
|
-
export const step1 = async () => {
|
|
21
|
-
const isProduction = networkName.includes("production");
|
|
22
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
23
|
-
|
|
24
|
-
let networkEnv = networkName.split("-")[0];
|
|
25
|
-
if (isForkSimulation) networkEnv = "production";
|
|
26
|
-
const fuseNetwork = networkEnv;
|
|
27
|
-
|
|
28
|
-
if (networkEnv === "fuse") networkEnv = "development";
|
|
29
|
-
const celoNetwork = networkEnv + "-celo";
|
|
30
|
-
const mainnetNetwork = `${networkName === "localhost" ? "production" : networkName.split("-")[0]}-mainnet`; //simulate production on localhost requires running hardhat node in fork mode
|
|
31
|
-
|
|
32
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
33
|
-
|
|
34
|
-
if (isForkSimulation)
|
|
35
|
-
// fund safe with eth so we can simulate TXs
|
|
36
|
-
await root.sendTransaction({ to: dao[mainnetNetwork].GuardiansSafe, value: ethers.constants.WeiPerEther });
|
|
37
|
-
|
|
38
|
-
console.log("got signers:", {
|
|
39
|
-
networkName,
|
|
40
|
-
root: root.address,
|
|
41
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
|
|
42
|
-
mainnetNetwork,
|
|
43
|
-
fuseNetwork,
|
|
44
|
-
celoNetwork
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
const proposalContracts = [
|
|
48
|
-
dao[mainnetNetwork].GoodReserveCDai, // update the nonubi bps to 55%. 10% community fund + 45% celo ubi
|
|
49
|
-
dao[mainnetNetwork].DistributionHelper, //set community fund to 0.1818 so it gets 10% from 55%
|
|
50
|
-
dao[mainnetNetwork].DistributionHelper //set celo ubi to 0.8182 so it gets 45% from 55%
|
|
51
|
-
];
|
|
52
|
-
|
|
53
|
-
const proposalEthValues = proposalContracts.map(_ => 0);
|
|
54
|
-
|
|
55
|
-
const proposalFunctionSignatures = [
|
|
56
|
-
"setDistributionHelper(address,uint32)",
|
|
57
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))",
|
|
58
|
-
"addOrUpdateRecipient((uint32,uint32,address,uint8))"
|
|
59
|
-
];
|
|
60
|
-
|
|
61
|
-
const proposalFunctionInputs = [
|
|
62
|
-
ethers.utils.defaultAbiCoder.encode(["address", "uint32"], [dao[mainnetNetwork].DistributionHelper, 5500]),
|
|
63
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
64
|
-
["uint32", "uint32", "address", "uint8"],
|
|
65
|
-
[8182, 42220, dao[celoNetwork].UBIScheme, 1]
|
|
66
|
-
),
|
|
67
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
68
|
-
["uint32", "uint32", "address", "uint8"],
|
|
69
|
-
[1818, 122, dao[fuseNetwork].CommunitySafe, 0] //community safe on fuse
|
|
70
|
-
)
|
|
71
|
-
];
|
|
72
|
-
|
|
73
|
-
if (isProduction) {
|
|
74
|
-
await executeViaSafe(
|
|
75
|
-
proposalContracts,
|
|
76
|
-
proposalEthValues,
|
|
77
|
-
proposalFunctionSignatures,
|
|
78
|
-
proposalFunctionInputs,
|
|
79
|
-
protocolSettings.guardiansSafe,
|
|
80
|
-
"mainnet"
|
|
81
|
-
);
|
|
82
|
-
} else {
|
|
83
|
-
await executeViaGuardian(
|
|
84
|
-
proposalContracts,
|
|
85
|
-
proposalEthValues,
|
|
86
|
-
proposalFunctionSignatures,
|
|
87
|
-
proposalFunctionInputs,
|
|
88
|
-
isForkSimulation ? await ethers.getImpersonatedSigner(dao[mainnetNetwork].GuardiansSafe) : root,
|
|
89
|
-
mainnetNetwork
|
|
90
|
-
);
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
if (isForkSimulation) {
|
|
94
|
-
const reserve = await ethers.getContractAt("GoodReserveCDai", dao[mainnetNetwork].GoodReserveCDai);
|
|
95
|
-
//verify balance of avatar is 0
|
|
96
|
-
const events = await reserve.queryFilter(reserve.filters.DistributionHelperSet(), -10);
|
|
97
|
-
console.log({ events });
|
|
98
|
-
console.assert(events[0].args?.bps === 5500, "wrong bps");
|
|
99
|
-
const helper = await ethers.getContractAt("DistributionHelper", dao[mainnetNetwork].DistributionHelper);
|
|
100
|
-
const helperEvents = await helper.queryFilter(helper.filters.RecipientUpdated(), -10);
|
|
101
|
-
console.log(
|
|
102
|
-
"helperEvents",
|
|
103
|
-
helperEvents.map(_ => _.args)
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
//verify multichain bridge did burn
|
|
107
|
-
console.assert(
|
|
108
|
-
helperEvents.find(
|
|
109
|
-
_ =>
|
|
110
|
-
_.args?.recipient[0] === 1818 &&
|
|
111
|
-
_.args?.recipient[2] == dao[fuseNetwork].CommunitySafe &&
|
|
112
|
-
_.args?.recipient[1] === 122 &&
|
|
113
|
-
_.args?.recipient[3] === 0
|
|
114
|
-
),
|
|
115
|
-
"wrong community pool bps"
|
|
116
|
-
);
|
|
117
|
-
console.assert(
|
|
118
|
-
helperEvents.find(
|
|
119
|
-
_ =>
|
|
120
|
-
_.args?.recipient[0] === 8182 &&
|
|
121
|
-
_.args?.recipient[2] == dao[celoNetwork].UBIScheme &&
|
|
122
|
-
_.args?.recipient[1] === 42220 &&
|
|
123
|
-
_.args?.recipient[3] === 1
|
|
124
|
-
),
|
|
125
|
-
"wrong celo ubi pool bps"
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const step2 = async () => {
|
|
131
|
-
const isProduction = networkName.includes("production");
|
|
132
|
-
let [root, ...signers] = await ethers.getSigners();
|
|
133
|
-
|
|
134
|
-
let networkEnv = networkName.split("-")[0];
|
|
135
|
-
const isForkSimulation = networkName === "localhost";
|
|
136
|
-
if (isForkSimulation) networkEnv = "production";
|
|
137
|
-
const fuseNetwork = networkEnv;
|
|
138
|
-
|
|
139
|
-
if (networkEnv === "fuse") networkEnv = "development";
|
|
140
|
-
const celoNetwork = networkEnv + "-celo";
|
|
141
|
-
const mainnetNetwork = `${networkName === "localhost" ? "production" : networkName}-mainnet`; //simulate production on localhost requires running hardhat node in fork mode
|
|
142
|
-
|
|
143
|
-
let protocolSettings = defaultsDeep({}, ProtocolSettings[networkName], ProtocolSettings["default"]);
|
|
144
|
-
|
|
145
|
-
if (isForkSimulation)
|
|
146
|
-
// fund safe with eth so we can simulate TXs
|
|
147
|
-
await root.sendTransaction({ to: dao[fuseNetwork].GuardiansSafe, value: ethers.constants.WeiPerEther });
|
|
148
|
-
|
|
149
|
-
console.log("got signers:", {
|
|
150
|
-
networkName,
|
|
151
|
-
root: root.address,
|
|
152
|
-
balance: await ethers.provider.getBalance(root.address).then(_ => _.toString()),
|
|
153
|
-
mainnetNetwork,
|
|
154
|
-
fuseNetwork,
|
|
155
|
-
celoNetwork
|
|
156
|
-
});
|
|
157
|
-
|
|
158
|
-
const fuseProposalContracts = [
|
|
159
|
-
dao[fuseNetwork].FirstClaimPool, // end the pool to get locked funds
|
|
160
|
-
dao[fuseNetwork].GoodDollar, //approve multichain wrapper
|
|
161
|
-
dao[fuseNetwork].MultichainRouter //anyswapout
|
|
162
|
-
];
|
|
163
|
-
|
|
164
|
-
const fuseProposalEthValues = fuseProposalContracts.map(_ => 0);
|
|
165
|
-
|
|
166
|
-
const fuseProposalFunctionSignatures = [
|
|
167
|
-
"end()",
|
|
168
|
-
// "transferAndCall(address,uint256,bytes)"//transferAndcall not working in simulation. using aprrove+anyswapout
|
|
169
|
-
"approve(address,uint256)",
|
|
170
|
-
"anySwapOut(address,address,uint256,uint256)"
|
|
171
|
-
];
|
|
172
|
-
|
|
173
|
-
const gd = await ethers.getContractAt("GoodDollar", dao[fuseNetwork].GoodDollar);
|
|
174
|
-
const aBalance = await gd.balanceOf(dao[fuseNetwork].Avatar);
|
|
175
|
-
const bBalance = await gd.balanceOf(dao[fuseNetwork].FirstClaimPool);
|
|
176
|
-
|
|
177
|
-
console.log("balances to bridge:", aBalance.toString(), bBalance.toString());
|
|
178
|
-
const fuseProposalFunctionInputs = [
|
|
179
|
-
ethers.utils.defaultAbiCoder.encode([], []),
|
|
180
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
181
|
-
["address", "uint256"],
|
|
182
|
-
[dao[fuseNetwork].GoodDollarMintBurnWrapper, aBalance.add(bBalance)]
|
|
183
|
-
),
|
|
184
|
-
ethers.utils.defaultAbiCoder.encode(
|
|
185
|
-
["address", "address", "uint256", "uint256"],
|
|
186
|
-
[dao[fuseNetwork].GoodDollarMintBurnWrapper, dao[celoNetwork].UBIScheme, aBalance.add(bBalance), 42220]
|
|
187
|
-
)
|
|
188
|
-
|
|
189
|
-
//transferAndCall isnt working in simualation for some reason
|
|
190
|
-
// ethers.utils.defaultAbiCoder.encode(
|
|
191
|
-
// ["address", "uint256", "bytes"],
|
|
192
|
-
// [
|
|
193
|
-
// dao[fuseNetwork].GoodDollarMintBurnWrapper,
|
|
194
|
-
// aBalance.add(bBalance),
|
|
195
|
-
// ethers.utils.defaultAbiCoder.encode(["address", "uint256"], [dao[celoNetwork].UBIScheme, 42220])
|
|
196
|
-
// ] //target ubipool on celo for multichain bridge
|
|
197
|
-
// )
|
|
198
|
-
];
|
|
199
|
-
|
|
200
|
-
const totalSupplyBefore = await gd.totalSupply();
|
|
201
|
-
if (isProduction) {
|
|
202
|
-
await executeViaSafe(
|
|
203
|
-
fuseProposalContracts,
|
|
204
|
-
fuseProposalEthValues,
|
|
205
|
-
fuseProposalFunctionSignatures,
|
|
206
|
-
fuseProposalFunctionInputs,
|
|
207
|
-
dao[fuseNetwork].GuardiansSafe,
|
|
208
|
-
"fuse"
|
|
209
|
-
);
|
|
210
|
-
} else {
|
|
211
|
-
await executeViaGuardian(
|
|
212
|
-
fuseProposalContracts,
|
|
213
|
-
fuseProposalEthValues,
|
|
214
|
-
fuseProposalFunctionSignatures,
|
|
215
|
-
fuseProposalFunctionInputs,
|
|
216
|
-
isForkSimulation ? await ethers.getImpersonatedSigner(dao[fuseNetwork].GuardiansSafe) : root,
|
|
217
|
-
fuseNetwork
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
|
|
221
|
-
if (isForkSimulation) {
|
|
222
|
-
//verify balance of avatar is 0
|
|
223
|
-
console.assert((await gd.balanceOf(dao[fuseNetwork].Avatar)).eq(0), await gd.balanceOf(dao[fuseNetwork].Avatar));
|
|
224
|
-
//verify multichain bridge did burn
|
|
225
|
-
console.assert((await gd.totalSupply()).lt(totalSupplyBefore), "bridge didnt burn G$s");
|
|
226
|
-
}
|
|
227
|
-
};
|
|
228
|
-
|
|
229
|
-
export const main = async () => {
|
|
230
|
-
prompt.start();
|
|
231
|
-
const { stepNumber } = await prompt.get(["stepNumber"]);
|
|
232
|
-
|
|
233
|
-
console.log("running step:", { stepNumber });
|
|
234
|
-
switch (stepNumber) {
|
|
235
|
-
case "1":
|
|
236
|
-
isForkSimulation && (await reset("https://cloudflare-eth.com"));
|
|
237
|
-
await step1();
|
|
238
|
-
break;
|
|
239
|
-
|
|
240
|
-
//to simulate run first
|
|
241
|
-
//npx hardhat node --fork https://rpc.fuse.io
|
|
242
|
-
//then run npx hardhat run scripts/proposals/gip-14_1.ts --network localhost
|
|
243
|
-
case "2":
|
|
244
|
-
isForkSimulation && (await reset("https://rpc.fuse.io"));
|
|
245
|
-
await step2();
|
|
246
|
-
break;
|
|
247
|
-
}
|
|
248
|
-
// await upgrade().catch(console.log);
|
|
249
|
-
};
|
|
250
|
-
|
|
251
|
-
main();
|