// SPDX-License-Identifier: MIT pragma solidity ^0.8.24; contract Called { bool public myBool; function foo() public pure returns (string memory) { return "A"; } } contract Caller { function callFooFunction(address _a) public returns (bytes memory) { (bool success, bytes memory data) = _a.call(abi.encodeWithSignature("foo()")); require(success, "Call failed"); return data; } }