Creating a managed supply smart property
A managed issuance creates a smart property that does not have any tokens to start with, tokens can be issued later by the issuer address, the issuer can also revoke created tokens but only ones owned by its address.
To create a new token you need a legacy or P2SH-SegWit address to be used as the issuer address, for reference a legacy address begins with a 6 or 7 and a P2SH-SegWit address begins with a 3. The getnewaddress command will generate P2SH-SegWit addresses by default and can also be used to generate a legacy address.
Creating a smart property with a managed supply involves creating a managed issuance transaction that will be parsed by the OmniLayer protocol resulting in a new smart property being created. The issuing address needs enough feathercoin to pay the cost of the transaction fee, any funds used on the transaction over the fee will be returned to the issuing address.
The command to create a managed issuance transaction either remotely or in Feathercoin’s user interface console is omni_sendissuancemanaged, for demonstration purposes the user interface console is shown in the examples below.
The arguments to omni_sendissuancemanaged are as follows:
- fromaddress – This is the address that will issue and hold all initially created tokens.
- ecosystem – 1 for main and 2 for test ecosystem.
- type – 1 for indivisible tokens and 2 for divisible tokens.
- previousid – 0 for new tokens otherwise used to identify a predecessor token.
- category – Category for the new tokens, can be empty, max 255 bytes.
- subcategory – Subcategory for the new token, can be empty, max 255 bytes.
- name – Name of the new token, cannot be empty, max 255 bytes.
- url – URL for further information, can be empty, max 255 bytes.
- data – Additional arbitrary data, can be empty, max 255 bytes.
The following example command call with arguments would be used to create a new divisible token on the main ecosystem, the token is called “Test Token”, other text fields have generic information for demonstration purposes, note that all text fields except the name field can be left blank. The issuer address is funded with some feathercoin to cover the transaction fee.
omni_sendissuancemanaged 6ssfk7GS7168aYEUjYFRFcJ7BdHL3v1Ds6 1 2 0 “category” “subcategory” “Test Token” “https://test.com” “data”
The result of this command should be a transaction hash, otherwise an error or help text should display. You can use the omni_gettransaction command with the transaction hash to look up the transaction on the OmniLayer. The following shows that the transaction is valid as the line starting with “valid” is set to true.
A new managed supply smart property has been created, next we look at creating a token supply.
Issue tokens
Tokens with a managed supply are issued by the smart property issuer address using the omni_sendgrant command.
The arguments to omni_sendgrant are as follows:
- fromaddress – The issuer address as defined in the smart property.
- toaddress – The address to receive tokens, if blank fromaddress will be used.
- propertyid – Property ID of the smart property to issue tokens for.
- amount – Must be a positive non-zero value.
- memo – Optional note attached to this transaction.
The property ID for the token can be found from the omni_gettransaction used with the managed issuance transaction hash. The property ID can also be found by going to the Toolbox tab, selecting the “Lookup Property” sub-tab, pasting in the issuer address into the search field and pressing search, this will populate the drop down with all smart properties relating to the address. Select the smart property from the drop down and the window will populate with the smart property information as shown below.
The following example command call with arguments would be used to grant new tokens to the issuer address, the second argument is an empty string provided with speech marks, property ID to issue tokens for and the amount of new tokens we will create. The fromaddress address is funded with some feathercoin to cover the transaction fee.
omni_sendgrant 6ssfk7GS7168aYEUjYFRFcJ7BdHL3v1Ds6 “” 4 “100000”
The result of this command should be a transaction hash, otherwise an error or help text should display. You can use the omni_gettransaction command with the transaction hash to look up the transaction on the OmniLayer. The following shows that the transaction issued 100,000 tokens to the issuer address.
These newly granted tokens can now be sent to others or used in a sell order on the decentralised exchange. To use these tokens from the GUI you will need to restart OmniFeather.
To issue tokens to a different address use the following command with the address to grant tokens to as the second argument.
omni_sendgrant 6ssfk7GS7168aYEUjYFRFcJ7BdHL3v1Ds6 6r8HYoA9FZBEiYdcddKHfJHEfFHy39WzCy 4 “100000”
Using the resulting transaction hash with omni_gettransaction you should see the following that shows that 100,000 tokens have been issued to the reference address, which was the address provided as the second argument.
Revoke tokens
Tokens with a managed supply can be revoked only from the issuer address and no more than the address owns. This means that the issuer cannot revoke tokens held by addresses other than its own.
The arguments to omni_sendrevoke are as follows:
- fromaddress – The issuer address as defined in the smart property.
- propertyid – Property ID of the tokens to revoke.
- amount – The amount of tokens to revoke.
- memo – Optional note attached to this transaction.
The following example command call with arguments would be used to revoke tokens from the issuer address provided as the first argument, property ID to revoke tokens for and the amount of tokens to revoke. The issuer address is funded with some feathercoin to cover the transaction fee.
omni_sendrevoke 6ssfk7GS7168aYEUjYFRFcJ7BdHL3v1Ds6 4 “100”
The result of this command should be a transaction hash, otherwise an error or help text should display. You can use the following command with the transaction hash to look up the transaction on the OmniLayer. The following shows that the transaction revoked 100 tokens from the issuer address provided.
For documentation on omni_sendissuancemanaged, omni_sendgrant, omni_sendrevoke and all other available OmniFeather commands refer to the documentation linked in below.
https://github.com/OmniLayer/omnifeather/blob/master/src/omnicore/doc/rpc-api.md