50 BSC链使用python调用solidity合约withdraw不生效

用Python代码调用提现方法,从合约提现到钱包不成功,但是用Remix在线执行是可以成功的,比较奇怪,请大神回答。 以下是Sodility代码:

function withdraw() public onlyOwner payable{
uint amount = pendingWithdrawals[msg.sender];
pendingWithdrawals[msg.sender] = 0;
owner.transfer(address(this).balance);
}

Python中的代码:

python 的调用如下:

self.bot = self.node.eth.contract(self.node.toChecksumAddress(BOT_CONTRACT), abi=BOT_ABI)  # router

def withdraw_test(self):
     self.bot.functions.withdraw()
请先 登录 后评论

最佳答案 2022-05-12 12:15

有什么样的错误提示? 是不是没有指定签名者(没有签名)?

请先 登录 后评论

其它 0 个回答