So I am starting a chain with the intention that it
would have a fixed number of tokens, and the way I went about doing it is to configure one endowed_account
: Alice
with a set number of tokens in the genesis configuration. Alice
so happens to also be the only validator, and she's also the only person running the node. When I create a try to send some tokens say 10 units from Alice to Bob, Bob gets the full amount, but total issuance goes down, presumably by the fees amount. Like if Alice initially had 100, and sent 10 to Bob, the total issuance in the block explorer shows something like 99.999 Units.
My intuition is that pub type TotalIssuance<T: Config<I>, I: 'static = ()> = StorageValue<_, T::Balance, ValueQuery>;
calculates the sum of free and reserved balance of all accounts above existential deposit and then stores that value, which is why we don't see the "fees" being accounted for in it, and the "fees" is effectively burned. However this is my speculation and I am not sure. I would initially think of TotalIssuance
as a hard upper limit on the number of tokens in circulation but is it so?
Besides this, I don't understand that since Alice is the only one validator and block producer in this chain, the fees should be going to her right, since typically block rewards go to the block producer? Yet, it's NOT so.
The second doubt I had regarding the transfer function is that the documentation says that if a transfer call puts the balance below existential deposit, the account will be "reaped". What does that mean? They've also provided an alternative transfer_keep_alive
which quote:
works the same way as
transfer
, but has an additional check that the transfer will not kill the origin account.
I am having trouble understanding these terms, since something I read previously said all valid pub/private key pairs are valid "accounts". So what does killing and reaping mean in this context?