Support OpenZeppelin Contracts with default settings
See original GitHub issueWhen importing from OpenZeppelin Contracts installed via npm the default settings of the plugin give a compiler error. File import callback not supported
It would be great if importing OpenZeppelin Contracts could be supported with default settings.
The default settings include:
"solidity.packageDefaultDependenciesContractsDirectory": "contracts"
Users need to change the setting from contracts
to an empty
string.
"solidity.packageDefaultDependenciesContractsDirectory": ""
Example contract with OpenZeppelin Contracts installed (npm i @openzeppelin/contracts
)
pragma solidity ^0.6.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract GLDToken is ERC20 {
constructor(uint256 initialSupply) ERC20("Gold", "GLD") public {
_mint(msg.sender, initialSupply);
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:22 (12 by maintainers)
Top Results From Across the Web
Contracts - OpenZeppelin Docs
The Hitchhiker's Guide to Smart Contracts in Ethereum will help you get an overview of the various tools available for smart contract development,...
Read more >Developing smart contracts - OpenZeppelin Docs
This guide will let you get started writing Solidity contracts by going over the following: Setting up a Solidity Project. Compiling Solidity Source...
Read more >Writing Upgradeable Contracts - OpenZeppelin Docs
When working with upgradeable contracts using OpenZeppelin Upgrades, there are a few minor caveats to keep in mind when writing your Solidity code....
Read more >Access Control - OpenZeppelin Docs
By default, the owner of an Ownable contract is the account that deployed it, which is usually exactly what you want. Ownable also...
Read more >Trouble importing OpenZeppelin Contracts into VS Code
I checked the settings and `Solidity: Package Default Dependencies ... in “Support OpenZeppelin Contracts with default settings” issue, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop 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
Top GitHub Comments
Working on it, should have something very soon. The virtual events are attempting to slow me down. 😃
Got it, I had to remove
node_modules
from the settings that I had and it worked.Thanks for this great extension!