ApeWorX / ape-etherscan

Etherscan explorer plugin using EVM-based networks for the Ape Framework
https://www.apeworx.io/
Apache License 2.0
22 stars 25 forks source link

ERROR: (NetworkError) Unable to publish contract - no explorer plugin installed. [APE-871] #85

Closed PatrickAlphaC closed 1 year ago

PatrickAlphaC commented 1 year ago

I have the etherscan explorer plugin installed, but it won't verify my sepolia contract.

FundMe is a vyper contract.

Environment information

$ ape --version
0.6.8

$ ape plugins list
  etherscan    0.6.3
  alchemy      0.6.1
  vyper        0.6.3

What went wrong?

I tried to verify my contract with a few methods and was unable.

Option 1:

def deploy_fund_me(unlock_password=None) -> project.FundMe:
    account = get_account(unlock_password=unlock_password)
    fund_me = account.deploy(
        project.FundMe,
        price_feed.address,
        publish=true,
        sender=account
    )
    print(f"Contract deployed to {fund_me.address}")
    return fund_me

Output:

INFO: Submitted 0xeff951ff350153fba20a66406295815c1c2d5e151d9830c5a2fde0b996666ebc
Confirmations (2/2): 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:28<00:00, 14.19s/it]
INFO: Confirmed 0xeff951ff350153fba20a66406295815c1c2d5e151d9830c5a2fde0b996666ebc (total fees paid = 321734002252138)
SUCCESS: Contract 'FundMe' deployed to: 0x0c16776abAb544dfAD30b411c21212121CBb8aEA

  File "/xxxx/scripts/deploy_fund_me.py", line 26, in main
    deploy_fund_me()
  File "/xxxxx/scripts/deploy_fund_me.py", line 15, in deploy_fund_me
    fund_me = account.deploy(

ERROR: (NetworkError) Unable to publish contract - no explorer plugin installed.

Option 2:

from ape import networks
>>> etherscan = networks.provider.network.explorer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/xxxx/ape/utils/basemodel.py", line 72, in provider
    raise ProviderNotConnectedError()
ape.exceptions.ProviderNotConnectedError: Not connected to a network provider.

Please include information like:

PatrickAlphaC commented 1 year ago

Also attempted with:

ape console --network :sepolia

In [8]: networks.provider.network.explorer.publish_contract("0x0c16776abAb544dfAD30b411c21212121CBb8aEA")
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
Cell In[8], line 1
----> 1 networks.provider.network.explorer.publish_contract("0x0c16776abAb544dfAD30b411c21212121CBb8aEA")

AttributeError: 'NoneType' object has no attribute 'publish_contract'
antazoey commented 1 year ago

this is fixed in ape-etherscan but we never released. i can go ahead and do that now. then switch to 0.6.4, ok? thx