I am writing a smart contract that allows users to stake ERC20 tokens and get a discount on a product they buy in the store.
At first, the user will transfer tokens to the contract and then based on the amount they transferred, the discount will be calculated and tokens will be staked for some time. I need to find a way to track token amount sent to the contract. Something like
How to do something like that?