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
Many changes have occured since v0.4 that made it into the 1.0 release. Some of these changes are not backwards compatible since changes were made to multiple tables' structure. It is recommended to start from a fresh contract rather than try and migrate data to the new version.
We have a basic usage tutorial
General
- general bug fixes
- removed custom dasset type in favor of standard asset type
- removed inline actions in most places to comply with EOS 1.8 changes
issue
function made batch
Added Features
- add sellable flag
- ex. transferable=false, sellable=true, can still trade; in fact becomes only way to effectively transfer item
- add locking mechanism for use when selling and for future use in renting
- enables listing for sale while keeping item until sell occurs
- enable configurable fee per token type used in sale
- enables an artist or creator to benefit from the resale market
listsalenft
now batch as well- can list multiple dgoods for sale as a batch
- update code to be compatible with CDT 1.6.1
- add checks for invalid amounts
- allow EOS to be sent without invoking
buynft
by setting memo to "deposit"
- 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_uri
is now formed from abase_uri
+ either thedgood_id
orrelative_uri
if it existscreate
now takes abase_uri
stringissue
has arelative_uri
parameter, but it is now optional (enter empty string)- if no
relative_uri
is specified on a given token, the metadata should be accessed by takingbase_uri
+dgood_id
- if a
relative_uri
exists, 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
->dgoodstats
tokeninfo
->dgood
tokeninfo_id
->dgood_id
Misc
- replaced
_self
withget_self()
for future proofing - actions dealing with fungible tokens now have
ft
appended (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_id
during issuance to aid in matching transaction with action
- contract implementation shared with collaborating teams for feedback/security checks
Token config
- renamed
symbolinfo
table totokenconfigs
- added name of the standard (dgoods), version, and changed symbol type to symbol_code
- added corresponding method called
setconfig
to 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
issue
now takes a metadata_typetokeninfo
table 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_supply
to keep track ofserial_number
when a token has been burned (iecurrent_supply
is decreased butissued_supply
never decreases)
Metadata Templates
- localization added
- Instead of just json object, metadata is an array of json objects with a
lang
key that specifies the language