question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support OpenZeppelin Contracts with default settings

See original GitHub issue

When importing from OpenZeppelin Contracts installed via npm the default settings of the plugin give a compiler error. File import callback not supported

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:closed
  • Created 3 years ago
  • Reactions:7
  • Comments:22 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
caleteetercommented, May 20, 2020

Working on it, should have something very soon. The virtual events are attempting to slow me down. 😃

1reaction
albertov19commented, Feb 23, 2021

Got it, I had to remove node_modules from the settings that I had and it worked.

Thanks for this great extension!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found