Cannot find module 'openzeppelin-solidity/contracts/utils/Context.sol'
See original GitHub issue➜ simpletoken truffle run verify WrappedSelfETH --network ropsten --debug
DEBUG logging is turned ON
Running truffle-plugin-verify v0.5.15
Verifying WrappedSelfETH
Reading artifact file at /Users/zhangnan/blockchain/simpletoken/build/contracts/WrappedSelfETH.json
Retrieving constructor parameters from https://api-ropsten.etherscan.io/api?apiKey=3QH9TTYIWSC5MJYC1CJEQUNSJ2RFT7KPDU&module=account&action=txlist&address=0xBf655E2b118bdc4581e345186DF030352f74688d&page=1&sort=asc&offset=1
Constructor parameters retrieved: 0x
Cannot find module 'openzeppelin-solidity/contracts/utils/Context.sol'
Failed to verify 1 contract(s): WrappedSelfETH
my contact
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "openzeppelin-solidity/contracts/token/ERC20/ERC20.sol";
import "openzeppelin-solidity/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "openzeppelin-solidity/contracts/access/Ownable.sol";
contract WrappedSelfETH is ERC20, ERC20Burnable, Ownable {
constructor() ERC20("wrapped ETH", "WETH") {
_mint(msg.sender, 20000 * 10 ** decimals());
}
function mint(address to, uint256 amount) public onlyOwner {
_mint(to, amount);
}
}
truffle-config.js
const HDWalletProvider = require('truffle-hdwallet-provider');
const fs = require('fs');
const mnemonic = fs.readFileSync(".secret").toString().trim();
module.exports = {
networks: {
ropsten: {
provider: () => new HDWalletProvider(mnemonic, `https://ropsten.infura.io/v3/0fef7f32ccd549f998137fe6b6b7422e`),
network_id: 3, // Ropsten's id
gas: 6000000, // Ropsten has a lower block limit than mainnet
confirmations: 2, // # of confs to wait between deployments. (default: 0)
timeoutBlocks: 200, // # of blocks before a deployment times out (minimum/default: 50)
skipDryRun: true // Skip dry run before migrations? (default: false for public nets )
},
},
mocha: {
// timeout: 100000
},
compilers: {
solc: {
version: "0.8.0", // Fetch exact version from solc-bin (default: truffle's version)
}
},
api_keys: {
etherscan: 'xxxxxxx',
ropsten:'xxxxxx'
},
plugins: [
'truffle-plugin-verify'
]
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:18 (7 by maintainers)
Top Results From Across the Web
not found utils/context.sol when i import from openzepplin
This line tries to import the file Context.sol from "utils" folder located "two folders up" relative to the folder where your ERC20 contract...
Read more >Openzepplin not found either you install it using NPM or ...
i'm using the local host to import all my smart contract into Remix IDE. The openzeppelin file is already there, and in the...
Read more >@openzeppelin/contracts - npm
A library for secure smart contract development. Build on a solid foundation of community-vetted code. Implementations of standards like ...
Read more >openzeppelin/contracts/utils/Counters.sol, ERC721.sol not found
A video that solves the following VS Code error for Solidity and Full Stack DevelopersSource "hardhat/console. sol " not found : File import ......
Read more >“ParserError: Source “openzeppelin/contracts/token/*.sol” not ...
Solution: One of the potential causes for this error could be a missing node_modules folder in the directory which contains the contracts directory....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Oh I see, that’s good to hear! Could you share what you were doing wrong and how you solved it? That could help other people who find this issue in the future.
If there’s anyone with a repository where you’re experiencing this that I can take a look at, please let me know.