Skip to content
This repository has been archived by the owner on Jan 10, 2025. It is now read-only.

Token type renaming #70

Merged
merged 1 commit into from
Jul 1, 2020
Merged

Conversation

jackcmay
Copy link
Contributor

TODO: update js bindings

@jackcmay
Copy link
Contributor Author

@mvines inline with what you were thinking too?

@mvines
Copy link
Contributor

mvines commented Jun 30, 2020

Nice. How about going a little further where:

  1. state::TokenMint becomes just Mint
  2. state::Account now becomes Token.

@jackcmay
Copy link
Contributor Author

@mvines Looks like you are referring to the generated C file, what do you think about the Rust naming?

@jackcmay
Copy link
Contributor Author

Could rename State::Account(Account) to State::Account(Token) but that doesn't seem better

@mvines
Copy link
Contributor

mvines commented Jun 30, 2020

Maybe this?

pub enum State {
    /// Unallocated state, may be initialized into another state.
    Unallocated,
    /// A token type and associated mint.
    TokenType(Mint),
    /// Some amount of tokens
    Token(TokenInfo),
    /// Invalid state, cannot be modified by the token program.
    Invalid,
}

I also kinda like how the ERC20 standard has a token name and token symbol strings in it (https://eips.ethereum.org/EIPS/eip-20). There's certainly room in the State::TokenType enum for those strings, since the Mint struct is much smaller than the TokenInfo. Name/symbol a little toyish, but it does allow for a generic explorer interface to display all known tokens -- which I think people in the space tend to like.

@jackcmay
Copy link
Contributor Author

jackcmay commented Jul 1, 2020

@mvines @CriesofCarrots Post commit reviews welcome :-)

@jackcmay jackcmay merged commit fc7a808 into solana-labs:master Jul 1, 2020
@jackcmay jackcmay deleted the token-renaming branch July 1, 2020 08:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants