import { BIG_NUMBER_1E18 } from "../../test/testUtils" ; import { DeployFunction } from "hardhat-deploy/types" ; import { HardhatRuntimeEnvironment } from "hardhat/types" ; import { MiniChefV2 } from "../../build/typechain" ; import { ethers } from "hardhat" ; const func = async function ( hre ) { const { deployments , getNamedAccounts , getChainId } = hre ; const { deploy , get , execute , getOrNull } = deployments ; const { deployer } = await getNamedAccounts ( ) ; if ( ( await getOrNull ( "MiniChefV2" ) ) == null ) { await deploy ( "MiniChefV2" , { from : deployer , log : true , skipIfAlreadyDeployed : true , args : [ ( await get ( "SDL" ) ) . address ] , } ) ; const minichef = await ethers . getContract ( "MiniChefV2" ) ; const TOTAL_LM_REWARDS = BIG_NUMBER_1E18 . mul ( 12500000 ) ; const lmRewardsPerSecond = TOTAL_LM_REWARDS . div ( 6 * 4 * 7 * 24 * 3600 ) ; const batchCall = [ await minichef . populateTransaction . setSaddlePerSecond ( lmRewardsPerSecond ) , await minichef . populateTransaction . add ( 1 , "0x0000000000000000000000000000000000000000" , "0x0000000000000000000000000000000000000000" ) , await minichef . populateTransaction . add ( 0 , ( await get ( "SaddleALETHPoolLPToken" ) ) . address , "0x0000000000000000000000000000000000000000" ) , await minichef . populateTransaction . add ( 0 , ( await get ( "SaddleD4PoolLPToken" ) ) . address , "0x0000000000000000000000000000000000000000" ) , await minichef . populateTransaction . add ( 0 , ( await get ( "SaddleUSDPoolV2LPToken" ) ) . address , "0x0000000000000000000000000000000000000000" ) , await minichef . populateTransaction . add ( 0 , ( await get ( "SaddleBTCPoolV2LPToken" ) ) . address , "0x0000000000000000000000000000000000000000" ) , ] ; const batchCallData = batchCall . map ( ( x ) => x . data ) ; await execute ( "MiniChefV2" , { from : deployer , log : true } , "batch" , batchCallData , false ) ; await execute ( "SDL" , { from : deployer , log : true } , "transfer" , ( await get ( "MiniChefV2" ) ) . address , TOTAL_LM_REWARDS . div ( 6 ) ) ; } } ; export default func ; func . tags = [ "MiniChef" ] ;