币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】

  • A+
所属分类:币安BSC

chatGPT账号

币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】

一、说明
在合约开发过程中直接在合约创建本币和WETH(BNB)的交易对时,在合约部署完成,BNB的资金池对创建完成后,会被脚本程序恶意向BNB对资金池地址打入0.000000000000000001个WBNB,也就是最小数量的WBNB。这样当用户在pancakeswapV2上添加BNB交易对的流动性时,资金池中本币的数量为0,但是又存在wbnb,这样无法计算添加流动性的价格。因为按照当前代币的比例为0.000000000000000001 : 0 ,本币的价格为0,bnb的价格为无穷大。因此,无法添加bnb交易对的流动性。
在pancakeswapV2 操作界面上直接提示无法添加BNB的交易对,需要修复该lp资金池对,并给出了官网的解决方案。
二、官方解决方案
针对该bug,官方给出了标准的解决方案:
Why can’t I add liquidity to a pair I just created?
Due to a bug from the legacy Exchange V2 (present in every UniSwap V2 forks), you will not be able to add liquidity to a pair using the normal PancakeSwap liquidity UI and its contract calls if a pair is:
  • Created by calling createPair on FactoryV2 without depositing initial liquidity and minting the initial LP tokens
  • Then, one of the tokens in the pair has been manually transferred into the pool contract while calling sync
Recently, an increase amount of such attacks were spotted on PancakeSwap Exchange V2 on BNB Chain.
We strongly recommend using our UI to create the trading pair for your token by adding the initial liquidity with the pair creation.
While Chefs are working hard on a solution to resolve this issue, here is a step-by-step guide to resolve this using BscScan:
Locate the pool address and its BscScan page
币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】
If your pair is affected, you will see the link to the BscScan page for the trading pair/pool in the error prompt.
Alternatively, you can head to Factory V2 (Bsc), go to “Read Contract”, “6. getPair”, enter the address of the two tokens in your trading pair, and click “Query”. You should see the pair address in the return field.
Check which token has been deposited and transfer the other token into the pair manually
币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】
From the token balance field on BscScan, you can check which token has been deposited into the pool. Usually, it should be the paired token. (Like WBNB, USDT, etc…)
Once confirmed, you must manually transfer the other asset into the pool contract. You may do that in the wallet app you prefer by entering the pool address as the receiver.
You can transfer any amount but since this is effectively “donating” assets to a pool. You will be transfering your assets into a liquidity without minting liquidity tokens. So we recommend keeping this amount minimal.
IMPORTANT: Once you’ve transferred the token, you must call sync()immediately on the pool.
You can do so by heading to the BscScan page for the trading pair, going to “Write Contract”, “8. Sync”, and clicking the “Write” button. You will need to connect your wallet before performing the transaction.
What if I want to define the launch price?
You must adjust the pool to the launch price while transferring the token and fixing the pool.
The amount to transfer can be calculated using:
  • tokenInside: the token that is already transferred into the pool. Usually it should be the paired token. (Like WBNB, USDT, etc…)
  • tokenToSend: the token that is about to be sent to the pool. Usually it should be your project token
  • tokenInside.price: the USD price of tokenInside
  • tokenToSend.price: the USD price of tokenToSend (the launch price)
  • pool: the V2 pool
With the following formula:
amountToSend = tokenInside.balanceOf(pool) / tokenInside.decimal() * tokenInside.price / tokenToSend.price * tokenToSend.decimal()
If the result is smaller than 0 (usually happens when the launch price is very large. You may need to first deposit more tokenInside into the pool)

pdf+视频币安智能链BSC发币教程及多模式组合合约源代码下载:

币安智能链BSC发币(合约部署、开源、锁仓、LP、参数配置、开发、故障处理、工具使用)教程下载:

币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】

多模式(燃烧、回流指定营销地址、分红本币及任意币种,邀请推广八代收益,LP加池分红、交易分红、复利分红、NFT分红、自动筑池、动态手续费、定时开盘、回购)组合合约源代码下载:

币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】

pdf+视频币安智能链BSC发币教程及多模式组合合约源代码下载地址:

此处为隐藏的内容!
登录后才能查看!

添加VX或者telegram获取全程线上免费指导

币安BSC智能链发币教程——合约自动创建的bnb资金池对被恶意打入WBNB导致添加流动性失败【pdf+视频BSC发币教程下载】

免责声明

发文时比特币价格:$71249

当前比特币价格:[crypto coins=”BTC” type=”text” show=”price”]

当前比特币涨幅:[crypto coins=”BTC” type=”text” show=”percent”]

免责声明:

本文不代表路远网立场,且不构成投资建议,请谨慎对待。用户由此造成的损失由用户自行承担,与路远网没有任何关系;

路远网不对网站所发布内容的准确性,真实性等任何方面做任何形式的承诺和保障;

网站内所有涉及到的区块链(衍生)项目,路远网对项目的真实性,准确性等任何方面均不做任何形式的承诺和保障;

网站内所有涉及到的区块链(衍生)项目,路远网不对其构成任何投资建议,用户由此造成的损失由用户自行承担,与路远网没有任何关系;

路远区块链研究院声明:路远区块链研究院内容由路远网发布,部分来源于互联网和行业分析师投稿收录,内容为路远区块链研究院加盟专职分析师独立观点,不代表路远网立场。

本文是全系列中第17 / 223篇:行业技术

  • 我的微信
  • 这是我的微信扫一扫
  • weinxin
  • 我的电报
  • 这是我的电报扫一扫
  • weinxin
chatGPT账号
路远

发表评论

您必须登录才能发表评论!