I have a general question regarding the OZ Proxies.
Why are you using a pure function to get the contract storage location and not a view function?
For example in https://github.com/OpenZeppelin/openzeppelin-contracts-upgradeable/blob/v5.0.2/contracts/access/OwnableUpgradeable.sol#L30
function _getOwnableStorage() private pure returns (OwnableStorage storage $) {
assembly {
$.slot := OwnableStorageLocation
}
}
I always thought a pure function shouldn't access state variables, or does simply accessing a constant (OwnableStorageLocation) and returning storage not count as a state variable access. What's happening under the hood here after compilation? And why isn't the compiler complaining about the access in a pure function?