【问题标题】:Pancakeswap Transaction failed message pythonPancakeswap 交易失败消息 python
【发布时间】:2021-10-05 13:11:43
【问题描述】:

我正在使用此代码片段并进行相关更改 https://github.com/CodeWithJoe2020/pancakeswapBot/blob/main/cakebot.py 它遵守合同。但是,当我尝试使用具有 %7 之类税收的合同时,我从 pancakeswap 收到交易失败错误。

pancakeswap2_txn = contract.functions.swapExactETHForTokens(
0,  # set to 0, or specify minimum amount of tokeny you want to receive - consider decimals!!!
[spend, tokenToBuy],
sender_address,
(int(time.time()) + 30000)
).buildTransaction({
'from': sender_address,
'value': web3.toWei(0.01, 'ether'),  # This is the Token(BNB) amount you want to Swap from
'gas': 159413,
'gasPrice': web3.toWei(speed, 'gwei'),
'nonce': nonce,
})

如您所见,我将最小值设为 0,因此理论上滑点应该无关紧要。 有任何想法吗?谢谢。

【问题讨论】:

  • 对此也有点新意,但也许我可以提供帮助。您能否发送失败交易的 bscscan 交易链接,以便我们进行故障排除?
  • @Bobola 的原因似乎是气少了。我需要将其提高到更高的速率。
  • 太棒了。很高兴你知道了。

标签: python ethereum swap web3


【解决方案1】:

当我输入高gas值时问题已解决

【讨论】:

    猜你喜欢
    • 2021-05-11
    • 2014-04-09
    • 2015-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-05-29
    • 1970-01-01
    相关资源
    最近更新 更多