Module tokenomics

Tokenomics.

Depends on consent

Functions

initiate (result) Initiate function: creates a token in an org.
create_token () Create token
balance (org, token, user) Returns balance.
change_balance (org, token, user, amount) Change balance
transfer (org, token, sender, recipient, amount) Transfer tokens from a sender to recipient
treasury_transfer (org, token, recipient, amount) Transfer from treasury
issue (org, token, amount) Creates new tokens in the org treasury

Tables

config Config for module


Functions

initiate (result)
Initiate function: creates a token in an org. Set up the token data structure. Create an org treasury

Parameters:

  • result (optional) Callback if this module is embedded in other modules
create_token ()
Create token
balance (org, token, user)
Returns balance. If no user, get treasury balance

Parameters:

  • org Name (string) or id (num)
  • token Slug (string)
  • user Name (string)
change_balance (org, token, user, amount)
Change balance

Parameters:

  • org Org name (string) or id (number)
  • token Token slug (string)
  • user
  • amount
transfer (org, token, sender, recipient, amount)
Transfer tokens from a sender to recipient

Parameters:

  • org
  • token
  • sender
  • recipient
  • amount Positive number
treasury_transfer (org, token, recipient, amount)
Transfer from treasury

Parameters:

  • org
  • token
  • recipient
  • amount Can be positive or negative, assumes flow from treasury to recipient
issue (org, token, amount)
Creates new tokens in the org treasury

Parameters:

  • org
  • token
  • amount

Tables

config
Config for module

Fields:

  • consent Require consent to create?
  • token_variables the data that goes into the token
  • token_slug A no-spaces slug for the token
  • initial_treasury Quantity in org treasury
  • negative_spend Boolean: can users spend negative tokens? (for mutual credit)
  • balances Table of user balances
generated by LDoc 1.4.6 Last updated 2022-01-23 18:18:51