import { BigNumberish , Signer } from "ethers" ; import { Controller , IntegrationRegistry , PriceOracle , SetToken , SetTokenCreator , SetValuer } from "./../contracts" ; import { Address } from "./../types" ; import { Controller__factory } from "../../typechain/factories/Controller__factory" ; import { IntegrationRegistry__factory } from "../../typechain/factories/IntegrationRegistry__factory" ; import { PriceOracle__factory } from "../../typechain/factories/PriceOracle__factory" ; import { SetToken__factory } from "../../typechain/factories/SetToken__factory" ; import { SetTokenCreator__factory } from "../../typechain/factories/SetTokenCreator__factory" ; import { SetValuer__factory } from "../../typechain/factories/SetValuer__factory" ; export default class DeployCoreContracts { private _deployerSigner : Signer ; constructor ( deployerSigner ) { this . _deployerSigner = deployerSigner ; } public async deployController ( feeRecipient ) { return await new Controller__factory ( this . _deployerSigner ) . deploy ( feeRecipient ) ; } public async getController ( controllerAddress ) { return await new Controller__factory ( this . _deployerSigner ) . attach ( controllerAddress ) ; } public async deploySetTokenCreator ( controller ) { return await new SetTokenCreator__factory ( this . _deployerSigner ) . deploy ( controller ) ; } public async getSetTokenCreator ( setTokenCreatorAddress ) { return await new SetTokenCreator__factory ( this . _deployerSigner ) . attach ( setTokenCreatorAddress ) ; } public async deploySetToken ( _components , _units , _modules , _controller , _manager , _name , _symbol ) { return await new SetToken__factory ( this . _deployerSigner ) . deploy ( _components , _units , _modules , _controller , _manager , _name , _symbol ) ; } public async getSetToken ( setTokenAddress ) { return await new SetToken__factory ( this . _deployerSigner ) . attach ( setTokenAddress ) ; } public async deployPriceOracle ( controller , masterQuoteAsset , adapters , assetOnes , assetTwos , oracles ) { return await new PriceOracle__factory ( this . _deployerSigner ) . deploy ( controller , masterQuoteAsset , adapters , assetOnes , assetTwos , oracles ) ; } public async getPriceOracle ( priceOracleAddress ) { return await new PriceOracle__factory ( this . _deployerSigner ) . attach ( priceOracleAddress ) ; } public async deployIntegrationRegistry ( controller ) { return await new IntegrationRegistry__factory ( this . _deployerSigner ) . deploy ( controller ) ; } public async getIntegrationRegistry ( integrationRegistryAddress ) { return await new IntegrationRegistry__factory ( this . _deployerSigner ) . attach ( integrationRegistryAddress ) ; } public async deploySetValuer ( controller ) { return await new SetValuer__factory ( this . _deployerSigner ) . deploy ( controller ) ; } }