If you want to receive all the participation rewards of the users, what you can do is create a stateless smart contract escrow account C
and an application (stateful smart contract) App that works as follows:
- To join, a user will send a group of two transaction:
- Send x Algos to
C
- Opt in to the application App that will record in the user address that they sent x Algos, and also keep in global state the total amount of Algos sent by user (call it
Total
)
- Send x Algos to
-
C
allows any transaction fromC
to an account you own if it is done in a group transaction with a call to App. And App will in that case allow any such transaction as long as the resulting balance ofC
is aboveTotal
. This allows to get all the participation rewards at any point in time.
To have an example of such a application using an escrow account, see the crowfunding stateful smart contract application.
If you want to only take part of the participation rewards, it becomes a bit more complex.
What you need to do is create one escrow account per user.
You can do it using the ideas in Bond Implementation - #7 by fabrice