PatrickAlphaC / fund_me

49 stars 85 forks source link

Verification of contract #22

Open nikkiwong opened 1 year ago

nikkiwong commented 1 year ago

Hi there,

I'm at the point of the course where you get the API key token from etherscan.io.

I followed all the steps, but my code breaks here:

fund_me = FundMe.deploy({"from": account}, publish_source=False)

and this is the error I get:

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.

Google has not been much use. Anyone can help?

PatrickAlphaC commented 1 year ago

thanks for this! Looks like you got an error back.

If you do:

print(response)

Before you do the line, what happens?

data = response.json()
nikkiwong commented 1 year ago
Screenshot 2023-07-13 at 14 51 43

its from the brownie publish_source function which I don't know how to debug?

:(

I tried to F12 to go to source but it said "no definition found for publish_source"

Here is the full deploy code:

Screenshot 2023-07-13 at 14 54 19

And I'm running in command line: brownie run scripts/deploy.py --network sepolia

PatrickAlphaC commented 1 year ago

What's the error?

nikkiwong commented 1 year ago

What's the error?

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)
PatrickAlphaC commented 1 year ago

Looks like it's having a hard time verifying... Your API key could be wrong or something with your networks... This might be a great stack exchange ETH or Peeranha question.

nikkiwong commented 1 year ago

ah ok ok, thank you! I'll ask this on stack exchange! Appreciate you