Commit 8c1a99e3 authored by yann300's avatar yann300

fix library comparison

parent 4f664fc7
...@@ -187,6 +187,11 @@ module.exports = { ...@@ -187,6 +187,11 @@ module.exports = {
if (code1 === code2) return true if (code1 === code2) return true
if (code2 === '0x') return false // abstract contract. see comment if (code2 === '0x') return false // abstract contract. see comment
if (code2.substr(4, 40) === '0000000000000000000000000000000000000000') {
// in the context of a library, that slot contains the address of the library (pushed by the compiler to avoid calling library other than with a DELEGATECALL)
// if code2 is not a library, well we still suppose that the comparison remain relevant even if we remove some information from `code1`
code1 = replaceLibReference(code1, 4)
}
var pos = -1 var pos = -1
while ((pos = code2.search(/__(.*)__/)) !== -1) { while ((pos = code2.search(/__(.*)__/)) !== -1) {
code2 = replaceLibReference(code2, pos) code2 = replaceLibReference(code2, pos)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment