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

Viewed 17

Keep getting this error when deploying fundMe contract using brownie running:

Not sure which variable is a nonetype and not iterable.

brownie run scripts/deploy.py

deploy file: deploy.py:

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


def deploy_fund_me():
    account = get_account()
    # pass the price feed address to our fundme contract

    # if we are on a persistent network 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, 1200000000000000000000, {"from": account}
        )
        price_feed_address = mock_aggregator.address
        print("Mocks Deployed!")

    fund_me = FundMe.deploy(
        price_feed_address,
        {"from": account},
        publish_source=config["networks"][network.show_active()].get("verify"),
    ) 
    print(f"Contract deployed to {fund_me.address}")


def main():
    deploy_fund_me()

config file: brownie-config.yaml:

dependencies:
# - <organization/repo>@<version>
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
  solc:
    remappings:
        - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1'
dotenv: .env 
networks:
  rinkeby:
    eth_usd_price_feed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
    verify: True
  kovan:
  mainnet:
  development:
    verify: False
wallets:  
  from_key: ${PRIVATE_KEY1}
1 Answers

So the issue is the blank kovan and mainnet under networks in the brownie-config.yml file:

dependencies:
# - <organization/repo>@<version>
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
  solc:
    remappings:
        - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1'
dotenv: .env 
networks:
  rinkeby:
    eth_usd_price_feed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
    verify: True
  kovan:
  mainnet:
  development:
    verify: False
wallets:  
  from_key: ${PRIVATE_KEY1}

apparently kovan: and mainnet: are compiled into nonetype and this causes the error the solution is to not have any blank variables. deleting (or commenting out) kovan and mainnet variables under networks fixes the error.

correct brownie-config.yaml

dependencies:
# - <organization/repo>@<version>
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
  solc:
    remappings:
        - '@chainlink=smartcontractkit/chainlink-brownie-contracts@1.1.1'
dotenv: .env 
networks:
  rinkeby:
    eth_usd_price_feed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
    verify: True
  development:
    verify: False
wallets:  
  from_key: ${PRIVATE_KEY1}
Related