Unable to fetch 0x contract from Etherscan and brownie

Viewed 217

I'm trying to test a smart contract which import 0x in brownie ecosystem. I have the following error when importing from explorer or from abi, also it looks like solc doesn't take in count the dependency I've install on my computer

CompilerError: solc returned the following errors:

    /home/merklejerk/code/0x-protocol/contracts/zero-ex/contracts/src/external/IFlashWallet.sol:23:1: ParserError: Source "@0x/contracts-utils/contracts/src/v06/interfaces/IOwnableV06.sol" not found: File outside of allowed directories.
    import "@0x/contracts-utils/contracts/src/v06/interfaces/IOwnableV06.sol";

^------------------------------------------------------------------------
1 Answers

Probably the compiler does not solve the relative path in the correct way.

Maybe the path of the file you import is wrong or not built properly from the compiler: when importing the file IOwnableV06.sol try to remove the @ symbol and replace it with ./ or ../ depending on your project folder structure. For example import "../../0x/the-path-here/File.sol";

Or the file you want to import might not be in the allowed paths: https://docs.soliditylang.org/en/v0.8.7/using-the-compiler.html#how-it-works (search for --allow-paths).

Related