Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to verify contract in phase 2 when providing .sol and metadata files - same process produces perfect match in phase 1 #755

Closed
ed-marquez opened this issue Nov 14, 2023 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ed-marquez
Copy link

ed-marquez commented Nov 14, 2023

Description

Tried verifying smart contracts with these tool combinations:

  • solc (not solcjs) for generating abi, bytecode, metadata JSON + ethers js for deployment
  • Remix for generating abi, bytecode, metadata JSON + ethers js for deployment

Both tool combinations produced the same exact results shown below.

Flow

For the same contract:
Phase 1:

  • Requires both the .sol and metadata JSON
  • When both files are provided, verification results in a perfect match
  • Verification not possible with just 1 file (either one)

Phase 2:

  • If both the .sol and metadata JSON are provided, verification fails with Resource missing; unsuccessful fetching: contracts/InventoryLookup.sol
  • Providing only the metadata doesn’t enable the verify button.
  • Providing only the .sol results in a partial match

The main issue is that, for phases 1 and 2, the same inputs produce different/inconsistent results.

2023-11-14.Smart.Contract.Verification.-.EthersJs.and.solc.issue.mp4

Steps to reproduce

GitHub repo with the example code

Additional context

No response

Hedera network

testnet

Version

https://hashscan-latest.hedera-devops.com/testnet/dashboard

Operating system

macOS

@ed-marquez ed-marquez added the bug Something isn't working label Nov 14, 2023
@ericleponner ericleponner self-assigned this Nov 15, 2023
@ed-marquez
Copy link
Author

ed-marquez commented Nov 15, 2023

The bug may still exist (for Remix only)
Looks like there may be an operating system factor at play here...

I did all my initial testing on a Mac. I saw this:

  • .sol and metadata are required for a full match
  • .sol file only will get you to a partial match

Now, I'm creating content on my work Windows PC... I'm seeing that:
Using Remix for compilation,

  • Providing the metadata JSON alone does not enable the verify button (Good - consistent with what I had seen before)
  • Providing the .sol file alone reaches partial match (Good - consistent with what I had seen before)
  • Providing both the .sol and metadata JSON files (required for full match) is failing the verification. This is true for initial verification and re-verification after a partial match (img 1 and 2). This same flow works ok on Mac...

image
image

See video capture:

2023-11-15.SCV.Issue.-.Part.2.mp4

ericleponner added a commit that referenced this issue Nov 20, 2023
…(fix for #755).

Signed-off-by: Eric Le Ponner <eric.leponner@icloud.com>
@svienot
Copy link
Collaborator

svienot commented Nov 20, 2023

Fixed in PR #758

@svienot svienot closed this as completed Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants