async function deployLpTokenPools(deployer, network, accounts) {
    console.log(`deployLpTokenPools deployering...`)
    let vaults = [
        AdareManor,
        VillaDEste,
        VillaLant,
        VillaFarnese,
        ChatsworthHouse,
        ChateauMargaux
    ];
    let lpToken = [
        lpTokenAddress.rUSD_USDT,
        lpTokenAddress.rBTC_HBTC,
        lpTokenAddress.rETH_HETH,
        lpTokenAddress.RICE_rUSD,
        lpTokenAddress.RICE_rBTC,
        lpTokenAddress.RICE_rETH
    ];
    let ifaMasterInstance = await IFAMaster.at(publicContractAddress.IFAMaster);
    let ifaPoolInstance = await IFAPool.at(publicContractAddress.IFAPool);
    let createIFAInstance = await CreateIFA.at(publicContractAddress.CreateIFA);
    let allocPoint = allocPointBase;
    for (let i = 3; i < vaults.length + 3; i++) {
        // Whether to deploy the current pool , Do not deploy when POOL_ENABLE_STATUS is false
        if (!POOL_ENABLE_STATUS[i]) {
            continue;
        }
        let poolId = i;
        let kVault = i
        let vault = vaults[kVault - 3];
        let now = Math.floor((new Date()).getTime() / 1000 - 3600);
        let vaultInstance = await vault.new(ifaMasterInstance.address, publicContractAddress.CreateIFA, publicContractAddress.ShareRevenue)
            .then((result) => { console.log(`${poolVaultName[i]}:`, result.address); return result; });
        poolVaultContractAddress[poolVaultName[i]] = vaultInstance.address;
        await ifaMasterInstance.addVault(kVault, vaultInstance.address);
        // close pool
        // await ifaPoolInstance.setPoolInfo(poolId, lpToken[i - 3], vaultInstance.address, now);
        if (i > 2 && i <= 5) {
            allocPoint = allocPointBase * 5
        }
        else if (i > 5) {
            allocPoint = allocPointBase * 50
        }
        await createIFAInstance.setPoolInfo(poolId, vaultInstance.address, lpToken[i - 3], allocPoint, false);
    }
    console.log(`deployLpTokenPools end\n`)

    // export address
    contracts.uniswapV2Factory = uniswapsAddress.factory;
    contracts.uniswapV2Router = uniswapsAddress.router;
    contracts.rUSD = itokensAddress.rUSD
    contracts.rBTC = itokensAddress.rBTC
    contracts.rETH = itokensAddress.rETH

    contracts.USDT = addressItem.tokensAddress.HUSD
    contracts.HBTC = addressItem.tokensAddress.HBTC
    contracts.ETH = addressItem.tokensAddress.HETH
    contracts.RICE = addressItem.tokensAddress.RICE
    contracts.USD = addressItem.tokensAddress.USDT

    contracts.iUSD_DAI = addressItem.lpTokenAddress.rUSD_USDT
    contracts.iBTC_wBTC = addressItem.lpTokenAddress.rBTC_HBTC
    contracts.iETH_ETH = addressItem.lpTokenAddress.rETH_HETH
    contracts.IFA_DAI = addressItem.lpTokenAddress.RICE_rUSD
    contracts.IFA_wBTC = addressItem.lpTokenAddress.RICE_rBTC
    contracts.IFA_ETH = addressItem.lpTokenAddress.RICE_rETH

    contracts.IFAMaster = addressItem.public.IFAMaster
    contracts.IFAPool = addressItem.public.IFAPool
    contracts.IFABank = addressItem.public.IFABank
    contracts.IFARevenue = addressItem.public.IFARevenue
    contracts.Costco = addressItem.public.Costco
    contracts.IFADataBoard = addressItem.public.IFADataBoard
    contracts.CreateIFA = addressItem.public.CreateIFA
    contracts.ShareRevenue = addressItem.public.ShareRevenue

    contracts.BirrCastle = addressItem.poolVaults.BirrCastle
    contracts.Sunnylands = addressItem.poolVaults.Sunnylands
    contracts.ChateauLafitte = addressItem.poolVaults.ChateauLafitte
    contracts.AdareManor = addressItem.poolVaults.AdareManor
    contracts.VillaDEste = addressItem.poolVaults.VillaDEste
    contracts.VillaLant = addressItem.poolVaults.VillaLant
    contracts.VillaFarnese = addressItem.poolVaults.VillaFarnese
    contracts.ChatsworthHouse = addressItem.poolVaults.ChatsworthHouse
    contracts.ChateauMargaux = addressItem.poolVaults.ChateauMargaux

    contracts.BirrCastleCalculators = addressItem.calculatorsAddress.BirrCastleCalculators
    contracts.SunnylandsCalculators = addressItem.calculatorsAddress.SunnylandsCalculators
    contracts.ChateauLafitteCalculators = addressItem.calculatorsAddress.ChateauLafitteCalculators
}
// depoly lp token pools total:6
depoly lp token pools total:6
depoly lp token pools total : 6
async function deployLpTokenPools(deployer, network, accounts) {
    console.log(`deployLpTokenPools deployering...`)
    let vaults = [
        AdareManor,
        VillaDEste,
        VillaLant,
        VillaFarnese,
        ChatsworthHouse,
        ChateauMargaux
    ];
    let lpToken = [
        lpTokenAddress.rUSD_USDT,
        lpTokenAddress.rBTC_HBTC,
        lpTokenAddress.rETH_HETH,
        lpTokenAddress.RICE_rUSD,
        lpTokenAddress.RICE_rBTC,
        lpTokenAddress.RICE_rETH
    ];
    let ifaMasterInstance = await IFAMaster.at(publicContractAddress.IFAMaster);
    let ifaPoolInstance = await IFAPool.at(publicContractAddress.IFAPool);
    let createIFAInstance = await CreateIFA.at(publicContractAddress.CreateIFA);
    let allocPoint = allocPointBase;
    for (let i = 3; i < vaults.length + 3; i++) {
        if (!POOL_ENABLE_STATUS[i]) {
            continue;
        }
        let poolId = i;
        let kVault = i
        let vault = vaults[kVault - 3];
        let now = Math.floor((new Date()).getTime() / 1000 - 3600);
        let vaultInstance = await vault.new(ifaMasterInstance.address, publicContractAddress.CreateIFA, publicContractAddress.ShareRevenue)
            .then((result) => { console.log(`${poolVaultName[i]}:`, result.address); return result; });
        poolVaultContractAddress[poolVaultName[i]] = vaultInstance.address;
        await ifaMasterInstance.addVault(kVault, vaultInstance.address);
        if (i > 2 && i <= 5) {
            allocPoint = allocPointBase * 5
        }
        else if (i > 5) {
            allocPoint = allocPointBase * 50
        }
        await createIFAInstance.setPoolInfo(poolId, vaultInstance.address, lpToken[i - 3], allocPoint, false);
    }
    console.log(`deployLpTokenPools end\n`)
    contracts.uniswapV2Factory = uniswapsAddress.factory;
    contracts.uniswapV2Router = uniswapsAddress.router;
    contracts.rUSD = itokensAddress.rUSD
    contracts.rBTC = itokensAddress.rBTC
    contracts.rETH = itokensAddress.rETH
    contracts.USDT = addressItem.tokensAddress.HUSD
    contracts.HBTC = addressItem.tokensAddress.HBTC
    contracts.ETH = addressItem.tokensAddress.HETH
    contracts.RICE = addressItem.tokensAddress.RICE
    contracts.USD = addressItem.tokensAddress.USDT
    contracts.iUSD_DAI = addressItem.lpTokenAddress.rUSD_USDT
    contracts.iBTC_wBTC = addressItem.lpTokenAddress.rBTC_HBTC
    contracts.iETH_ETH = addressItem.lpTokenAddress.rETH_HETH
    contracts.IFA_DAI = addressItem.lpTokenAddress.RICE_rUSD
    contracts.IFA_wBTC = addressItem.lpTokenAddress.RICE_rBTC
    contracts.IFA_ETH = addressItem.lpTokenAddress.RICE_rETH
    contracts.IFAMaster = addressItem.public.IFAMaster
    contracts.IFAPool = addressItem.public.IFAPool
    contracts.IFABank = addressItem.public.IFABank
    contracts.IFARevenue = addressItem.public.IFARevenue
    contracts.Costco = addressItem.public.Costco
    contracts.IFADataBoard = addressItem.public.IFADataBoard
    contracts.CreateIFA = addressItem.public.CreateIFA
    contracts.ShareRevenue = addressItem.public.ShareRevenue
    contracts.BirrCastle = addressItem.poolVaults.BirrCastle
    contracts.Sunnylands = addressItem.poolVaults.Sunnylands
    contracts.ChateauLafitte = addressItem.poolVaults.ChateauLafitte
    contracts.AdareManor = addressItem.poolVaults.AdareManor
    contracts.VillaDEste = addressItem.poolVaults.VillaDEste
    contracts.VillaLant = addressItem.poolVaults.VillaLant
    contracts.VillaFarnese = addressItem.poolVaults.VillaFarnese
    contracts.ChatsworthHouse = addressItem.poolVaults.ChatsworthHouse
    contracts.ChateauMargaux = addressItem.poolVaults.ChateauMargaux
    contracts.BirrCastleCalculators = addressItem.calculatorsAddress.BirrCastleCalculators
    contracts.SunnylandsCalculators = addressItem.calculatorsAddress.SunnylandsCalculators
    contracts.ChateauLafitteCalculators = addressItem.calculatorsAddress.ChateauLafitteCalculators
}
async function deployLpTokenPools ( deployer , network , accounts ) { console . log ( ` ` ) let vaults = [ AdareManor , VillaDEste , VillaLant , VillaFarnese , ChatsworthHouse , ChateauMargaux ] ; let lpToken = [ lpTokenAddress . rUSD_USDT , lpTokenAddress . rBTC_HBTC , lpTokenAddress . rETH_HETH , lpTokenAddress . RICE_rUSD , lpTokenAddress . RICE_rBTC , lpTokenAddress . RICE_rETH ] ; let ifaMasterInstance = await IFAMaster . at ( publicContractAddress . IFAMaster ) ; let ifaPoolInstance = await IFAPool . at ( publicContractAddress . IFAPool ) ; let createIFAInstance = await CreateIFA . at ( publicContractAddress . CreateIFA ) ; let allocPoint = allocPointBase ; for ( let i = 3 ; i < vaults . length + 3 ; i ++ ) { if ( ! POOL_ENABLE_STATUS [ i ] ) { continue ; } let poolId = i ; let kVault = i let vault = vaults [ kVault - 3 ] ; let now = Math . floor ( ( new Date ( ) ) . getTime ( ) / 1000 - 3600 ) ; let vaultInstance = await vault . new ( ifaMasterInstance . address , publicContractAddress . CreateIFA , publicContractAddress . ShareRevenue ) . then ( ( result ) => { console . log ( ` ${ poolVaultName [ i ] } ` , result . address ) ; return result ; } ) ; poolVaultContractAddress [ poolVaultName [ i ] ] = vaultInstance . address ; await ifaMasterInstance . addVault ( kVault , vaultInstance . address ) ; if ( i > 2 && i <= 5 ) { allocPoint = allocPointBase * 5 } else if ( i > 5 ) { allocPoint = allocPointBase * 50 } await createIFAInstance . setPoolInfo ( poolId , vaultInstance . address , lpToken [ i - 3 ] , allocPoint , false ) ; } console . log ( ` \n ` ) contracts . uniswapV2Factory = uniswapsAddress . factory ; contracts . uniswapV2Router = uniswapsAddress . router ; contracts . rUSD = itokensAddress . rUSD contracts . rBTC = itokensAddress . rBTC contracts . rETH = itokensAddress . rETH contracts . USDT = addressItem . tokensAddress . HUSD contracts . HBTC = addressItem . tokensAddress . HBTC contracts . ETH = addressItem . tokensAddress . HETH contracts . RICE = addressItem . tokensAddress . RICE contracts . USD = addressItem . tokensAddress . USDT contracts . iUSD_DAI = addressItem . lpTokenAddress . rUSD_USDT contracts . iBTC_wBTC = addressItem . lpTokenAddress . rBTC_HBTC contracts . iETH_ETH = addressItem . lpTokenAddress . rETH_HETH contracts . IFA_DAI = addressItem . lpTokenAddress . RICE_rUSD contracts . IFA_wBTC = addressItem . lpTokenAddress . RICE_rBTC contracts . IFA_ETH = addressItem . lpTokenAddress . RICE_rETH contracts . IFAMaster = addressItem . public . IFAMaster contracts . IFAPool = addressItem . public . IFAPool contracts . IFABank = addressItem . public . IFABank contracts . IFARevenue = addressItem . public . IFARevenue contracts . Costco = addressItem . public . Costco contracts . IFADataBoard = addressItem . public . IFADataBoard contracts . CreateIFA = addressItem . public . CreateIFA contracts . ShareRevenue = addressItem . public . ShareRevenue contracts . BirrCastle = addressItem . poolVaults . BirrCastle contracts . Sunnylands = addressItem . poolVaults . Sunnylands contracts . ChateauLafitte = addressItem . poolVaults . ChateauLafitte contracts . AdareManor = addressItem . poolVaults . AdareManor contracts . VillaDEste = addressItem . poolVaults . VillaDEste contracts . VillaLant = addressItem . poolVaults . VillaLant contracts . VillaFarnese = addressItem . poolVaults . VillaFarnese contracts . ChatsworthHouse = addressItem . poolVaults . ChatsworthHouse contracts . ChateauMargaux = addressItem . poolVaults . ChateauMargaux contracts . BirrCastleCalculators = addressItem . calculatorsAddress . BirrCastleCalculators contracts . SunnylandsCalculators = addressItem . calculatorsAddress . SunnylandsCalculators contracts . ChateauLafitteCalculators = addressItem . calculatorsAddress . ChateauLafitteCalculators }
depoly lp token pools total:6
depoly lp token pools total : 6
// Whether to deploy the current pool , Do not deploy when POOL_ENABLE_STATUS is false // close pool // await ifaPoolInstance.setPoolInfo(poolId, lpToken[i - 3], vaultInstance.address, now); // export address