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

i tried verify contract on sepolia testnet but it show error #1861

Open
Rhaegar0x00 opened this issue Apr 7, 2023 · 7 comments
Open

i tried verify contract on sepolia testnet but it show error #1861

Rhaegar0x00 opened this issue Apr 7, 2023 · 7 comments

Comments

@Rhaegar0x00
Copy link

I tried deploy and verify on goerli it work but on sepolia ( Add sepolia using infura api ) it shows :

Transaction sent: 0x574214495409706e1e0c946f2a8bc0030b73bac140d290c9b87c45ada398f8ca
Gas price: 2.726061052 gwei Gas limit: 449772 Nonce: 53
FundMe.constructor confirmed Block: 3244279 Gas used: 408884 (90.91%)
FundMe deployed at: 0x7C4dB3AaDfDD4E94f9E0DcC92716d1caf6be83e0

File "D:\python3_10\lib\site-packages\brownie_cli\run.py", line 51, in main
return_value, frame = run(
File "D:\python3_10\lib\site-packages\brownie\project\scripts.py", line 110, in run
return_value = f_locals[method_name](*args, **kwargs)
File ".\scripts\deploy.py", line 12, in main
deploy_FundMe()
File ".\scripts\deploy.py", line 7, in deploy_FundMe
fund_me = FundMe.deploy({"from": account}, publish_source=True)
File "D:\python3_10\lib\site-packages\brownie\network\contract.py", line 549, in call
return tx["from"].deploy(
File "D:\python3_10\lib\site-packages\brownie\network\account.py", line 557, in deploy
contract.publish_source(deployed_contract, silent=silent)
File "D:\python3_10\lib\site-packages\brownie\network\contract.py", line 408, in publish_source
data = response.json()
File "D:\python3_10\lib\site-packages\requests\models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 2 column 1 (char 1)
PS E:\solidity_learn\brownie_fund_me>

Contract deployed but seem like brownie have some error when verifying contract

@Stefs-2142
Copy link

Got same error with sepolia

@hbarrabasqui
Copy link

I have a similar problem. The Rinkeby network is no longer working, I am using the Sepolia network. Up to now things have worked, but when I want to verify a contract problems come up. I have used the Keys API from etherscan.io . I add these API Keys to the .env file as explained in Vasiliy Gualoto's video time 6:27 (https://www.youtube.com/watch?v=yN3zpI3sNAE&t=23701s&ab_channel=Chainlink). I also updated the deploy.py file, but when executing the command in the terminal I get an error that I don't know how to solve. Here I show you the command and the result


(brownieProjects) horacio@DESKTOP-DJSHN39:~/demos/brownie_fund_me$ brownie run scripts/deploy.py --network sepolia
Brownie v1.19.3 - Python development framework for Ethereum

BrownieFundMeProject is the active project.

Running 'scripts/deploy.py::main'...
Transaction sent: 0x4c9bf09e62deb5618416c4211327450e04766cc03b1428ded9efb8d1307af823
Gas price: 1.00000001 gwei Gas limit: 396416 Nonce: 48
FundMe.constructor confirmed Block: 3465410 Gas used: 360379 (90.91%)
FundMe deployed at: 0x11796C04C240b34b9B4963EC05D646dE66F62540

File "brownie/_cli/run.py", line 51, in main
return_value, frame = run(
File "brownie/project/scripts.py", line 110, in run
return_value = f_locals[method_name](*args, **kwargs)
File "./scripts/deploy.py", line 15, in main
deploy_fund_me()
File "./scripts/deploy.py", line 11, in deploy_fund_me
fund_me = FundMe.deploy({"from":account}, publish_source=True)
File "brownie/network/contract.py", line 549, in call
return tx["from"].deploy(
File "brownie/network/account.py", line 557, in deploy
contract.publish_source(deployed_contract, silent=silent)
File "brownie/network/contract.py", line 338, in publish_source
raise ValueError("Explorer API not set for this network")
ValueError: Explorer API not set for this network
(brownieProjects) horacio@DESKTOP-DJSHN39:~/demos/brownie_fund_me$


Somebody has the same problem? I do not know what is the meaning of "Explorer API not set for this network".
Thank you!!

@hbarrabasqui
Copy link

I forgot to indicate that I added the sepolia network to Brownie and it is displayed like this:

The following networks are declared:

Ethereum
├─Mainnet (Infura): mainnet
├─Ropsten (Infura): ropsten
├─Rinkeby (Infura): rinkeby
├─Goerli (Infura): goerli
├─Kovan (Infura): kovan
└─sepolia: sepolia

Ethereum Classic
├─Mainnet: etc
└─Kotti: kotti
.
.
.
Is it correct to see it like this? Could there have been an error adding it? Thank you!!

@mule-codex
Copy link

what alternatives to rinkeby network can I use?

@Rhaegar0x00
Copy link
Author

I find the right way to add sepolia to brownie , just use it and everything will be fine :
brownie networks add Ethereum sepolia2 host='https://sepolia.infura.io/v3/$WEB3_INFURA_PROJECT_ID' chainid=11155111 explorer=https://api-sepolia.etherscan.io/api
I think we missed explorer for evm know where do you want to verify contract

@hbarrabasqui
Copy link

For my problem, after searching a lot, I found a solution and I was finally able to verify the smart contract in brownie. I went into .brownie\network-config and replaced the sepolia data with the following:


-chainid: 11155111
explorer: https://api-sepolia.etherscan.io/api
host: https://sepolia.infura.io/v3/$WEB3_INFURA_PROJECT_ID
id:sepolia
multicall2: '0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696'
name: Sepolia (Infura)
provider: infura


I redisplayed the contract and brownie verified it. I could check it at https://sepolia.etherscan.io/

I found this information at: https://ethereum.stackexchange.com/questions/147238/infura-network-support-for-sepollia-in-brownie

@marginalfriend
Copy link

I have kinda similar error with @hbarrabasqui it says

ValueError: Explorer API not set for this network

And I figured out how to set the explorer API. You just have to modify the network through the terminal:

\brownie_fund_me> brownie networks modify sepolia explorer=https://api-sepolia.etherscan.io/api

If your sepolia network has the same name as mine, it is supposed to be working well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants