Naming Conventions
Standard Account Names
- Can only contain the characters
.abcdefghijklmnopqrstuvwxyz12345
.a-z
(lowercase),1-5
and.
(period) - Must start with a letter
- Must be 12 characters
Table Names, Structs, Functions, Classes
- Can only contain up to 12 alpha characters
Symbols
- Must be capitalized alpha characters between A and Z
- Must be 7 characters or less
Principle
Macro & functions related naming
Encode argument into EOSIO name. (base32)
Used for fixed name
If you want to convert into EOSIO name from variable, you should use eosio::string_to_name()
Tips
-
To encode a script into EOSIO name, see eosio::string_to_name
-
To decode from base32 and restore to string form, use
eosio::to_string()
(an alias ofstd::string
)
auto user_name_obj = eosio::name{user}; // account_name user
std::string user_name = user_name_obj.to_string();
Updated less than a minute ago