commit 46d87db9b926c4daf6ce61188d618bf7789d01e1
parent d128a0e53bc3e90c0b1385a3fef4315674bc5217
Author: nolash <dev@holbrook.no>
Date: Tue, 8 Dec 2020 21:00:15 +0100
Add owner flag in deploy
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/python/erc20_approval_escrow/runnable/deploy.py b/python/erc20_approval_escrow/runnable/deploy.py
@@ -23,6 +23,7 @@ logging.getLogger('urllib3').setLevel(logging.WARNING)
argparser = argparse.ArgumentParser()
argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
+argparser.add_argument('-o', '--owner', dest='o', type=str, help='Contract owner')
argparser.add_argument('-a', '--approver', dest='a', action='append', type=str, help='approver to add')
argparser.add_argument('--contracts-dir', dest='contracts_dir', default='.', help='Directory containing bytecode and abi')
argparser.add_argument('-v', action='store_true', help='Be verbose')
@@ -43,6 +44,8 @@ def main():
f.close()
w3.eth.defaultAccount = w3.eth.accounts[0]
+ if args.o != None:
+ w3.eth.defaultAccount = args.o
c = w3.eth.contract(abi=abi, bytecode=bytecode)
@@ -52,12 +55,11 @@ def main():
approvers.append(a)
logg.info('add approver {}'.format(a))
- tx_hash = c.constructor(approvers).transact({'from': w3.eth.accounts[0]})
+ tx_hash = c.constructor(approvers).transact()
rcpt = w3.eth.getTransactionReceipt(tx_hash)
address = rcpt.contractAddress
- #c = w3.eth.contract(abi=abi, address=address)
print(address)