erc20-transfer-authorization

Simple approval escrow for ERC20 spending
Log | Files | Refs

commit e2244bd052c7ce929c0ae323ca4789eb2eaec6fa
parent 2e705e19e104c6661eef36b2fbc27e2d24fc9ca8
Author: nolash <dev@holbrook.no>
Date:   Fri, 11 Dec 2020 16:51:13 +0100

Rename contracts-dir flag to abi-dir, use package data dir as abi dir

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

diff --git a/python/CHANGELOG b/python/CHANGELOG @@ -1,3 +1,6 @@ +- 0.0.4 + * Rename contracts-dir flag to abi-dir + * Use package data dir as default abi dir - 0.0.3 * Add owner flag in deploy script - 0.0.2 diff --git a/python/erc20_approval_escrow/runnable/deploy.py b/python/erc20_approval_escrow/runnable/deploy.py @@ -21,11 +21,14 @@ logg = logging.getLogger() logging.getLogger('web3').setLevel(logging.WARNING) logging.getLogger('urllib3').setLevel(logging.WARNING) +script_dir = os.path.dirname(__file__) +data_dir = os.path.join(script_dir, '..', 'data') + 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('--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') args = argparser.parse_args() @@ -35,11 +38,11 @@ if args.v: def main(): w3 = web3.Web3(web3.Web3.HTTPProvider(args.p)) - f = open(os.path.join(args.contracts_dir, 'ERC20ApprovalEscrow.abi.json'), 'r') + f = open(os.path.join(args.abi_dir, 'ERC20ApprovalEscrow.abi.json'), 'r') abi = json.load(f) f.close() - f = open(os.path.join(args.contracts_dir, 'ERC20ApprovalEscrow.bin'), 'r') + f = open(os.path.join(args.abi_dir, 'ERC20ApprovalEscrow.bin'), 'r') bytecode = f.read() f.close() diff --git a/python/setup.cfg b/python/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = erc20-approval-escrow -version = 0.0.3 +version = 0.0.4 description = Simple approval escrow for ERC20 spend approval author = Louis Holbrook author_email = dev@holbrook.no