From 646fc8c1e1259f3871475c9fdf4ba0e0eeafbd50 Mon Sep 17 00:00:00 2001 From: nolash Date: Tue, 8 Dec 2020 19:37:20 +0100 Subject: [PATCH] Add owner flag to deploy script --- python/CHANGELOG | 2 ++ python/giftable_erc20_token/runnable/deploy.py | 3 +++ python/setup.cfg | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/python/CHANGELOG b/python/CHANGELOG index 8fd5022..fb11245 100644 --- a/python/CHANGELOG +++ b/python/CHANGELOG @@ -1,3 +1,5 @@ +* 0.0.5 + - Add token owner flag to deploy script * 0.0.4 - Bundle abi in data subfolder * 0.0.3 diff --git a/python/giftable_erc20_token/runnable/deploy.py b/python/giftable_erc20_token/runnable/deploy.py index 9c589fb..ad6e6ab 100644 --- a/python/giftable_erc20_token/runnable/deploy.py +++ b/python/giftable_erc20_token/runnable/deploy.py @@ -27,6 +27,7 @@ argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8 argparser.add_argument('-n', '--name', dest='n', default='Giftable Token', type=str, help='Token name') argparser.add_argument('-s', '--symbol', dest='s', default='GFT', type=str, help='Token symbol') argparser.add_argument('-d', '--decimals', dest='d', default=18, type=int, help='Token decimals') +argparser.add_argument('-o', '--owner', dest='o', type=str, help='Reserve owner account') argparser.add_argument('-a', '--account', dest='a', action='append', type=str, help='Account to fund') argparser.add_argument('-m', '--minter', dest='m', action='append', type=str, help='Minter to add') argparser.add_argument('--contracts-dir', dest='contracts_dir', type=str, default='.', help='Directory containing bytecode and abi') @@ -49,6 +50,8 @@ def main(): f.close() w3.eth.defaultAccount = w3.eth.accounts[0] + if args.o != None: + w3.eth.defaultAccount = web3.Web3.toChecksumAddress(args.o) c = w3.eth.contract(abi=abi, bytecode=bytecode) tx_hash = c.constructor(args.n, args.s, args.d).transact() diff --git a/python/setup.cfg b/python/setup.cfg index 3c8bf1a..0ef5fdc 100644 --- a/python/setup.cfg +++ b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = giftable-erc20-token -version = 0.0.4 +version = 0.0.5 description = Simple ERC20 contract with deployment script that lets any address mint and gift itself tokens. author = Louis Holbrook author_email = dev@holbrook.no