Joystream / joystream

Joystream Monorepo
http://www.joystream.org
GNU General Public License v3.0
1.42k stars 115 forks source link

Symbol string for `issue_token` #4789

Closed ignazio-bovo closed 7 months ago

ignazio-bovo commented 1 year ago

Needed to be set in the orion as a human-readable character, eg "JOY","AVA", "HAPI" etc. I don't think it is a good idea to pass a whole string as an argument which might make the extrinsic more expensive among other things.

What I would suggest is:

_Originally posted by @Lezek123 in https://github.com/Joystream/orion/pull/99#discussion_r1227206158_

bedeho commented 1 year ago

I don't understand the problem, can you restate a clear problem section here? what is this symobl bookkeping in the runtime and what is wrong about it?

bedeho commented 1 year ago

His comment seems to be saying something different:

Currently, the runtime emits hash of the symbol, not the symbol itself, so I think a change in the runtime is required to support this.

ignazio-bovo commented 1 year ago
  1. What is the purpose of storing the symbol on chain if we just set it at initialization and then we don't even use it. We just store it on a map SymbolUsed? Can we remove it, plain and simple?
  2. In order to solve the above problem can we just have a metadata item for the token symbol to allow orion to store it in the Token entity as a field?
  3. I don't think it makes sense to store them both, as one user can specify the hash for JOY in the parameters but then set another string like ETH in the metadata, and the runtime cannot check this case (as far as I know)
bedeho commented 1 year ago

What is the purpose of storing the symbol on chain if we just set it at initialization

The premise is incorrect, it is used again when a new token is created to check for possible conflict, so it is indeed read back. I think if ticker only lives in metadata, it raises the question of how you deal with conflicts. So you create many tokens in a row with same ticker, what do they get as ticker? If first one gets to reserve it, then what will ticker of the remaining ones be, nothing? what if first token is deleted, then the old ones still have nothing? Its possible to do something like that, but then we are allowing "null" as ticker symbols, I don't love that, but its an open question.

So its up to you, if you want to simplify runtime, with no ticker sympbol accounting, you need a proper logic for managing conflicts and deletions. I guess the simplest one is

up to you.

But I think the most important thing here is

ignazio-bovo commented 1 year ago

This has been addressed in #4858