Skip to content

Instantly share code, notes, and snippets.

@janfilips
Created July 14, 2018 22:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save janfilips/7d4438e623c07f70c50fc41aeb058194 to your computer and use it in GitHub Desktop.
Save janfilips/7d4438e623c07f70c50fc41aeb058194 to your computer and use it in GitHub Desktop.
import os
import json
import web3
from web3 import Web3
from eth_account import Account
from solc import compile_source
from web3.contract import ConciseContract
from eth_account.messages import defunct_hash_message
from web3.providers.rpc import HTTPProvider
wallet = "0xf53516510035433247Ad74b87A63d9B6a191b1b4"
passphrase='mrdka pica srac riti pici'
private_key = b'S\xb1\xab\xcfB\xa8k\xf4\xea\x98\xe0H\x80,\x03M\xf73a\x84Di\xad\xf9\x0c|i\xf9\xf3|n\x0b'
# web3.py instance
w3 = Web3(HTTPProvider('https://ropsten.infura.io'))
#account = w3.eth.account.create(passphrase)
#w3.eth.defaultAccount = account
#print ('wallet address', account.address)
#print ('private key', account.privateKey)
#print ('-'*80)
account = Account.privateKeyToAccount(private_key)
#print ('account', account)
#print ('account wallet', account.address)
print ('unlocked_account', unlocked_account)
unlocked_account = w3.personal.unlockAccount('0xf53516510035433247Ad74b87A63d9B6a191b1b4',passphrase,1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment