Hi,
I have the following two contracts, Contract A is given by:
pragma solidity ^0.5.8;
contract A {
address owner;
constructor() public{
owner = msg.sender;
}
function transferTo(address to, uint amount) public {
(bool success,) = to.call.value(amount)("");
require(success);
}
function() external payable {}
}
Contract B is given by:
//B.sol
pragma solidity ^0.5.8;
interface A {
function transferTo(address to, uint amount) external;
}
contract B {
address owner;
constructor () public { owner = msg.sender;}
function getOwner() public view returns (address) { return owner;}
function() external payable {
A(msg.sender).transferTo(owner, msg.sender.balance);
}
}
When I compile the code on Truffle console, I am getting the following warning: Duplicate contract names found for A. Somebody please guide me how to remove this warning.