SpaceCraft new token identifier and payment options

Problem

The current token identifier and payment types started as exclusively ESDT, and were then modified to include EGLD, but with a custom token representation in arguments and storage: EGLD.

Then, after Spica it became possible to use EGLD in multi-transfer, with the ticker EGLD-000000. We do have plans to transform EGLD from a special token into a regular ESDT, with this token identifier.

Furthermore, on lightspeed chains EGLD is not necessarily the native token.

So it makes little sense to keep the articifial distinction. The only problem is, because existing contracts already use the EGLD representation, migration cannot happen automatically. We need a new set of types to represent the simplified token identifiers and payments.

Proposition 1

I propose creating types TokenIdent and Payment. Unfortunately, TokenIdentifier is already taken, even though a more correct name for it would have been EgldOrEsdtTokenIdentifier.

Token identifiers are simple byte arrays, with a validation method, but nothing else.

Proposition 2

We should create an API for getting the current native token used for gas in transactions. It is worth eventually adding to the VM, but until then we can hardcode it into contracts via sc-config.toml, to help developers easily build contracts for either mainnet of lightspeed chains.

2 Likes

I honestly don’t like “TokenIdent”, dunno why..

What about the simpler form of “TokenId”, is there a reason you decided against it?

1 Like