index.js
/* Main function because we like async and await  */
Main function because we like async and await
Main function because we like async and await
async function main(nextJob){
console.log('Starting asset conversion on the EggMaker contract.')
  for (i = 0; i < tokens.length; i++) {
    console.log(`Converting Token: ${tokens[i].name}  Address: ${tokens[i].addr}`);
    const tx = await CONTRACT.convert(WEXP.addr, tokens[i].addr, { gasPrice: gasPrice, gasLimit: gasLimit});
    await waitForTx(provider, tx.hash)
  }
console.log(`Finished conversion. Next job @ ${nextJob}`)
}
async function main ( nextJob ) { console . log ( 'Starting asset conversion on the EggMaker contract.' ) for ( i = 0 ; i < tokens . length ; i ++ ) { console . log ( ` ${ tokens [ i ] . name } ${ tokens [ i ] . addr } ` ) ; const tx = await CONTRACT . convert ( WEXP . addr , tokens [ i ] . addr , { gasPrice : gasPrice , gasLimit : gasLimit } ) ; await waitForTx ( provider , tx . hash ) } console . log ( ` ${ nextJob } ` ) }
Main function because we like async and await
Main function because we like async and await