What is meant by a ValueError: Invalid NPM block in import when trying to run brownie compile?

  blockchain, brownie, python, smartcontracts, solidity

I am trying to test and replicate in my local machine the FundMe.sol

// SPDX-License-Identifier: MIT

pragma solidity ^0.6.6

import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
import "@chainlink/contracts/src/v0.6/vendor/SafeMathChainlink.sol";

contract FundMe {

using SafeMathChainlink for uint256;

mapping(address => uint256) public addressToAmountFunded;
address[] public funders;
address public owner;

constructor() public {
    owner = msg.sender;
}

function fund() public payable {
    uint minimumUSD = 50 * 10 ** 18;
    require(getConversionRate(msg.value) >= minimumUSD, "You need to spend more ETH! reminder by: Marco Rado");
    addressToAmountFunded[msg.sender] += msg.value;
    funders.push(msg.sender);
}

function getVersion() public view returns (uint256) {
    AggregatorV3Interface priceFeed = AggregatorV3Interface(0x9326BFA02ADD2366b30bacB125260Af641031331);
    return priceFeed.version();
}

function getPrice() public view returns(uint256) {
    AggregatorV3Interface priceFeed = AggregatorV3Interface(0x9326BFA02ADD2366b30bacB125260Af641031331);
    (,int256 answer,,,) = priceFeed.latestRoundData();
    return uint256(answer * 10000000000);
    //4,143.080000000000000000
}

function getConversionRate(uint256 ethAmount) public view returns (uint256) {
    uint ethPrice = getPrice();
    uint ethAmountInUsd = (ethPrice * ethAmount) / 1000000000000000000;
    return ethAmountInUsd;
}

modifier onlyOwner {
    require(msg.sender == owner);
    _;
}

function withdraw() payable onlyOwner public {
    msg.sender.transfer(address(this).balance);
    for (uint256 funderIndex=0; funderIndex < funders.length; funderIndex++) {
        address funder = funders[funderIndex];
        addressToAmountFunded[funder] = 0;
    }
    funders = new address[](0);
}

}

with a
brownie-config.yaml
dependencies:

but when I do compile using: brownie compile

I got this ValueError:
bash terminal screenshot

Source: Python Questions

One Reply to “What is meant by a ValueError: Invalid NPM block in import when trying to run brownie compile?”

LEAVE A COMMENT