import { BigNumberish , BigNumber , Signer } from "ethers" ; import { ether } from "../common" ; import { CompoundPriceOracleMock , Comp , CompoundGovernorAlpha , CompoundGovernorBravoDelegate , CompoundGovernorBravoDelegator , CompoundTimelock , Comptroller , CERc20 , CEther , PriceOracleProxy , Unitroller , WhitePaperInterestRateModel } from "./../contracts/compound" ; import { WETH9 , DelegateRegistry } from "./../contracts" ; import { Address } from "./../types" ; import { CERc20__factory } from "../../typechain/factories/CERc20__factory" ; import { CEther__factory } from "../../typechain/factories/CEther__factory" ; import { CompoundPriceOracleMock__factory } from "../../typechain/factories/CompoundPriceOracleMock__factory" ; import { Comp__factory } from "../../typechain/factories/Comp__factory" ; import { CompoundGovernorAlpha__factory } from "../../typechain/factories/CompoundGovernorAlpha__factory" ; import { CompoundGovernorBravoDelegator__factory } from "../../typechain/factories/CompoundGovernorBravoDelegator__factory" ; import { CompoundGovernorBravoDelegate__factory } from "../../typechain/factories/CompoundGovernorBravoDelegate__factory" ; import { CompoundTimelock__factory } from "../../typechain/factories/CompoundTimelock__factory" ; import { Comptroller__factory } from "../../typechain/factories/Comptroller__factory" ; import { PriceOracleProxy__factory } from "../../typechain/factories/PriceOracleProxy__factory" ; import { Unitroller__factory } from "../../typechain/factories/Unitroller__factory" ; import { WETH9__factory } from "../../typechain/factories/WETH9__factory" ; import { WhitePaperInterestRateModel__factory } from "../../typechain/factories/WhitePaperInterestRateModel__factory" ; import { LendingPoolAddressesProvider__factory } from "../../typechain/factories/LendingPoolAddressesProvider__factory" ; import { AavePropositionPower , AaveProtoGovernance , AaveTokenV2Mintable , AssetVotingWeightProvider , CoreLibrary , DefaultReserveInterestRateStrategy , GovernanceParamsProvider , LendingPool , LendingPoolAddressesProvider , LendingPoolConfigurator , LendingPoolCore , LendingRateOracle , LendToAaveMigrator } from "../contracts/aave" ; import { AaveTokenV2Mintable__factory } from "../../typechain/factories/AaveTokenV2Mintable__factory" ; import { AavePropositionPower__factory } from "../../typechain/factories/AavePropositionPower__factory" ; import { AaveProtoGovernance__factory } from "../../typechain/factories/AaveProtoGovernance__factory" ; import { AssetVotingWeightProvider__factory } from "../../typechain/factories/AssetVotingWeightProvider__factory" ; import { LendingPoolCore__factory , LendingPoolCoreLibraryAddresses } from "../../typechain/factories/LendingPoolCore__factory" ; import { CoreLibrary__factory } from "../../typechain/factories/CoreLibrary__factory" ; import { GovernanceParamsProvider__factory } from "../../typechain/factories/GovernanceParamsProvider__factory" ; import { LendingPool__factory } from "../../typechain/factories/LendingPool__factory" ; import { DefaultReserveInterestRateStrategy__factory } from "../../typechain/factories/DefaultReserveInterestRateStrategy__factory" ; import { LendingPoolConfigurator__factory } from "../../typechain/factories/LendingPoolConfigurator__factory" ; import { LendingRateOracle__factory } from "../../typechain/factories/LendingRateOracle__factory" ; import { LendingPoolDataProvider__factory } from "../../typechain/factories/LendingPoolDataProvider__factory" ; import { LendingPoolDataProvider } from "../../typechain/LendingPoolDataProvider" ; import { LendToAaveMigrator__factory } from "../../typechain/factories/LendToAaveMigrator__factory" ; import { CurveDeposit , CurvePoolERC20 , CRVToken , GaugeController , LiquidityGauge , LiquidityGaugeReward , Minter , Stableswap , } from "../contracts/curve" ; import { CurvePoolERC20__factory } from "../../typechain/factories/CurvePoolERC20__factory" ; import { Stableswap__factory } from "../../typechain/factories/Stableswap__factory" ; import { CurveDeposit__factory } from "../../typechain/factories/CurveDeposit__factory" ; import { CRVToken__factory } from "../../typechain/factories/CRVToken__factory" ; import { GaugeController__factory } from "../../typechain/factories/GaugeController__factory" ; import { LiquidityGaugeReward__factory } from "../../typechain/factories/LiquidityGaugeReward__factory" ; import { Minter__factory } from "../../typechain/factories/Minter__factory" ; import { LiquidityGauge__factory } from "../../typechain/factories/LiquidityGauge__factory" ; import { StakingRewards , Uni , UniswapGovernorAlpha , UniswapTimelock , UniswapV2Factory , UniswapV2Pair , UniswapV2Router02 , } from "../contracts/uniswap" ; import { StakingRewards__factory } from "../../typechain/factories/StakingRewards__factory" ; import { Uni__factory } from "../../typechain/factories/Uni__factory" ; import { UniswapGovernorAlpha__factory } from "../../typechain/factories/UniswapGovernorAlpha__factory" ; import { UniswapTimelock__factory } from "../../typechain/factories/UniswapTimelock__factory" ; import { UniswapV2Factory__factory } from "../../typechain/factories/UniswapV2Factory__factory" ; import { UniswapV2Pair__factory } from "../../typechain/factories/UniswapV2Pair__factory" ; import { UniswapV2Router02__factory } from "../../typechain/factories/UniswapV2Router02__factory" ; import { BFactory , BRegistry , ExchangeProxy } from "../contracts/balancer" ; import { BFactory__factory } from "../../typechain/factories/BFactory__factory" ; import { BRegistry__factory } from "../../typechain/factories/BRegistry__factory" ; import { ExchangeProxy__factory } from "../../typechain/factories/ExchangeProxy__factory" ; import { DelegateRegistry__factory } from "../../typechain/factories/DelegateRegistry__factory" ; import { Vault , Registry } from "../contracts/yearn" ; import { Registry__factory } from "../../typechain/factories/Registry__factory" ; import { Vault__factory } from "../../typechain/factories/Vault__factory" ; import { KyberNetworkTokenV2 , DMMFactory , DMMPool , DMMRouter02 } from "../contracts/kyberV3" ; import { DMMFactory__factory } from "../../typechain/factories/DMMFactory__factory" ; import { DMMRouter02__factory } from "../../typechain/factories/DMMRouter02__factory" ; import { DMMPool__factory } from "../../typechain/factories/DMMPool__factory" ; import { KyberNetworkTokenV2__factory } from "../../typechain/factories/KyberNetworkTokenV2__factory" ; import { TokenSwap } from "../contracts/index" ; import { TokenSwap__factory } from "../../typechain/factories/TokenSwap__factory" ; import { SingularityNetToken } from "../contracts/index" ; import { SingularityNetToken__factory } from "../../typechain/factories/SingularityNetToken__factory" ; import { SwapRouter , UniswapV3Factory , NonfungiblePositionManager , Quoter , NFTDescriptor , UniswapV3Pool } from "../contracts/uniswapV3" ; import { UniswapV3Factory__factory } from "../../typechain/factories/UniswapV3Factory__factory" ; import { UniswapV3Pool__factory } from "../../typechain/factories/UniswapV3Pool__factory" ; import { SwapRouter__factory } from "../../typechain/factories/SwapRouter__factory" ; import { NonfungiblePositionManager__factory } from "../../typechain/factories/NonfungiblePositionManager__factory" ; import { Quoter__factory } from "../../typechain/factories/Quoter__factory" ; import { NFTDescriptor__factory } from "../../typechain/factories/NFTDescriptor__factory" ; import { AaveGovernanceV2 , AaveV2AToken , AaveV2StakedTokenIncentivesController , AaveV2StableDebtToken , AaveV2VariableDebtToken , AaveV2ProtocolDataProvider , AaveV2LendingPool , AaveV2LendingPoolAddressesProvider , AaveV2LendingPoolConfigurator , AaveV2LendingPoolCollateralManager , AaveV2DefaultReserveInterestRateStrategy , AaveV2LendingRateOracle , AaveV2Oracle , AaveV2PriceOracle , Executor , GovernanceStrategy , GenericLogic , ReserveLogic , ValidationLogic } from "../contracts/aaveV2" ; import { AaveV2LendingPool__factory } from "../../typechain/factories/AaveV2LendingPool__factory" ; import { AaveV2LendingPoolAddressesProvider__factory } from "../../typechain/factories/AaveV2LendingPoolAddressesProvider__factory" ; import { AaveV2ProtocolDataProvider__factory } from "../../typechain/factories/AaveV2ProtocolDataProvider__factory" ; import { AaveV2LendingPoolConfigurator__factory } from "../../typechain/factories/AaveV2LendingPoolConfigurator__factory" ; import { AaveV2LendingPoolCollateralManager__factory } from "../../typechain/factories/AaveV2LendingPoolCollateralManager__factory" ; import { AaveV2DefaultReserveInterestRateStrategy__factory } from "../../typechain/factories/AaveV2DefaultReserveInterestRateStrategy__factory" ; import { AaveV2AToken__factory } from "../../typechain/factories/AaveV2AToken__factory" ; import { AaveV2StableDebtToken__factory } from "../../typechain/factories/AaveV2StableDebtToken__factory" ; import { AaveV2VariableDebtToken__factory } from "../../typechain/factories/AaveV2VariableDebtToken__factory" ; import { AaveV2StakedTokenIncentivesController__factory } from "../../typechain/factories/AaveV2StakedTokenIncentivesController__factory" ; import { GenericLogic__factory } from "../../typechain/factories/GenericLogic__factory" ; import { ValidationLogic__factory } from "../../typechain/factories/ValidationLogic__factory" ; import { ReserveLogic__factory } from "../../typechain/factories/ReserveLogic__factory" ; import { AaveV2LendingRateOracle__factory } from "../../typechain/factories/AaveV2LendingRateOracle__factory" ; import { AaveV2Oracle__factory } from "../../typechain/factories/AaveV2Oracle__factory" ; import { AaveV2PriceOracle__factory } from "../../typechain/factories/AaveV2PriceOracle__factory" ; import { AaveGovernanceV2__factory } from "../../typechain/factories/AaveGovernanceV2__factory" ; import { Executor__factory } from "../../typechain/factories/Executor__factory" ; import { GovernanceStrategy__factory } from "../../typechain/factories/GovernanceStrategy__factory" ; import { PerpV2MarketRegistry , PerpV2OrderBook , PerpV2Quoter , PerpV2QuoteToken , PerpV2Vault , PerpV2TestAggregatorV3 , PerpV2ChainlinkPriceFeed , PerpV2BaseToken , PerpV2ClearingHouse , PerpV2ClearingHouseConfig , PerpV2InsuranceFund , PerpV2AccountBalance , PerpV2Exchange } from "../contracts/perpV2" ; import { PerpV2ClearingHouse__factory } from "../../typechain/factories/PerpV2ClearingHouse__factory" ; import { PerpV2MarketRegistry__factory } from "../../typechain/factories/PerpV2MarketRegistry__factory" ; import { PerpV2OrderBook__factory } from "../../typechain/factories/PerpV2OrderBook__factory" ; import { PerpV2Quoter__factory } from "../../typechain/factories/PerpV2Quoter__factory" ; import { PerpV2QuoteToken__factory } from "../../typechain/factories/PerpV2QuoteToken__factory" ; import { PerpV2Vault__factory } from "../../typechain/factories/PerpV2Vault__factory" ; import { PerpV2TestAggregatorV3__factory } from "../../typechain/factories/PerpV2TestAggregatorV3__factory" ; import { PerpV2ChainlinkPriceFeed__factory } from "../../typechain/factories/PerpV2ChainlinkPriceFeed__factory" ; import { PerpV2BaseToken__factory } from "../../typechain/factories/PerpV2BaseToken__factory" ; import { PerpV2ClearingHouseConfig__factory } from "../../typechain/factories/PerpV2ClearingHouseConfig__factory" ; import { PerpV2InsuranceFund__factory } from "../../typechain/factories/PerpV2InsuranceFund__factory" ; import { PerpV2AccountBalance__factory } from "../../typechain/factories/PerpV2AccountBalance__factory" ; import { PerpV2Exchange__factory } from "../../typechain/factories/PerpV2Exchange__factory" ; import { DGLight , DgToken } from "../contracts/dg" ; import { DgToken__factory } from "../../typechain/factories/DgToken__factory" ; import { DGLight__factory } from "../../typechain/factories/DGLight__factory" ; export default class DeployExternalContracts { private _deployerSigner : Signer ; constructor ( deployerSigner ) { this . _deployerSigner = deployerSigner ; } public async deployComp ( _account ) { return await new Comp__factory ( this . _deployerSigner ) . deploy ( _account ) ; } public async deployCompoundTimelock ( _admin , _delay ) { return await new CompoundTimelock__factory ( this . _deployerSigner ) . deploy ( _admin , _delay ) ; } public async deployCompoundGovernorAlpha ( _timelock , _comp , _guardian ) { return await new CompoundGovernorAlpha__factory ( this . _deployerSigner ) . deploy ( _timelock , _comp , _guardian ) ; } public async deployCompoundGovernorBravoDelegate ( ) { return await new CompoundGovernorBravoDelegate__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployCompoundGovernorBravoDelegator ( timelock , comp , admin , implementation , votingPeriod , votingDelay , proposalThreshold ) { return await new CompoundGovernorBravoDelegator__factory ( this . _deployerSigner ) . deploy ( timelock , comp , admin , implementation , votingPeriod , votingDelay , proposalThreshold ) ; } public async deployCeRc20 ( underlying , comptroller , interestRateModel , initialExchangeRateMantissa , name , symbol , decimals ) { return await new CERc20__factory ( this . _deployerSigner ) . deploy ( underlying , comptroller , interestRateModel , initialExchangeRateMantissa , name , symbol , decimals ) ; } public async deployCEther ( comptroller , interestRateModel , initialExchangeRateMantissa , name , symbol , decimals ) { return await new CEther__factory ( this . _deployerSigner ) . deploy ( comptroller , interestRateModel , initialExchangeRateMantissa , name , symbol , decimals ) ; } public async deployCompoundPriceOracleMock ( ) { return await new CompoundPriceOracleMock__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPriceOracleProxy ( guardian , v1PriceOracle , cEthAddress , cUsdcAddress , cSaiAddress , cDaiAddress , cUsdtAddress ) { return await new PriceOracleProxy__factory ( this . _deployerSigner ) . deploy ( guardian , v1PriceOracle , cEthAddress , cUsdcAddress , cSaiAddress , cDaiAddress , cUsdtAddress ) ; } public async deployComptroller ( ) { return await new Comptroller__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployUnitroller ( ) { return await new Unitroller__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployWhitePaperInterestRateModel ( baseRate , multiplier ) { return await new WhitePaperInterestRateModel__factory ( this . _deployerSigner ) . deploy ( baseRate , multiplier ) ; } public async deployWETH ( ) { return await new WETH9__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveProtoGovernance ( govParamsProvider ) { return await new AaveProtoGovernance__factory ( this . _deployerSigner ) . deploy ( govParamsProvider ) ; } public async deployGovernanceParamsProvider ( propositionPowerThreshold , propositionPower , assetVotingWeightProvider ) { return await new GovernanceParamsProvider__factory ( this . _deployerSigner ) . deploy ( propositionPowerThreshold , propositionPower , assetVotingWeightProvider ) ; } public async deployAavePropositionPower ( name , symbol , decimals , council , cap ) { return await new AavePropositionPower__factory ( this . _deployerSigner ) . deploy ( name , symbol , decimals , council , cap ) ; } public async deployAssetVotingWeightProvider ( assets , weights ) { return await new AssetVotingWeightProvider__factory ( this . _deployerSigner ) . deploy ( assets , weights ) ; } public async deployLendingPoolAddressesProvider ( ) { return await new LendingPoolAddressesProvider__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployCoreLibrary ( ) { return await new CoreLibrary__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployLendingPoolCore ( coreLibraryAddress ) { const lendingPoolCoreLibraryAddresses = { __CoreLibrary___________________________ : coreLibraryAddress , } ; return await new LendingPoolCore__factory ( lendingPoolCoreLibraryAddresses , this . _deployerSigner ) . deploy ( ) ; } public async deployLendingPool ( ) { return await new LendingPool__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployLendingPoolConfigurator ( ) { return await new LendingPoolConfigurator__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployDefaultReserveInterestRateStrategy ( _reserve , _AddressProvider , _baseVariableBorrowRate = ether ( 1 ) , _variableRateSlope1 = ether ( 1 ) , _variableRateSlope2 = ether ( 1 ) , _stableRateSlope1 = ether ( 1 ) , _stableRateSlope2 = ether ( 1 ) ) { return await new DefaultReserveInterestRateStrategy__factory ( this . _deployerSigner ) . deploy ( _reserve , _AddressProvider , _baseVariableBorrowRate , _variableRateSlope1 , _variableRateSlope2 , _stableRateSlope1 , _stableRateSlope2 ) ; } public async deployLendingRateOracle ( ) { return await new LendingRateOracle__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployLendingPoolDataProvider ( ) { return await new LendingPoolDataProvider__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployLendToAaveMigrator ( _aaveToken , _lendToken , _aaveLendRatio ) { return await new LendToAaveMigrator__factory ( this . _deployerSigner ) . deploy ( _aaveToken , _lendToken , _aaveLendRatio ) ; } public async getLendToAaveMigrator ( lendToAaveMigratorAddress ) { return await new LendToAaveMigrator__factory ( this . _deployerSigner ) . attach ( lendToAaveMigratorAddress ) ; } public async deployAaveV2LendingPoolAddressesProvider ( marketId ) { return await new AaveV2LendingPoolAddressesProvider__factory ( this . _deployerSigner ) . deploy ( marketId ) ; } public async deployAaveV2LendingPool ( validationLogicAddress , reserveLogicAddress ) { return await new AaveV2LendingPool__factory ( { [ "__$de8c0cf1a7d7c36c802af9a64fb9d86036$__" ] : validationLogicAddress , [ "__$22cd43a9dda9ce44e9b92ba393b88fb9ac$__" ] : reserveLogicAddress , } , this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2LendingPoolConfigurator ( ) { return await new AaveV2LendingPoolConfigurator__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2LendingPoolCollateralManager ( ) { return await new AaveV2LendingPoolCollateralManager__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2LendingRateOracle ( ) { return await new AaveV2LendingRateOracle__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2Oracle ( assets , sources , fallBackOracle , weth ) { return await new AaveV2Oracle__factory ( this . _deployerSigner ) . deploy ( assets , sources , fallBackOracle , weth ) ; } public async deployAaveV2PriceOracle ( ) { return await new AaveV2PriceOracle__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2DefaultReserveInterestRateStrategy ( _AddressesProvider , _optimalUtilizationRate = ether ( 1 ) , _baseVariableBorrowRate = ether ( 1 ) , _variableRateSlope1 = ether ( 1 ) , _variableRateSlope2 = ether ( 1 ) , _stableRateSlope1 = ether ( 1 ) , _stableRateSlope2 = ether ( 1 ) ) { return await new AaveV2DefaultReserveInterestRateStrategy__factory ( this . _deployerSigner ) . deploy ( _AddressesProvider , _optimalUtilizationRate , _baseVariableBorrowRate , _variableRateSlope1 , _variableRateSlope2 , _stableRateSlope1 , _stableRateSlope2 ) ; } public async deployAaveV2ProtocolDataProvider ( addressProvider ) { return await new AaveV2ProtocolDataProvider__factory ( this . _deployerSigner ) . deploy ( addressProvider ) ; } public async deployAaveV2AToken ( ) { return await new AaveV2AToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2StableDebtToken ( ) { return await new AaveV2StableDebtToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2VariableDebtToken ( ) { return await new AaveV2VariableDebtToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveV2StakedTokenIncentivesController ( stakeToken , emissionManager ) { return await new AaveV2StakedTokenIncentivesController__factory ( this . _deployerSigner ) . deploy ( stakeToken , emissionManager ) ; } public getForkedAaveLendingPoolAddressesProvider ( _mainnetAddressesProvider ) { return AaveV2LendingPoolAddressesProvider__factory . connect ( _mainnetAddressesProvider , this . _deployerSigner ) ; } public getForkedAaveV2ProtocolDataProvider ( _mainnetAddressesProvider ) { return AaveV2ProtocolDataProvider__factory . connect ( _mainnetAddressesProvider , this . _deployerSigner ) ; } public async deployGeneralLogic ( ) { return await new GenericLogic__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployValidationLogic ( genericLogicLibraryAddress ) { return await new ValidationLogic__factory ( { [ "__$52a8a86ab43135662ff256bbc95497e8e3$__" ] : genericLogicLibraryAddress , } , this . _deployerSigner ) . deploy ( ) ; } public async deployReserveLogic ( ) { return await new ReserveLogic__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployAaveGovernanceV2 ( _governanceStrategy , _votingDelay , _guardian , _executors ) { return await new AaveGovernanceV2__factory ( this . _deployerSigner ) . deploy ( _governanceStrategy , _votingDelay , _guardian , _executors ) ; } public async deployExecutor ( _admin , _delay , _gracePeriod , _minimumDelay , _maximumDelay , _propositionThreshold , _voteDuration , _voteDifferential , _minmumQuorum ) { return await new Executor__factory ( this . _deployerSigner ) . deploy ( _admin , _delay , _gracePeriod , _minimumDelay , _maximumDelay , _propositionThreshold , _voteDuration , _voteDifferential , _minmumQuorum ) ; } public async deployGovernanceStrategy ( _aave , _stkaave ) { return await new GovernanceStrategy__factory ( this . _deployerSigner ) . deploy ( _aave , _stkaave ) ; } public async deployAaveTokenV2Mintable ( ) { return await new AaveTokenV2Mintable__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployCurveDeposit ( _coins , _underlying_coins , _curve , _token ) { return await new CurveDeposit__factory ( this . _deployerSigner ) . deploy ( _coins , _underlying_coins , _curve , _token ) ; } public async deployCurvePoolERC20 ( _name , _symbol , _decimals = 18 , _supply ) { return await new CurvePoolERC20__factory ( this . _deployerSigner ) . deploy ( _name , _symbol , _decimals , _supply ) ; } public async deployStableswap ( _coins , _underlying_coins , _pool_token , _aCoefficient = 1 , _fee = 0 ) { return await new Stableswap__factory ( this . _deployerSigner ) . deploy ( _coins , _underlying_coins , _pool_token , _aCoefficient , _fee ) ; } public async deployCrvToken ( _name , _symbol , _decimals = 18 ) { return await new CRVToken__factory ( this . _deployerSigner ) . deploy ( _name , _symbol , _decimals ) ; } public async deployGaugeController ( _token , _voting_escrow ) { return await new GaugeController__factory ( this . _deployerSigner ) . deploy ( _token , _voting_escrow ) ; } public async deployLiquidityGaugeReward ( _lpAddr , _minter , _reward_contract , _rewarded_token ) { return await new LiquidityGaugeReward__factory ( this . _deployerSigner ) . deploy ( _lpAddr , _minter , _reward_contract , _rewarded_token ) ; } public async deployLiquidityGauge ( _lpAddr , _minter ) { return await new LiquidityGauge__factory ( this . _deployerSigner ) . deploy ( _lpAddr , _minter ) ; } public async deployMinter ( _token , _controller ) { return await new Minter__factory ( this . _deployerSigner ) . deploy ( _token , _controller ) ; } public async deployUni ( _account , _minter , _mintingAllowedAfter ) { return await new Uni__factory ( this . _deployerSigner ) . deploy ( _account , _minter , _mintingAllowedAfter ) ; } public async deployUniswapTimelock ( _admin , _delay ) { return await new UniswapTimelock__factory ( this . _deployerSigner ) . deploy ( _admin , _delay ) ; } public async deployUniswapGovernorAlpha ( _timelock , _uni ) { return await new UniswapGovernorAlpha__factory ( this . _deployerSigner ) . deploy ( _timelock , _uni ) ; } public async deployUniswapV2Factory ( _feeToSetter ) { return await new UniswapV2Factory__factory ( this . _deployerSigner ) . deploy ( _feeToSetter ) ; } public async deployUniswapV2Router02 ( _factory , _weth ) { return await new UniswapV2Router02__factory ( this . _deployerSigner ) . deploy ( _factory , _weth ) ; } public getForkedUniswapV2Router02 ( _mainnetRouter ) { return UniswapV2Router02__factory . connect ( _mainnetRouter , this . _deployerSigner ) ; } public async deployUniswapV2Pair ( ) { return await new UniswapV2Pair__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployStakingRewards ( _rewardsDistribution , _rewardsToken , _stakingToken ) { return await new StakingRewards__factory ( this . _deployerSigner ) . deploy ( _rewardsDistribution , _rewardsToken , _stakingToken ) ; } public async deployB__factory ( ) { return await new BFactory__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployExchangeProxy ( weth ) { return await new ExchangeProxy__factory ( this . _deployerSigner ) . deploy ( weth ) ; } public async deployBRegistry ( factory ) { return await new BRegistry__factory ( this . _deployerSigner ) . deploy ( factory ) ; } public async deployDelegateRegistry ( ) { return await new DelegateRegistry__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployVault ( ) { return await new Vault__factory ( this . _deployerSigner ) . deploy ( ) ; } public async getVault ( vaultAddress ) { return await new Vault__factory ( this . _deployerSigner ) . attach ( vaultAddress ) ; } public async deployRegistry ( ) { return await new Registry__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployKyberNetworkTokenV2 ( ) { return await new KyberNetworkTokenV2__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployDMMFactory ( _feeToSetter ) { return await new DMMFactory__factory ( this . _deployerSigner ) . deploy ( _feeToSetter ) ; } public async deployDMMRouter02 ( _factory , _weth ) { return await new DMMRouter02__factory ( this . _deployerSigner ) . deploy ( _factory , _weth ) ; } public async deployDMMPool ( ) { return await new DMMPool__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployTokenSwap ( oldToken , newToken ) { return await new TokenSwap__factory ( this . _deployerSigner ) . deploy ( oldToken , newToken ) ; } public async deploySingularityNetToken ( ) { return await new SingularityNetToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployUniswapV3Factory ( ) { return await new UniswapV3Factory__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deploySwapRouter ( factory , weth ) { return await new SwapRouter__factory ( this . _deployerSigner ) . deploy ( factory , weth ) ; } public async deployNftPositionManager ( factory , weth , nftDesc ) { return await new NonfungiblePositionManager__factory ( this . _deployerSigner ) . deploy ( factory , weth , nftDesc ) ; } public async deployQuoter ( factory , weth ) { return await new Quoter__factory ( this . _deployerSigner ) . deploy ( factory , weth ) ; } public async deployNFTDescriptor ( ) { return await new NFTDescriptor__factory ( this . _deployerSigner ) . deploy ( ) ; } public async getUniswapV3PoolInstance ( pool ) { return await new UniswapV3Pool__factory ( this . _deployerSigner ) . attach ( pool ) ; } public async deployDGLight ( dgToken ) { return await new DGLight__factory ( this . _deployerSigner ) . deploy ( dgToken ) ; } public async deployDgToken ( ) { return await new DgToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2OrderBook ( ) { return await new PerpV2OrderBook__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2MarketRegistry ( ) { return await new PerpV2MarketRegistry__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2Quoter ( marketRegistry ) { return await new PerpV2Quoter__factory ( this . _deployerSigner ) . deploy ( marketRegistry ) ; } public async deployPerpV2QuoteToken ( ) { return await new PerpV2QuoteToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2Vault ( ) { return await new PerpV2Vault__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2TestAggregatorV3 ( ) { return await new PerpV2TestAggregatorV3__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2ChainlinkPriceFeed ( ) { return await new PerpV2ChainlinkPriceFeed__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2BaseToken ( ) { return await new PerpV2BaseToken__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2ClearingHouseConfig ( ) { return await new PerpV2ClearingHouseConfig__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2InsuranceFund ( ) { return await new PerpV2InsuranceFund__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2AccountBalance ( ) { return await new PerpV2AccountBalance__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2Exchange ( ) { return await new PerpV2Exchange__factory ( this . _deployerSigner ) . deploy ( ) ; } public async deployPerpV2ClearingHouse ( ) { return await new PerpV2ClearingHouse__factory ( this . _deployerSigner ) . deploy ( ) ; } }