rusk
rusk copied to clipboard
Implement genesis contract Account for Moonlight Shard
Summary
Implement contract which will allow users to keep unobfuscated balance accounts and allow for seamless exchanges of balances between users. This functionality complements the existing Phoenix transaction model by providing a simple ledger of easily transferrable accounts.
Possible solution design or implementation
The contract should take form of a fourth genesis contract called Account
contract, and it should, similarly to the Stake contract, keep all users' aggregated funds as a single contract's balance, and keep users' money in a form of internal users' tabs. The contract should have a method to deposit funds to it (notes->balance), withdraw funds from it (balance->notes), and to transfer funds between users' tabs (balance unchanged, notes not involved). Initial implementation will work with fees charged in a regular way, from notes via the transfer contract. Hence, all money transfers will be exact, with no fees involved. After the initial version, we will add more sophisticated fee scenarios, like contract-pays-fee.
Additional context
This task will become part of the Moonlight Shard epic.