|
|
|
@ -154,10 +154,14 @@ module.exports = { |
|
|
|
|
* Compare bytecode. return true if the code is equal (handle swarm hash and library references) |
|
|
|
|
* @param {String} code1 - the bytecode that is actually deployed (contains resolved library reference and a potentially different swarmhash) |
|
|
|
|
* @param {String} code2 - the bytecode generated by the compiler (contains unresolved library reference and a potentially different swarmhash) |
|
|
|
|
this will return false if the generated bytecode is empty (asbtract contract cannot be deployed) |
|
|
|
|
* |
|
|
|
|
* @return {bool} |
|
|
|
|
*/ |
|
|
|
|
compareByteCode: function (code1, code2) { |
|
|
|
|
if (code1 === code2) return true |
|
|
|
|
if (code2 === '0x') return false // abstract contract. see comment
|
|
|
|
|
|
|
|
|
|
var pos = -1 |
|
|
|
|
while ((pos = code2.search(/__(.*)__/)) !== -1) { |
|
|
|
|
code2 = replaceLibReference(code2, pos) |
|
|
|
|