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 test): --fork-url etherscan: Failed to deserialize response #6651

Closed
2 tasks done
slordua opened this issue Dec 21, 2023 · 27 comments · Fixed by #9242
Closed
2 tasks done

bug(forge test): --fork-url etherscan: Failed to deserialize response #6651

slordua opened this issue Dec 21, 2023 · 27 comments · Fixed by #9242
Assignees
Labels
A-compatibility Area: compatibility C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug
Milestone

Comments

@slordua
Copy link

slordua commented Dec 21, 2023

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 (73fb616 2023-12-19T00:16:21.131413571Z)

What command(s) is the bug in?

forge test --fork-url $SEPOLIA_RPC_URL

Operating System

Linux

Describe the bug

i found #3621 which is very similar to my issue to be closed in lieu of #6079, so i apologize if this is dup issue,

there is nothing special about my test, and everything passes and completes without issues. unlike @amusingaxl however, trace shows no problems with rate limiting, traces all look pretty standard:

Screenshot 2023-12-21 162915

2023-12-21T23:26:59.714575Z  WARN etherscanidentifier: could not get etherscan info: Serde(Error("expected value", line: 1, column: 1))

response (captcha):

<!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Just a moment...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">
    <meta http-equiv="refresh" content="375">
</head>
<body class="no-js">
    <div class="main-wrapper" role="main">
        <div class="main-content">
            <noscript>
                <div id="challenge-error-title">
                    <div class="h2">
                        <span class="icon-wrapper">
                            <div class="heading-icon warning-icon"></div>
                        </span>
                        <span id="challenge-error-text">Enable JavaScript and cookies to continue</span>
                    </div>
                </div>
            </noscript>
        </div>
    </div>
    <script>
        (function(){
            // challenge function
        }());
    </script>
</body>
</html>

i am working on a remote server thru vscode remote ssh, not sure if that's a factor

@slordua slordua added the T-bug Type: bug label Dec 21, 2023
@gakonst gakonst added this to Foundry Dec 21, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 21, 2023
@slordua
Copy link
Author

slordua commented Dec 22, 2023

btw this is caused by this entry in foundry.toml

[etherscan]
sepolia = { key = "${ETHERSCAN_KEY}" }

don't have this issue when omitted

don't think anything is wrong with my config because there's no issue verifying contracts elsewhere

@mattsse
Copy link
Member

mattsse commented Dec 22, 2023

mind sharing the etherscan api url?
this is either wrong API or a JS challenge for some reason, which doesn't really make sense for API URLs... but etherscan has these

@slordua
Copy link
Author

slordua commented Dec 22, 2023

direct copy and paste

[rpc_endpoints]
mainnet = "${MAINNET_RPC_URL}"
sepolia = "${SEPOLIA_RPC_URL}"

[etherscan]
mainnet = { key = "${ETHERSCAN_API_KEY}", url = "https://api.etherscan.io/api" }
sepolia = { key = "${ETHERSCAN_API_KEY}", url = "https://api-sepolia.etherscan.io/api" }

and .env

MAINNET_RPC_URL="http://127.0.0.1:8545"
SEPOLIA_RPC_URL="http://127.0.0.1:8546"
ETHERSCAN_API_KEY="RR2Q7D9SP4ATYZENACMCSWC5QPXTTVH318"

if i use url = "https://api.sepolia.etherscan.io/api" i actually don't get the error, but this can't be correct right? additionally, it's not getting any of the traces it should when i remove all my vm.labels (that was my workaround)

@rocketman-21
Copy link

--verifier etherscan --verifier-url https://api-sepolia.etherscan.io/api\? adding to the end of my commands helped w/a similar issue

@slordua
Copy link
Author

slordua commented Dec 23, 2023

tried passing that but i get invalid escape sequence

@codyx
Copy link

codyx commented Jan 9, 2024

2023-12-21T23:26:59.714575Z  WARN etherscanidentifier: could not get etherscan info: Serde(Error("expected value", line: 1, column: 1))

and

ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1

I ran into a similar issue (see above), here's what I discovered:

  • When ETHERSCAN_API_KEY is set in the environment, forge will try resolving the etherscan API and fetch contracts info.
  • Even though the script being ran may not be broadcasting anything, is in offline mode and isn't being provided with the --verify flag, forge will still execute the previous step multiples times anyways.

TL;DR: unsetting ETHERSCAN_API_KEY when running local tests & scripts resolved my issue.

PS: the etherscan key must be commented out from the .env if using it, as unsetting the variable doesn't prevent forge from loading the environment file.

