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 script): ResponseData error when verifying smart contract on Mode, but verification succeeds. #9072

Open
2 tasks done
JacobHomanics opened this issue Oct 9, 2024 · 1 comment
Labels
A-verification Area: verification C-forge Command: forge Cmd-forge-script Command: forge script P-low Priority: low T-bug Type: bug

Comments

@JacobHomanics
Copy link

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 (de596a4 2024-09-06T00:25:03.025680000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

I try to run this command: forge script script/VerifyAll.s.sol --ffi --rpc-url https://sepolia.mode.network --verifier-url https://sepolia.explorer.mode.network/api.

In response, I get the following output:

forge script script/VerifyAll.s.sol --ffi --rpc-url https://sepolia.mode.network --verifier-url https://sepolia.explorer.mode.network/api
[⠒] Compiling...
No files changed, compilation skipped
2024-10-09T02:54:08.871697Z ERROR etherscan: Failed to deserialize response: data did not match any variant of untagged enum ResponseData res="{\"message\":\"OK\",\"result\":[{\"Address\":\"0x5b73c5498c1e3b4dba84de0f1833c4a029d90519\"}],\"status\":\"1\"}"
Script ran successfully.
Screenshot 2024-10-08 at 9 57 13 PM

The VerifyAll.s.sol file is a utility script which can be found here: VerifyAll.s.sol. However, I have gutted it in my project to be exactly like so:

pragma solidity ^0.8.19;

contract VerifyAll {
    function run() external {}
}

and I still receive the error.

Not sure if there is a way to fix the error on my end or if its an issue with Foundry itself.

Glad to help any way I can.

Thanks!

@JacobHomanics JacobHomanics added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Oct 9, 2024
@zerosnacks
Copy link
Member

zerosnacks commented Oct 9, 2024

Hi @JacobHomanics

Mode uses the Blockscout explorer and it looks like we are receiving back some unhandled response data. You can ignore this error, you deployment and verification should still work without issue.

Make sure you pass in the --verify flag and set the --verifier to blockscout

I was able to deploy and verify with the command below just now:

forge script script/<file>.sol --rpc-url https://sepolia.mode.network --verifier-url https://sepolia.explorer.mode.network/api --verify --verifier blockscout --broadcast --keystore <keystore>

For future reference, occurs when not passing --verifier blockscout and instead using the default w/ ETHERSCAN_API_KEY

ERROR etherscan: Failed to deserialize response: data did not match any variant of untagged enum ResponseData res="{\"message\":\"OK\",\"result\":[{\"Address\":\"0x7109709ecfa91a80626ff3989d68f67f5b1dd12d\"}],\"status\":\"1\"}"

WARN traces::etherscan: could not get etherscan info: Serde { error: Error("data did not match any variant of untagged enum ResponseData", line: 0, column: 0), content: "{\"message\":\"OK\",\"result\":[{\"Address\":\"0x7109709ecfa91a80626ff3989d68f67f5b1dd12d\"}],\"status\":\"1\"}" }

@zerosnacks zerosnacks added C-forge Command: forge Cmd-forge-verify Command: forge verify-contract/check Cmd-forge-script Command: forge script A-verification Area: verification and removed Cmd-forge-verify Command: forge verify-contract/check T-needs-triage Type: this issue needs to be labelled labels Oct 9, 2024
@zerosnacks zerosnacks changed the title Error when verifying smart contract on Mode, but verification succeeds. bug(forge script): ResponseData error when verifying smart contract on Mode, but verification succeeds. Oct 9, 2024
@zerosnacks zerosnacks added the P-low Priority: low label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-verification Area: verification C-forge Command: forge Cmd-forge-script Command: forge script P-low Priority: low T-bug Type: bug
Projects
Status: Todo
Development

No branches or pull requests

2 participants