We were brainstorming about ways to enable Group Currencies with the current version of Hub.sol
When using a transaction batch mechanism, like the Gnosis Safe Transaction Builder, this can be achieved quite easily. This approach will use a Token Swap mechanism, which then enables the original Token sender to exchange the swapped Token for Group Currencies.
Bob trusts Alice and is member of BobsGroup, which uses the BobsGroupCurrencyToken. This means that Bob can always exchange his CRC for the BobsGroupCurrencyToken.
Alice wants to exchange some of her CRC for BobsGroupCurrencyToken, but is not member of BobsGroup. As she is trusted by Bob she could use Bob’s Tokens to exchange those for BobsGroupCurrencyToken, but currently there is no way of swapping Tokens in Circles.
For Alice to acquire BobsGroupCurrencyToken, this sequence could work:
- Alice swaps her Tokens for Bobs, so she sends Bob her CRC and gets Bob’s CRC back. This might be transitive (Alice sends Bob via Charly but still gets 1:1 Bob Tokens)
- Alice uses
GroupCurrencyTokento mint BobsGroupCurrencyToken for the Bob Tokens she received
For the first step, one possible implementation would be a
Universal Receiver contract which allows (unrestricted!) fetching of Tokens which have been sent to it. This contract is an org account which trusts all users in its Group. As the fetching of transferred Tokens is unrestricted, the
transfer step and the
claim step must be bundled in one transaction batch.
Once Alice owns Bob Tokens by swapping her Tokens via the
Universal Receiver, she can call
mintDelegate on the
GroupCurrencyToken. This step does not have to be in the former atomic (batch) transaction, but could be, to provide better UX.
The transaction bracket is created with an external tool, eg. the Transaction Builder in the Gnosis Safe.