I have the follow use case:
There is an off-chain service, like a game, which will generate/mint new ERC20 tokens when some requirements are met by end-users. Since the users will get profit (in terms of ERC20 tokens), I do not want to pay the transaction fee of calling the
mint function in the ERC20 contract.
Question: How can I make users pay the transaction fee of
mint while under the control of my off-chain service (e.g. not violating the rule of minting new tokens)?
I know usually, this gas-paid-by-someone-else use case is often something like: the user do not need to pay the transaction fee, while a third-party will pay the fee. And there are a lot of mature libraries can do this, like openzeppelin GSN. But in my case, this is different.
I found a related question here talking about the general solution to such problems. But I prefer not to implement too many things by myself, since there may be security issues. Are there any libraries that can help me achieve my goal?
Thanks in advance.