@maurelian
Copy link

TL;DR: unsetting ETHERSCAN_API_KEY when running local tests & scripts resolved my issue.

This worked for me, though (probably because I was running from a script?) unset ETHERSCAN_API_KEY was insufficient, and I needed export ETHERSCAN_API_KEY="".

@slordua
Copy link
Author

slordua commented Jan 10, 2024

This worked for me, though (probably because I was running from a script?) unset ETHERSCAN_API_KEY was insufficient, and I needed export ETHERSCAN_API_KEY="".

this one works for me

@codyx
Copy link

codyx commented Jan 11, 2024

TL;DR: unsetting ETHERSCAN_API_KEY when running local tests & scripts resolved my issue.

This worked for me, though (probably because I was running from a script?) unset ETHERSCAN_API_KEY was insufficient, and I needed export ETHERSCAN_API_KEY="".

Correct, I edited my message to add this precision as it was indeed not specified.

@farmage
Copy link

farmage commented Jan 12, 2024

trying to compile Optimism L2 on Sepolia Testnet
getting the error even with
--verifier etherscan --etherscan-api-key ************************ --verifier-url https://api-sepolia.etherscan.io/api
The difference is in my case it returns Access Denied error
using the latest forge version
forge 0.2.0 (b320027 2024-01-12T00:17:44.209192793Z)
please advise

2024-01-12T08:47:44.050530Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n<title>403 - Forbidden: Access is denied.</title>\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\n</head>\n<body>\n<div id=\"header\"><h1>Server Error</h1></div>\n<div id=\"content\">\n<div class=\"content-container\"><fieldset>\n<h2>403 - Forbidden: Access is denied.</h2>\n<h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\n</fieldset></div>\n</div>\n<script>(function(){var js = \"window['__CF$cv$params']={r:'844422eafa618ec2',t:'MTcwNTA0OTI2NC4wNDAwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js',document.getElementsByTagName('head')[0].appendChild(_cpo);\";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>\n</html>\n"

@codyx
Copy link

codyx commented Jan 12, 2024

trying to compile Optimism L2 on Sepolia Testnet getting the error even with --verifier etherscan --etherscan-api-key ************************ --verifier-url https://api-sepolia.etherscan.io/api The difference is in my case it returns Access Denied error using the latest forge version forge 0.2.0 (b320027 2024-01-12T00:17:44.209192793Z) please advise

2024-01-12T08:47:44.050530Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n<title>403 - Forbidden: Access is denied.</title>\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\n</head>\n<body>\n<div id=\"header\"><h1>Server Error</h1></div>\n<div id=\"content\">\n<div class=\"content-container\"><fieldset>\n<h2>403 - Forbidden: Access is denied.</h2>\n<h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\n</fieldset></div>\n</div>\n<script>(function(){var js = \"window['__CF$cv$params']={r:'844422eafa618ec2',t:'MTcwNTA0OTI2NC4wNDAwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js',document.getElementsByTagName('head')[0].appendChild(_cpo);\";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>\n</html>\n"

Yes it's probably related to the same error. That's also what I had (i.e., Access denied).

@drinkius
Copy link

trying to compile Optimism L2 on Sepolia Testnet getting the error even with --verifier etherscan --etherscan-api-key ************************ --verifier-url https://api-sepolia.etherscan.io/api The difference is in my case it returns Access Denied error using the latest forge version forge 0.2.0 (b320027 2024-01-12T00:17:44.209192793Z) please advise

2024-01-12T08:47:44.050530Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n<title>403 - Forbidden: Access is denied.</title>\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\n</head>\n<body>\n<div id=\"header\"><h1>Server Error</h1></div>\n<div id=\"content\">\n<div class=\"content-container\"><fieldset>\n<h2>403 - Forbidden: Access is denied.</h2>\n<h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\n</fieldset></div>\n</div>\n<script>(function(){var js = \"window['__CF$cv$params']={r:'844422eafa618ec2',t:'MTcwNTA0OTI2NC4wNDAwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js',document.getElementsByTagName('head')[0].appendChild(_cpo);\";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>\n</html>\n"

Same here, after several attempts on gas estimation for Optimism deployment on Sepolia - suddenly started getting this error

@sandybradley
Copy link

trying to compile Optimism L2 on Sepolia Testnet getting the error even with --verifier etherscan --etherscan-api-key ************************ --verifier-url https://api-sepolia.etherscan.io/api The difference is in my case it returns Access Denied error using the latest forge version forge 0.2.0 (b320027 2024-01-12T00:17:44.209192793Z) please advise

