protocol
protocol copied to clipboard
Change the way import is written
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
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";