Getting two errors with the following code.
abstract contract ReceiveBalanceContract is Ownable {
receive() external payable {
require(msg.sender == address(SendBalanceContract));
}
function withdrawBalance() external {
owner.call.value(address(this).balance)();
}
}
contract SendBalanceContract {
constructor(address _nftAddress) public {
ERC721 candidateContract = ERC721(_nftAddress);
require(candidateContract.supportsInterface(InterfaceSignature_ERC721));
nonFungibleContract = candidateContract;
}
function withdrawBalance() external {
address nftAddress = address(nonFungibleContract);
require(msg.sender == owner || msg.sender == nftAddress); // Error 1
bool res = nftAddress.call.value(address(this).balance)(""); // Error 2
}
}
I am getting two errors and can't manage to fix this. Error 1:
TypeError: Operator == not compatible with types address payable and function () view returns (address)
require(msg.sender == owner || msg.sender == nftAddress);
Error 2:
TypeError: Different number of components on the left hand side (1) than on the right hand side (2).
I don't understand what s going on here