I had a quick question about an abnormal ways to buy ERC-20 Tokens and hear if this is technically possible.
Let's assume there is a smart contract that generates and holds ERC-20Token called 'ThankYou' token, which has a supply of 1 billion tokens.
1) User A donates 100ETH to a child in need.
2) Smart contract detects that User A has donated 100 ETH and validates that 100ETH indeed has been sent to the child
3) Smart contract is triggered to transfer 30ThankYou tokens to User A for doing good.
I would very much appreciate your thought on this. I only came across cases where ERC-20 Tokens are attained by 'buying' with ETH (based on the price of ERC-20 Tokens). I was wondering if above step I mentioned is possible. And If yes, then can User A sell that 30ThankYou tokens for a exchange with ETH.
Thank you,