Brownie: CompilerError: File outside of allowed directories
Brownie: CompilerError: File outside of allowed directories
我正在尝试将“@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol”导入我的合同,但我遇到了这个错误。 CompilerError:solc 返回以下错误:
contracts/Lottery.sol:4:1: ParserError: Source "C:/Users/Алексей/.brownie/packages/smartcontractkit/chainlink-brownie contracts@1.1.1/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" not found: 文件在允许的目录之外。
导入“@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol”;
^------------------------------------------------ --------------------------^
这是我的合同 (Lottery.sol):
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
contract Lottery {
address payable[] public players;
uint256 public usdEnterFee;
AggregatorV3Interface internal ethUsdPriceFeed;
constructor(address _priceFeedAddress) public {
usdEnterFee = 50 * (10 ** 18);
ethUsdPriceFeed = AggregatorV3Interface(_priceFeedAddress);
}
function enter() public payable {
players.push(msg.sender);
}
function getEnterFee() public view returns(uint256) {
}
function startLottery() public {
}
function endLottery() public {
}
}
这是布朗尼-config.yaml:
dependencies:
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
solc:
remappings:
- '@chainlink=smartcontractkit/chainlink-brownie contracts@1.1.1'
错误:
enter image description here
没有找到aggregatorV3interface.sol
你安装了吗?
尝试pip3 install @chainlink/contracts
或npm install @chainlink/contracts
如果你已经完成了,请检查它是否在正确的路径中
我正在尝试将“@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol”导入我的合同,但我遇到了这个错误。 CompilerError:solc 返回以下错误:
contracts/Lottery.sol:4:1: ParserError: Source "C:/Users/Алексей/.brownie/packages/smartcontractkit/chainlink-brownie contracts@1.1.1/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol" not found: 文件在允许的目录之外。 导入“@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol”; ^------------------------------------------------ --------------------------^
这是我的合同 (Lottery.sol):
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.6;
import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";
contract Lottery {
address payable[] public players;
uint256 public usdEnterFee;
AggregatorV3Interface internal ethUsdPriceFeed;
constructor(address _priceFeedAddress) public {
usdEnterFee = 50 * (10 ** 18);
ethUsdPriceFeed = AggregatorV3Interface(_priceFeedAddress);
}
function enter() public payable {
players.push(msg.sender);
}
function getEnterFee() public view returns(uint256) {
}
function startLottery() public {
}
function endLottery() public {
}
}
这是布朗尼-config.yaml:
dependencies:
- smartcontractkit/chainlink-brownie-contracts@1.1.1
compiler:
solc:
remappings:
- '@chainlink=smartcontractkit/chainlink-brownie contracts@1.1.1'
错误: enter image description here
没有找到aggregatorV3interface.sol
你安装了吗?
尝试pip3 install @chainlink/contracts
或npm install @chainlink/contracts
如果你已经完成了,请检查它是否在正确的路径中