Lesson 9 ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found #1286
-
|
I copied the exact code from the GitHub. Not using GitHub Repo commands but just copying and pasting and I am getting this error: Compiling contracts... ParserError: Source "@openzeppelin/contracts/token/ERC20/ERC20.sol" not found: File not found. Searched the following locations: "". Any ideas on how to fix this? Under Contracts: OurToken.sol // contracts/OurToken.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract OurToken is ERC20 {
// wei
constructor(uint256 initialSupply) ERC20("OurToken", "OT") {
_mint(msg.sender, initialSupply);
}
}
Under Scripts: init.py Under Scripts: 1_deploy_token.py from brownie import OurToken
from scripts.helpful_scripts import get_account
from web3 import Web3
initial_supply = Web3.toWei(1000, "ether")
def main():
account = get_account()
our_token = OurToken.deploy(initial_supply, {"from": account})
print(our_token.name()).env .gitattributes .gitignore brownie-config.yaml dependencies:
- OpenZeppelin/openzeppelin-contracts@4.5.0
compiler:
solc:
remappings:
- '@openzeppelin=OpenZeppelin/openzeppelin-contracts@4.5.0'
dotenv: .env
wallets:
from_key: ${PRIVATE_KEY}requirements.txt eth-brownie
python-dotenv
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 11 replies
-
|
can you have a look under |
Beta Was this translation helpful? Give feedback.
can you have a look under
>$home\.brownie\packages\if there is an OpenZeppelin directory?This path means on Windows
C:\Users\yourAccountName\.brownie\packages