MetaFam / chievemints

MetaGame’s achievements NFTs
https://chiev.es
0 stars 9 forks source link

Create a unbounded permission type #2

Open dysbulic opened 2 years ago

dysbulic commented 2 years ago

There is a desire to create tokens that are transferable by their owners without creating individual permission tokens for each owner.

A solution for this would be to create a new type of permission token. Currently there are two types: universal tokens that give a user a permission for all token types and specific tokens that give a permission only for a particular type. The new permission type will disable that particular permission type, so creating one for transfer for a token type would allow any user to transfer without a check.

The token ids are bit fields. There is a flag that represents a token is a gating token. An additional field represents the type of gating. Another option could be added to that field for the new type.

With the current token types, a check is made if the requesting user holds the pertinent token. For this new type it is sufficient simply that the type exists. This is possible because we maintain a mapping between token ids and their index in the all types array.