Hi, I am currently using the openzeppelin upgrades library and specifically using the UUPS proxy. I am implementing an upgradeable NFT contract however so as to not have individuals needlessly waste money on the logic contract, I want to make it not possible for them to mint via the logic contract unless they go via the proxy. Currently, I am using comments to detail that they should NOT interact with the contract directly as well as the frontend sending calls to the proxy.
Disclaimer: I am unfamiliar with assembly for solidity.
A basic guess and implementation is:
- Set logic contract's owner to be proxy
- Add onlyOwner modifiers to the functions
- Change logic functions to contain original msg.sender
- Change the assembly in the proxy forwarding to have msg.sender be the proxy and change call data to include the original msg.sender
Is this doable?
Ideally, I would like to not have to mess with the assembly (if the above is even possible) and bake in solidity code to enforce the rule that only the proxy can execute write functions of the logic contract. Does anyone know if this is possible?