-
Hi guys. contracts/FundMe.sol:5:1: ParserError: Source "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" not found: File outside of allowed directories. my brownie.config.yamal |
Beta Was this translation helpful? Give feedback.
Replies: 9 comments 19 replies
-
This is 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 {
uint256 minimumUSD = 50 * 10 ** 18;
require(getConversionRate(msg.value) >= minimumUSD, "You need to spend more ETH!");
addressToAmountFunded[msg.sender] += msg.value;
funders.push(msg.sender);
}
function getVersion() public view returns (uint256){
AggregatorV3Interface priceFeed = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e);
return priceFeed.version();
}
function getPrice() public view returns(uint256){
AggregatorV3Interface priceFeed = AggregatorV3Interface(0x8A753747A1Fa494EC906cE90E9f37563A8AF630e);
(,int256 answer,,,) = priceFeed.latestRoundData();
return uint256(answer * 10000000000);
}
// 1000000000
function getConversionRate(uint256 ethAmount) public view returns (uint256){
uint256 ethPrice = getPrice();
uint256 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);
}
} this the brownie-config.yaml:
And this is the error:
|
Beta Was this translation helpful? Give feedback.
-
It's not |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Perhaps it's a grammar mistake in brownie-config.yaml , i wrongly type the word commpiler and that's the case |
Beta Was this translation helpful? Give feedback.
-
I got the same problem, and can't find the reason no one of the listed above |
Beta Was this translation helpful? Give feedback.
-
Hi - I have the same issue and the solutions above have not worked. Below is the brownie-config.yaml file: I also added this to settings.json file |
Beta Was this translation helpful? Give feedback.
-
Hi! I am a complete noob at this but learning quickly. It seems I got suck here and can't figure out what is the problem. Any help pls?? here is my brownie-config.yaml |
Beta Was this translation helpful? Give feedback.
-
Hello Please can some help me with this issue, i got the some issue of you guys but i don't know where is the problem |
Beta Was this translation helpful? Give feedback.
-
I had the same error, apparently, I didn't leave a space between the |
Beta Was this translation helpful? Give feedback.
It's not
brownie_config.yaml
isbrownie-config.yaml
with-
so that's why your brownie can't find the configuration, give it a try ;)Best regards.