eth-brownie / brownie

A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
https://eth-brownie.readthedocs.io
MIT License
2.65k stars 552 forks source link

Source verification fails when importing multiple objects from the same file #1778

Open consol3cowboy opened 6 months ago

consol3cowboy commented 6 months ago

Environment information

What was wrong?

Source verification fails when importing multiple objects from the same file, e.g.:

import {
    ILayerZeroEndpointV2,
    Origin,
    MessagingReceipt,
    MessagingParams
} from "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol";

When attempting to verify I get the following error:

Verification complete. Result: Fail - Unable to verify. Solidity Compilation Error: Source "@layerzerolabs/lz-evm-protocol-v2/contracts/interfaces/ILayerZeroEndpointV2.sol" not found: File not found. Searched the following locations: "".

How can it be fixed?

When I modify the import statement so that it only imports a single object, or imports the entire file, verification is successful. I believe that the verification logic must not consider the possibility for multiple objects in a single statement, and so it misses further dependencies created by the import.