openzeppelin-sdk icon indicating copy to clipboard operation
openzeppelin-sdk copied to clipboard

oz verify fails when using binary solc (instead of solc.js)

Open shark0der opened this issue 5 years ago • 1 comments

When oz verify sends the post request to etherscan, it sends the compiler version as well. In oz source code there's this line:

const compiler = `v${compilerVersion.replace('.Emscripten.clang', '')}`;

https://github.com/OpenZeppelin/openzeppelin-sdk/blob/11352d7ee54cbbee8234f418cd0ffc0bac30e749/packages/cli/src/models/Verifier.ts#L87

What it tries to do is to remove the suffix from the version, but it wrongly assumes that we're using solc.js. In my case, the version is 0.5.17+commit.d19bba13.Linux.g++ and it was sending that verbatim to etherscan.

Dropping .Linux.g++ solved the issue and the verification went through succesfully:

const compiler = `v${compilerVersion.replace('.Emscripten.clang', '')}`.replace('.Linux.g++', '');

As a side note, oz verify shows up a false warning:

A regular instance of TokenMock was found. Verification of regular instances is not yet supported.

The verification went through despite the warning.

shark0der avatar Jun 05 '20 16:06 shark0der

Hi @shark0der! I’m sorry that you had this issue.

Thanks so much for reporting it! The project owner will review and triage this issue during the next week.

abcoathup avatar Jun 08 '20 05:06 abcoathup