@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
|
@@ -257,6 +257,6 @@ describe("ClaimersDistribution", () => {
|
|
|
257
257
|
// console.log({ totalGas }, tx.gasUsed.toNumber(), tx2.gasUsed.toNumber());
|
|
258
258
|
}
|
|
259
259
|
console.log(Object.keys(gasCosts));
|
|
260
|
-
expect(totalGas / 30).lt(
|
|
260
|
+
expect(totalGas / 30).lt(319000);
|
|
261
261
|
});
|
|
262
262
|
});
|
|
@@ -94,13 +94,13 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
94
94
|
|
|
95
95
|
await gov
|
|
96
96
|
.connect(actor)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
97
|
+
["propose(address[],uint256[],string[],bytes[],string)"](
|
|
98
|
+
targets,
|
|
99
|
+
values,
|
|
100
|
+
signatures,
|
|
101
|
+
callDatas,
|
|
102
|
+
"do nothing"
|
|
103
|
+
);
|
|
104
104
|
await ethers.provider.send("evm_mine", []);
|
|
105
105
|
await ethers.provider.send("evm_mine", []);
|
|
106
106
|
let proposalId = await gov.latestProposalIds(actor.address);
|
|
@@ -123,13 +123,13 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
123
123
|
);
|
|
124
124
|
let tx = await gov
|
|
125
125
|
.connect(actor)
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
126
|
+
["propose(address[],uint256[],string[],bytes[],string)"](
|
|
127
|
+
targets,
|
|
128
|
+
values,
|
|
129
|
+
signatures,
|
|
130
|
+
callDatas,
|
|
131
|
+
"do nothing"
|
|
132
|
+
);
|
|
133
133
|
await ethers.provider.send("evm_mine", []);
|
|
134
134
|
await ethers.provider.send("evm_mine", []);
|
|
135
135
|
let proposalId = await gov.latestProposalIds(actor.address);
|
|
@@ -171,10 +171,10 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
171
171
|
describe("casts vote on behalf of the signatory", async () => {
|
|
172
172
|
let receipt;
|
|
173
173
|
it("should cast vote", async () => {
|
|
174
|
-
let wallet = ethers.Wallet.createRandom(
|
|
174
|
+
let wallet = ethers.Wallet.createRandom();
|
|
175
175
|
await acct.sendTransaction({
|
|
176
176
|
to: wallet.address,
|
|
177
|
-
value: ethers.utils.parseEther("
|
|
177
|
+
value: ethers.utils.parseEther("1")
|
|
178
178
|
});
|
|
179
179
|
|
|
180
180
|
wallet = wallet.connect(ethers.provider);
|
|
@@ -182,13 +182,13 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
182
182
|
await grep.mint(actor.address, ethers.BigNumber.from("100001"));
|
|
183
183
|
await gov
|
|
184
184
|
.connect(actor)
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
);
|
|
185
|
+
["propose(address[],uint256[],string[],bytes[],string)"](
|
|
186
|
+
targets,
|
|
187
|
+
values,
|
|
188
|
+
signatures,
|
|
189
|
+
callDatas,
|
|
190
|
+
"do nothing"
|
|
191
|
+
, { gasPrice: 1e6, gasLimit: 1000000 });
|
|
192
192
|
let proposalId = await gov.latestProposalIds(actor.address);
|
|
193
193
|
|
|
194
194
|
const signature = await wallet._signTypedData(
|
|
@@ -231,13 +231,13 @@ describe("CompoundVotingMachine#CastVote", () => {
|
|
|
231
231
|
await grep.mint(actor.address, ethers.BigNumber.from("100001"));
|
|
232
232
|
await gov
|
|
233
233
|
.connect(actor)
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
234
|
+
["propose(address[],uint256[],string[],bytes[],string)"](
|
|
235
|
+
targets,
|
|
236
|
+
values,
|
|
237
|
+
signatures,
|
|
238
|
+
callDatas,
|
|
239
|
+
"do nothing"
|
|
240
|
+
);
|
|
241
241
|
let proposalId = await gov.latestProposalIds(actor.address);
|
|
242
242
|
|
|
243
243
|
const sigsFor = [];
|
package/test/helpers.ts
CHANGED
|
@@ -12,7 +12,7 @@ import IUniswapV2Pair from "@uniswap/v2-core/build/IUniswapV2Pair.json";
|
|
|
12
12
|
import UniswapV2Factory from "@uniswap/v2-core/build/UniswapV2Factory.json";
|
|
13
13
|
import WETH9 from "@uniswap/v2-periphery/build/WETH9.json";
|
|
14
14
|
import UniswapV2Router02 from "@uniswap/v2-periphery/build/UniswapV2Router02.json";
|
|
15
|
-
import { GoodMarketMaker, CompoundVotingMachine } from "../types";
|
|
15
|
+
import { GoodMarketMaker, CompoundVotingMachine, IdentityV4 } from "../types";
|
|
16
16
|
import { Contract } from "ethers";
|
|
17
17
|
import testDeployer from "@superfluid-finance/ethereum-contracts/dev-scripts/deploy-test-framework";
|
|
18
18
|
|
|
@@ -24,9 +24,7 @@ export const getStakingFactory = async (
|
|
|
24
24
|
| "GoodAaveStakingV2"
|
|
25
25
|
| "GoodCompoundStakingV2"
|
|
26
26
|
) => {
|
|
27
|
-
let swapHelper = await ethers
|
|
28
|
-
.getContractFactory("UniswapV2SwapHelper")
|
|
29
|
-
.then(_ => _.deploy());
|
|
27
|
+
let swapHelper = await ethers.getContractFactory("UniswapV2SwapHelper").then(_ => _.deploy());
|
|
30
28
|
|
|
31
29
|
const simpleStakingFactory = await ethers.getContractFactory(factory, {
|
|
32
30
|
libraries: {
|
|
@@ -46,17 +44,13 @@ export const deploySuperFluid = async () => {
|
|
|
46
44
|
};
|
|
47
45
|
|
|
48
46
|
export const deploySuperGoodDollar = async (sfContracts, tokenArgs) => {
|
|
49
|
-
const SuperGoodDollarFactory = await ethers.getContractFactory(
|
|
50
|
-
"SuperGoodDollar"
|
|
51
|
-
);
|
|
47
|
+
const SuperGoodDollarFactory = await ethers.getContractFactory("SuperGoodDollar");
|
|
52
48
|
|
|
53
49
|
console.log("deploying supergooddollar logic");
|
|
54
50
|
const SuperGoodDollar = await SuperGoodDollarFactory.deploy(sfContracts.host);
|
|
55
51
|
|
|
56
52
|
console.log("deploying supergooddollar proxy");
|
|
57
|
-
const GoodDollarProxyFactory = await ethers.getContractFactory(
|
|
58
|
-
"contracts/token/superfluid/UUPSProxy.sol:UUPSProxy"
|
|
59
|
-
);
|
|
53
|
+
const GoodDollarProxyFactory = await ethers.getContractFactory("contracts/token/superfluid/UUPSProxy.sol:UUPSProxy");
|
|
60
54
|
const GoodDollarProxy = await GoodDollarProxyFactory.deploy();
|
|
61
55
|
console.log("deployed supergooddollar proxy, initializing proxy...");
|
|
62
56
|
await GoodDollarProxy.initializeProxy(SuperGoodDollar.address);
|
|
@@ -67,15 +61,12 @@ export const deploySuperGoodDollar = async (sfContracts, tokenArgs) => {
|
|
|
67
61
|
const outNftProxy = await GoodDollarProxyFactory.deploy();
|
|
68
62
|
const inNftProxy = await GoodDollarProxyFactory.deploy();
|
|
69
63
|
|
|
70
|
-
const constantInflowNFT = await ethers.deployContract("ConstantInflowNFT", [
|
|
64
|
+
const constantInflowNFT = await ethers.deployContract("ConstantInflowNFT", [sfContracts.host, outNftProxy.address]);
|
|
65
|
+
|
|
66
|
+
const constantOutflowNFT = await ethers.deployContract("ConstantOutflowNFT", [
|
|
71
67
|
sfContracts.host,
|
|
72
|
-
|
|
68
|
+
inNftProxy.address
|
|
73
69
|
]);
|
|
74
|
-
|
|
75
|
-
const constantOutflowNFT = await ethers.deployContract(
|
|
76
|
-
"ConstantOutflowNFT",
|
|
77
|
-
[sfContracts.host, inNftProxy.address]
|
|
78
|
-
);
|
|
79
70
|
await outNftProxy.initializeProxy(constantOutflowNFT.address);
|
|
80
71
|
await inNftProxy.initializeProxy(constantInflowNFT.address);
|
|
81
72
|
|
|
@@ -83,42 +74,27 @@ export const deploySuperGoodDollar = async (sfContracts, tokenArgs) => {
|
|
|
83
74
|
await SuperGoodDollar.attach(GoodDollarProxy.address)[
|
|
84
75
|
"initialize(string,string,uint256,address,address,address,address)"
|
|
85
76
|
](...tokenArgs);
|
|
86
|
-
const GoodDollar = await ethers.getContractAt(
|
|
87
|
-
"SuperGoodDollar",
|
|
88
|
-
GoodDollarProxy.address
|
|
89
|
-
);
|
|
77
|
+
const GoodDollar = await ethers.getContractAt("SuperGoodDollar", GoodDollarProxy.address);
|
|
90
78
|
console.log("supergooddollar created successfully");
|
|
91
79
|
|
|
92
80
|
await constantOutflowNFT
|
|
93
81
|
.attach(outNftProxy.address)
|
|
94
|
-
.initialize(
|
|
95
|
-
(await GoodDollar.symbol()) + " Outflow NFT",
|
|
96
|
-
(await GoodDollar.symbol()) + " COF"
|
|
97
|
-
);
|
|
82
|
+
.initialize((await GoodDollar.symbol()) + " Outflow NFT", (await GoodDollar.symbol()) + " COF");
|
|
98
83
|
await constantInflowNFT
|
|
99
84
|
.attach(inNftProxy.address)
|
|
100
|
-
.initialize(
|
|
101
|
-
(await GoodDollar.symbol()) + " Inflow NFT",
|
|
102
|
-
(await GoodDollar.symbol()) + " CIF"
|
|
103
|
-
);
|
|
85
|
+
.initialize((await GoodDollar.symbol()) + " Inflow NFT", (await GoodDollar.symbol()) + " CIF");
|
|
104
86
|
return GoodDollar;
|
|
105
87
|
} else {
|
|
106
88
|
console.log("initializing supergooddollar....");
|
|
107
89
|
await SuperGoodDollar.attach(GoodDollarProxy.address)[
|
|
108
90
|
"initialize(string,string,uint256,address,address,address,address)"
|
|
109
91
|
](...tokenArgs);
|
|
110
|
-
const GoodDollar = await ethers.getContractAt(
|
|
111
|
-
"SuperGoodDollar",
|
|
112
|
-
GoodDollarProxy.address
|
|
113
|
-
);
|
|
92
|
+
const GoodDollar = await ethers.getContractAt("SuperGoodDollar", GoodDollarProxy.address);
|
|
114
93
|
console.log("supergooddollar created successfully");
|
|
115
94
|
return GoodDollar;
|
|
116
95
|
}
|
|
117
96
|
};
|
|
118
|
-
export const createDAO = async (
|
|
119
|
-
tokenType: "super" | "regular" = "super",
|
|
120
|
-
identity: "v2" | "v3" = "v3"
|
|
121
|
-
) => {
|
|
97
|
+
export const createDAO = async (tokenType: "super" | "regular" = "super", identity: "v2" | "v3" | "v4" = "v4") => {
|
|
122
98
|
let [root, ...signers] = await ethers.getSigners();
|
|
123
99
|
|
|
124
100
|
const sfContracts = await deploySuperFluid();
|
|
@@ -130,38 +106,23 @@ export const createDAO = async (
|
|
|
130
106
|
|
|
131
107
|
let cDAI = await cdaiFactory.deploy(dai.address);
|
|
132
108
|
|
|
133
|
-
const DAOCreatorFactory = new ethers.ContractFactory(
|
|
134
|
-
DAOCreatorABI.abi,
|
|
135
|
-
DAOCreatorABI.bytecode,
|
|
136
|
-
root
|
|
137
|
-
);
|
|
109
|
+
const DAOCreatorFactory = new ethers.ContractFactory(DAOCreatorABI.abi, DAOCreatorABI.bytecode, root);
|
|
138
110
|
|
|
139
|
-
const IdentityFactory = await ethers.getContractFactory(
|
|
140
|
-
identity === "v2" ? "IdentityV2" : "IdentityV3"
|
|
141
|
-
);
|
|
111
|
+
const IdentityFactory = await ethers.getContractFactory("Identity" + identity.toUpperCase());
|
|
142
112
|
|
|
143
|
-
const FeeFormulaFactory = new ethers.ContractFactory(
|
|
144
|
-
FeeFormulaABI.abi,
|
|
145
|
-
FeeFormulaABI.bytecode,
|
|
146
|
-
root
|
|
147
|
-
);
|
|
113
|
+
const FeeFormulaFactory = new ethers.ContractFactory(FeeFormulaABI.abi, FeeFormulaABI.bytecode, root);
|
|
148
114
|
|
|
149
|
-
const BancorFormula = await (
|
|
150
|
-
await ethers.getContractFactory("BancorFormula")
|
|
151
|
-
).deploy();
|
|
115
|
+
const BancorFormula = await (await ethers.getContractFactory("BancorFormula")).deploy();
|
|
152
116
|
|
|
153
117
|
await BancorFormula.init();
|
|
154
118
|
|
|
155
119
|
console.log("deploy upgradeable identity...");
|
|
156
120
|
|
|
157
|
-
const Identity = await upgrades.deployProxy(
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
163
|
-
);
|
|
164
|
-
|
|
121
|
+
const Identity = (await upgrades.deployProxy(IdentityFactory, [root.address, ethers.constants.AddressZero], {
|
|
122
|
+
kind: "uups"
|
|
123
|
+
})) as IdentityV4;
|
|
124
|
+
// put reverify far in the future to avoid interference with tests
|
|
125
|
+
if (identity === "v4") await Identity.setReverifyDaysOptions([180]);
|
|
165
126
|
const daoCreator = await DAOCreatorFactory.deploy();
|
|
166
127
|
const FeeFormula = await FeeFormulaFactory.deploy(0);
|
|
167
128
|
const GReputation = await ethers.getContractFactory("GReputation");
|
|
@@ -183,19 +144,10 @@ export const createDAO = async (
|
|
|
183
144
|
|
|
184
145
|
GoodDollar = await upgrades.deployProxy(
|
|
185
146
|
GoodDollarFactory,
|
|
186
|
-
[
|
|
187
|
-
"GoodDollar",
|
|
188
|
-
"G$",
|
|
189
|
-
0,
|
|
190
|
-
FeeFormula.address,
|
|
191
|
-
Identity.address,
|
|
192
|
-
ethers.constants.AddressZero,
|
|
193
|
-
daoCreator.address
|
|
194
|
-
],
|
|
147
|
+
["GoodDollar", "G$", 0, FeeFormula.address, Identity.address, ethers.constants.AddressZero, daoCreator.address],
|
|
195
148
|
{
|
|
196
149
|
kind: "uups",
|
|
197
|
-
initializer:
|
|
198
|
-
"initialize(string, string, uint256, address, address, address,address)"
|
|
150
|
+
initializer: "initialize(string, string, uint256, address, address, address,address)"
|
|
199
151
|
}
|
|
200
152
|
);
|
|
201
153
|
} else {
|
|
@@ -218,20 +170,11 @@ export const createDAO = async (
|
|
|
218
170
|
daoCreator: daoCreator.address
|
|
219
171
|
});
|
|
220
172
|
// await Identity.setAuthenticationPeriod(365);
|
|
221
|
-
await daoCreator.forgeOrg(
|
|
222
|
-
GoodDollar.address,
|
|
223
|
-
reputation.address,
|
|
224
|
-
[],
|
|
225
|
-
1000,
|
|
226
|
-
[]
|
|
227
|
-
);
|
|
173
|
+
await daoCreator.forgeOrg(GoodDollar.address, reputation.address, [], 1000, []);
|
|
228
174
|
|
|
229
175
|
const Avatar = new ethers.Contract(
|
|
230
176
|
await daoCreator.avatar(),
|
|
231
|
-
[
|
|
232
|
-
"function owner() view returns (address)",
|
|
233
|
-
"function nativeToken() view returns (address)"
|
|
234
|
-
],
|
|
177
|
+
["function owner() view returns (address)", "function nativeToken() view returns (address)"],
|
|
235
178
|
root
|
|
236
179
|
);
|
|
237
180
|
|
|
@@ -245,11 +188,7 @@ export const createDAO = async (
|
|
|
245
188
|
await GoodDollar.isPauser(Avatar.address)
|
|
246
189
|
);
|
|
247
190
|
|
|
248
|
-
const ccFactory = new ethers.ContractFactory(
|
|
249
|
-
ContributionCalculation.abi,
|
|
250
|
-
ContributionCalculation.bytecode,
|
|
251
|
-
root
|
|
252
|
-
);
|
|
191
|
+
const ccFactory = new ethers.ContractFactory(ContributionCalculation.abi, ContributionCalculation.bytecode, root);
|
|
253
192
|
|
|
254
193
|
const contribution = await ccFactory.deploy(Avatar.address, 0, 1e15);
|
|
255
194
|
|
|
@@ -332,13 +271,9 @@ export const createDAO = async (
|
|
|
332
271
|
|
|
333
272
|
const MM = await ethers.getContractFactory("GoodMarketMaker");
|
|
334
273
|
|
|
335
|
-
let marketMaker = (await upgrades.deployProxy(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
{
|
|
339
|
-
kind: "uups"
|
|
340
|
-
}
|
|
341
|
-
)) as unknown as GoodMarketMaker;
|
|
274
|
+
let marketMaker = (await upgrades.deployProxy(MM, [nameService.address, 999388834642296, 1e15], {
|
|
275
|
+
kind: "uups"
|
|
276
|
+
})) as unknown as GoodMarketMaker;
|
|
342
277
|
|
|
343
278
|
await (await reputation.updateDAO(nameService.address)).wait();
|
|
344
279
|
|
|
@@ -346,28 +281,16 @@ export const createDAO = async (
|
|
|
346
281
|
//generic call permissions
|
|
347
282
|
let schemeMock = signers[signers.length - 1];
|
|
348
283
|
|
|
349
|
-
const ictrl = await ethers.getContractAt(
|
|
350
|
-
"Controller",
|
|
351
|
-
controller,
|
|
352
|
-
schemeMock
|
|
353
|
-
);
|
|
284
|
+
const ictrl = await ethers.getContractAt("Controller", controller, schemeMock);
|
|
354
285
|
|
|
355
286
|
const setSchemes = async (addrs, params = []) => {
|
|
356
287
|
for (let i in addrs) {
|
|
357
|
-
await ictrl.registerScheme(
|
|
358
|
-
addrs[i],
|
|
359
|
-
params[i] || ethers.constants.HashZero,
|
|
360
|
-
"0x0000001F",
|
|
361
|
-
Avatar.address
|
|
362
|
-
);
|
|
288
|
+
await ictrl.registerScheme(addrs[i], params[i] || ethers.constants.HashZero, "0x0000001F", Avatar.address);
|
|
363
289
|
}
|
|
364
290
|
};
|
|
365
291
|
|
|
366
292
|
const setDAOAddress = async (name, addr) => {
|
|
367
|
-
const encoded = nameService.interface.encodeFunctionData("setAddress", [
|
|
368
|
-
name,
|
|
369
|
-
addr
|
|
370
|
-
]);
|
|
293
|
+
const encoded = nameService.interface.encodeFunctionData("setAddress", [name, addr]);
|
|
371
294
|
|
|
372
295
|
await ictrl.genericCall(nameService.address, encoded, Avatar.address, 0);
|
|
373
296
|
};
|
|
@@ -377,21 +300,20 @@ export const createDAO = async (
|
|
|
377
300
|
expect(funcNameEnd).to.be.gt(-1);
|
|
378
301
|
const functionName = functionAbi.substring(0, funcNameEnd);
|
|
379
302
|
|
|
380
|
-
await expect(contract[functionAbi](...parameters)).to.revertedWith(
|
|
381
|
-
|
|
382
|
-
);
|
|
383
|
-
const encoded = contract.interface.encodeFunctionData(functionName, [
|
|
384
|
-
...parameters
|
|
385
|
-
]);
|
|
303
|
+
await expect(contract[functionAbi](...parameters)).to.revertedWith(/avatar/);
|
|
304
|
+
const encoded = contract.interface.encodeFunctionData(functionName, [...parameters]);
|
|
386
305
|
|
|
387
306
|
await ictrl.genericCall(contract.address, encoded, Avatar.address, 0);
|
|
388
307
|
};
|
|
389
308
|
|
|
390
309
|
const setReserveToken = async (token, gdReserve, tokenReserve, RR) => {
|
|
391
|
-
const encoded = marketMaker.interface.encodeFunctionData(
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
310
|
+
const encoded = marketMaker.interface.encodeFunctionData("initializeToken", [
|
|
311
|
+
token,
|
|
312
|
+
gdReserve,
|
|
313
|
+
tokenReserve,
|
|
314
|
+
RR,
|
|
315
|
+
0
|
|
316
|
+
]);
|
|
395
317
|
|
|
396
318
|
await ictrl.genericCall(marketMaker.address, encoded, Avatar.address, 0);
|
|
397
319
|
};
|
|
@@ -417,9 +339,9 @@ export const createDAO = async (
|
|
|
417
339
|
const gd = await Avatar.nativeToken();
|
|
418
340
|
//make GoodCap minter
|
|
419
341
|
console.log("Setting reserve as minter...");
|
|
420
|
-
const encoded = (
|
|
421
|
-
|
|
422
|
-
|
|
342
|
+
const encoded = (await ethers.getContractAt("IGoodDollar", gd)).interface.encodeFunctionData("addMinter", [
|
|
343
|
+
goodReserve.address
|
|
344
|
+
]);
|
|
423
345
|
|
|
424
346
|
await ictrl.genericCall(gd, encoded, Avatar.address, 0);
|
|
425
347
|
|
|
@@ -427,25 +349,17 @@ export const createDAO = async (
|
|
|
427
349
|
|
|
428
350
|
await ictrl.genericCall(
|
|
429
351
|
goodReserve.address,
|
|
430
|
-
goodReserve.interface.encodeFunctionData("setDistributionHelper", [
|
|
431
|
-
distHelper.address
|
|
432
|
-
]),
|
|
352
|
+
goodReserve.interface.encodeFunctionData("setDistributionHelper", [distHelper.address]),
|
|
433
353
|
Avatar.address,
|
|
434
354
|
0
|
|
435
355
|
);
|
|
436
356
|
|
|
437
|
-
const gasFeeMockFactory = await ethers.getContractFactory(
|
|
438
|
-
"GasPriceMockOracle"
|
|
439
|
-
);
|
|
357
|
+
const gasFeeMockFactory = await ethers.getContractFactory("GasPriceMockOracle");
|
|
440
358
|
const gasFeeOracle = await gasFeeMockFactory.deploy();
|
|
441
|
-
const daiEthPriceMockFactory = await ethers.getContractFactory(
|
|
442
|
-
"DaiEthPriceMockOracle"
|
|
443
|
-
);
|
|
359
|
+
const daiEthPriceMockFactory = await ethers.getContractFactory("DaiEthPriceMockOracle");
|
|
444
360
|
const daiEthOracle = await daiEthPriceMockFactory.deploy();
|
|
445
361
|
|
|
446
|
-
const ethUsdOracleFactory = await ethers.getContractFactory(
|
|
447
|
-
"EthUSDMockOracle"
|
|
448
|
-
);
|
|
362
|
+
const ethUsdOracleFactory = await ethers.getContractFactory("EthUSDMockOracle");
|
|
449
363
|
const ethUsdOracle = await ethUsdOracleFactory.deploy();
|
|
450
364
|
|
|
451
365
|
console.log("setting nameservice addrresses...");
|
|
@@ -531,15 +445,17 @@ export const deployUBI = async (deployedDAO, withFirstClaim = true) => {
|
|
|
531
445
|
|
|
532
446
|
const gd = await nameService.getAddress("GOODDOLLAR");
|
|
533
447
|
|
|
534
|
-
let encoded = (
|
|
535
|
-
|
|
536
|
-
|
|
448
|
+
let encoded = (await ethers.getContractAt("IGoodDollar", gd)).interface.encodeFunctionData("mint", [
|
|
449
|
+
firstClaim.address,
|
|
450
|
+
1000000
|
|
451
|
+
]);
|
|
537
452
|
|
|
538
453
|
await genericCall(gd, encoded);
|
|
539
454
|
|
|
540
|
-
encoded = (
|
|
541
|
-
|
|
542
|
-
|
|
455
|
+
encoded = (await ethers.getContractAt("IGoodDollar", gd)).interface.encodeFunctionData("mint", [
|
|
456
|
+
ubiScheme.address,
|
|
457
|
+
1000000
|
|
458
|
+
]);
|
|
543
459
|
|
|
544
460
|
await genericCall(gd, encoded);
|
|
545
461
|
|
|
@@ -547,9 +463,7 @@ export const deployUBI = async (deployedDAO, withFirstClaim = true) => {
|
|
|
547
463
|
await setSchemes([firstClaim.address, ubiScheme.address]);
|
|
548
464
|
|
|
549
465
|
if (withFirstClaim) {
|
|
550
|
-
encoded = firstClaim.interface.encodeFunctionData("setUBIScheme", [
|
|
551
|
-
ubiScheme.address
|
|
552
|
-
]);
|
|
466
|
+
encoded = firstClaim.interface.encodeFunctionData("setUBIScheme", [ubiScheme.address]);
|
|
553
467
|
|
|
554
468
|
await genericCall(firstClaim.address, encoded);
|
|
555
469
|
await firstClaim.start();
|
|
@@ -598,15 +512,17 @@ export const deployOldUBI = async deployedDAO => {
|
|
|
598
512
|
|
|
599
513
|
const gd = await nameService.getAddress("GOODDOLLAR");
|
|
600
514
|
|
|
601
|
-
let encoded = (
|
|
602
|
-
|
|
603
|
-
|
|
515
|
+
let encoded = (await ethers.getContractAt("IGoodDollar", gd)).interface.encodeFunctionData("mint", [
|
|
516
|
+
firstClaim.address,
|
|
517
|
+
1000000
|
|
518
|
+
]);
|
|
604
519
|
|
|
605
520
|
await genericCall(gd, encoded);
|
|
606
521
|
|
|
607
|
-
encoded = (
|
|
608
|
-
|
|
609
|
-
|
|
522
|
+
encoded = (await ethers.getContractAt("IGoodDollar", gd)).interface.encodeFunctionData("mint", [
|
|
523
|
+
ubiScheme.address,
|
|
524
|
+
1000000
|
|
525
|
+
]);
|
|
610
526
|
|
|
611
527
|
await genericCall(gd, encoded);
|
|
612
528
|
|
|
@@ -651,26 +567,16 @@ export const deployOldVoting = async dao => {
|
|
|
651
567
|
SchemeRegistrarF.deploy()
|
|
652
568
|
]);
|
|
653
569
|
console.log("setting parameters");
|
|
654
|
-
const voteParametersHash = await absoluteVote.getParametersHash(
|
|
655
|
-
50,
|
|
656
|
-
ethers.constants.AddressZero
|
|
657
|
-
);
|
|
570
|
+
const voteParametersHash = await absoluteVote.getParametersHash(50, ethers.constants.AddressZero);
|
|
658
571
|
|
|
659
572
|
console.log("setting params for voting machine and schemes");
|
|
660
573
|
|
|
661
574
|
await Promise.all([
|
|
662
|
-
schemeRegistrar.setParameters(
|
|
663
|
-
voteParametersHash,
|
|
664
|
-
voteParametersHash,
|
|
665
|
-
absoluteVote.address
|
|
666
|
-
),
|
|
575
|
+
schemeRegistrar.setParameters(voteParametersHash, voteParametersHash, absoluteVote.address),
|
|
667
576
|
absoluteVote.setParameters(50, ethers.constants.AddressZero),
|
|
668
577
|
upgradeScheme.setParameters(voteParametersHash, absoluteVote.address)
|
|
669
578
|
]);
|
|
670
|
-
const upgradeParametersHash = await upgradeScheme.getParametersHash(
|
|
671
|
-
voteParametersHash,
|
|
672
|
-
absoluteVote.address
|
|
673
|
-
);
|
|
579
|
+
const upgradeParametersHash = await upgradeScheme.getParametersHash(voteParametersHash, absoluteVote.address);
|
|
674
580
|
|
|
675
581
|
// Deploy SchemeRegistrar
|
|
676
582
|
const schemeRegisterParams = await schemeRegistrar.getParametersHash(
|
|
@@ -710,18 +616,10 @@ export const deployUniswap = async (comp, dai) => {
|
|
|
710
616
|
UniswapV2Factory.bytecode,
|
|
711
617
|
(await ethers.getSigners())[0]
|
|
712
618
|
);
|
|
713
|
-
const wethFactory = new ethers.ContractFactory(
|
|
714
|
-
WETH9.abi,
|
|
715
|
-
WETH9.bytecode,
|
|
716
|
-
(await ethers.getSigners())[0]
|
|
717
|
-
);
|
|
619
|
+
const wethFactory = new ethers.ContractFactory(WETH9.abi, WETH9.bytecode, (await ethers.getSigners())[0]);
|
|
718
620
|
|
|
719
621
|
const weth = await wethFactory.deploy();
|
|
720
|
-
const factory = await uniswapFactory.deploy(
|
|
721
|
-
(
|
|
722
|
-
await ethers.getSigners()
|
|
723
|
-
)[0].address
|
|
724
|
-
);
|
|
622
|
+
const factory = await uniswapFactory.deploy((await ethers.getSigners())[0].address);
|
|
725
623
|
const router = await routerFactory.deploy(factory.address, weth.address);
|
|
726
624
|
await factory.createPair(comp.address, weth.address); // Create comp and weth pair
|
|
727
625
|
const compPairAddress = factory.getPair(comp.address, weth.address);
|
|
@@ -729,28 +627,11 @@ export const deployUniswap = async (comp, dai) => {
|
|
|
729
627
|
await factory.createPair(dai.address, weth.address); // Create comp and dai pair
|
|
730
628
|
const daiPairAddress = factory.getPair(dai.address, weth.address);
|
|
731
629
|
|
|
732
|
-
const compPair = new Contract(
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
).
|
|
737
|
-
const daiPair = new Contract(
|
|
738
|
-
daiPairAddress,
|
|
739
|
-
JSON.stringify(IUniswapV2Pair.abi),
|
|
740
|
-
staker
|
|
741
|
-
).connect(founder);
|
|
742
|
-
await dai["mint(address,uint256)"](
|
|
743
|
-
founder.address,
|
|
744
|
-
ethers.utils.parseEther("2000000")
|
|
745
|
-
);
|
|
746
|
-
await dai["mint(address,uint256)"](
|
|
747
|
-
daiPair.address,
|
|
748
|
-
ethers.utils.parseEther("2000000")
|
|
749
|
-
);
|
|
750
|
-
await comp["mint(address,uint256)"](
|
|
751
|
-
compPair.address,
|
|
752
|
-
ethers.utils.parseEther("200000")
|
|
753
|
-
);
|
|
630
|
+
const compPair = new Contract(compPairAddress, JSON.stringify(IUniswapV2Pair.abi), staker).connect(founder);
|
|
631
|
+
const daiPair = new Contract(daiPairAddress, JSON.stringify(IUniswapV2Pair.abi), staker).connect(founder);
|
|
632
|
+
await dai["mint(address,uint256)"](founder.address, ethers.utils.parseEther("2000000"));
|
|
633
|
+
await dai["mint(address,uint256)"](daiPair.address, ethers.utils.parseEther("2000000"));
|
|
634
|
+
await comp["mint(address,uint256)"](compPair.address, ethers.utils.parseEther("200000"));
|
|
754
635
|
console.log("depositing eth to liquidity pools");
|
|
755
636
|
await weth.deposit({ value: ethers.utils.parseEther("4000") });
|
|
756
637
|
console.log(await weth.balanceOf(founder.address).then(_ => _.toString()));
|