2024-01-12T08:47:44.050530Z ERROR etherscan: Failed to deserialize response: expected value at line 1 column 1 res="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" />\n<title>403 - Forbidden: Access is denied.</title>\n<style type=\"text/css\">\r\n<!--\r\nbody{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}\r\nfieldset{padding:0 15px 10px 15px;} \r\nh1{font-size:2.4em;margin:0;color:#FFF;}\r\nh2{font-size:1.7em;margin:0;color:#CC0000;} \r\nh3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} \r\n#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:\"trebuchet MS\", Verdana, sans-serif;color:#FFF;\r\nbackground-color:#555555;}\r\n#content{margin:0 0 0 2%;position:relative;}\r\n.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}\r\n-->\r\n</style>\n</head>\n<body>\n<div id=\"header\"><h1>Server Error</h1></div>\n<div id=\"content\">\n<div class=\"content-container\"><fieldset>\n<h2>403 - Forbidden: Access is denied.</h2>\n<h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>\n</fieldset></div>\n</div>\n<script>(function(){var js = \"window['__CF$cv$params']={r:'844422eafa618ec2',t:'MTcwNTA0OTI2NC4wNDAwMDA='};_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/scripts/jsd/main.js',document.getElementsByTagName('head')[0].appendChild(_cpo);\";var _0xh = document.createElement('iframe');_0xh.height = 1;_0xh.width = 1;_0xh.style.position = 'absolute';_0xh.style.top = 0;_0xh.style.left = 0;_0xh.style.border = 'none';_0xh.style.visibility = 'hidden';document.body.appendChild(_0xh);function handler() {var _0xi = _0xh.contentDocument || _0xh.contentWindow.document;if (_0xi) {var _0xj = _0xi.createElement('script');_0xj.innerHTML = js;_0xi.getElementsByTagName('head')[0].appendChild(_0xj);}}if (document.readyState !== 'loading') {handler();} else if (window.addEventListener) {document.addEventListener('DOMContentLoaded', handler);} else {var prev = document.onreadystatechange || function () {};document.onreadystatechange = function (e) {prev(e);if (document.readyState !== 'loading') {document.onreadystatechange = prev;handler();}};}})();</script></body>\n</html>\n"

Same here, after several attempts on gas estimation for Optimism deployment on Sepolia - suddenly started getting this error

Same issue with Holesky

@Abhishek-2416
Copy link

Hey getting the same error what can i do

@zerosnacks zerosnacks added C-forge Command: forge Cmd-forge-test Command: forge test labels Jul 9, 2024
@zerosnacks zerosnacks changed the title forge test w/ --fork-url etherscan: Failed to deserialize response bug(forge test): `--fork-url etherscan: Failed to deserialize response Jul 9, 2024
@zerosnacks zerosnacks changed the title bug(forge test): `--fork-url etherscan: Failed to deserialize response bug(forge test): --fork-url etherscan: Failed to deserialize response Jul 9, 2024
@zerosnacks zerosnacks added the A-compatibility Area: compatibility label Jul 9, 2024
@zerosnacks zerosnacks added this to the v1.0.0 milestone Jul 26, 2024
@grandizzy
Copy link
Collaborator

@slordua there were some changes for handling such, could you please let us now if you still facing the issue in latest version? thank you!

@grandizzy grandizzy modified the milestone: v1.0.0 Oct 24, 2024
@hernandp
Copy link

Same problem here, running forge 0.2.0 (9501589 2024-10-30T00:22:24.244150356Z)

@grandizzy
Copy link
Collaborator

@hernandp can you share a way to reproduce the issue? Thank you

@zerosnacks
Copy link
Member

zerosnacks commented Oct 31, 2024

I think this is all just related to receiving some kind of non-JSON formatted HTML error / gate page that Etherscan may throw. We could attempt to implement an error handler to give the user a more descriptive error but I don't see a practical way we can actually resolve this. It clearly happens sporadically and under certain conditions.

@hernandp
Copy link

@hernandp can you share a way to reproduce the issue? Thank you

It worked in Sepolia/Arbitrum Sepolia now, thanks.

In particular, Celo both Testnet/Mainnet does not support forge verify-contract and still displays this error.

@grandizzy
Copy link
Collaborator

thanks, is that celoscan to support this? @zerosnacks wdyt?

@zerosnacks zerosnacks self-assigned this Oct 31, 2024
@hernandp
Copy link

hernandp commented Oct 31, 2024

