protocol icon indicating copy to clipboard operation
protocol copied to clipboard

Change the way import is written

Open Akira-Taniguchi opened this issue 4 years ago • 1 comments

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 avatar May 31 '20 12:05 Akira-Taniguchi

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 avatar May 31 '20 14:05 aggre