Eitan Seri-Levi
Eitan Seri-Levi

Reputation: 341

Invalid input source specified

getting an Invalid input source specified error with the following import when building a smart contract using the remix IDE

import "https://github.com/aave/flashloan-box/blob/Remix/contracts/aave/FlashLoanReceiverBase.sol"; 

Put together a super basic example smart contract in remix. It compiles just fine if I dont include the import statement.

pragma solidity ^0.6.6;
import "https://github.com/aave/flashloan-box/blob/Remix/contracts/aave/FlashLoanReceiverBase.sol";
contract Inbox {
    string public message; 
    
    constructor(string memory initialMessage) public {
        message = initialMessage;
    }
    
    function setMessage(string memory newMessage) public {
        message = newMessage;
    }
    
    function getMessage() public view returns (string memory) {
        return message;
    }
}

Upvotes: 0

Views: 1235

Answers (1)

Petr Hejda
Petr Hejda

Reputation: 43481

This issue is happening because of the nested import using relative path.

The FlashLoanReceiverBase.sol is trying to import relative path ./IFlashLoanReceiver.sol (not absolute path https://github.com/aave/flashloan-box/blob/Remix/contracts/aave/IFlashLoanReceiver.sol).

Since you don't have a contract named IFlashLoanReceiver.sol in the same folder as your own contract, this import fails.

Best solution would be to submit a PR to the aave/flashloan-box repository making all import paths absolute.

Upvotes: 2

Related Questions