#Why are the `name` and `symbol` values of the `initialize` function on the token contract Bytes?

11 messages · Page 1 of 1 (latest)

raven vine
#
fn initialize(e: Env, admin: Address, decimal: u32, name: Bytes, symbol: Bytes);

I'm curious why the name and symbol here are Bytes vs String. Seems it could make it difficult to know how to parse those values on the frontend given these are primarily if not exclusively informational/human readable values.

wide rock
#

it's gonna be changed to string from what i understand

raven vine
#

Actually looking at that PR it looks like only the return types are changing not the initialize types

wide rock
#

good catch

slim venture
#

@raven vine the PR I linked to on that thread (https://github.com/stellar/rs-soroban-env/pull/852) is updating the stellar asset contract. It has fixed name and symbol values that are derived from the stellar asset. Initializing the stellar asset contract accepts an xdr asset object, not a symbol and a name.

GitHub

What
Resolves #727, #756

Update name and symbol to return String.
Encode issuer account as strkey in name (example of name - zabd:GBN6JXTQ4RG2RHKAR4BKRV7CDLZXOW3HXBK4LIDFTQGJ5YMMWNNLKJ2X)

#

The functions for initializing tokens is not part of the standard token interface. You can use string, byte, whatever you want if you're making a token.

wide rock
#

interesting i assumed everything needed to match exact on the token interface to ensure interop

#

so you're saying we can already initialize it with a string? would we then need to return bytes orr

raven vine