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

Update Foundry + Blockscout contract verification docs #13907

Closed
1 of 2 tasks
2manslkh opened this issue Jun 7, 2023 · 10 comments
Closed
1 of 2 tasks

Update Foundry + Blockscout contract verification docs #13907

2manslkh opened this issue Jun 7, 2023 · 10 comments
Assignees

Comments

@2manslkh
Copy link
Contributor

2manslkh commented Jun 7, 2023

Issues with verifying contract with foundry on blockscout.

foundry-rs/foundry#4909

https://guide.scroll.io/developers/verifying-smart-contracts

Todos:

  • Add alert on docs to inform users of issues
  • Update docs when fix is available
@2manslkh 2manslkh converted this from a draft issue Jun 7, 2023
@2manslkh 2manslkh self-assigned this Jun 7, 2023
@dionysuzx
Copy link
Collaborator

curious whats the status here, do we think it's a blockscout version issue? this is the docker image version we are using: FROM blockscout/blockscout:5.1.5

@kshyun28
Copy link
Contributor

kshyun28 commented Jun 17, 2023

Hello @2manslkh, was trying to follow the guide for deploying and verifying contracts with foundry on Taiko.

Was able to deploy a contract just fine since the guide is available.

For verifying, I saw this issue you made, but foundry #4909 issue was already closed.

My assumption is that we can finally verify contracts using foundry.

Hence, I tried to verify using the following command
forge verify-contract 0xCAba40113D27e67676BEdFE9170BB5956a9F6F85 src/Counter.sol:Counter --chain-id 167005 --verifier-url https://explorer.test.taiko.xyz/api --verifier blockscout

But got this error instead:

Start verifying contract `0xcaba40113d27e67676bedfe9170bb5956a9f6f85` deployed on 167005
Error:
Response result is unexpectedly empty: status=0, message=Something went wrong.

Let me know if I missed anything or if there's anything else I can help with.

@2manslkh
Copy link
Contributor Author

I am getting this error too 😓

@MarcusWentz
Copy link
Contributor

MarcusWentz commented Jul 23, 2023

I get this error too on other networks using Blockscout.

Example:

Guide
https://guide.scroll.io/developers/verifying-smart-contracts#foundry
Test Foundry repo
https://github.com/MarcusWentz/foundry-testing
Test command

forge verify-contract 0xC08bAe25c62Dc5488AC46905ADDe1609b52A3844 src/Contract.sol:SimpleStorage --chain-id 534353 --verifier-url https://blockscout.scroll.io/api --verifier blockscout

Response

Start verifying contract `0xc08bae25c62dc5488ac46905adde1609b52a3844` deployed on scroll-alpha-testnet
Error: 
Response result is unexpectedly empty: status=0, message=Something went wrong.

I updated Foundry with

foundryup

Which updated me to

forge 0.2.0 (0e72b71 2023-07-19T00:31:45.646186071Z)

but I see this issue still.

@MarcusWentz
Copy link
Contributor

I get a different error on the updated Blockscout explorer the Taiko L3 explorer is using as described here:
blockscout/blockscout#7983

@MarcusWentz
Copy link
Contributor

I think this might work if you add \? to the end of the Blockscout verification URL.

Test verification on Scroll

forge verify-contract 0xC08bAe25c62Dc5488AC46905ADDe1609b52A3844 src/Contract.sol:SimpleStorage --chain-id 534353 --verifier blockscout --verifier-url https://blockscout.scroll.io/api\?

Response

Start verifying contract `0xc08bae25c62dc5488ac46905adde1609b52a3844` deployed on scroll-alpha-testnet

Submitting verification for [src/Contract.sol:SimpleStorage] "0xC08bAe25c62Dc5488AC46905ADDe1609b52A3844".
Submitted contract for verification:
        Response: `OK`
        GUID: `c08bae25c62dc5488ac46905adde1609b52a384464bec9dd`
        URL:
        https://blockscout.scroll.io/address/0xc08bae25c62dc5488ac46905adde1609b52a3844

Source
foundry-rs/foundry#5160 (comment)

@MarcusWentz
Copy link
Contributor

On Taiko L2 when I run

forge verify-contract 0x860eAfD65249D09268A314D7d56d686d4784A5a5 src/Contract.sol:SimpleStorage --chain-id 167005 --verifier blockscout --verifier-url https://explorer.test.taiko.xyz/api\? 

I get

Start verifying contract `0x860eafd65249d09268a314d7d56d686d4784a5a5` deployed on 167005

Submitting verification for [src/Contract.sol:SimpleStorage] "0x860eAfD65249D09268A314D7d56d686d4784A5a5".
Submitted contract for verification:
        Response: `OK`
        GUID: `860eafd65249d09268a314d7d56d686d4784a5a564beccda`
        URL:
        https://explorer.test.taiko.xyz/api?/address/0x860eafd65249d09268a314d7d56d686d4784a5a5

However on Taiko L3 when I run

forge verify-contract 0xfE854EB335786037aDb33C36936f679CA127C3CD src/Contract.sol:SimpleStorage --chain-id 167006 --verifier blockscout --verifier-url https://explorer.l3test.taiko.xyz/api\?

I get error

Start verifying contract `0xfe854eb335786037adb33c36936f679ca127c3cd` deployed on 167006
2023-07-24T19:13:02.975541Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 ...
Error: 
expected value at line 1 column 1

Similar to error
blockscout/blockscout#7983

@MarcusWentz
Copy link
Contributor

This is working on L2:

forge create --rpc-url https://rpc.test.taiko.xyz/ --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://explorer.test.taiko.xyz/api/?

@MarcusWentz
Copy link
Contributor

This is working on L3:

forge create --rpc-url https://rpc.l3test.taiko.xyz --private-key $devTestnetPrivateKey src/Contract.sol:SimpleStorage --verify --verifier blockscout --verifier-url https://blockscoutapi.l3test.taiko.xyz/api\?

@MarcusWentz
Copy link
Contributor

Fixed issue and opened this documentation pull request:

#14266

@github-project-automation github-project-automation bot moved this from 📝 Todo to ✅ Done in Taiko Project Board Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

5 participants