From a71cdafca0f348c8f822a3e4e9cce64e747e78e1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 17 May 2018 10:45:47 +0200 Subject: [PATCH] test whole signature --- remix-lib/src/util.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/remix-lib/src/util.js b/remix-lib/src/util.js index 9b9169da1e..a30b8b9d56 100644 --- a/remix-lib/src/util.js +++ b/remix-lib/src/util.js @@ -187,7 +187,8 @@ module.exports = { if (code1 === code2) return true if (code2 === '0x') return false // abstract contract. see comment - if (code2.substr(4, 40) === '0000000000000000000000000000000000000000') { + if (code2.substr(2, 46) === '7300000000000000000000000000000000000000003014') { + // testing the following signature: PUSH20 00..00 ADDRESS EQ // 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)