Remove hardcoded sender address

This commit is contained in:
nolash 2020-12-08 20:54:21 +01:00
parent 1b37e0726a
commit 05234aa73c
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746

View File

@ -47,10 +47,11 @@ def main():
w3.eth.defaultAccount = w3.eth.accounts[0]
if args.o != None:
w3.eth.defaultAccount = web3.Web3.toChecksumAddress(args.o)
w3.eth.defaultAccount = args.o
logg.debug('owner address {}'.format(w3.eth.defaultAccount))
c = w3.eth.contract(abi=abi, bytecode=bytecode)
tx_hash = c.constructor().transact({'from': w3.eth.accounts[0]})
tx_hash = c.constructor().transact()
rcpt = w3.eth.getTransactionReceipt(tx_hash)
@ -72,7 +73,7 @@ def main():
if not args.k:
logg.debug('deleting sender for write list')
c.functions.deleteWriter(w3.eth.accounts[0]).transact()
c.functions.deleteWriter(w3.eth.defaultAccount).transact()
print(address)