Openzeppelin initializer for my functions

Hi Team,

I am using UUPSUpgradable.

constructor() initializer {}
function initialize() public override initializer {


constructor needs initializer as well because of the known hack and I won't go into details.

Now, I also got one function in that contract called deposit.

I want to restrict users from calling deposit on the logic contract unless they call through proxy because if called on logic directly, that contract is something nobody uses and their money kind of gets lost.

How do you approach/solve this ? I might come up with my way, but what's OpenZeppelin's way ?

Thanks a lot.

You can use the onlyProxy modifier: