mirror of
https://github.com/chaintool-py/eth-erc20.git
synced 2024-11-25 19:26:46 +01:00
Remove g option
This commit is contained in:
parent
f2d35bf3fd
commit
f266dc6056
13
deploy.py
13
deploy.py
@ -23,11 +23,11 @@ logging.getLogger('urllib3').setLevel(logging.WARNING)
|
|||||||
|
|
||||||
argparser = argparse.ArgumentParser()
|
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('-p', '--provider', dest='p', default='http://localhost:8545', type=str, help='Web3 provider url (http only)')
|
||||||
argparser.add_argument('-g', '--gift', dest='g', action='store_true', help='If set, tokens will be gifted to all accounts in provider wallet')
|
#argparser.add_argument('-g', '--gift', dest='g', action='store_true', help='If set, tokens will be gifted to all accounts in provider wallet')
|
||||||
argparser.add_argument('-n', '--name', dest='n', default='Giftable Token', type=str, help='Token name')
|
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('-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('-d', '--decimals', dest='d', default=18, type=int, help='Token decimals')
|
||||||
argparser.add_argument('-a', '--account', dest='a', type=str, help='Owner account. If not specified, first account in wallet will be used')
|
argparser.add_argument('-a', '--account', dest='a', action='append', type=str, help='Account to fund')
|
||||||
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
argparser.add_argument('-v', action='store_true', help='Be verbose')
|
||||||
argparser.add_argument('amount', type=int, help='Initial token supply (will be owned by contract creator)')
|
argparser.add_argument('amount', type=int, help='Initial token supply (will be owned by contract creator)')
|
||||||
args = argparser.parse_args()
|
args = argparser.parse_args()
|
||||||
@ -46,10 +46,6 @@ if __name__ == '__main__':
|
|||||||
bytecode = f.read()
|
bytecode = f.read()
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
if args.a != None:
|
|
||||||
a = web3.Web3.toChecksumAddress(args.a)
|
|
||||||
w3.eth.defaultAccount = a
|
|
||||||
else:
|
|
||||||
w3.eth.defaultAccount = w3.eth.accounts[0]
|
w3.eth.defaultAccount = w3.eth.accounts[0]
|
||||||
|
|
||||||
c = w3.eth.contract(abi=abi, bytecode=bytecode)
|
c = w3.eth.contract(abi=abi, bytecode=bytecode)
|
||||||
@ -62,8 +58,9 @@ if __name__ == '__main__':
|
|||||||
balance = c.functions.balanceOf(w3.eth.defaultAccount).call()
|
balance = c.functions.balanceOf(w3.eth.defaultAccount).call()
|
||||||
logg.info('balance {}: {}'.format(w3.eth.defaultAccount, balance))
|
logg.info('balance {}: {}'.format(w3.eth.defaultAccount, balance))
|
||||||
|
|
||||||
if args.g:
|
|
||||||
for a in w3.eth.accounts:
|
if args.a != None:
|
||||||
|
for a in args.a:
|
||||||
if a == w3.eth.defaultAccount:
|
if a == w3.eth.defaultAccount:
|
||||||
continue
|
continue
|
||||||
tx_hash = c.functions.gift(a, args.amount).transact()
|
tx_hash = c.functions.gift(a, args.amount).transact()
|
||||||
|
Loading…
Reference in New Issue
Block a user