I'm at the point of a solidity course where I need to get the API key token from etherscan.io.
I followed all the steps, but my code breaks when I use Brownies deploy function with "publish_source".
fund_me = FundMe.deploy({"from": account}, publish_source=True)
and this is the error I get:
Transaction sent: 0xebb78b3dadcaac375f552f1352a32ec435f90ef75a02b10e6ced88133d53bf16
Gas price: 1.447e-06 gwei Gas limit: 397829 Nonce: 13
FundMe.constructor confirmed Block: 3881378 Gas used: 361663 (90.91%)
FundMe deployed at: 0xAed87E48d5482b1de09AD0f54D18600BB216c640
File "eth_brownie-1.19.3-py3.9.egg/brownie/_cli/run.py", line 51, in main
return_value, frame = run(
File "eth_brownie-1.19.3-py3.9.egg/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_fund_me()
File "./scripts/deploy.py", line 7, in deploy_fund_me
fund_me = FundMe.deploy({"from": account}, publish_source=True)
File "eth_brownie-1.19.3-py3.9.egg/brownie/network/contract.py", line 552, in __call__
return tx["from"].deploy(
File "eth_brownie-1.19.3-py3.9.egg/brownie/network/account.py", line 557, in deploy
contract.publish_source(deployed_contract, silent=silent)
File "eth_brownie-1.19.3-py3.9.egg/brownie/network/contract.py", line 411, in publish_source
data = response.json()
File "requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
JSONDecodeError: Expecting value: line 2 column 1 (char 1)
I saw somewhere online that they said perhaps because I'm passing an empty variable, I've got the api key token in my .env file. I tried with wrap it in single quotes, double quotes and no quotes, still nothing. I tried to F12 to go to source but it said "no definition found for publish_source"
Here is the full deploy code:
And I'm running in command line:
brownie run scripts/deploy.py --network sepolia
I tried googling for a solution but I couldn't find anything helpful.
If anyone has any advice or suggestions, I'd be super grateful! Thank you in advance!