Comments (14)
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.
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.
This worked for me, though (probably because I was running from a script?)
unset ETHERSCAN_API_KEY
was insufficient, and I neededexport ETHERSCAN_API_KEY=""
.
this one works for me
from foundry.
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.
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.
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.
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.
--verifier etherscan --verifier-url https://api-sepolia.etherscan.io/api\?
adding to the end of my commands helped w/a similar issue
from foundry.
tried passing that but i get invalid escape sequence
from foundry.
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 neededexport ETHERSCAN_API_KEY=""
.
Correct, I edited my message to add this precision as it was indeed not specified.
from foundry.
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.
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.
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.
Hey getting the same error what can i do
from foundry.
Related Issues (20)
- Cast abi-decode crashes HOT 1
- Forge is failing to deploy valid contract HOT 5
- Setting for `include_storage` in invariant tests seems to leak into fuzz tests settings HOT 2
- Called contract seemingly randomly exits HOT 5
- forge verify-contract error when using --chain parameter
- feat(cheatcodes): `vm.mockCalls()` for mocking multiple calls
- Failed to deserialize response
- Challenges in Directly Accessing Nested Mappings within Structs in Solidity for Testing
- Support resetting from forked to non forked on anvil_reset HOT 2
- add the ability to select a given chain in the scripts HOT 2
- Coverage report misses return-declared variables if returned as-is
- anvil: configure memory limit HOT 3
- Foundry panics after executing 3 transactions using `transact` on a forked state HOT 1
- Deserialization Error: EOF while parsing a value at line 1 column 0 HOT 4
- Etherscan Multichain Contract Verification
- Max Priority gas price does not work HOT 2
- Feature request: `input.index(key)` HOT 3
- Feature request: `--disable-metadata` as CLI option to `forge build`
- anvil: EVM error MemoryLimitOOG HOT 10
- Retrieving default `arbitrum_one` rpc url fails HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from foundry.