Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the way import is written #432

Open
Akira-Taniguchi opened this issue May 31, 2020 · 1 comment
Open

Change the way import is written #432

Akira-Taniguchi opened this issue May 31, 2020 · 1 comment
Labels
enhancement New feature or request refactor

Comments

@Akira-Taniguchi
Copy link
Member

Description

Change the description method from absolute path to relative path

Solution

before

import {Pausable} from "@openzeppelin/contracts/lifecycle/Pausable.sol";
import {IAllocator} from "contracts/src/allocator/IAllocator.sol";

after

import "../../../@openzeppelin/contracts/lifecycle/Pausable.sol";
import "./IAllocator.sol";

reason:
Dependencies can't be resolved when referring to a contract after npm install

@Akira-Taniguchi Akira-Taniguchi added the enhancement New feature or request label May 31, 2020
@aggre
Copy link
Member

aggre commented May 31, 2020

I think a relative path, similar to a general JavaScript project, would be appropriate. Cause @openzeppelin/contracts will be installed in the user project's node_modules, but essentially cannot be known relative to @devprtcl/protocol.

So, like the following:

import "@openzeppelin/contracts/lifecycle/Pausable.sol";
import "./IAllocator.sol";

@aggre aggre added the refactor label Jul 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor
Projects
None yet
Development

No branches or pull requests

2 participants