It seems all function definitions in an interface must be external. However is it okay to define a public function in its interface as external? If so, how can I define a public function that takes a bytes memory?
for example, How could I write an interface for this contract:
contract C {
function a(bytes memory b) public view returns (bool) {
return true;
}
}
Best Answer
This should work:
A
public
function can handle being called from inside the contract or outside, so it sort of has two interfaces. The internal one uses memory for the parameters' location, but the external interface uses call data.