Hello, I am new to Waves! I want to make a smart contract that would compare the attachments of two incoming transactions and if they match, then send the funds to the first sender, but if the not match, then send funds to the second sender.
This is similar to a game where the first player makes a number, and the second player guesses.
I have two questions.
How can a smart contract identify a transaction? That is, how does a smart contract can understand that a transaction came from a player who makes a number or from a player who guesses?
Can a smart account send funds to the winner automatically or a smart contract can only allow the winner to withdraw funds from the smart account?
For now, smart contracts can validate outgoing transactions only, not incoming transactions.
But in testnet a new big feature is available - Ride4DApps. This adds new features to the RIDE language and adds new transaction type InvokeScriptTransaction.
So, you can create a new DApp contract that receives InvokeScript and sends funds for a winner when some conditions are met.
Please note that this functionality is currently available only on testnet. It is expected to appear on mainnet around June.