用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()