Running E:\projects\Greeter-Contract-master\contracts>solcjs --abi Greeter.sol
gives:
Greeter.sol:3:1: ParserError:
Source "contracts/Mortal.sol" not found: File import callback not supported
import "contracts/Mortal.sol";
^----------------------------^
Greeter.sol:
pragma solidity ^0.6.4;
import "contracts/Mortal.sol";
contract Greeter is Mortal {
string greeting;
constructor( string memory _greeting) public {
greeting = _greeting;
}
function changeGreeting( string memory _greeting) public {
greeting = _greeting;
}
function greet() public view returns (string memory) {
return greeting;
}
}
Mortal.sol:
pragma solidity ^0.6.4;
contract Mortal {
/* Define variable owner of the type address */
address payable owner;
/* This function is executed at initialization and sets the owner of the contract */
constructor() public { owner = msg.sender; }
/* Function to recover the funds on the contract */
function kill() public {
if (msg.sender == owner)
selfdestruct(owner);
}
}
solcjs --abi Greeter.sol
- compile a contract (obviously).