Created
February 16, 2017 18:25
-
-
Save thebalaa/72fca753d725a4d5bf5bd2cf12df08b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create an account and unlock it | |
web3.personal.newAccount('password') | |
web3.personal.unlockAccount(web3.eth.accounts[0], 'password') | |
# load bytcode and abi from local file | |
bytecode = open('provenanve.bytcode', 'r').read() | |
abi = open('provenanve.abi', 'r').read() | |
# instantiate and deploy contract | |
contract = web3.eth.contract(abi, bytecode=bytecode) | |
contract.deploy(transaction={"from":web3.eth.accounts[0]}) | |
# re-instantiate contract with address | |
contract = web3.eth.contract(contract_name='provenance', abi=abi, address='0xaD82D4a32a7A066C0971234412ab4b01bd130FB3') | |
# call create data | |
contract.transact({"from":web3.eth.accounts[0]}).createData('0xaD82D4a32a7A066C0971234412ab4b01bd130FB3','0xaD82D4a32a7A066C0971234412ab4b01bd130FB3') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, after line 11, how do I get the deployed contract address??