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

bug(forge verify-contract): Unable to verify on explorer #9542

Closed
2 tasks done
duncancmt opened this issue Dec 11, 2024 · 4 comments
Closed
2 tasks done

bug(forge verify-contract): Unable to verify on explorer #9542

duncancmt opened this issue Dec 11, 2024 · 4 comments
Labels
T-bug Type: bug T-needs-triage Type: this issue needs to be labelled

Comments

@duncancmt
Copy link

duncancmt commented Dec 11, 2024

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (59f354c 2024-12-11T00:24:56.327766786Z)

What command(s) is the bug in?

forge verify-contract

Operating System

Linux

Describe the bug

This bug is also present in fe2acca . Reference previous bug report #8470 .

As I promised in the previous report, I checked to see if the problem had been remedied by recent changes to foundry. Unfortunately, they have not.

Steps to reproduce

If you check out 0xProject/0x-settler#265 (built from fe2acca; commit 883c3ee56df7143dcd82724c25309a1c6155fc9c [note: not on the dcmt/taiko branch]) or 0xProject/0x-settler#266 (built from 59f354c; commit 076e85ae5f119b845e1381d0e853d2f3c5af265e) you can reproduce this by attempting to verify the latest deployment of Settler on their respective chains (Taiko and World Chain).

forge clean
forge flatten -o src/flat/TaikoFlat.sol src/chains/Taiko.sol # substitute WorldChain if you want to test that instead
forge build -- src/flat/TaikoFlat.sol
forge verify-contract --watch --chain 167000 --verifier etherscan --etherscan-api-key 'YOUR_KEY_HERE' --verifier-url 'https://api.taikoscan.io/api' --constructor-args 0x883c3ee56df7143dcd82724c25309a1c6155fc9c000000000000000000000000 0xd36B8EA952EB37B842281788047E7C4501Cef91d 'src/flat/TaikoFlat.sol:TaikoSettlerMetaTxn' # substitute 0x076e85ae5f119b845e1381d0e853d2f3c5af265e000000000000000000000000 for the constructor argument and 0x271C15b2EB680e1EAb6435967f1D3600080aA8ce for deployed address if testing World Chain

### Output
# Start verifying contract `0xd36B8EA952EB37B842281788047E7C4501Cef91d` deployed on taiko
# Constructor args: 0x883c3ee56df7143dcd82724c25309a1c6155fc9c000000000000000000000000
# 
# Submitting verification for [src/flat/TaikoFlat.sol:TaikoSettlerMetaTxn] 0xd36B8EA952EB37B842281788047E7C4501Cef91d.
# Submitted contract for verification:
# 	Response: `OK`
# 	GUID: `ftvfgysjufjsjhdymzccnq4cdrbdntkn1rwr2ptnun8ehfivv3`
# 	URL: https://taikoscan.io/address/0xd36b8ea952eb37b842281788047e7c4501cef91d
# Contract verification status:
# Response: `NOTOK`
# Details: `Pending in queue`
# Warning: Verification is still pending...; waiting 15 seconds before trying again (7 tries remaining)
# Contract verification status:
# Response: `NOTOK`
# Details: `Fail - Unable to verify. Compiled contract deployment bytecode does NOT match the transaction deployment bytecode.`
# Error: Checking verification result failed
# 
# Context:
# - Contract failed to verify.

It's worth noting that the other contract deployed from that same flattened file on each chain verified just fine.

@duncancmt duncancmt added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Dec 11, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 11, 2024
@grandizzy
Copy link
Collaborator

@duncancmt I suspect a block explorer related issue, are you able to manually verify the same contract?

@duncancmt
Copy link
Author

The "SINGLE FILE / CONCATENATED METHOD" verification fails because I can't set viaIR as an optimization option. I don't know how I'd go about debugging an explorer-related issue. I don't have any contacts with the Etherscan team :(

@duncancmt
Copy link
Author

After deploying yet another chain, I realized that the issue was actually in my deployment script. I'm therefore closing this issue because the technique of "forge flatten then forge create" solves my problem.

My sincere apologies for wasting y'all's time

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 12, 2024
@grandizzy
Copy link
Collaborator

no worries, glad it worked!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug T-needs-triage Type: this issue needs to be labelled
Projects
Status: Done
Development

No branches or pull requests

2 participants