erc20-faucet

ERC20 token faucet
Log | Files | Refs

commit ac7054965effaa293d5064f98a2879db81227e7d
parent a091ea58797897d56c366ac25f2d0bb2b6fa1c9c
Author: nolash <dev@holbrook.no>
Date:   Thu, 24 Dec 2020 08:23:47 +0100

Fix typos in executable change

Diffstat:
Mpython/CHANGELOG | 4+++-
Mpython/erc20_single_shot_faucet/runnable/deploy.py | 10++++++++++
Mpython/setup.cfg | 2+-
3 files changed, 14 insertions(+), 2 deletions(-)

diff --git a/python/CHANGELOG b/python/CHANGELOG @@ -1,5 +1,7 @@ +- 0.1.1 + * Add set amount on deploy executable - 0.1.0 - * Add account index backend for verification of user + * Add (optional) account index backend for verification of user - 0.0.4 * Fix owner flag processing typo - 0.0.3 diff --git a/python/erc20_single_shot_faucet/runnable/deploy.py b/python/erc20_single_shot_faucet/runnable/deploy.py @@ -29,6 +29,7 @@ argparser.add_argument('-p', '--provider', dest='p', default='http://localhost:8 argparser.add_argument('-a', '--approvers', dest='a', action='append', type=str, help='Approver account to add') argparser.add_argument('-o', '--owner', dest='o', type=str, help='Owner account (provider must have private key)') argparser.add_argument('-t', '--token-address', dest='t', required=True, type=str, help='Token to add faucet for') +argparser.add_argument('--set-amount', dest='amount', default=0, type=int, help='Initial amount to set. Will be 0 if not set!') argparser.add_argument('-i', '--account-index-address', dest='i', required=False, type=str, help='Accounts index to verify requesting address against (if not specified, any address may use the faucet') argparser.add_argument('--abi-dir', dest='abi_dir', type=str, default=data_dir, help='Directory containing bytecode and abi (default: {})'.format(data_dir)) argparser.add_argument('-v', action='store_true', help='Be verbose') @@ -81,6 +82,15 @@ def main(): tx_hash = c.constructor(approvers, token_address, store_address, accounts_index_address).transact() rcpt = w3.eth.getTransactionReceipt(tx_hash) address = rcpt.contractAddress + + if args.amount > 0: + c = w3.eth.contract(abi=abi, address=address) + tx_hash = c.functions.setAmount(args.amount).transact() + logg.debug('setting initial ammount to {} tx_hash {}'.format(args.amount, tx_hash)) + r = w3.eth.getTransactionReceipt(tx_hash) + amount = c.functions.amount().call() + logg.info('set initial ammount tx_hash {}'.format(amount)) + print(address) diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = erc20-single-shot-faucet -version = 0.1.0 +version = 0.1.1 description = ERC20 token faucet that can be used once per account author = Louis Holbrook author_email = dev@holbrook.no