diff --git a/lib/modules/deployment/contract_deployer.js b/lib/modules/deployment/contract_deployer.js index 9966f9df2..ae97e0024 100644 --- a/lib/modules/deployment/contract_deployer.js +++ b/lib/modules/deployment/contract_deployer.js @@ -144,6 +144,7 @@ class ContractDeployer { }); }, function deployIt(next) { + let skipBytecodeCheck = false; if (contract.address !== undefined) { try { utils.toChecksumAddress(contract.address); @@ -155,9 +156,7 @@ class ContractDeployer { return next(e.message); } contract.deployedAddress = contract.address; - self.logFunction(contract)(contract.className.bold.cyan + __(" already deployed at ").green + contract.address.bold.cyan); - self.events.emit("deploy:contract:deployed", contract); - return next(); + skipBytecodeCheck = true; } self.plugins.emitAndRunActionsForEvent('deploy:contract:shouldDeploy', {contract: contract, shouldDeploy: true}, function(_err, params) { @@ -175,7 +174,7 @@ class ContractDeployer { } self.blockchain.getCode(trackedContract.address, function(_getCodeErr, codeInChain) { - if (codeInChain !== "0x") { + if (codeInChain.length > 3 || skipBytecodeCheck) { // it is "0x" or "0x0" for empty code, depending on web3 version self.contractAlreadyDeployed(contract, trackedContract, next); } else { self.deployContract(contract, next);