diff --git a/gateway/management/commands/deployar_smart_contract.py b/gateway/management/commands/deployar_smart_contract.py index 485901a88b0564a6ecdeca0b69c5e71f3836d68a..e0600c5fd25a5fbd0dcdef901303a4aed36b1329 100644 --- a/gateway/management/commands/deployar_smart_contract.py +++ b/gateway/management/commands/deployar_smart_contract.py @@ -18,6 +18,8 @@ class Command(BaseCommand): parser.add_argument('--bytecode', help='Path del bytecode', action=str) parser.add_argument('--abi', help='Path del abi', action=str) parser.add_argument('--gas', help='Gas a usar', action=int) + parser.add_argument('--constructor_args', help='Parametros del constructor en formato json', nargs='*', + default='{}') parser.set_defaults(node_url=None, account=None, bytecode=None, abi=None, gas=None, is_poa=False) def handle(self, *args, **options): @@ -55,7 +57,7 @@ class Command(BaseCommand): deployer = ContractDeployer(gateway) - gas = deployer.estimate_deploy(abi, bytecode) + gas = deployer.estimate_deploy(abi, bytecode, None) logger.info("Gas estimado: {}".format(str(gas))) if options['gas'] is not None: gas_aux = options['gas'] @@ -64,7 +66,7 @@ class Command(BaseCommand): if gas_aux is not '': gas = int(gas_aux) - tx_receipt = deployer.deploy_contract(abi, bytecode, gas, True) + tx_receipt = deployer.deploy_contract(abi, bytecode, gas, True, None, False) logger.info("Contract address: {0}".format(tx_receipt['contractAddress'])) logger.info("tx_receipt: {}".format(str(tx_receipt))) except Exception as e: