diff --git a/lib/contracts/deploy.js b/lib/contracts/deploy.js index dfb6bf244..bb001314b 100644 --- a/lib/contracts/deploy.js +++ b/lib/contracts/deploy.js @@ -115,6 +115,9 @@ class Deploy { deployedAddress = deployedAddress.substr(2); } let linkReference = '__' + filename + ":" + contractObj.className; + if (linkReference.length > 40) { + return callback(new Error(linkReference + " is too long, try reducing the path of the contract (" + filename + ") and/or its name " + contractObj.className)); + } let toReplace = linkReference + "_".repeat(40 - linkReference.length); if (contractCode.indexOf(linkReference) >= 0 && deployedAddress === undefined) { let libraryName = contractObj.className;