Giter VIP home page Giter VIP logo

Comments (14)

codyx avatar codyx commented on June 2, 2024 1
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.

from foundry.

maurelian avatar maurelian commented on June 2, 2024 1

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="".

from foundry.

slordua avatar slordua commented on June 2, 2024 1

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

from foundry.

farmage avatar farmage commented on June 2, 2024 1

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"

from foundry.

slordua avatar slordua commented on June 2, 2024

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

from foundry.

mattsse avatar mattsse commented on June 2, 2024

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

from foundry.

slordua avatar slordua commented on June 2, 2024

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)

from foundry.

rocketman-21 avatar rocketman-21 commented on June 2, 2024

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

from foundry.

slordua avatar slordua commented on June 2, 2024

tried passing that but i get invalid escape sequence

from foundry.

codyx avatar codyx commented on June 2, 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.

from foundry.

codyx avatar codyx commented on June 2, 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).

from foundry.

drinkius avatar drinkius commented on June 2, 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"

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

from foundry.

sandybradley avatar sandybradley commented on June 2, 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"

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

Same issue with Holesky

from foundry.

Abhishek-2416 avatar Abhishek-2416 commented on June 2, 2024

Hey getting the same error what can i do

from foundry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.