Skip to content

Generated schema for tokenization/permissions.proto: 7 messages in the x/tokenization module.

Proto package tokenization, part of the x/tokenization module. It declares 7 messages. Read the raw source.

Messages

ActionPermission

ActionPermission defines the permissions for performing an action.

This is simple and straightforward as the only thing we need to check is the permitted/forbidden times.

Field#TypeRuleDescription
permanentlyPermittedTimes1UintRangerepeatedSpecifies the times when this permission is permitted. Can not overlap with permanentlyForbiddenTimes.
permanentlyForbiddenTimes2UintRangerepeatedSpecifies the times when this permission is forbidden. Can not overlap with permanentlyPermittedTimes.

CollectionApprovalPermission

CollectionApprovalPermission defines what collection approved transfers can be updated vs. are locked.

Each transfer is broken down to a (from, to, initiatedBy, transferTime, tokenId) tuple. For a transfer to match, we need to match ALL of the fields in the combination. These are determined by the fromListId, toListId, initiatedByListId, transferTimes, tokenIds fields. AddressLists are used for (from, to, initiatedBy) which are a permanent list of addresses identified by an ID (see AddressLists).

permanentlyPermitted/ForbiddenTimes: when can the manager execute this permission?

Ex: Let's say we are updating the transferability for the transfer tuple ("AllWithoutMint", "AllWithoutMint", "AllWithoutMint", 10, 1000). We would check to find the FIRST CollectionApprovalPermission that matches this combination. If we find a match, we would check the permitted/forbidden times to see if we can execute this permission (default is ALLOWED).

Ex: So if you wanted to freeze the transferability to enforce that token ID 1 will always be transferable, you could set the combination ("AllWithoutMint", "AllWithoutMint", "AllWithoutMint", "All Transfer Times", 1) to always be forbidden.

Field#TypeRuleDescription
fromListId1stringsingularIdentifier for the sender list.
toListId2stringsingularIdentifier for the recipient list.
initiatedByListId3stringsingularIdentifier for the initiator list (who is approved?).
transferTimes4UintRangerepeatedSpecifies the times when the transfer can occur.
tokenIds5UintRangerepeatedSpecifies the token IDs involved in the transfer.
ownershipTimes6UintRangerepeatedSpecifies the ownership times for the tokens in the transfer.
approvalId7stringsingularIdentifier for the approvalId. You can use "All" or "!approvalId" for shorthand. If you use "All", this approval will match to all approvalIds. If you use "!approvalId", this approval will match to all approvalIds except for approvalId. If you use "approvalId", this approval will match to only the specified approvalId and fail on all others.
permanentlyPermittedTimes8UintRangerepeatedSpecifies the times when this permission is permitted. Can not overlap with permanentlyForbiddenTimes.
permanentlyForbiddenTimes9UintRangerepeatedSpecifies the times when this permission is forbidden. Can not overlap with permanentlyPermittedTimes.

CollectionPermissions

CollectionPermissions defines the permissions for the collection (i.e., what the manager can and cannot do).

There are three types of permissions for a collection: ActionPermission, TokenIdsActionPermission, and CollectionApprovalPermission.

The permission type allows fine-grained access control for each action. - ActionPermission: defines when the manager can perform an action or update a field. - TokenIdsActionPermission: defines when the manager can perform an action for specific tokens - CollectionApprovalPermission: defines when the manager can update the transferability of the collection and what transfers can be updated vs. locked.

Note there are a few different times here which could get confusing: - permanentlyPermitted/ForbiddenTimes - the times that a permission can be performed - transferTimes - the times that a transfer occurs - ownershipTimes - the times when a token is owned by a user

The permitted/permanentlyForbiddenTimes are used to determine when a permission can be executed. Once a time is set to be permitted or forbidden, it is PERMANENT and cannot be changed. If a time is not set to be permitted or forbidden, it is considered NEUTRAL and can be updated but is ALLOWED by default.

IMPORTANT: We take first-match only for the permissions. This means that if you forbid time T in array index 0 and permit time T in index 1, we will only check the first permission (forbid time T) and not the second permission (permit time T).

Field#TypeRuleDescription
canDeleteCollection1ActionPermissionrepeatedPermissions related to deleting the collection.
canArchiveCollection2ActionPermissionrepeatedPermissions related to archiving the collection.
canUpdateStandards3ActionPermissionrepeatedPermissions related to updating standards for the collection.
canUpdateCustomData4ActionPermissionrepeatedPermissions related to updating custom data for the collection.
canUpdateManager5ActionPermissionrepeatedPermissions related to updating the collection's manager.
canUpdateCollectionMetadata6ActionPermissionrepeatedPermissions related to updating the metadata of the collection.
canUpdateValidTokenIds7TokenIdsActionPermissionrepeatedPermissions related to creating more tokens for the collection.
canUpdateTokenMetadata8TokenIdsActionPermissionrepeatedPermissions related to updating token metadata for specific tokens.
canUpdateCollectionApprovals9CollectionApprovalPermissionrepeatedPermissions related to updating collection approvals.
canAddMoreAliasPaths10ActionPermissionrepeatedPermissions related to adding more alias paths to the collection.
canAddMoreCosmosCoinWrapperPaths11ActionPermissionrepeatedPermissions related to adding more cosmos coin wrapper paths to the collection.

