ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File not found.
当我在默认的本地 ganache-cli 上部署 brownie 时。
命令:
$ brownie compile
得到:
Brownie v1.17.2 - Python development framework for Ethereum
Compiling contracts...
Solc version: 0.8.11
Optimizer: Enabled Runs: 200
EVM Version: Istanbul
CompilerError: solc returned the following errors:
ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File not found.
令牌文件头:
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract InvestToken is ERC20 {
brownie-config.yaml 文件:
dependencies:
# - <organization/repo>@<version>
- OpenZeppelin/openzeppelin-contracts@4.4.2
compiler:
solc:
remappings:
- '@openzeppelin = OpenZeppelin/openzeppelin-contracts@4.4.2'
命令:
$brownie pm install OpenZeppelin/openzeppelin-contracts@4.4.2
得到:
FileExistsError("Package is aleady installed")