I guess I have a very common use case, but I don’t know how to implement it right:
Consider, I have a simple online app that users can use to do something (e.g. create a badge by users data, convert one document format to another, etc.). Now I want to monetize this app. For this, I’m going to create a ERC-20 token and sell the use of the app for these tokens: one token per one app usage.
There are alot of articles on the internet on how to write smart contracts, but I couldn’t find much info on how to bind the real world app to the token.
For instance, how will app know that a particular user paid a token and he can now use it? How a token sender address could be matched to the app user account? How can I withdraw ETH from the smart contract?
Any references to ready-to-use solutions, articles and examples are welcome.