-
Hi 👋 I am finally posting in here since I am out of option to solve these following issues on Moccasin (Vyper framework), and Titanoboa (Vyper interpreter): Cyfrin/moccasin#253 ContextWe had some feedback from students learning the Vyper course on Cyfrin, that they could not verify their contract on Sepolia testnet. So I tested, and I am also struggling to achieve a verification with Moccasin and Titanoboa: E requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://eth-sepolia.blockscout.com/api/v2/smart-contracts/0xd22070aD3D5d8173498CAc32b7D41cf3d591bAc8/verification/via/vyper-standard-input?apikey=<MY_API_KEY>
.venv/lib/python3.12/site-packages/requests/models.py:1026: HTTPError To give some Python context, the verification step is like this in Titanoboa: if license_type is None:
license_type = "none"
api_key = self.api_key or ""
url = f"{self.uri}/api/v2/smart-contracts/{address}/"
url += f"verification/via/vyper-standard-input?apikey={api_key}"
data = {
"compiler_version": solc_json["compiler_version"],
"license_type": license_type,
}
files = {
"files[0]": (
contract_name,
json.dumps(solc_json).encode("utf-8"),
"application/json",
)
}
response = requests.post(url, data=data, files=files)
response.raise_for_status() We are using the InvestigationGoing further in the processing before sending the request, we end up with this --8f4a1cc47ad485dbad8aa83fcd31ee41
Content-Disposition: form-data; name="compiler_version"
v0.4.3+commit.bff19ea2
--8f4a1cc47ad485dbad8aa83fcd31ee41
Content-Disposition: form-data; name="license_type"
1
--8f4a1cc47ad485dbad8aa83fcd31ee41
Content-Disposition: form-data; name="files[0]"; filename="ipuwbnvcso"
Content-Type: application/json
{
"language": "Vyper",
"sources": {
"tests/integration/network/sepolia/module_lib.vy": {
"content": "# pragma version ~=0.4.0\n\n@view\ndef throw():\n raise \"Error with message\"\n\ndef throw_dev_reason():\n raise # dev: some dev reason\n",
"sha256sum": "a50c95427d9e79507ed1179f137a5d6cbe2b22c156d88281d4d6109f10cd40ec"
},
"<unknown>": {
"content": "\nimport module_lib\n\n@deploy\ndef __init__(t: uint256):\n if t == 0:\n module_lib.throw()\n\n@external\ndef ipuwbnvcso() -> uint256:\n return 5591906717906843636306105947619866331449843430409101901995410518206380090736\n",
"sha256sum": "c931e5a511e6544974baa20460b5949e1aac534c949b631ad19c1b9b6dd28da9"
}
},
"settings": {
"outputSelection": {
"<unknown>": [
"*"
]
},
"search_paths": [
".",
"tests/integration/network/sepolia"
]
},
"compiler_version": "v0.4.3+commit.bff19ea2",
"integrity": "0100ae8f2064b45c9d61e03aaf18e195e0dcc83e0625e68c03233acea02ecca1"
}
--8f4a1cc47ad485dbad8aa83fcd31ee41-- I have checked the output directly on my browser too (https://eth-sepolia.blockscout.com/api/v2/smart-contracts/0xd22070aD3D5d8173498CAc32b7D41cf3d591bAc8): {
"creation_bytecode": "0x3461009c57602061011a5f395f516100195761001961002b565b6100466100a06100ba396100466100baf35b60208060a05260126040527f4572726f722077697468206d657373616765000000000000000000000000000060605260408160a001603282825e8051806020830101601f825f03163682375050601f19601f8251602001011690509050810190506308c379a060805280600401609cfd5b5f80fd5f3560e01c630aee8499811861003e5734610042577f38fa08cb8c72b174ff5b07a8017f1114a1ee7085ab9b46112c21b2130b82696f60405260206040f35b5f5ffd5b5f80fd8558202034fdccad5aeebec693212b831e3ae23edc5ff183cbaed7fca4a92807b9c9d118468000a165767970657283000403003438fa08cb8c72b174ff5b07a8017f1114a1ee7085ab9b46112c21b2130b82696f",
"creation_status": "success",
"deployed_bytecode": "0x5f3560e01c630aee8499811861003e5734610042577f38fa08cb8c72b174ff5b07a8017f1114a1ee7085ab9b46112c21b2130b82696f60405260206040f35b5f5ffd5b5f80fd",
"implementations": [],
"is_self_destructed": false,
"proxy_type": "unknown"
} And on the Scalar API Client accessible from the BlockScout doc, I saw in the response that we get I also checked the API endpoints there smart-contract-verifier.swagger.yaml, but I think I am getting lost, and the right endpoints are in the blockscout-smart-contract-verification-api doc. Any chance to get some insights on this? I am trying to contribute as much as I can to help the Vyper community and I have to admit that alone I might not reach a good solution. Maybe we have to update something. Sorry if it is not clear or not posted in the right tab, but I am available if you need any details. Thanks for your help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
bump |
Beta Was this translation helpful? Give feedback.
-
An API key is not required to verify a contract on Blockscout.
Your contract is actually located on this address: 0x510dEF6899250a044B166039a602C6d9fDfa9689 |
Beta Was this translation helpful? Give feedback.
I fixed my issue. Apparently, I need to ensure that my deployed contract is recognized as a contract or already verified with the following API:
By waiting in a session to get
is_contract=true
oris_verified=true
, the previous call to verify with Vyper is working 👍I managed to get this by testing on the Blockscout explorer and checking the
Fetch/xhr
tab ofNetworks
.