我fork了以太坊主链,通过input data 发送交易,提示错误信息: 'message': 'invalid remainder'
input data的来源:https://etherscan.io/tx/0x79b5b12223bb9881a979599fd4b409fab482e4dd15d4af094411c6967ef42ed5
部分代码:
params = {
'from': from_address,
'nonce': nonce,
'to': contract_address,
'value': w3.toWei(amount, 'ether'),
'gas': gas,
'maxFeePerGas': w3.toWei(gas_fee, 'gwei'),
'maxPriorityFeePerGas': w3.toWei(priorityfee, 'gwei'),
'chainId': chainId,
'data': input_data,
}
signed_tx = w3.eth.account.signTransaction(params, private_key=MY_PRIVATE_KEY)
txn = w3.eth.sendRawTransaction(signed_tx.rawTransaction)
print(w3.toHex(txn))