๐Ÿช™Token Operations

For a demo example of following steps, here is the policy timestamp: 1675164687.693099003

Task Summary

Create a token with which newly registered users would be automatically linked. After the registration these users would be able to create documents which would be used for minting tokens at the rate of 1 token to 1000 units of value in the document.


First step in the execution of the policy would be user registration. To enable this we will create a corresponding schema which would contain โ€˜First nameโ€™ and โ€˜Last nameโ€™ fields.

Second step of policy execution is data input and document submission. To enable this we will create a corresponding schema containing โ€˜Organization nameโ€™ and โ€˜Amountโ€™ fields

To enable document submission we will use document input block (requestVcDocumentBlock) and document persistence block (sendToGuardianBlock)

Please see example 2 for the more in-depth guide of working with documents in Guardian Policies.

Token operations

  1. Create a token instances of which will be minted.

Switch to the โ€˜Tokensโ€™ tab and create a new token

  1. Please note we created a token with โ€˜KYCโ€™ flag as โ€˜onโ€™. This imposes the requirement to perform a KYC action on users before they can receive the token:

2.1 Link the token to the user via the โ€˜tokenActionBlock'

2.1.1 Add โ€˜tokenActionBlockโ€™ immediately after the user registration

2.1.2 Select token and action type

2.2 Set user KYC

2.2.1 Add โ€˜tokenActionBlockโ€™ immediately after โ€˜token_associateโ€™

2.2.2 Select token and the action type

  1. User โ€˜tokenActionBlockโ€™ to mint tokens

3.1 Add โ€˜mintDocumentBlockโ€™ immediately after saving the new document (save_new_documents)

3.2 Select token which will be minted

3.3 Configure the formula which would define the amount of tokens minted

3.4 Configure the account where tokens will be sent to upon minting

Document Display

  1. To show documents use โ€˜interfaceDocumentsSourceBlock'

1.1 Add a new container in which the grid containing results would be placed

1.2 Ensure that โ€˜documentsโ€™ and โ€˜tokensโ€™ are displayed in separate tabs

1.2.1 In the parent block set property โ€˜Typeโ€™ to โ€˜Tabsโ€™

1.2.2 Set the property โ€˜Titleโ€™ to configure tab titles

1.3 Add โ€˜interfaceDocumentsSourceBlockโ€™ into the โ€˜tokensโ€™ container and configure its columns

1.4 Use โ€˜documentsSourceAddonโ€™ block to retrieve data from the database.


Create User

Create Project

Mint Token

Last updated