Skip to content

Instantly share code, notes, and snippets.

@dendisuhubdy
Created April 11, 2021 06:19
Show Gist options
  • Save dendisuhubdy/dfda6921940c0c65a51699c7207a094c to your computer and use it in GitHub Desktop.
Save dendisuhubdy/dfda6921940c0c65a51699c7207a094c to your computer and use it in GitHub Desktop.
token_from = "0x0d0707963952f2fba59dd06f2b425ace40b492fe"
token_to = "0x763015f098cf18cfa28baf25653955f271fb63ff"
token_to_private_key = "0x0000000000000000000000000000000"
my_provider = Web3.IPCProvider("~/.local/share/io.parity.ethereum/docker/jsonrpc.ipc")
w3 = Web3(my_provider)
contractAddress = "0xdac17f958d2ee523a2206206994597c13d831ec7"
token = w3.eth.contract(Web3.toChecksumAddress(contractAddress), abi=usdtABI)
transaction = {
'from': token_from,
'to': token_to,
'nonce': w3.eth.getTransactionCount(Web3.toChecksumAddress(token_from)),
'gas': 2000000,
'gasPrice': 234567897654321,
'data' : token.caller.transfer(Web3.toChecksumAddress(token_to), 10000000),
'chainId': 1,
}
signed = w3.eth.account.signTransaction(transaction, token_to_private_key)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment