Pancakeswap事务失败消息python

2024-05-27 11:18:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用此代码段并进行相关更改 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,所以理论上滑动应该不重要。 有什么想法吗?多谢各位


Tags: tofromhttpsgithubcomyoutimeaddress

热门问题