最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會員登陸 & 注冊

數(shù)字貨幣去中心化交易所系統(tǒng)開發(fā)(方案項目)/案例詳情/源碼功能/成熟技術(shù)

2023-07-05 09:33 作者:bili_36625761919  | 我要投稿

  區(qū)塊鏈數(shù)據(jù)層包括底層數(shù)據(jù)區(qū)塊、基礎(chǔ)數(shù)據(jù)、算法等內(nèi)容,數(shù)據(jù)層的創(chuàng)新改變數(shù)據(jù)結(jié)構(gòu),提升存儲效率,降低存儲空間。


  數(shù)字貨幣交易所開發(fā)技術(shù)是一種去中心化的共識機制,來維護一個完整的、分布式的、不可篡改的賬本數(shù)據(jù)庫的技術(shù)。It can enable participants in the blockchain to achieve a unified ledger system without establishing trust relationships.


  如果區(qū)塊鏈是數(shù)據(jù)庫,則智能合約是使區(qū)塊鏈技術(shù)能夠應(yīng)用于現(xiàn)實世界的應(yīng)用層。智能合約是在區(qū)塊鏈數(shù)據(jù)庫上運行的計算機程序,在滿足其源代碼中寫入的條件時可以自己執(zhí)行。


  let buyAction=async()=>{


  if(initialLiquidityDetected===true){


  console.log('not buy cause already buy');


  return null;


  }


  console.log('ready to buy');


  try{


  initialLiquidityDetected=true;


  let amountOutMin=0.;


  //We buy x amount of the new token for our wbnb


  const amountIn=ethers.utils.parseUnits(`${data.AMOUNT_OF_WBNB}`,'ether');


  //if(parseInt(data.Slippage)!==0){


  //const amounts=await router.getAmountsOut(amountIn,[tokenIn,tokenOut]);


  //Our execution price will be a bit different,we need some flexbility


  //amountOutMin=amounts[1].sub(amounts[1].div(`${data.Slippage}`));


  //}


  console.log(


  chalk.green.inverse(`Start to buyn`)


  +


  `Buying Token


  =================


  tokenIn:${(amountIn*1e-18).toString()}${tokenIn}(BNB)


  tokenOut:${(amountOutMin/1e-18).toString()}${tokenOut}


  `);


  console.log('Processing Transaction.....');


  console.log(chalk.yellow(`amountIn:${(amountIn*1e-18)}${tokenIn}(BNB)`));


  console.log(chalk.yellow(`amountOutMin:${amountOutMin/1e-18}`));


  console.log(chalk.yellow(`tokenIn:${tokenIn}`));


  console.log(chalk.yellow(`tokenOut:${tokenOut}`));


  console.log(chalk.yellow(`data.recipient:${data.recipient}`));


  console.log(chalk.yellow(`data.gasLimit:${data.gasLimit}`));


  console.log(chalk.yellow(`data.gasPrice:${data.gasPrice}`));


  const tx=await router.swapExactTokensForTokensSupportingFeeOnTransferTokens(//uncomment this if you want to buy deflationary token


  //const tx=await router.swapExactTokensForTokens(//uncomment here if you want to buy token


  amountIn,


  amountOutMin,


  [tokenIn,tokenOut],


  data.recipient,


  Date.now()+1000*60*5,//5 minutes


  {


  'gasLimit':data.gasLimit,


  'gasPrice':data.gasPrice,


  'nonce':null//set you want buy at where position in blocks


  });


  const receipt=await tx.wait();


  console.log(`Transaction receipt:https://www.bscscan.com/tx/${receipt.logs[1].transactionHash}`);


  setTimeout(()=>{process.exit()},4000);


  }catch(err){


  let error=JSON.parse(JSON.stringify(err));


  console.log(`Error caused by:


  {


  reason:${error.reason},


  transactionHash:${error.transactionHash}


  message:Please check your BNB/WBNB balance,maybe its due because insufficient balance or approve your token manually on pancakeSwap


  }`);


  console.log(error);


  inquirer.prompt([


  {


  type:'confirm',


  name:'runAgain',


  message:'Do you want to run again thi bot?',


  },


  ])


  .then(answers=>{


  if(answers.runAgain===true){


  console.log


  console.log('Run again');


  console.log


  initialLiquidityDetected=false;


  run();


  }else{


  process.exit();


  }


  });


  }


  }


  run();


  const PORT=5001;


  app.listen(PORT,console.log(chalk.yellow(`Listening for Liquidity Addition to token${data.to_PURCHASE}`)));


數(shù)字貨幣去中心化交易所系統(tǒng)開發(fā)(方案項目)/案例詳情/源碼功能/成熟技術(shù)的評論 (共 條)

分享到微博請遵守國家法律
永新县| 精河县| 西吉县| 五原县| 甘肃省| 正阳县| 祁门县| 奉化市| 洪洞县| 喀喇| 南溪县| 蓬安县| 新密市| 邳州市| 泰来县| 延庆县| 和平县| 抚顺县| 岳普湖县| 高密市| 台中县| 淅川县| 股票| 忻城县| 澳门| 屯昌县| 舞阳县| 南开区| 宁乡县| 房山区| 百色市| 西乡县| 翁牛特旗| 抚宁县| 明光市| 嘉荫县| 南召县| 乌兰浩特市| 宜都市| 青岛市| 明溪县|