From 3d2a14e28b6fbffb8df46930cb17224463d58b08 Mon Sep 17 00:00:00 2001 From: Iuri Matias Date: Mon, 31 Aug 2015 21:14:12 -0400 Subject: [PATCH] check if contract exists --- lib/deploy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/deploy.js b/lib/deploy.js index e65a3625..e1c84709 100644 --- a/lib/deploy.js +++ b/lib/deploy.js @@ -82,7 +82,7 @@ Deploy.prototype.deploy_contracts = function(env) { else { var chainContract = this.chainManager.getContract(className, contract.compiled.code, realArgs); - if (chainContract != undefined) { + if (chainContract != undefined && web3.eth.getCode(chainContract.address) !== "0x") { console.log("contract " + className + " is unchanged and already deployed at " + chainContract.address); this.deployedContracts[className] = chainContract.address; this.execute_cmds(contract.onDeploy);