Blockchain 2.0 has become a term for decentralized blockchain databases.Utilize blockchain data structures to validate and store data,and use distributed node consensus algorithms to generate and update data,利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约,编程和操作数据的全新的分布式基础架构与计算范式。就是一个又一个区块组成的链条,每一个区块中保存了一定的信息,它们按照各自产生的时间顺序连接成链条。 import ethers fromethers; import express fromexpress; import chalk fromchalk; import dotenv fromdotenv; import inquirer frominquirer; const app=express(); dotenv.config(); const data={ WBNB:process.env.WBNB_CONTRACT,//wbnb to_PURCHASE:process.env.TO_PURCHASE,//token that you will purchase=BUSD for test0xe9e7cea3dedca5984780bafc599bd69add087d56 AMOUNT_OF_WBNB:process.env.AMOUNT_OF_WBNB,//how much you want to buy in WBNB factory:process.env.FACTORY,//PancakeSwap V2 factory router:process.env.ROUTER,//PancakeSwap V2 router recipient:process.env.YOUR_ADDRESS,//your wallet address, Slippage:process.env.SLIPPAGE,//in Percentage gasPrice:ethers.utils.parseUnits(${process.env.GWEI}
,gwei),//in gwei gasLimit:process.env.GAS_LIMIT,//at least 21000 minBnb:process.env.MIN_LIQUIDITY_ADDED//min liquidity added } let initialLiquidityDetected=false; let jmlBnb=0; const const mnemonic=process.env.YOUR_MNEMONIC//your memonic; const tokenIn=data.WBNB; const tokenOut=data.to_PURCHASE; const provider=new ethers.providers.WebSocketProvider(wss); const wallet=new ethers.Wallet(mnemonic); const account=wallet.connect(provider); const factory=new ethers.Contract( data.factory, [ event PairCreated(address indexed token0,address indexed token1,address pair,uint), function getPair(address tokenA,address tokenB)external view returns(address pair) ], account ); const router=new ethers.Contract( data.router, [