diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index 9d98b6a02..dfb6bf244 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -116,6 +116,10 @@ class Deploy { } let linkReference = '__' + filename + ":" + contractObj.className; let toReplace = linkReference + "_".repeat(40 - linkReference.length); + if (contractCode.indexOf(linkReference) >= 0 && deployedAddress === undefined) { + let libraryName = contractObj.className; + return callback(new Error(contract.className + " needs " + libraryName + " but an address was not found, did you deploy it or configured an address?")); + } contractCode = contractCode.replace(new RegExp(toReplace, "g"), deployedAddress); }