TokenIdsActionPermission

TokenIdsActionPermission defines the permissions for performing an action for specific tokens. Currently, this is only used for creating new tokens.

Ex: If you want to lock the ability to create new tokens for tokenIds [1,2] at ownershipTimes 1/1/2020 - 1/1/2021, you could set the combination (tokenIds: [1,2], ownershipTimes: [1/1/2020 - 1/1/2021]) to always be forbidden.

Field#TypeRuleDescription
tokenIds1UintRangerepeatedSpecifies the token IDs involved in the transfer.
permanentlyPermittedTimes2UintRangerepeatedSpecifies the times when this permission is permitted. Can not overlap with permanentlyForbiddenTimes.
permanentlyForbiddenTimes3UintRangerepeatedSpecifies the times when this permission is forbidden. Can not overlap with permanentlyPermittedTimes.

UserIncomingApprovalPermission

UserIncomingApprovalPermission defines the permissions for updating the user's approved incoming transfers.

See CollectionApprovalPermission for more details. This is equivalent without the toListId field because that is always the user.

Field#TypeRuleDescription
fromListId1stringsingularIdentifier for the sender list.
initiatedByListId2stringsingularIdentifier for the initiator list (who is approved?).
transferTimes3UintRangerepeatedSpecifies the times when the transfer can occur.
tokenIds4UintRangerepeatedSpecifies the token IDs involved in the transfer.
ownershipTimes5UintRangerepeatedSpecifies the ownership times for the tokens in the transfer.
approvalId6stringsingularIdentifier for the approvalId. You can use "All" or "!approvalId" for shorthand. If you use "All", this approval will match to all approvalIds. If you use "!approvalId", this approval will match to all approvalIds except for approvalId. If you use "approvalId", this approval will match to only the specified approvalId and fail on all others.
permanentlyPermittedTimes7UintRangerepeatedSpecifies the times when this permission is permitted. Can not overlap with permanentlyForbiddenTimes.
permanentlyForbiddenTimes8UintRangerepeatedSpecifies the times when this permission is forbidden. Can not overlap with permanentlyPermittedTimes.

UserOutgoingApprovalPermission

UserOutgoingApprovalPermission defines the permissions for updating the user's approved outgoing transfers.

Field#TypeRuleDescription
toListId1stringsingularIdentifier for the recipient list.
initiatedByListId2stringsingularIdentifier for the initiator list (who is approved?).
transferTimes3UintRangerepeatedSpecifies the times when the transfer can occur.
tokenIds4UintRangerepeatedSpecifies the token IDs involved in the transfer.
ownershipTimes5UintRangerepeatedSpecifies the ownership times for the tokens in the transfer.
approvalId6stringsingularIdentifier for the approvalId. You can use "All" or "!approvalId" for shorthand. If you use "All", this approval will match to all approvalIds. If you use "!approvalId", this approval will match to all approvalIds except for approvalId. If you use "approvalId", this approval will match to only the specified approvalId and fail on all others.
permanentlyPermittedTimes7UintRangerepeatedSpecifies the times when this permission is permitted. Can not overlap with permanentlyForbiddenTimes.
permanentlyForbiddenTimes8UintRangerepeatedSpecifies the times when this permission is forbidden. Can not overlap with permanentlyPermittedTimes.

UserPermissions

UserPermissions defines the permissions for the user about their approvals (i.e., what the user can and cannot do).

See CollectionPermissions for more details on the different types of permissions.

canUpdateOutgoingApprovals and canUpdateOutgoingApprovals follow the same as the canUpdateCollectionApprovals in CollectionPermissions, but certain fields are removed because they are not relevant to the user.

Field#TypeRuleDescription
canUpdateOutgoingApprovals1UserOutgoingApprovalPermissionrepeatedPermissions related to updating the user's approved outgoing transfers.
canUpdateIncomingApprovals2UserIncomingApprovalPermissionrepeatedPermissions related to updating the user's approved incoming transfers.
canUpdateAutoApproveSelfInitiatedOutgoingTransfers3ActionPermissionrepeatedPermissions related to updating auto-approval settings for self-initiated outgoing transfers (whether they are allowed by default).
canUpdateAutoApproveSelfInitiatedIncomingTransfers4ActionPermissionrepeatedPermissions related to updating auto-approval settings for self-initiated incoming transfers (whether they are allowed by default).
canUpdateAutoApproveAllIncomingTransfers5ActionPermissionrepeatedPermissions related to updating auto-approval settings for all incoming transfers (whether they are allowed by default).

Edit this page on GitHub