Setup

    // wallet from mnemonic
    let wallet = new ethers.Wallet.fromMnemonic(mnemonic)
    console.log(blue('address'), wallet.address)

    // connect provider to wallet
    wallet = wallet.connect(provider)

    // add wallet address to list of bot addresses
    walletAddresses.push(wallet.address)    
    
    // wallet balance
    const walletBalance = await wallet.getBalance()
    const formattedBalance = ethers.utils.formatEther(walletBalance)
    console.log(blue('wallet balance:'), formattedBalance, blue('matic\n'))
    
    // contracts
    contracts.LongShortContract = new ethers.Contract(long_short_address, LONG_SHORT_ABI, wallet)
    contracts.StakerContract = new ethers.Contract(staker_address, STAKER_ABI, wallet)
    contracts.DaiContract = new ethers.Contract(dai_address, DAI_ABI, wallet)

Last updated