Is this possible...send crypto on an event/action (like a button click)?

Not sure if this is the right place to post this, but wanted to ask if anyone knows if the following is possible:

Is there a way to hook up an action to a faucet? Basically my idea is a way where if you get a correct answer, it sends you crypto. Is there a way to do this based on a cryptocurrency you mint or hook it up to Rinkeby test faucet? More so thinking of a gaming use case, but figured y’all might have some ideas!

I don’t know if you can hook directly to the rinkeby faucet but what you will need to build a backend for this. The user sends their answer to your backend server, and if the answer is correct, the backend server executes transfer tx to send crypto to the user.
You cannot really do the quiz logic in smart contract because everything you write in the contract is exposed, even for private variables. Or maybe, you put the hashed version of the answer in the smart contract and if the user enters the correct hash, the smart contract can send crypto. But this will be one time only because once one user gets the correct answer, other people can know the answer…

1 Like