dGoods is an open source and free standard for handling the virtual representation of items, both digital and physical, on the EOS blockchain led by Mythical Games. Fungible and non-fungible tokens are represented in this standard, as well as what we term semi-fungible tokens. These are nft's that share many properties but have at minimum a unique serial number. Things like tickets, luxury goods, or even fractionalized ownership are well suited to this classification and therefore, a major focus of this standard.
Three most important properties of dGoods which differentiate from other token standards
-
hierarchical naming structure of category:name for each token or set of tokens, enabling filtering and organization of tokens
-
focus on semi-fungible tokens -- that is, tokens that are 1 of n with a serial number or slightly different metadata
-
opensource metadata types and standardization for each type with localization, eg
3dGameAsset,Ticket, etc
- release of beta implementation
DEX in a token (simple marketplace functionality)
- listing tokens for sale is now built into the token itself
listsalenft: callable ownly by owner; creates a sale listing in the token contract valid for 1 week, transfers ownership to token contractclosesalenft: callable by seller if listing hasn't expired, or anyone if the listing is expired; will remove listing and return nft to sellerbuynft: called when a user sends EOS to the dgood contract with a memo of "dgood_id,to_account"- the buy action allows a user (or marketplace) to buy on behalf of another user
Metadata URI changes
metadata_uriis now formed from abase_uri+ either thedgood_idorrelative_uriif it existscreatenow takes abase_uristringissuehas arelative_uriparameter, but it is now optional (enter empty string)- if no
relative_uriis specified on a given token, the metadata should be accessed by takingbase_uri+dgood_id - if a
relative_uriexists, the metadata isbase_uri+relative_uri - this serves multiple purposes, but the most important is that it saves an immense amount of RAM compared to the total cost of creating a single token
- can still accommodate ipfs
Table Changes
- table names and table types now matchin abi making decoding easier from state history
- some table names were changed to be more precise
tokenstats->dgoodstatstokeninfo->dgoodtokeninfo_id->dgood_id
Misc
- replaced
_selfwithget_self()for future proofing - actions dealing with fungible tokens now have
ftappended (ex burn -> burnft) - trim functionality implemented when parsing string
- fungible tokens can be created with precision of 0 and no decimal place (ex 10)
- precision mismatch assert will print what precision is required
- logcall function logs the
dgood_idduring issuance to aid in matching transaction with action
- contract implementation shared with collaborating teams for feedback/security checks
Token config
- renamed
symbolinfotable totokenconfigs - added name of the standard (dgoods), version, and changed symbol type to symbol_code
- added corresponding method called
setconfigto set the symbol and version
Asset / Quantities
- introduce dasset type, similar to EOS asset but without unnecessary symbol
- dasset has functionality to convert from string
- all quantities are passed in as strings and converted to a dasset type
- precision is set similar to EOS asset and all numbers are converted to uint64_t
Issuance
issuenow takes a metadata_typetokeninfotable adds metadata_type onto the token instead of just in the metadata itself
Transfer
- fungible transfer parameters change to include category, token_name
Token Stats Table
- added
issued_supplyto keep track ofserial_numberwhen a token has been burned (iecurrent_supplyis decreased butissued_supplynever decreases)
Metadata Templates
- localization added
- Instead of just json object, metadata is an array of json objects with a
langkey that specifies the language