Skip to content

Commit d4ab0a5

Browse files
authored
Use abi-to-sol's outputSource: false option (#20)
Instead of manually trimming the output source ABI JSON
1 parent 625888f commit d4ab0a5

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/compiler/remoteCompiler.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,12 @@ function getRemoteInterfaceFromEtherscan(address, name, chain) {
7171
return reject(data)
7272
}
7373
let abi = JSON.parse(data.result);
74-
let src = generateSolidity({ name: name, solidityVersion: "0.8.9", abi });
75-
src = src.substring(src.indexOf("\n\n") + 2, src.indexOf("// THIS FILE WAS AUTOGENERATED FROM"));
74+
let src = generateSolidity({
75+
name: name,
76+
solidityVersion: "0.8.9",
77+
abi,
78+
outputSource: false
79+
});
7680
return resolve(src)
7781
}
7882
})

0 commit comments

Comments
 (0)