Tag: Brownie

Solidity deployment error – ContractNotFound: No contract deployed at address

At time when the Ganache tool is re-opened all the Transactions and Constracts are reset. Whilst deploying contract you might see the error –

ContractNotFound: No contract deployed at {address}

PS C:\Projects\Blockchain\Solidity\brownie_fundme> brownie run .\scripts\deploy.py --network ganache-local
INFO: Could not find files for the given pattern(s).
Brownie v1.19.0 - Python development framework for Ethereum

BrownieFundmeProject is the active project.
  File "C:\Users\sandeep\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\__main__.py", line 64, in main
    importlib.import_module(f"brownie._cli.{cmd}").main()
  File "C:\Users\sandeep\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\_cli\run.py", line 45, in main
    network.connect(CONFIG.argv["network"])
  File "C:\Users\sandeep\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\main.py", line 55, in connect
    p._load_deployments()
  File "C:\Users\sandeep\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\project\main.py", line 370, in _load_deployments
    contract = ProjectContract(self, build, build_json.stem)
  File "C:\Users\sandeep\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 1305, in __init__
    _DeployedContractBase.__init__(self, address, owner, tx)
  File "C:\Users\sandeep\.local\pipx\venvs\eth-brownie\lib\site-packages\brownie\network\contract.py", line 708, in __init__
    raise ContractNotFound(f"No contract deployed at {address}")
ContractNotFound: No contract deployed at 0x7465E5ca8aFeFba39eFD83bd056ACAafa3d16646

Solution-

Delete all the files and folders in Deployment folder as closing the Ganache tool will reset contracts etc. the deployment folder has references to old contract.

Reference-

https://stackoverflow.com/questions/68460396/contractnotfound-no-contract-deployed-at

Add new network in Ganache using brownie for Ethereum Smart Contract local development

This should show the list of networks available in Brownie.

brownie networks list

In the Ethereum (persistent network) there is no Ganache(local) network

Add a network to Ethereum

brownie networks add Ethereum ganache-local host=http://127.0.0.1:7545 chainid=1337

Name of the network- ganache-local

host- where ganache endpoint is listening i.e. RPC Server

chainid – for ganache it is 1337

Output