multisol icon indicating copy to clipboard operation
multisol copied to clipboard

Fails to locate some imported/inherited contracts in node_modules

Open coinfupanda opened this issue 4 years ago • 6 comments

Problem multisol throws error: Couldn't get an absolute path to the contract: "IERC165.sol" when run in the create-react-app repo structure, using openzeppelin imports in the target contract.

In this case, IERC165.sol is not a direct import of the target contract - it is inherited by IERC721.sol, which is itself inherited by ERC721.sol.

repo structure

myProject
  /contracts
    /VerifyThisContract.sol
  /node_modules
  /...

VerifyThisContract.sol header

// File: VerifyThisContract.sol

pragma solidity ^0.8.0;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Pausable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

CLI to reproduce

> cd c:/users/.../myProject
> multisol contracts/VerifyThisContract.sol

Response Couldn't get an absolute path to the contract: "IERC165.sol"

node_modules structure image

coinfupanda avatar Aug 20 '21 10:08 coinfupanda

Thank you ser! I will investigate this.

PaulRBerg avatar Aug 20 '21 10:08 PaulRBerg

getting the same error

ihorbond avatar Mar 03 '22 04:03 ihorbond

@ihorbond is your set-up exactly the same as @coinfupanda's? If not, could you add more details?

PaulRBerg avatar Mar 03 '22 10:03 PaulRBerg

@paulrberg yes exactly the same. I have NFT contract that loads up OZ dependencies and the nested one are erroring out in the same way

ihorbond avatar Mar 03 '22 20:03 ihorbond

I see. To be frank I won't have time to investigate this in the near future .. but if anyone does, PRs accepted :)

PaulRBerg avatar Mar 03 '22 21:03 PaulRBerg

I'm too dumb to pick up Rust lol

ihorbond avatar Mar 04 '22 22:03 ihorbond

Closing as a duplicate of https://github.com/PaulRBerg/multisol/issues/13.

PaulRBerg avatar Jan 01 '24 07:01 PaulRBerg