@grandizzy @zerosnacks Sidenote, manual submission of data to Celoscan using generated JSON with --show-json-standard-input in forge command line works. So I guess is the RPC/HTTP interfacing which is failing.

@slordua
Copy link
Author

slordua commented Oct 31, 2024

@slordua there were some changes for handling such, could you please let us now if you still facing the issue in latest version? thank you!

sorry i'm not working in crypto anymore good luck guys

@zerosnacks
Copy link
Member

Am able to reproduce it reliably on the Celoscan Alfajores testnet upon verification:

<!DOCTYPE html>
<html lang="en-US">

<head>
    <title>Just a moment...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <style>
        * {
            box-sizing: border-box;
            margin: 0;
            padding: 0
        }

        html {
            line-height: 1.15;
            -webkit-text-size-adjust: 100%;
            color: #313131;
            font-family: system-ui, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica Neue, Arial, Noto Sans, sans-serif, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji
        }

        body {
            display: flex;
            flex-direction: column;
            height: 100vh;
            min-height: 100vh
        }

        .main-content {
            margin: 8rem auto;
            max-width: 60rem;
            padding-left: 1.5rem
        }

        @media (width <=720px) {
            .main-content {
                margin-top: 4rem
            }
        }

        .h2 {
            font-size: 1.5rem;
            font-weight: 500;
            line-height: 2.25rem
        }

        @media (width <=720px) {
            .h2 {
                font-size: 1.25rem;
                line-height: 1.5rem
            }
        }

        #challenge-error-text {
            background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMiIgaGVpZ2h0PSIzMiIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iI0IyMEYwMyIgZD0iTTE2IDNhMTMgMTMgMCAxIDAgMTMgMTNBMTMuMDE1IDEzLjAxNSAwIDAgMCAxNiAzbTAgMjRhMTEgMTEgMCAxIDEgMTEtMTEgMTEuMDEgMTEuMDEgMCAwIDEtMTEgMTEiLz48cGF0aCBmaWxsPSIjQjIwRjAzIiBkPSJNMTcuMDM4IDE4LjYxNUgxNC44N0wxNC41NjMgOS41aDIuNzgzem0tMS4wODQgMS40MjdxLjY2IDAgMS4wNTcuMzg4LjQwNy4zODkuNDA3Ljk5NCAwIC41OTYtLjQwNy45ODQtLjM5Ny4zOS0xLjA1Ny4zODktLjY1IDAtMS4wNTYtLjM4OS0uMzk4LS4zODktLjM5OC0uOTg0IDAtLjU5Ny4zOTgtLjk4NS40MDYtLjM5NyAxLjA1Ni0uMzk3Ii8+PC9zdmc+);
            background-repeat: no-repeat;
            background-size: contain;
            padding-left: 34px
        }

        @media (prefers-color-scheme:dark) {
            body {
                background-color: #222;
                color: #d9d9d9
            }
        }
    </style>
    <meta http-equiv="refresh" content="390">
</head>
<body class="no-js">
    <div class="main-wrapper" role="main">
        <div class="main-content"><noscript>
                <div class="h2"><span id="challenge-error-text">Enable JavaScript and cookies to continue</span></div>
            </noscript></div>
    </div>
    <script>(function () { window._cf_chl_opt = { cvId: '3', cZone: "explorer.celo.org", ... }());</script>
</body>
</html>

I'll reach out to Etherscan to see if we can get this fixed for Celo

Unfortunately it looks like there is no direct action Foundry can take here

@hernandp
Copy link

@zerosnacks thank you.

@0xV4L3NT1N3
Copy link

Looking into this from Etherscan's end!

@zerosnacks
Copy link
Member

Thanks @0xV4L3NT1N3!

The HTML error that gets thrown originates from Blockscout due to a misclassification in the Alloy Chain's configuration, adding a fix here: alloy-rs/chains#109. Should land in Foundry soon.

In the meantime as a workaround @hernandp, please directly pass in the --verifier-url as follows: --verifier-url https://api-alfajores.celoscan.io/api with an accompanying --etherscan-api-key <API_KEY>.

@zerosnacks
Copy link
Member

Fix has been merged into Foundry in: #9242

If you are running into a similar issue please leave a comment on this ticket, it is likely related to a misclassification of the explorer or an incorrect API URL

@grandizzy grandizzy moved this from Done to Completed in Foundry Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-compatibility Area: compatibility C-forge Command: forge Cmd-forge-test Command: forge test T-bug Type: bug
Projects
Status: Completed
Development

Successfully merging a pull request may close this issue.