How does Remix import files with unspecified path?

26 views Asked by At

This is a very basic question as I just started learning how to use Remix Ethereum and I am trying to reverse engineer a particular smart contract whose first two lines are:

pragma solidity 0.8.20;
import 'filexyz';

filexyz is not initially present in the workspace but Remix finds it on the basis of the simple info provided by the second line of code and places it under default_workspace/.deps/npm.
I am far from an expert to know whether this is a standard import statement, but it definitely does not follow the syntax recommended in the Remix documentation.

These are issues that I am striving to understand:

  1. Where does Remix look for filexyz when it finds the import statement specifying its name enclosed in single quotes with no path indication?

  2. On the other side, what does the writer of the contract have to do with filexyz in order to make it discoverable by Remix and are there any obvious reason to go this way, in the case in which filexyz is just a self-contained file with a few lines of code and not part of a library?

I want to mention that before posting I did some research on what NPM is but was unable to find any material that could explain it at a level that allowed me to understand its role in the issues above.

0

There are 0 answers