tokenomics.html 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>Reference</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <br/>
  20. <h1>Modpol</h1>
  21. <ul>
  22. <li><a href="../index.html">Index</a></li>
  23. </ul>
  24. <h2>Contents</h2>
  25. <ul>
  26. <li><a href="#Functions">Functions</a></li>
  27. <li><a href="#Tables">Tables</a></li>
  28. </ul>
  29. <h2>Modules</h2>
  30. <ul class="nowrap">
  31. <li><a href="../modules/modpol.interactions.html">modpol.interactions</a></li>
  32. <li><a href="../modules/add_child_org_consent.html">add_child_org_consent</a></li>
  33. <li><a href="../modules/change_modules.html">change_modules</a></li>
  34. <li><a href="../modules/change_modules.html">change_modules</a></li>
  35. <li><a href="../modules/consent.html">consent</a></li>
  36. <li><a href="../modules/create_token.html">create_token</a></li>
  37. <li><a href="../modules/defer_consent.html">defer_consent</a></li>
  38. <li><a href="../modules/display_processes.html">display_processes</a></li>
  39. <li><a href="../modules/join_org.html">join_org</a></li>
  40. <li><a href="../modules/join_org_consent.html">join_org_consent</a></li>
  41. <li><a href="../modules/leave_org.html">leave_org</a></li>
  42. <li><a href="../modules/message_org.html">message_org</a></li>
  43. <li><a href="../modules/randomizer.html">randomizer</a></li>
  44. <li><a href="../modules/remove_child_consent.html">remove_child_consent</a></li>
  45. <li><a href="../modules/remove_member_consent.html">remove_member_consent</a></li>
  46. <li><a href="../modules/remove_org.html">remove_org</a></li>
  47. <li><a href="../modules/remove_org_consent.html">remove_org_consent</a></li>
  48. <li><a href="../modules/remove_process.html">remove_process</a></li>
  49. <li><a href="../modules/rename_org_consent.html">rename_org_consent</a></li>
  50. <li><a href="../modules/send_token.html">send_token</a></li>
  51. <li><a href="../modules/module_template.html">module_template</a></li>
  52. <li><strong>tokenomics</strong></li>
  53. <li><a href="../modules/modpol.orgs.base.html">modpol.orgs.base</a></li>
  54. <li><a href="../modules/modpol.orgs.process.html">modpol.orgs.process</a></li>
  55. <li><a href="../modules/modpol.util.misc.html">modpol.util.misc</a></li>
  56. <li><a href="../modules/modpol_minetest.api.html">modpol_minetest.api</a></li>
  57. <li><a href="../modules/priv_to_org.html">priv_to_org</a></li>
  58. <li><a href="../modules/modpol_minetest.overrides.interactions.html">modpol_minetest.overrides.interactions</a></li>
  59. </ul>
  60. </div>
  61. <div id="content">
  62. <h1>Module <code>tokenomics</code></h1>
  63. <p>Tokenomics.</p>
  64. <p>
  65. Depends on consent</p>
  66. <h2><a href="#Functions">Functions</a></h2>
  67. <table class="function_list">
  68. <tr>
  69. <td class="name" nowrap><a href="#initiate">initiate (result)</a></td>
  70. <td class="summary">Initiate function: creates a token in an org.</td>
  71. </tr>
  72. <tr>
  73. <td class="name" nowrap><a href="#create_token">create_token ()</a></td>
  74. <td class="summary">Create token</td>
  75. </tr>
  76. <tr>
  77. <td class="name" nowrap><a href="#balance">balance (org, token, user)</a></td>
  78. <td class="summary">Returns balance.</td>
  79. </tr>
  80. <tr>
  81. <td class="name" nowrap><a href="#change_balance">change_balance (org, token, user, amount)</a></td>
  82. <td class="summary">Change balance</td>
  83. </tr>
  84. <tr>
  85. <td class="name" nowrap><a href="#transfer">transfer (org, token, sender, recipient, amount)</a></td>
  86. <td class="summary">Transfer tokens from a sender to recipient</td>
  87. </tr>
  88. <tr>
  89. <td class="name" nowrap><a href="#treasury_transfer">treasury_transfer (org, token, recipient, amount)</a></td>
  90. <td class="summary">Transfer from treasury</td>
  91. </tr>
  92. <tr>
  93. <td class="name" nowrap><a href="#issue">issue (org, token, amount)</a></td>
  94. <td class="summary">Creates new tokens in the org treasury</td>
  95. </tr>
  96. </table>
  97. <h2><a href="#Tables">Tables</a></h2>
  98. <table class="function_list">
  99. <tr>
  100. <td class="name" nowrap><a href="#config">config</a></td>
  101. <td class="summary">Config for module</td>
  102. </tr>
  103. </table>
  104. <br/>
  105. <br/>
  106. <h2 class="section-header "><a name="Functions"></a>Functions</h2>
  107. <dl class="function">
  108. <dt>
  109. <a name = "initiate"></a>
  110. <strong>initiate (result)</strong>
  111. </dt>
  112. <dd>
  113. Initiate function: creates a token in an org.
  114. Set up the token data structure.
  115. Create an org treasury
  116. <h3>Parameters:</h3>
  117. <ul>
  118. <li><span class="parameter">result</span>
  119. (optional) Callback if this module is embedded in other modules
  120. </li>
  121. </ul>
  122. </dd>
  123. <dt>
  124. <a name = "create_token"></a>
  125. <strong>create_token ()</strong>
  126. </dt>
  127. <dd>
  128. Create token
  129. </dd>
  130. <dt>
  131. <a name = "balance"></a>
  132. <strong>balance (org, token, user)</strong>
  133. </dt>
  134. <dd>
  135. Returns balance.
  136. If no user, get treasury balance
  137. <h3>Parameters:</h3>
  138. <ul>
  139. <li><span class="parameter">org</span>
  140. Name (string) or id (num)
  141. </li>
  142. <li><span class="parameter">token</span>
  143. Slug (string)
  144. </li>
  145. <li><span class="parameter">user</span>
  146. Name (string)
  147. </li>
  148. </ul>
  149. </dd>
  150. <dt>
  151. <a name = "change_balance"></a>
  152. <strong>change_balance (org, token, user, amount)</strong>
  153. </dt>
  154. <dd>
  155. Change balance
  156. <h3>Parameters:</h3>
  157. <ul>
  158. <li><span class="parameter">org</span>
  159. Org name (string) or id (number)
  160. </li>
  161. <li><span class="parameter">token</span>
  162. Token slug (string)
  163. </li>
  164. <li><span class="parameter">user</span>
  165. </li>
  166. <li><span class="parameter">amount</span>
  167. </li>
  168. </ul>
  169. </dd>
  170. <dt>
  171. <a name = "transfer"></a>
  172. <strong>transfer (org, token, sender, recipient, amount)</strong>
  173. </dt>
  174. <dd>
  175. Transfer tokens from a sender to recipient
  176. <h3>Parameters:</h3>
  177. <ul>
  178. <li><span class="parameter">org</span>
  179. </li>
  180. <li><span class="parameter">token</span>
  181. </li>
  182. <li><span class="parameter">sender</span>
  183. </li>
  184. <li><span class="parameter">recipient</span>
  185. </li>
  186. <li><span class="parameter">amount</span>
  187. Positive number
  188. </li>
  189. </ul>
  190. </dd>
  191. <dt>
  192. <a name = "treasury_transfer"></a>
  193. <strong>treasury_transfer (org, token, recipient, amount)</strong>
  194. </dt>
  195. <dd>
  196. Transfer from treasury
  197. <h3>Parameters:</h3>
  198. <ul>
  199. <li><span class="parameter">org</span>
  200. </li>
  201. <li><span class="parameter">token</span>
  202. </li>
  203. <li><span class="parameter">recipient</span>
  204. </li>
  205. <li><span class="parameter">amount</span>
  206. Can be positive or negative, assumes flow from treasury to recipient
  207. </li>
  208. </ul>
  209. </dd>
  210. <dt>
  211. <a name = "issue"></a>
  212. <strong>issue (org, token, amount)</strong>
  213. </dt>
  214. <dd>
  215. Creates new tokens in the org treasury
  216. <h3>Parameters:</h3>
  217. <ul>
  218. <li><span class="parameter">org</span>
  219. </li>
  220. <li><span class="parameter">token</span>
  221. </li>
  222. <li><span class="parameter">amount</span>
  223. </li>
  224. </ul>
  225. </dd>
  226. </dl>
  227. <h2 class="section-header "><a name="Tables"></a>Tables</h2>
  228. <dl class="function">
  229. <dt>
  230. <a name = "config"></a>
  231. <strong>config</strong>
  232. </dt>
  233. <dd>
  234. Config for module
  235. <h3>Fields:</h3>
  236. <ul>
  237. <li><span class="parameter">consent</span>
  238. Require consent to create?
  239. </li>
  240. <li><span class="parameter">token_variables</span>
  241. the data that goes into the token
  242. </li>
  243. <li><span class="parameter">token_slug</span>
  244. A no-spaces slug for the token
  245. </li>
  246. <li><span class="parameter">initial_treasury</span>
  247. Quantity in org treasury
  248. </li>
  249. <li><span class="parameter">negative_spend</span>
  250. Boolean: can users spend negative tokens? (for mutual credit)
  251. </li>
  252. <li><span class="parameter">balances</span>
  253. Table of user balances
  254. </li>
  255. </ul>
  256. </dd>
  257. </dl>
  258. </div> <!-- id="content" -->
  259. </div> <!-- id="main" -->
  260. <div id="about">
  261. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.6</a></i>
  262. <i style="float:right;">Last updated 2022-01-23 18:18:51 </i>
  263. </div> <!-- id="about" -->
  264. </div> <!-- id="container" -->
  265. </body>
  266. </html>