Let's say I have the following struct:
struct Price {
uint value;
}
Let's say I have the following function:
function isPriceOkay(Price calldata price) public pure returns (bool) {
return price.value > 10;
}
Is it possible to, from another function, encode a memory/storage to calldata when sending it to another function. Such as in:
function buy() public view returns (bool) {
Price memory priceData;
price.value = 10;
// Maybe do some encoding here?
return isPriceOkay(priceData); // <-- I wonder if this is possible (in any way)
}
If it is possible, is it possible to do it with nested structs?