you need the interface of the contract too. If you do not have a contract code and you want to call contract methods but if you do not have the code how would you know which methods to call?
interface InterfaceA {
function count() external view returns (uint256);
function increment() external;
}
you know the address of the contract
InterfaceA a = InterfaceA(addressA);
a
is the contract instance
If you know only the address you can use address.call
but this is not Safe ant Not recommended. You need to know the selector of the function. For example if you have "transfer" function
// we need function name and its argument types (address and uint256)
bytes4 private constant TRANSFER_SELECTOR = bytes4(keccak256(bytes('transfer(address,uint256)')));
then
// abi.encodeWithSignature() method is the standard way to interact with contracts
(bool success, bytes memory data) = contractAddress.call(abi.encodeWithSelector(TRANSFER_SELECTOR, to, value));