BROWNIE ISSUES:NONETYPE

Viewed 124

5:31:35 in the video, Typed the codes in exactly the same way and ran it but I keep getting this error INFO: Could not find files for the given pattern(s). Brownie v1.18.1 - Python development framework for Ethereum

File "C:\Users\Morounfola\AppData\Local\Programs\Python\Python38\lib\site-packages\brownie_cli_main_.py", line 64, in main

importlib.import_module(f"brownie._cli.{cmd}").main()

File "C:\Users\Morounfola\AppData\Local\Programs\Python\Python38\lib\site-packages\brownie_cli\run.py", line 42, in main active_project.load_config() File "C:\Users\Morounfola\AppData\Local\Programs\Python\Python38\lib\site-packages\brownie\project\main.py", line 462, in load_config _load_project_config(self._path) File "C:\Users\Morounfola\AppData\Local\Programs\Python\Python38\lib\site-packages\brownie_config.py", line 222, in _load_project_config and "cmd_settings" in values TypeError: argument of type 'NoneType' is not iterable

This is the code;

from brownie import FundMe, MockV3Aggregator, network, config
from scripts.helpful_scripts import get_account 

def deploy_fund_me():
    account = get_account()
# pass the pricefeed address to our fund me contract    

# if we are on a persistent address like rinkeby, use the associated address
# otherwise, deploy mocks
if network.show_active != "development":
   price_feed_address = config["networks"][network.show_active()][
             "eth_usd_price_feed"
]
else:
   print(f"The active network is{network.show_active()}")
print("Deploying Mocks...")
mock_aggregator = MockV3Aggregator.deploy(
      18, 200000000000000000000, {"from": account}
)
price_feed_address = mock_aggregator.address
print("Mocks Deployed!")

fund_me = FundMe.deploy(price_feed_address, {"from": account}, publish_source=True)
print(f"Contract deployed to {fund_me.address}")
def main():
    deploy_fund_me()
1 Answers

I answered this here: File "brownie/_config.py", line 222, in _load_project_config and "cmd_settings" in values TypeError: argument of type 'NoneType' is not iterable

I had the same exact issue and it was because my brownie-config.yml file was incorrect. You can't have any blank variables in your config file. Under networks I had:

networks:
  rinkeby:
    eth_usd_price_feed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
    verify: True
  kovan:
  mainnet:

having 'kovan' and 'mainnet' set to blank caused the error.

The solution is to either delete those two lines or comment them out like this:

networks:
  rinkeby:
    eth_usd_price_feed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
    verify: True
  # kovan:
  # mainnet:
Related