I've created an Ethereum token that could be transfered from user to user. As a next step I would like to write a smart contract that transfers an amount of tokens from user A to user B when a specific state has been reached.
- User A has 10 tokens.
- User B has 1 token.
- Third party company registers actions of the users on their website / app
- All users trust a third party company.
User A agreed with the 3rd party that it is allowed to transfer 1 token to user B when condition 1 is met. For example if user B clicks 100x times on a specific button. Interaction between User B and the third party company should trigger the transfer. User A allows the 3rd party to transfer tokens.
How can I put such logic in a smart contract? I've found smart contract examples online where a smart contract is linked to another smart contract (3rd party) which tells if the condition is met or not. This does mean that all the clicks need to be registered on the blockchain? The condition will be different for each other user, for example a different interaction or different number of tokens.