├── CMakeLists.txt ├── LICENSE ├── README.md ├── README_ES.md ├── README_KR.md ├── README_ZH.md ├── build.sh ├── build └── SimpleAssets │ ├── SimpleAssets.abi │ └── SimpleAssets.wasm ├── external_test └── unit_tests.sh ├── include ├── SimpleAssets.hpp └── backtoken.hpp ├── ricardian ├── SimpleAssets.clauses.md ├── SimpleAssets.contracts.md └── SimpleAssets.contracts.md.in └── src ├── CMakeLists.txt └── SimpleAssets.cpp /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include(ExternalProject) 2 | # if no cdt root is given use default path 3 | if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) 4 | find_package(eosio.cdt) 5 | endif() 6 | 7 | set(ICON_BASE_URL "https://cryptolions.io/assets/images/sa-icons-256") 8 | 9 | set(ATTACH_ICON_URI "attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452") 10 | set(ATTACHF_ICON_URI "attachf.png#2d190203c6ae474e01cd70963c82a54cb542d95e29174e7572acb8c7653d8a8c") 11 | set(AUTHORUPDATE_ICON_URI "authorupdate.png#0b11c9c4e41b6ba1b00bd907c671f7ddc9e2f9caf26580f0b2e7c73e02f36ff3") 12 | set(BURN_ICON_URI "burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84") 13 | set(CANCELOFFER_ICON_URI "canceloffer.png#83328bae49f18f0aeca6d04c2e3003e49637a462b44a492d3439a9c44724a654") 14 | set(CANCELOFFERF_ICON_URI "cancelofferf.png#9c35f488e2c53464f430e0e31e5a4b3bd2e914fe3b6db126722166a8a408fa83") 15 | set(CLAIMF_ICON_URI "claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30") 16 | set(CREATE_ICON_URI "create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70") 17 | set(CREATEF_ICON_URI "createf.png#5fb6788f19b8fb08ce46e765a9b0ae8758cba7e4da9895f840d34d143912fd3d") 18 | set(DELEGATE_ICON_URI "delegate.png#f8d91c1b9c0f376464e69aadf41142a17492af1e75d394601872b6a992b420bc") 19 | set(DELEGATE_MORE_ICON_URI "delegate_more.png#6d1f7319569e3780e25cfb717d83f4ad58c91c0890ab234f106d1593956dfd10") 20 | set(DETACH_ICON_URI "detach.png#a075de69e2cf8eed78306834cc5688b64ce6ed660c0db762ae20c7c7a1d19a6b") 21 | set(DETACHF_ICON_URI "detachf.png#2476bc6b7c02a4ec7e0e307b60f44a02486b4bebb4d91714817e5816063198e8") 22 | set(ISSUEF_ICON_URI "issuef.png#a40d77b2162d646cd3ce0488dfeab1cdfae8801fcc1d0c6ef1f16f2547b16551") 23 | set(OFFER_ICON_URI "offer.png#4aea6612c87df6cde081689f861b55ddba2c277cc553f4faeb65a4cb26656c66") 24 | set(OFFERF_ICON_URI "offerf.png#a34462918e536372610a523225e5221cd2685eff3c329499ded7298907f8524b") 25 | set(REGAUTHOR_ICON_URI "regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e") 26 | set(TRANSFER_ICON_URI "transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf") 27 | set(UPDATE_ICON_URI "update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e") 28 | set(UPDATEF_ICON_URI "updatef.png#f5d5af2ed6af508777f9f0b3c3a8e24b61eeca2ea623cfec6f6d0e9ea2c4d1a7") 29 | set(CLAIM_ICON_URI "claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d") 30 | 31 | configure_file( ${CMAKE_SOURCE_DIR}/ricardian/SimpleAssets.contracts.md.in ${CMAKE_SOURCE_DIR}/ricardian/SimpleAssets.contracts.md @ONLY ) 32 | 33 | ExternalProject_Add( 34 | SimpleAssets_project 35 | SOURCE_DIR ${CMAKE_SOURCE_DIR}/src 36 | BINARY_DIR ${CMAKE_BINARY_DIR}/SimpleAssets 37 | CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake 38 | UPDATE_COMMAND "" 39 | PATCH_COMMAND "" 40 | TEST_COMMAND "" 41 | INSTALL_COMMAND "" 42 | BUILD_ALWAYS 1 43 | ) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /README_ES.md: -------------------------------------------------------------------------------- 1 | # SimpleAssets 2 | *versión 1.4.1 del documento* 3 | 4 | ## Alcance: 5 | 1. [Introducción](#introduction) 6 | 2. [Acciones de contratos](#contract-actions) 7 | 3. [Estructuras de datos](#data-structures) 8 | 4. [EJEMPLOS: cómo usar Simple Assets en contratos inteligentes](#examples-how-to-use-simple-assets-in-smart-contracts) 9 | 5. [RegistroAutor](#authorreg) 10 | 6. [RegistroCambios](#change-logs) 11 | 12 | --------------------------- 13 | 14 | # Introducción 15 | 16 | Un estándar simple para activos digitales en blockchains EOSIO: Tokens no fungibles (NFTs), Tokens fungibles (FTs) y Tokens no transferibles (NTTs). 17 | por [CryptoLions](https://CryptoLions.io) 18 | 19 | 中文翻译: https://github.com/CryptoLions/SimpleAssets/blob/master/README_ZH.md 20 | 한국어 번역: https://github.com/CryptoLions/SimpleAssets/blob/master/README_KR.md 21 | 22 | web: http://simpleassets.io 23 | Git: https://github.com/CryptoLions/SimpleAssets 24 | Telegram: https://t.me/simpleassets 25 | 26 | Intro & Demos: https://medium.com/@cryptolions/introducing-simple-assets-b4e17caafaa4 27 | 28 | Ejemplo de recepción de eventos para autores: https://github.com/CryptoLions/SimpleAssets-EventReceiverExample 29 | 30 | **ADVERTENCIA** La dependencia mínima en eosio.cdt ahora es v1.6.3. 31 | 32 | --------------------------- 33 | 34 | Use Simple Assets realizando solicitudes al contrato de Simple Assets. Esta es como una Dapp para Dapps. 35 | 36 | Jungle Testnet: **simpleassets** 37 | 38 | EOS Mainnet: **simpleassets** 39 | WAX Mainnet: **simpleassets** 40 | MEETONE Mainnet: **smplassets.m** 41 | TELOS Mainnet: **simpleassets** 42 | PROTON: **simpleassets** 43 | 44 | Simple Assets es un contrato aparte que otras Dapps pueden solicitar para gestionar sus activos digitales. Este funciona como garantía adicional para usuarios de la Dapp de que la posesión de activos es administrada por una autoridad externa acreditada, y que una vez creada, la Dapp solo podrá gestionar la mdata del activo. Todas las funcionalidades relacionadas a la propiedad existen fuera del juego. 45 | 46 | Estamos en el proceso de crear un DAC que curará actualizaciones de Simple Assets luego de su implementación en EOSIO mainnet. 47 | 48 | Relacionado: entendiendo [autoridad de propiedad](https://medium.com/@cryptolions/digital-assets-we-need-to-think-about-ownership-authority-a2b0465c17f6). 49 | 50 | Para publicar información sobre sus NFTs a marketplaces de terceros, use la acción ```authorreg```. 51 | 52 | Alternativamente, las dapps pueden implementar una copia propia de Simple Assets y modificarla para tener mayor control de la funcionalidad. Antes de ser implementada, Simple Assets debe modificarse para prevenir que cualquiera pueda crear activos. 53 | 54 | --------------------------- 55 | ## Uso de RAM 56 | 57 | El uso de RAM para NFTs depende de cuántos datos están almacenados en los campos i.data y mdata. Si se llegasen a vaciar, cada NFT requiere `276 bytes`. 58 | 59 | Cada símbolo en idata y mdata es de +1 byte. 60 | 61 | --------------------------- 62 | ## Tokens Fungibles (FTs) 63 | 64 | Las Dapps que necesitan Tokens Fungibles deben decidir entre usar el contrato estándar eosio.token y el contrato de Simple Assets. Estas son las diferencias: 65 | 66 | En Simple Assets, 67 | 68 | * El Alcance es el Autor en lugar del Símbolo 69 | * La tabla de estadísticas también incluye datos adicionales sobre cada FT (ver [Estadísticas de monedas](#currency-stats-fungible-token) abajo). 70 | * Para transferencias se deberá usar la acción ```transferf``` desde el contrato SA. 71 | * Si el autor establece un indicador ```authorcontrol```, el autor podrá transferir/quemar/etc los FTs independientemente del consentimiento del usuario. 72 | * La tabla que monitorea los FTs incluye el nombre de cuenta del autor, permitiendo a distintos dapps que tengan FTs con el mismo nombre. (Ejemplo: https://bloks.io/contract?tab=Tables&table=accounts&account=simpleassets&scope=bohdanbohdan&limit=100) 73 | 74 | 75 | --------------------------- 76 | ## Tokens No Transferibles (NTTs) 77 | 78 | Los dos casos más comunes para NTTs son 79 | 80 | * licencias que pueden ser otorgadas a una cuenta, pero no transferidas. 81 | * premios dados a una cuenta en particular. 82 | 83 | Las razones para usar NTTs son: 84 | 85 | * los NTTs aparecen en exploradores de activos de terceros. 86 | * Simple Assets se encarga de algunas funcionalidades. 87 | 88 | Más sobre NTTs: https://medium.com/@cryptolions/introducing-non-transferable-tokens-ntts-2f1a532bf170 89 | 90 | --------------------------- 91 | 92 | # Acciones del contrato 93 | 94 | Aquí se puede encontrar una descripción de cada parámetro: 95 | https://github.com/CryptoLions/SimpleAssets/blob/master/include/SimpleAssets.hpp 96 | 97 | ``` 98 | authorreg ( name author, string dappinfo, string fieldtypes, string priorityimg ) 99 | authorupdate ( name author, string dappinfo, string fieldtypes, string priorityimg ) 100 | 101 | 102 | # -- Para Tokens No Fungibles (NFTs)--- 103 | 104 | create (author, category, owner, idata, mdata, requireсlaim) 105 | update (author, owner, assetid, mdata) 106 | transfer (from, to , [assetid1,..,assetidn], memo) 107 | burn (owner, [assetid1,..,assetidn], memo) 108 | 109 | offer (owner, newowner, [assetid1,..,assetidn], memo) 110 | canceloffer (owner, [assetid1,..,assetidn]) 111 | claim (claimer, [assetid1,..,assetidn]) 112 | 113 | delegate (owner, to, [assetid1,..,assetidn], period, redelegate, memo) 114 | undelegate (owner, [assetid1,..,assetidn]) 115 | delegatemore (owner, assetid, period) 116 | 117 | attach (owner, assetidc, [assetid1,..,assetidn]) 118 | detach (owner, assetidc, [assetid1,..,assetidn]) 119 | 120 | attachf (owner, author, quantity, assetidc) 121 | detachf (owner, author, quantity, assetidc) 122 | 123 | # -- Para Tokens Fungibles (FTs) --- 124 | 125 | createf (author, maximum_supply, authorctrl, data) 126 | updatef (author, sym, data) 127 | issuef (to, author, quantity, memo) 128 | transferf (from, to, author, quantity, memo) 129 | burnf (from, author, quantity, memo) 130 | 131 | offerf (owner, newowner, author, quantity, memo) 132 | cancelofferf (owner, [ftofferid1,...,ftofferidn]) 133 | claimf (claimer, [ftofferid1,...,ftofferidn]) 134 | 135 | openf (owner, author, symbol, ram_payer) 136 | closef (owner, author, symbol) 137 | 138 | # -- Para Tokens No Transferibles (NTTs) --- 139 | 140 | createntt (author, category, owner, idata, mdata, requireсlaim) 141 | updatentt (author, owner, assetid, mdata) 142 | burnntt (owner, [assetid1,..,assetidn], memo) 143 | claimntt (claimer, [assetid1,..,assetidn]) 144 | 145 | ``` 146 | 147 | # Estructuras de datos 148 | ## Activos 149 | ``` 150 | sasset { 151 | uint64_t id; // identificación del activo usado para transferir y buscar; 152 | name owner; // propietario del activo (mutable - por el propietario!!!); 153 | name author; // autor del activo (contrato del juego, inmutable); 154 | name category; // categoría del activo, elegido por el autor, inmutable; 155 | string idata; // datos inmutables de activos. Puede ser stringified JSON o solo sha256 string; 156 | string mdata; // datos mutables de activos, añadidos en creación o actualización de activos por el autor. Puede ser 157 | // stringified JSON o solo sha256 string; 158 | sasset[] container; // otros NFTs adjuntos a este activo 159 | account[] containerf; // FTs adjuntos a este activo 160 | } 161 | ``` 162 | Para ayudar a exploradores de activos externos, recomendamos incluir los siguientes campos en `idata` o `mdata`: 163 | `name` (text) 164 | `img` (url to image file) 165 | 166 | 167 | ## Ofertas 168 | ``` 169 | offers { 170 | uint64_t assetid; // identificación de activo ofrecida para tomar ; 171 | name owner; // propietario del activo; 172 | name offeredto; // quien puede tomar este activo ; 173 | uint64_t cdate; // fecha de creación de oferta; 174 | } 175 | ``` 176 | 177 | ## Autores 178 | ``` 179 | authors { 180 | name author; // autor de activos, quien puede crear y actualizar activos; 181 | 182 | string data; // datos del autor (json) serán usados por mercados para una mejor demostración; 183 | // recomendaciones: logo, info, url; 184 | 185 | string stemplate; // esquema de datos (json) para avisar a mercados de terceros cómo mostrar cada campo del NFT. 186 | // llave: valores de estado, en la que la clave es la llave de mdata o idata; 187 | // valores recomendados: 188 | // txt | tipo predeterminado 189 | // url | mostrar como URL cliqueable 190 | // img | enlace al archivo img 191 | // webgl | enlace al archivo webgl 192 | // mp3 | enlace al archivo mp3 193 | // video | enlace al archivo de video 194 | // hide | no mostrar 195 | // imgb | imagen como string en formato binario 196 | // webglb | webgl binario 197 | // mp3b | mp3 binario 198 | // videob | video binario 199 | 200 | string imgpriority; // Especifica campo de imagen primaria para categorías de NFTs. 201 | // 202 | // Esta se usa cuando quiera que su imagen primaria de NFTs sea otra 203 | // que un URL a un campo de imagen específico en un campo img. Además, le permite 204 | // crear categorías de NFTs con distintos campos de imágenes primarias. 205 | // 206 | // la data es un strigified json. 207 | // llave: categorías de NFT. 208 | // valor: un campo de idata o mdata para usarse como imagen primaria para 209 | // todos los NFTs de esa categoría. 210 | 211 | } 212 | ``` 213 | 214 | ## Delegados 215 | ``` 216 | delegates{ 217 | uint64_t assetid; // identificación del activo ofrecido para tomar; 218 | name owner; // propietario del activo; 219 | name delegatedto; // quien puede tomar este activo; 220 | uint64_t cdate; // fecha de creación de oferta; 221 | uint64_t period; // Tiempo en segundos que el activo será prestado. El prestador no puede dejar de delegar hasta 222 | // que el periodo expire, sin embargo el receptor puede transferir de vuelta en cualquier momento. 223 | bool redelegate; // delegar de nuevo es permitir más delegación a la cuenta o no. 224 | string memo; // memorandum de parámetros de acción. Máxima longitud es de 64. 225 | 226 | } 227 | ``` 228 | 229 | ## Estadísticas de monedas (Tokens Fungibles) 230 | ``` 231 | stat { 232 | asset supply; // Suministro de tokens 233 | asset max_supply; // Máximo suministro de tokens 234 | name issuer; // Autor de token fungible 235 | uint64_t id; // Identificación única de este token 236 | bool authorctrl; // si es verídico(1) permitir al autor del token (y no solo al propietario) a quemar y transferir. 237 | string data; // stringified json. Llaves recomendadas para incluir: `img`, `name` 238 | } 239 | ``` 240 | 241 | ## Cuenta (Token Fungible) 242 | ``` 243 | accounts { 244 | uint64_t id; // identificación del token, de tabla de estadísticas 245 | name author; // autor del token 246 | asset balance; // balance de tokens 247 | } 248 | ``` 249 | 250 | ``` 251 | offerfs { 252 | uint64_t id; // identificación de la oferta para tomar (incrementa automáticamente) 253 | name author; // autor de ft 254 | name owner; // propietario de ft 255 | asset quantity; // cantidad 256 | name offeredto; // cuenta que puede tomar la oferta 257 | uint64_t cdate; // fecha de creación de oferta 258 | } 259 | ``` 260 | 261 | 262 | ## NTT 263 | ``` 264 | snttassets { 265 | uint64_t id; // Identificación del NTT usado para tomar o quemar; 266 | name owner; // propietario del activo (mutable - por el propietario!!!); 267 | name author; // autor del activo (contrato del juego, inmutable); 268 | name category; // categoría del activo, elegida por autor, inmutable; 269 | string idata; // datos inmutables de activos. Puede ser stringified JSON o solo sha256 string; 270 | string mdata; // datos mutables de activos, añadidos con la creación o actualización de activos por el autor. Puede ser 271 | // stringified JSON o solo sha256 string; 272 | } 273 | ``` 274 | 275 | ``` 276 | nttoffers { 277 | uint64_t id; // identificación de la oferta para tomar (incrementa automáticamente) 278 | name author; // autor de ft 279 | name owner; // propietario de ft 280 | asset quantity; // cantidad 281 | name offeredto; // cuenta que puede tomar la oferta 282 | uint64_t cdate; // fecha de creación de oferta 283 | } 284 | ``` 285 | 286 | # EJEMPLOS: cómo usar Simple Assets en contratos inteligentes 287 | 288 | ## Crear un activo y transferirlo a la cuenta del propietario ownerowner22: 289 | ``` 290 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 291 | 292 | name author = get_self(); 293 | name category = "weapon"_n; 294 | name owner = "ownerowner22"_n; 295 | string idata = "{\"power\": 10, \"speed\": 2.2, \"name\": \"Magic Sword\" }"; 296 | string mdata = "{\"color\": \"bluegold\", \"level\": 3, \"stamina\": 5, \"img\": \"https://bit.ly/2MYh8EA\" }"; 297 | 298 | action createAsset = action( 299 | permission_level{author, "active"_n}, 300 | SIMPLEASSETSCONTRACT, 301 | "create"_n, 302 | std::make_tuple( author, category, owner, idata, mdata, 0 ) 303 | ); 304 | createAsset.send(); 305 | ``` 306 | 307 | ## Crear activo con la opción requireclaim de ownerowner22: 308 | ``` 309 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 310 | 311 | name author = get_self(); 312 | name category = "balls"_n; 313 | name owner = "ownerowner22"_n; 314 | string idata = "{\"radius\": 2, \"weigh\": 5, \"material\": \"rubber\", \"name\": \"Baseball\" }"; 315 | string mdata = "{\"color\": \"white\", \"decay\": 99, \"img\": \"https://i.imgur.com/QoTcosp.png\" }"; 316 | 317 | 318 | action createAsset = action( 319 | permission_level{author, "active"_n}, 320 | SIMPLEASSETSCONTRACT, 321 | "create"_n, 322 | std::make_tuple( author, category, owner, idata, mdata, 1 ) 323 | ); 324 | createAsset.send(); 325 | ``` 326 | 327 | ## Buscar activo y obtener información de activos 328 | 1. Por favor, agregue en su archivo hpp la información sobre la estructura de los activos 329 | 330 | ``` 331 | TABLE account { 332 | uint64_t id; 333 | name author; 334 | asset balance; 335 | 336 | uint64_t primary_key()const { 337 | return id; 338 | } 339 | }; 340 | typedef eosio::multi_index< "accounts"_n, account > accounts; 341 | 342 | TABLE sasset { 343 | uint64_t id; 344 | name owner; 345 | name author; 346 | name category; 347 | string idata; 348 | string mdata; 349 | std::vector container; 350 | std::vector containerf; 351 | 352 | 353 | auto primary_key() const { 354 | return id; 355 | } 356 | 357 | uint64_t by_author() const { 358 | return author.value; 359 | } 360 | }; 361 | 362 | typedef eosio::multi_index< "sassets"_n, sasset, 363 | eosio::indexed_by< "author"_n, eosio::const_mem_fun > 364 | > sassets; 365 | ``` 366 | 367 | 2. Búsqueda y uso de información 368 | ``` 369 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 370 | name author = get_self(); 371 | name owner = "lioninjungle"_n; 372 | 373 | uint64_t assetid = 100000000000187 374 | 375 | sassets assets(SIMPLEASSETSCONTRACT, owner.value); 376 | auto idx = assets.find(assetid); 377 | 378 | check(idx != assets.end(), "Asset not found or not yours"); 379 | 380 | check (idx->author == author, "Asset is not from this author"); 381 | 382 | auto idata = json::parse(idx->idata); // for parsing json here is used nlohmann lib 383 | auto mdata = json::parse(idx->mdata); // https://github.com/nlohmann/json 384 | 385 | check(mdata["cd"] < now(), "Not ready yet for usage"); 386 | ``` 387 | 388 | ## Actualización del activo 389 | ``` 390 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 391 | 392 | auto mdata = json::parse(idxp->mdata); 393 | mdata["cd"] = now() + 84600; 394 | 395 | name author = get_self(); 396 | name owner = "ownerowner22"_n; 397 | uint64_t assetid = 100000000000187; 398 | 399 | action saUpdate = action( 400 | permission_level{author, "active"_n}, 401 | SIMPLEASSETSCONTRACT, 402 | "update"_n, 403 | std::make_tuple(author, owner, assetid, mdata.dump()) 404 | ); 405 | saUpdate.send(); 406 | ``` 407 | 408 | ## Transferir un activo 409 | ``` 410 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 411 | 412 | name author = get_self(); 413 | name from = "lioninjungle"_n; 414 | name to = "ohtigertiger"_n; 415 | 416 | std::vector assetids; 417 | assetids.push_back(assetid); 418 | 419 | string memo = "Transfer one asset"; 420 | 421 | action saUpdate = action( 422 | permission_level{author, "active"_n}, 423 | SIMPLEASSETSCONTRACT, 424 | "transfer"_n, 425 | std::make_tuple(from, to, assetids, memo) 426 | ); 427 | saUpdate.send(); 428 | ``` 429 | 430 | ## Transferir dos activos al mismo receptor con el mismo memorandum 431 | ``` 432 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 433 | 434 | name author = get_self(); 435 | name from = "lioninjungle"_n; 436 | name to = "ohtigertiger"_n; 437 | 438 | std::vector assetids; 439 | assetids.push_back(assetid1); 440 | assetids.push_back(assetid2); 441 | 442 | string memo = "Transfer two asset" 443 | 444 | action saUpdate = action( 445 | permission_level{author, "active"_n}, 446 | SIMPLEASSETSCONTRACT, 447 | "transfer"_n, 448 | std::make_tuple(from, to, assetids, memo) 449 | ); 450 | saUpdate.send(); 451 | ``` 452 | 453 | ## Token issuef (fungible) creado en cuestión 454 | ``` 455 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 456 | 457 | asset wood; 458 | wood.amount = 100; 459 | wood.symbol = symbol("WOOD", 0); 460 | 461 | name author = get_self(); 462 | name to = "lioninjungle"_n; 463 | 464 | std::string memo = "WOOD faucet"; 465 | action saRes1 = action( 466 | permission_level{author, "active"_n}, 467 | SIMPLEASSETSCONTRACT, 468 | "issuef"_n, 469 | std::make_tuple(to, author, wood, memo) 470 | ); 471 | saRes1.send(); 472 | ``` 473 | 474 | ## transferf (fungible) por el autor si authorctrl está habilitado 475 | ``` 476 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 477 | 478 | asset wood; 479 | wood.amount = 20; 480 | wood.symbol = symbol("WOOD", 0); 481 | 482 | name from = "lioninjungle"_n; 483 | name to = get_self(); 484 | name author = get_self(); 485 | 486 | std::string memo = "best WOOD"; 487 | action saRes1 = action( 488 | permission_level{author, "active"_n}, 489 | SIMPLEASSETSCONTRACT, 490 | "transferf"_n, 491 | std::make_tuple(from, to, author, wood, memo) 492 | ); 493 | saRes1.send(); 494 | ``` 495 | 496 | ## burnf (fungible) por el autor si authorctrl está habilitado 497 | ``` 498 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 499 | 500 | asset wood; 501 | wood.amount = 20; 502 | wood.symbol = symbol("WOOD", 0); 503 | 504 | name author = get_self(); 505 | name from = "lioninjungle"_n; 506 | 507 | std::string memo = "WOOD for oven"; 508 | action saRes1 = action( 509 | permission_level{author, "active"_n}, 510 | SIMPLEASSETSCONTRACT, 511 | "burnf"_n, 512 | std::make_tuple(from, author, wood, memo) 513 | ); 514 | saRes1.send(); 515 | ``` 516 | 517 | ----------------- 518 | # AuthorReg 519 | 520 | ## Acción authorreg 521 | Los autores pueden registrar en la tabla authorreg para comunicarse con exploradores de activos externos, billeteras, y marketplaces. 522 | 523 | ``` 524 | ACTION authorreg( name author, string dappinfo, string fieldtypes, string priorityimg ); 525 | ``` 526 | 527 | @param **author** es la cuenta del autor que creará los activos. 528 | 529 | @param **dappinfo** es stringified JSON. Las recomendaciones incluyen: 530 | name - nombre de la aplicación 531 | company - nombre de la compañía 532 | logo - url a la imagen 533 | url - url al sitio web del juego 534 | info - descripción corta de la aplicación 535 | defaultfee - 100x el % de cuota que le gustaría recolectar de marketplaces. (por 2%, 200) 536 | 537 | @param **fieldtypes** es stringified JSON con llave: valores del estado, en que la clave es la llave de mdata o idata y el 538 | estado indica la forma recomendada de mostrar el campo. Valores recomendados: 539 | txt - texto (predeterminado) 540 | url - mostrar como URL cliqueable 541 | img - enlace al archivo img 542 | webgl - enlace al archivo webgl 543 | mp3 - enlace al archivo mp3 544 | video - enlace al archivo del video 545 | hide - no mostrar 546 | imgb - la imagen como un string en formato binario 547 | webglb - webgl binario 548 | mp3b - mp3 binario 549 | videob - video binario 550 | timestamp - marca de tiempo unix en segundos 551 | ipfs - enlace ipfs 552 | 553 | @param **priorityimg** es JSON que se asocia a la categoría NFT con el campo del nombre de idata or mdata 554 | que especifica el campo de imagen principal por esa categoría de NFTs. Este es probablemente un uso poco común y 555 | puede dejarse en blanco. Si prefiere que una categoría de NFTs tenga un campo de imagen principal distinto al img, 556 | deberá usar "CATEGORY":"otherfieldname". Un caso de uso común sería si quiere que webgls o algún otro formato 557 | sea la imagen principal. 558 | 559 | ## Ejemplos de Cleos de authorreg y authorupdate 560 | 561 | 562 | ### authorreg 563 | ``` 564 | ./cleos.sh.jungle push action simpleassets authorreg '["ilovekolobok", "{\"name\": \"Kolobok Breeding Game\", \"company\": \"CryptoLions\", \"info\": \"Breed your Kolobok\", \"logo\": \"https://imgs.cryptolions.io/logo_256.png\", \"url\": \"https://kolobok.io\", \"defaultfee\":200}", "{\"bdate\":\"timestamp\"},{\"cd\":\"timestamp\"},{\"img\":\"img\"},{\"st\":\"hide\"},{\"url\":\"url\"}", "{\"kolobok\":\"img\"},{\"*\":\"img\"}" ]' -p ilovekolobok 565 | ``` 566 | 567 | ### authorupdate 568 | ``` 569 | ./cleos.sh.jungle push action simpleassets authorupdate '["ilovekolobok", "{\"name\": \"Kolobok Breeding Game\", \"company\": \"CryptoLions\", \"info\": \"Breed your Kolobok\", \"logo\": \"https://imgs.cryptolions.io/logo_256.png\", \"url\": \"https://kolobok.io\", \"defaultfee\":200}", "{\"bdate\":\"timestamp\"},{\"cd\":\"timestamp\"},{\"img\":\"img\"},{\"st\":\"hide\"},{\"url\":\"url\"}", "{\"kolobok\":\"img\"},{\"*\":\"img\"}" ]' -p ilovekolobok 570 | ``` 571 | 572 | ----------------- 573 | # Registro de cambios 574 | 575 | ## Registro de cambios v1.4.1 576 | 577 | - Campos y acciones renombradas en el Registro del Autor para una mayor claridad 578 | regauthor -> authorreg 579 | data -> dappinfo 580 | stemplate -> fieldtypes 581 | imgpriority -> priorityimg 582 | - Documentación del Registro del Autor agregada al readme 583 | 584 | ## Registro de cambios v1.4.0 585 | - activos delegados de nuevo. (prestador de activos puede permitir que sean prestados nuevamente) 586 | - Nuevo parámetro `bool redelegate` agregado en acción de delegar, la que permite que se deleguen activos de nuevo. 587 | - Nuevo campo `bool redelegate` agregado en la tabla `delegates` => requiere migración en caso de un contrato auto-ejecutado!!! 588 | - En el parámetro de la acción `undelegate` fue removido el `from`. (la identidad del prestatario está disponible en la tabla de delegados) 589 | - Corrección de transferencias de matriz de activos vacía 590 | - Mensajes de error con mayor claridad 591 | - Refactoring de códigos 592 | 593 | 594 | ## Registro de cambios v1.3.0 595 | - Actualización con la última versión del Contract Development Toolkit (CDT v1.6.3). 596 | (Resuelve este compilation [issue](https://github.com/EOSIO/eosio.cdt/issues/527)) 597 | - refactoring menor del código. 598 | 599 | 600 | ## Registro de cambios v1.2.0 601 | - TOKENS NO TRANSFERIBLES (NTTs) - nuevas tablas: snttassets y nttoffers 602 | - nuevas acciones NTT: createntt, createnttlog, claimntt, updatentt, burnntt 603 | - corrección de la acción delegatemore (gracias a cc32d9) 604 | - contratos ricardianos actualizados. 605 | - tests externos para la lógica NTT agregados. 606 | 607 | 608 | ## Registro de cambios v1.1.3 609 | - contratos ricardianos actualizados. 610 | - corrección del issue de oferta de token fungible 611 | 612 | 613 | ## Registro de cambios v1.1.2 614 | - agregado el campo de `string imgpriority` en la tabla `sauthor` y a las acciones `regauthor` y `authorupdate` 615 | - IMPORTANTE: Instancias auto-ejecutables de Simple Assets podrían necesitar migrar a la tabla regauthor (si se usan). 616 | 617 | 618 | ## Registro de cambios v1.1.1 619 | - función optimizada de tomar/transferir/quemar 620 | - Campo de memorandum agregado a la tabla de delegados. (Esto permite a prestadores/juegos crear diferentes clases de activos prestados - eg. alto riesgo / bajo riesgo.) En cuanto a una acción delegada, el memorandum del parámetro de acción es almacenado a este campo nuevo. máxima longitud de 64 caracteres. 621 | - Tres nuevas unidades de prueba agregadas al memorandum de delegación. 622 | 623 | 624 | ## Registro de cambios v1.1.0 625 | - Refactoring del código 626 | - Corrección de separación de NFTs en contenedores para NFTs delegados y transferidos. 627 | - nueva acción delegatemore que permite extender el periodo del delegado por NFT en préstamo. 628 | - Agregadas unidades de prueba externas (bash) 629 | 630 | ## Registro de cambios v1.0.1 631 | - nuevo parámetro `requireclaim` en la acción `createlog` que es usado internamente para el registro de historial de acciones `create`. 632 | 633 | 634 | ## Registro de cambios v1.0.0 635 | - Bloqueo de ofertas de propietarios de activos a ellos mismos 636 | 637 | ## Registro de cambios v0.4.2 638 | - cambio de formato de evento `saeclaim`: matriz de assetids reemplazada por mapa 639 | 640 | ## Registro de cambios v0.4.1 641 | - agregado require_recipient(owner) a la acción `create` 642 | 643 | 644 | ## Registro de cambios v0.4.0 645 | 646 | **Encuentre fácilmente información del token fungible (los tokens fungibles tienen alcance de autor):** 647 | - nuevo campo `author` en tabla de `account` por FT. (Hace más fácil encontrar información del token fungible) 648 | 649 | **Más información del token fungible:** 650 | - nuevo campo `data` en la tabla de `currency_stats` - stringify json que puede incluir llaves `img`, `name` (recomendado para mostrar mejor por mercados) 651 | - nuevo parámetro `data` en la acción de `createf` 652 | - nueva acción `updatef` para cambiar `data` del FT 653 | 654 | **Ofrecer/tomar tokens fungibles** 655 | - nueva tabla `sofferf` para usar `offer`/`claim` FT 656 | - nuevas acciones `offerf`, `cancelofferf` y `claimf` 657 | - en chequeo `closef` si no hay ofertas abiertas (internas) 658 | 659 | **Activos en contenedores** 660 | - nuevos campos `container` y `containerf` en estructura de activos NFT para adjuntar y separar otros NFT o FT 661 | - nuevas acciones `attach`, `detach` 662 | - nuevas acciones `attachf`, `detachf` 663 | 664 | **misc** 665 | - campos renombrados `lastid` -> `lnftid`, `spare`->`defid` (uso interno) en la tabla `global` 666 | - campo `offeredTo` renombrado a `offeredto` en la tabla `soffer` 667 | 668 | 669 | ## Registro de cambios v0.3.2 670 | - Agregado el parámetro `memo` a la acción `offer`; 671 | - Agregado el parámetro `memo` a la acción `delegate`; 672 | 673 | 674 | ## Registro de cambios v0.3.1 675 | - Agregada la acción interna `createlog` para NFT. Usada por la acción de crear registro assetid para que así exploradores externos puedan fácilmente obtener nuevas identificaciones de activos y otra información. 676 | - Nueva tabla singelton `tokenconfigs` agregada. Ayuda a contratos externos analizar acciones y tablas correctamente (Útil para intercambios descentralizados, marketplaces y otros contratos que usen múltiples tokens). 677 | Marketplaces, intercambios y otros contratos de confianza tendrán visibilidad sobre esta información usando el siguiente código. 678 | ``` 679 | Configs configs("simpleassets"_n, "simpleassets"_n.value); 680 | configs.get("simpleassets"_n); 681 | ``` 682 | - agregada la acción `updatever`. Esta actualiza la versión de implementación de este SimpleAssets por billeteras de terceros, marketplaces, etc; 683 | - Nuevos ejemplos de notificaciones de Eventos: https://github.com/CryptoLions/SimpleAssets-EventReceiverExample 684 | 685 | ## Registro de cambios v0.3.0 686 | - Agregadas notificaciones de eventos usando transacciones diferidas. El autor de activos recibirá notificaciones sobre activos creados, transferidos, tomados o quemados. Para recibirlas por favor agregue la siguiente acción a su contrato de autor: 687 | ``` 688 | ACTION saecreate ( name owner, uint64_t assetid ); 689 | ACTION saetransfer ( name from, name to, std::vector& assetids, std::string memo ); 690 | ACTION saeclaim ( name account, std::vector& assetids ); 691 | ACTION saeburn ( name account, std::vector& assetids, std::string memo ); 692 | ``` 693 | - el parámetro `untildate` fue cambiado a `period` (en segundos) para las acciones `delegate` y la tabla `sdelegates` 694 | 695 | 696 | ## Registro de cambios v0.2.0 697 | ### Agregadas tablas y lógica de Tokens Fungibles usando el contrato eosio.token pero con algunos cambios 698 | - Nuevas acciones y lógica: `createf`, `issuef`, `transferf`, `burnf`, `openf`, `closef` 699 | - agregadas nuevas tablas `stat(supply, max_supply, issuer, id)` y `accounts (id, balance)`. 700 | - alcance de tablas de estadísticas (info about fungible tokens) cambiado a autor 701 | - índice primario para la tabla `accounts` e identificación única creada en la acción createf y almacenada en la tabla de estadísticas. 702 | - agregada la acción `createf` para tokens fungibles con el parámetro `authorctrl` a tabla de `stats`. Si es verdad(1) permite al autor del token (y no solo al propietario) a burnf y transferf. ¡No puede ser cambiado luego de su creación! 703 | - Contratos ricardianos actualizados 704 | - más ejemplos de uso abajo 705 | 706 | 707 | ## Registro de cambios v0.1.1 708 | Misc 709 | - estructura de la tabla sdelagate renombrada a sdelegate (errata) 710 | - creación de parámetros de acción renombrada: requireClaim -> requireclaim 711 | - parámetro de acción assetID renombrado en todas las acciones assetid 712 | 713 | Activos en préstamo 714 | - tabla sdelegate - agregado nuevo campo: untildate 715 | - agregado parámetro en acción de delegación untildate. La acción hace una revisión sencilla si el parámetro fue introducido correctamente (ya sea cero o en el futuro). 716 | - undelegate no funcionará hasta untildate (esto garantiza un término mínimo en préstamo del activo). 717 | - permitir transferencia de vuelta de activos (retorno) si es delegado, antes de untiltime (prestador tiene la opción de devolver antes de tiempo) 718 | 719 | Procesamiento del lote 720 | - acción claim: el parámetro assetid fue cambiado a matriz de assetsids. Lógica de tomares múltiples añadida. 721 | - acción offer: el parámetro assetid fue cambiado a la matriz de assetsids. Lógica de ofertas múltiples añadida. 722 | - acción canceloffer: el parámetro assetid fue cambiado a la matriz de assetsids. Lógica de cancelaciones múltiples añadida. 723 | - acción transfer: el parámetro assetid fue cambiado a la matriz de assetsids. Lógica de transferencia de activos múltiple añadida. 724 | - acción burn: el parámetro assetid fue cambiado a la matriz de assetsids. Lógica de quemar múltiple añadida. 725 | - acción delegate/undelegate: el parámetro assetid fue cambiado a la matriz de assetsids. Lógica de delegation/undelegation múltiple añadida. 726 | 727 | 728 | 729 | 730 | 731 | 732 | 733 | 734 | 735 | 736 | 737 | -------------------------------------------------------------------------------- /README_KR.md: -------------------------------------------------------------------------------- 1 | # 한국어 2 | 3 | # 심플에셋 (SimpleAssets) 4 | 5 | EOSIO 블록체인 상의 (대체 가능 코인과 불가능 코인—NFT를 모두 포함한) 디지털 자산을 위해, [Cryptolions](https://cryptolions.io/)가 고안해 낸 간편 표준 6 | 7 | Web: [http://simpleassets.io](http://simpleassets.io) 8 | Git: [https://github.com/CryptoLions/SimpleAssets](https://github.com/CryptoLions/SimpleAssets) 9 | Telegram: [https://t.me/simpleassets](https://t.me/simpleassets) 10 | 11 | 12 | 소개 & 데모: [https://medium.com/@cryptolions/introducing-simple-assets-b4e17caafaa4](https://medium.com/@cryptolions/introducing-simple-assets-b4e17caafaa4) 13 | 14 | 작성자들을 위한 이벤트 리시버 예시: [https://github.com/CryptoLions/SimpleAssets-EventReceiverExample](https://github.com/CryptoLions/SimpleAssets-EventReceiverExample) 15 | 16 | 주의!!! 현재 CDT는 v1.6.x에서는 컴파일이 되지 않는 버그가 있습니다. v1.5.0 역시 abi 생성 시 "세그멘테이션 오류 (core dumped)" 버그가 발생합니다. 컨트랙트 컴파일 시 v1.5.0와 저희가 제공하는 abi를 사용하실 것을 추천합니다. 17 | 18 | 이슈: https://github.com/EOSIO/eosio.cdt/issues/527 19 | 20 | --- 21 | 22 | 심플에셋은 심플에셋 컨트렉트와 연결하여 사용합니다. 한마디로, Dapp을 위한 Dapp이라고 할 수 있겠습니다. 23 | 24 | 정글 테스트넷: `simpleassets` 25 | EOS 메인넷: `simpleassets` 26 | MEETONE 메인넷: `smplassets.m` 27 | TELOS 메인넷: `simpleassets` 28 | PROTON: `simpleassets` 29 | 30 | 심플에셋은 다른 Dapp들이 자신의 디지털 자산을 관리하기 위해 호출할 수 있는 별개의 컨트랙트입니다. 이는 자산의 소유권이 신뢰할 수 있는 외부 권한자에 의해 관리될 수 있도록, 그리고 생성과 동시에 해당 Dapp이 자산의 mdata만을 관리할 수 있도록 하는 추가적인 보장책을 해당 Dapp 사용자들에게 제공합니다. 소유권과 관련한 모든 기능들은 외부에 존재하게 됩니다. 31 | 32 | 현재 우리는, EOSIO 메인넷에 배포된 심플에셋의 업데이트를 큐레이팅할 DAC를 만드는 과정에 있습니다. 33 | 34 | 관련 정보: 소유권 권한자 이해하기. 35 | 36 | 자신의 NFT 관련 정보를 제 3자 시장에 게재하려면, regauthor 액션을 사용하세요. 37 | 38 | 또는, 각 Dapp은 자신만의 심플에셋 사본을 배포할 수 있으며, 각 기능에 대해 더 큰 통제권을 가질 수 있도록 수정을 적용할 수 있습니다. 배포에 앞서, 심플에셋은 누군가가 자산을 생성하는 것을 막도록 수정되어야 합니다. 39 | --------------------------- 40 | 41 | ## RAM 사용량 42 | 43 | NFT의 RAM 사용량은 idata와 mdata 필드에 얼마나 많은 데이터가 있는지에 의해 정해집니다. 두 영역 모두가 비어있다면, 각 NFT는 `276byte`를 차지합니다. 44 | 45 | idata와 mdata의 각 기호들은 1 byte 씩을 차지합니다. 46 | 47 | --------------------------- 48 | 49 | ## 목차: 50 | 1. [컨트랙트 액션](#컨트랙트-액션) 51 | 2. [데이터 구조](#데이터-구조) 52 | 3. [예시: 스마트 컨트랙트에서 심플에셋 사용하기](#예시:-스마트-컨트랙트에서-심플에셋-사용하기) 53 | 4. [변경 로그](#변경-로그) 54 | 55 | --------------------------- 56 | 57 | # 컨트랙트 액션 58 | 59 | 각 파라미터에 대한 설명은 다음 링크에서 찾아볼 수 있습니다. 60 | [https://github.com/CryptoLions/SimpleAssets/blob/master/include/SimpleAssets.hpp](https://github.com/CryptoLions/SimpleAssets/blob/master/include/SimpleAssets.hpp) 61 | 62 | ``` 63 | authorreg ( name author, string dappinfo, string fieldtypes, string priorityimg ) 64 | authorupdate ( name author, string dappinfo, string fieldtypes, string priorityimg ) 65 | 66 | # -- For Non-Fungible Tokens --- 67 | 68 | create (author, category, owner, idata, mdata, requireсlaim) 69 | update (author, owner, assetid, mdata) 70 | transfer (from, to , [assetid1,..,assetidn], memo) 71 | burn (owner, [assetid1,..,assetidn], memo) 72 | 73 | offer (owner, newowner, [assetid1,..,assetidn], memo) 74 | canceloffer (owner, [assetid1,..,assetidn]) 75 | claim (claimer, [assetid1,..,assetidn]) 76 | 77 | regauthor (name author, data, stemplate) 78 | authorupdate (author, data, stemplate) 79 | 80 | delegate (owner, to, [assetid1,..,assetidn], period, memo) 81 | undelegate (owner, from, [assetid1,..,assetidn]) 82 | delegatemore (owner, assetid, period) 83 | 84 | attach (owner, assetidc, [assetid1,..,assetidn]) 85 | detach (owner, assetidc, [assetid1,..,assetidn]) 86 | 87 | attachf (owner, author, quantity, assetidc) 88 | detachf (owner, author, quantity, assetidc) 89 | 90 | # -- For Fungible Tokens --- 91 | 92 | createf (author, maximum_supply, authorctrl, data) 93 | updatef (author, sym, data) 94 | issuef (to, author, quantity, memo) 95 | transferf (from, to, author, quantity, memo) 96 | burnf (from, author, quantity, memo) 97 | 98 | offerf (owner, newowner, author, quantity, memo) 99 | cancelofferf (owner, [ftofferid1,...,ftofferidn]) 100 | claimf (claimer, [ftofferid1,...,ftofferidn]) 101 | 102 | openf (owner, author, symbol, ram_payer) 103 | closef (owner, author, symbol) 104 | ``` 105 | 106 | # 데이터 구조 107 | 108 | ## 자산 109 | 110 | ``` 111 | sasset { 112 | uint64_t id; // 양도와 검색에 이용되는 자산 ID; 113 | name owner; // 자산 소유자 (소유자에 의해 변경 가능!!!); 114 | name author; // 자산 생성자 (게임 컨트랙트, 변경 불가); 115 | name category; // 자산 종류, 생성자가 선택, 변경 불가; 116 | string idata; // 변경 불가 자산 데이터. JSON이나 sha256로 스트링화 가능; 117 | string mdata; // 변경 가능 자산, 생성 시나 자산 업데이트 시 생성자에 의해 추가됨 118 | // JSON이나 sha256로 스트링화 가능; 119 | sasset[] container; // 이 자산에 첨부된 다른 NFT 120 | account[] containerf; // 이 자산에 첨부된 FT 121 | } 122 | ``` 123 | 124 | // Markets에서 사용될 자산 이름 img desc에 대한 idata 혹은 mdata 정보를 포함시켜 주세요. 125 | 126 | ## 오퍼 127 | 128 | ``` 129 | offers { 130 | uint64_t assetid; // 클레임을 위해 오퍼된 자산 ID; 131 | name owner; // 자산 소유자; 132 | name offeredto; // 이 자산을 클레임할 수 있는 사람 ; 133 | uint64_t cdate; // 오퍼 생성일; 134 | } 135 | ``` 136 | 137 | ## 작성자 138 | 139 | ``` 140 | authors { 141 | name author; // 자산을 생성하고 업데이트할 수 있는 자산 샌성자; 142 | string data; // 개선된 디스플레이를 위해 마켓에서 사용되는 생성자의 데이터(json); 143 | // 추천: logo, info, url; 144 | string stemplate; // 제 3자 시장을 위한 데이터(json) 스키마; 145 | // 키: mdata, idata의 키의 상태값; 146 | // 추천값: txt, img, url, hide, webgl, mp3, video, timestamp; 147 | } 148 | ``` 149 | 150 | ## 위임자 151 | 152 | ``` 153 | delegates{ 154 | uint64_t assetid; // ```claim```을 위해 오퍼된 자산 ID; 155 | name owner; // 자산 소유자; 156 | name delegatedto; // 이 자산을 클레임할 수 있는 사람; 157 | uint64_t cdate; // 오퍼 생성일; 158 | uint64_t period; // 자산이 대여될 시간(초). 대여자는 이 시간이 만료될 때까지 159 | // 위임을 해제할 수 없음. 하지만 대출자는 언제든 반환 가능. 160 | } 161 | ``` 162 | 163 | ## 화폐 통계 (대체 가능 토큰) 164 | 165 | ``` 166 | stat { 167 | asset supply; // 토큰 공급 168 | asset max_supply; // 토큰 최대 공급 169 | name issuer; // 대체 가능 토큰 생성자 170 | uint64_t id; // 이 토큰의 고유 ID 171 | bool authorctrl; // 이것이 참(1)이면 토큰 생성자(소유자가 아님)가 ```burn```과 ```transfer```를 할 수 있음. 172 | string data; // 스트링화 된 json. 다음 키를 포함할 것을 추천: `img`, `name` 173 | } 174 | ``` 175 | 176 | ## 계정 (대체 불가능 토큰) 177 | 178 | ``` 179 | accounts { 180 | uint64_t id; // ```stat``` 테이블의 토큰 ID 181 | name author; // 토큰 생성자 182 | asset balance; // 토큰 잔고 183 | } 184 | ``` 185 | 186 | ``` 187 | sofferf { 188 | uint64_t id; // ```claim```을 위한 ```offer```의 ID (자동으로 증가함) 189 | name author; // FT 생성자 190 | name owner; // FT 소유자 191 | asset quantity; // 수량 192 | name offeredto; // 오퍼를 클레임할 수 있는 계정 193 | uint64_t cdate; // 오퍼 생성일 194 | } 195 | ``` 196 | 197 | # 예시: 스마트 컨트랙트에서 심플에셋 사용하기 198 | 199 | ## 자산을 생성해 소유자 계정 ownerowner22으로 전송하기: 200 | 201 | ``` 202 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 203 | 204 | name author = get_self(); 205 | name category = "weapon"_n; 206 | name owner = "ownerowner22"_n; 207 | string idata = "{\"power\": 10, \"speed\": 2.2, \"name\": \"Magic Sword\" }"; 208 | string mdata = "{\"color\": \"bluegold\", \"level\": 3, \"stamina\": 5, \"img\": \"https://bit.ly/2MYh8EA\" }"; 209 | 210 | action createAsset = action( 211 | permission_level{author, "active"_n}, 212 | SIMPLEASSETSCONTRACT, 213 | "create"_n, 214 | std::make_tuple( author, category, owner, idata, mdata, 0 ) 215 | ); 216 | createAsset.send(); 217 | ``` 218 | 219 | ## requireclaim 옵션으로 ownerowner22에 자산 생성하기: 220 | 221 | ``` 222 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 223 | 224 | name author = get_self(); 225 | name category = "balls"_n; 226 | name owner = "ownerowner22"_n; 227 | string idata = "{\"radius\": 2, \"weigh\": 5, \"material\": \"rubber\", \"name\": \"Baseball\" }"; 228 | string mdata = "{\"color\": \"white\", \"decay\": 99, \"img\": \"https://i.imgur.com/QoTcosp.png\" }"; 229 | 230 | action createAsset = action( 231 | permission_level{author, "active"_n}, 232 | SIMPLEASSETSCONTRACT, 233 | "create"_n, 234 | std::make_tuple( author, category, owner, idata, mdata, 1 ) 235 | ); 236 | createAsset.send(); 237 | ``` 238 | 239 | ## 자산의 검색과 자산 정보 가져오기 240 | 241 | 1. 자산 구조에 관한 hpp 파일을 추가하십시오. 242 | 243 | **주의! 현재 CDT는 v1.6.1에서는 컴파일이 되지 않는 버그가 있습니다. 244 | v1.5.0 역시 abi generation에 한해 (객체 자신의 배열 포함 : std::vector container;) "Segmentation fault (core dumped)" 버그가 발생합니다.** 245 | 246 | ``` 247 | TABLE account { 248 | uint64_t id; 249 | name author; 250 | asset balance; 251 | 252 | uint64_t primary_key()const { 253 | return id; 254 | } 255 | }; 256 | typedef eosio::multi_index< "accounts"_n, account > accounts; 257 | 258 | TABLE sasset { 259 | uint64_t id; 260 | name owner; 261 | name author; 262 | name category; 263 | string idata; 264 | string mdata; 265 | std::vector container; 266 | std::vector containerf; 267 | 268 | auto primary_key() const { 269 | return id; 270 | } 271 | 272 | uint64_t by_author() const { 273 | return author.value; 274 | } 275 | }; 276 | 277 | typedef eosio::multi_index< "sassets"_n, sasset, 278 | eosio::indexed_by< "author"_n, eosio::const_mem_fun > 279 | > sassets; 280 | ``` 281 | 282 | 2. 정보의 검색 및 사용 283 | 284 | ``` 285 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 286 | name author = get_self(); 287 | name owner = "lioninjungle"_n; 288 | 289 | uint64_t assetid = 100000000000187 290 | 291 | sassets assets(SIMPLEASSETSCONTRACT, owner.value); 292 | auto idx = assets.find(assetid); 293 | 294 | check(idx != assets.end(), "Asset not found or not yours"); 295 | 296 | check (idx->author == author, "Asset is not from this author"); 297 | 298 | auto idata = json::parse(idx->idata); // for parsing json here is used nlohmann lib 299 | auto mdata = json::parse(idx->mdata); // https://github.com/nlohmann/json 300 | 301 | check(mdata["cd"] < now(), "Not ready yet for usage"); 302 | ``` 303 | 304 | 305 | 306 | ## 자산 업데이트 307 | 308 | ``` 309 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 310 | 311 | auto mdata = json::parse(idxp->mdata); 312 | mdata["cd"] = now() + 84600; 313 | 314 | name author = get_self(); 315 | name owner = "ownerowner22"_n; 316 | uint64_t assetid = 100000000000187; 317 | 318 | action saUpdate = action( 319 | permission_level{author, "active"_n}, 320 | SIMPLEASSETSCONTRACT, 321 | "update"_n, 322 | std::make_tuple(author, owner, assetid, mdata.dump()) 323 | ); 324 | saUpdate.send(); 325 | ``` 326 | 327 | 328 | 329 | ## 자산 하나 전송하기 330 | 331 | ``` 332 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 333 | 334 | name author = get_self(); 335 | name from = "lioninjungle"_n; 336 | name to = "ohtigertiger"_n; 337 | 338 | std::vector assetids; 339 | assetids.push_back(assetid); 340 | 341 | string memo = "Transfer one asset"; 342 | 343 | action saUpdate = action( 344 | permission_level{author, "active"_n}, 345 | SIMPLEASSETSCONTRACT, 346 | "transfer"_n, 347 | std::make_tuple(from, to, assetids, memo) 348 | ); 349 | saUpdate.send(); 350 | ``` 351 | 352 | ## 동일한 메모가 첨부된 자산 두 개를 동일한 수신자에게 전송하기 353 | 354 | ``` 355 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 356 | 357 | name author = get_self(); 358 | name from = "lioninjungle"_n; 359 | name to = "ohtigertiger"_n; 360 | 361 | std::vector assetids; 362 | assetids.push_back(assetid1); 363 | assetids.push_back(assetid2); 364 | 365 | string memo = "Transfer two asset" 366 | 367 | action saUpdate = action( 368 | permission_level{author, "active"_n}, 369 | SIMPLEASSETSCONTRACT, 370 | "transfer"_n, 371 | std::make_tuple(from, to, assetids, memo) 372 | ); 373 | saUpdate.send(); 374 | ``` 375 | 376 | ## issue로 생성된 토큰에 대한 issuef (대체 가능 토큰) 377 | 378 | ``` 379 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 380 | 381 | asset wood; 382 | wood.amount = 100; 383 | wood.symbol = symbol("WOOD", 0); 384 | 385 | name author = get_self(); 386 | name to = "lioninjungle"_n; 387 | 388 | std::string memo = "WOOD faucet"; 389 | action saRes1 = action( 390 | permission_level{author, "active"_n}, 391 | SIMPLEASSETSCONTRACT, 392 | "issuef"_n, 393 | std::make_tuple(to, author, wood, memo) 394 | ); 395 | saRes1.send(); 396 | ``` 397 | 398 | ## authorctrl이 사용 가능한 경우의, 작성자에 의한 transferf (대체 가능 토큰) 399 | 400 | ``` 401 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 402 | 403 | asset wood; 404 | wood.amount = 20; 405 | wood.symbol = symbol("WOOD", 0); 406 | 407 | name from = "lioninjungle"_n; 408 | name to = get_self(); 409 | name author = get_self(); 410 | 411 | std::string memo = "best WOOD"; 412 | action saRes1 = action( 413 | permission_level{author, "active"_n}, 414 | SIMPLEASSETSCONTRACT, 415 | "transferf"_n, 416 | std::make_tuple(from, to, author, wood, memo) 417 | ); 418 | saRes1.send(); 419 | ``` 420 | 421 | ## authorctrl이 사용 가능한 경우의, 작성자에 의한 burnf (대체 가능 토큰) 422 | 423 | ``` 424 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 425 | 426 | asset wood; 427 | wood.amount = 20; 428 | wood.symbol = symbol("WOOD", 0); 429 | 430 | name author = get_self(); 431 | name from = "lioninjungle"_n; 432 | 433 | std::string memo = "WOOD for oven"; 434 | action saRes1 = action( 435 | permission_level{author, "active"_n}, 436 | SIMPLEASSETSCONTRACT, 437 | "burnf"_n, 438 | std::make_tuple(from, author, wood, memo) 439 | ); 440 | saRes1.send(); 441 | ``` 442 | 443 | ## 변경 로그 v1.1.0 444 | 445 | * 코드 리펙터링 446 | * 위임 및 양도된 NFT를 위해 컨테이너라이징 된 NFT의 분리 수정 447 | * 대여한 NFT의 위임 기간을 연장할 수 있게 해주는 새로운 액션 delegatemore 추가 448 | * 외부(bash) 유닛 테스트 추가 449 | 450 | ## 변경 로그 v1.0.1 451 | 452 | - 내부적으로 `create` 액션 히스토리 로그에 이용되는 새로운 파라미터 `requireclaim`가 `createlog` 액션에 추가됨. 453 | 454 | ## 변경 로그 v1.0.0 455 | 456 | - 자기 자신에게 자산을 오퍼하는 소유자 블록 처리 457 | 458 | ## 변경 로그 v0.4.2 459 | 460 | - `saeclaim` 이벤트의 포멧 변경: assetids 배열이 map 으로 대체됨 461 | 462 | ## 변경 로그 v0.4.1 463 | 464 | - `create` 액션에 require_recipient(owner) 추가 465 | 466 | ## 변경 로그 v0.4.0 467 | 468 | **대체 가능 코인 정보를 보다 쉽게 찾을 수 있게 됨 (대체 가능 코인이 scope author를 가짐):** 469 | 470 | - FT를 위해 `account` 테이블에 새 필드 `author`가 추가됨. (대체 가능 코인 정보를 보다 쉽게 찾을 수 있음) 471 | 472 | **추가된 대체 가능 코인 정보:** 473 | 474 | - `currency_stats` 테이블에 새로운 필드 `data`가 추가됨 - 키 `img`, `name`을 포함할 수도 있는 json을 스트링화 (시장을 통한 개선된 디스플레이를 위해 권장) 475 | - `createf` 액션에 새로운 파라미터 `data`가 추가됨 476 | - FT `data`를 변경하기 위한 새로운 액션 `updatef`가 추가됨 477 | 478 | 479 | 480 | **대체 가능 토큰 오퍼/클레임** 481 | 482 | - `offer`/`claim` FT에 사용되는 새로운 테이블 `sofferf`가 추가됨 483 | - 새로운 액션 `offerf`, `cancelofferf`, `claimf`가 추가됨 484 | - 개방된 오퍼가 없을 경우 (내부) `closef`에 대해 검사 485 | 486 | **자산 컨테이너라이징** 487 | **주의! 현재 CDT는 v1.6.1에서는 컴파일이 되지 않는 버그가 있습니다. 488 | v1.5.0 역시 abi generation 시 "Segmentation fault (core dumped)" 버그가 발생합니다. 추천: 컨트랙트 컴파일 시 v1.5.0와 저희가 제공하는 abi를 사용하실 것을 추천합니다.** 489 | 490 | - 다른 NFT 및 FT의 어태치와 디태치를 위해 새로운 필드 `container`와 `containerf`가 NFT 자산 구조에 추가됨 491 | - 새로운 액션 `attach`, `detach`가 추가됨 492 | - 새로운 액션 `attachf`, `detachf`가 추가됨 493 | 494 | **기타** 495 | 496 | - `global` 테이블 내 필드 이름 변경됨 `lastid` -> 'lnftid`, 'spare` -> `defid` (내부용) 497 | - `soffer` 테이블 내 `offeredTo` 필드의 이름이 `offeredto`로 변경됨 498 | 499 | ## 변경 로그 v0.3.2 500 | 501 | - `offer` 액션에 `memo` 파라미터 추가; 502 | - `delegate` 액션에 `memo` 파라미터 추가; 503 | 504 | ## 변경 로그 v0.3.1 505 | 506 | - NFT를 위한 내부 액션 `createlog`를 추가함. create 액션에 의해 사용되며, assetid를 기록하여 제 3자 탐색자가 새로운 자산 id와 기타 정보를 손쉽게 얻을 수 있도록 함. 507 | - 새로운 싱글톤 테이블 `tokenconfigs`를 추가함. 이는 외부 컨트랙트 파스 액션과 테이블을 도움 (탈중앙화 교환소, 시장, 및 다수의 토큰을 사용하는 기타 컨트랙트에 유용). 508 | 시장, 교환소, 및 기타 유관 컨트랙트는 다음 코드를 이용해 이 정보를 열람할 수 있음. 509 | 510 | ``` 511 | Configs configs("simpleassets"_n, "simpleassets"_n.value); 512 | configs.get("simpleassets"_n); 513 | ``` 514 | 515 | - 새로운 액션 `updatever`를 추가함. 이는 제 3자 지갑, 시장 등에 대해 본 버전으로 배포된 심플에셋을 업데이트함; 516 | - 이벤트 알림과 관련한 새로운 예시: https://github.com/CryptoLions/SimpleAssets-EventReceiverExample 517 | 518 | ## 변경 로그 v0.3.0 519 | 520 | - 유예된 거래를 이용한 이벤트 알림이 추가됨. 자산 작성자는 자산의 생성, 전송, 클레임, 소각에 대한 알림을 받게됨. 알림을 받기 위해선 작성자 컨트랙트에 다음을 입력 해야함: 521 | 522 | ``` 523 | ACTION saecreate ( name owner, uint64_t assetid ); 524 | ACTION saetransfer ( name from, name to, std::vector& assetids, std::string memo ); 525 | ACTION saeclaim ( name account, std::vector& assetids ); 526 | ACTION saeburn ( name account, std::vector& assetids, std::string memo ); 527 | ``` 528 | 529 | - `delegate` 액션과 `sdelegates` 테이블에 대한 `untildate` 파라미터가 `period` (초 단위)로 변경됨 530 | 531 | ## 변경 로그 v0.2.0 532 | 533 | ### 다소 변경된 eosio.token 컨트랙트를 이용하는 로직과 대체 가능 토큰 테이블 추가 534 | 535 | - 새로운 액션 및 로직 추가: `createf`, `issuef`, `transferf`, `burnf`, `openf`, `closef` 536 | - 새로운 테이블 `stat(supply, max_supply, issuer, id)`와 `accounts (id, balance)` 추가됨. 537 | - stats 테이블(대체 가능 토큰들에 관한 정보)을 위한 scope가 작성자로 변경됨 538 | - `accounts` 테이블의 기본 인덱스는 creates 액션에 생성되고 stats 테이블에 저장된 uniq id임. 539 | - `authorctrl` 파라미터를 가진 대체 가능 코인을 위해 `stats` 테이블에 `createf` 액션이 추가됨. 이것이 참(1)인 경우, 토큰 작성자(소유자가 아님)가 burnf과 transferf를 할 수 있음. 생성 후에는 변경할 수 없음! 540 | - 리카르디안 컨트랙트 업데이트 541 | - 더 많은 예시 추가 542 | 543 | ## 변경 로그 v0.1.1 544 | 545 | 기타 546 | 547 | - sdelagate 테이블 구조의 이름이 sdelegate로 변경됨 (오타) 548 | - create 액션 파라미터의 이름이 변경됨: requireClaim -> require claim 549 | - 모든 액션에 대한 assetID 액션 파라미터의 이름이 assetid로 변경됨 550 | 551 | 대출 자산 552 | 553 | - sdelegate 테이블 - 새 필드 추가됨: luntildate 554 | - delegate 액션에 untildate 파라미터 추가됨. 파라미터가 올바르게 입력된 경우 (0이거나 미래에) 액션은 단순 검사를 시행함. 555 | - undelegate는 untildate에 이르기 전까지는 작동하지 않음 (이는 자산 대출에 최소 기간을 보장함). 556 | - 위임된 경우, untiltime 보다 일찍 자산을 재전송(반납)하는 것을 허용 (대출자는 일찍 반납할 수 있는 옵션을 가짐) 557 | 558 | 배치 프로세싱 559 | 560 | - 클레임(claim) 액션: assentid 파라미터가 assetsids의 배열로 변경됨. 복수 클레임 로직 추가됨. 561 | - 오퍼(offer) 액션: assentid 파라미터가 assetsids의 배열로 변경됨. 복수 오퍼 로직 추가됨. 562 | - 오퍼 취소(canceloffer) 액션: assentid 파라미터가 assetsids의 배열로 변경됨. 복수 취소 로직 추가됨. 563 | - 전송(transfer) 액션: assentid 파라미터가 assetsids의 배열로 변경됨. 복수 전송 로직 추가됨. 564 | - 소각(burn) 액션: assentid 파라미터가 assetsids의 배열로 변경됨. 복수 소각 로직 추가됨. 565 | - 위임/위임취소(delegate/undelegate) 액션: assentid 파라미터가 assetsids의 배열로 변경됨. 복수 위임/위임취소 로직 추가 566 | 567 | - `sofferf` 用于`offer` / `calimFT`的新表 568 | 569 | - 新的操作`offer`,`cancelofferf` 和 `claimf` 570 | 571 | - 对 `closef` 检查如果没有公开招股(内部) 572 | 573 | **集装资产** 574 | 575 | **警告!!! CDT目前有一个不被允许在v1.6.1上编译的漏洞。 576 | 1.5.0也有一个漏洞“Segmentation fault(core dumped)”,但只有abi生效。** 577 | 578 | **建议:使用1.5.0进行合约编译,并使用我们的abi。** 579 | 580 | - nft资产结构中用于附加和分离其他NFT或FT的新字段“container”和“containerf” 581 | 582 | - 新操作 `attach`,`detach` 583 | 584 | - 新操作 `attachf`,`detach` 585 | 586 | **杂项** 587 | 588 | - 字段重命名 `lasted`- \>` lnftid`,`spare`- \> `defid`(内部用法)在表 `global` 中 589 | 590 | - 字段 `providedTo` 在 `soffer` 表中重命名为 `offersto` 591 | --- 592 | ## 更改日志v0.3.2 593 | 594 | - 为操作 `offer` 添加了 `memo` 参数; 595 | 596 | - 为操作 `delegate` 添加了 `memo` 参数; 597 | --- 598 | ## 更改日志v0.3.1 599 | 600 | - 增加了NFT的内部操作 `createlog` 。由创建操作用于记录资产ID,以便第三方资源管理器可以轻松获取新的资产ID和其他信息。 601 | 602 | - 增加了新的单例表 `tokenconfigs`。它有助于外部合约正确解析操作和表格(对于分散交换,市场和使用多个代币的其他合约有用)。市场,交易所和其他依赖合约将能够使用以下代码查看此信息。 603 | ``` 604 | Configs configs("simpleassets"_n, "simpleassets"_n.value); 605 | 606 | configs.get("simpleassets"_n); 607 | ``` 608 | - 增加了操作 `updatever`。它为第三方钱包,市场等更新了SimpleAstes部署的版本; 609 | 610 | - 事件通知的新示例: 611 | --- 612 | ## 更改日志v0.3.0 613 | 614 | - 使用延迟事务添加了事件通知。资产作者将收到有关资产创建,转移,索赔或烧录的通知。要收到它,请为您的创建者合约添加以下操作: 615 | ``` 616 | ACTION saecreate ( name owner, uint64_t assetid ); 617 | 618 | ACTION saetransfer ( name from, name to, std::vector\& assetids, 619 | std::string memo ); 620 | 621 | ACTION saeclaim ( name account, std::vector\& assetids ); 622 | 623 | ACTION saeburn ( name account, std::vector\& assetids, std::string 624 | memo ); 625 | ``` 626 | - `untildate` 参数更改为 `period`(以秒为单位)的操作 `delegate` 和表 `sdelegates` 627 | --- 628 | ## 更改日志v0.2.0 629 | 630 | ### 使用eosio.token合约添加了可替代代币(Fungible Token)表和逻辑,但有一些更改 631 | 632 | - 新的操作和逻辑:`createf`,`issuef`,`transfer`,`burnf`,`openf`,`closef` 633 | 634 | - 添加了新表 `stat(supply, max_supply, issuer, id)` 和 `accounts (id, balance)` 。 635 | 636 | - 统计表的范围(关于可替代代币的信息)已更改为创建者 637 | 638 | - `accountstable` 的主索引是在 `create` f操作上创建的 `uniq id` 并存储在 `stats` 表中。 639 | 640 | - 添加 `createf` 与 `parameter` 可替代代币操作 `authorctrl` 至 `stats` 表。如果为true(1)允许代币创建者(而不仅仅是所有者)使用burnf和transferf。创建后无法更改! 641 | 642 | - 李嘉图合约已更新 643 | 644 | - 以下有更多用法示例 645 | --- 646 | ## 更改日志v0.1.1 647 | 648 | **杂项** 649 | 650 | - sdelagate 表结构重命名为 sdelegate(typo) 651 | 652 | - 创建操作参数重命名:requireClaim - \> requireclaim 653 | 654 | - assetID操作参数在所有要声明的操作中重命名 655 | 656 | **借入资产** 657 | 658 | - sdelegate表 - 添加了新字段:untildate 659 | 660 | - 委托操作添加参数untildate。如果参数输入正确(零或将来),操作会进行简单检查。 661 | 662 | - undelegate在不公开之前不会工作(这保证了资产贷款的最低期限)。 663 | 664 | - 如果被委托,允许转移资产(返还)早于截至时间(借款人可以提前返还) 665 | 666 | **批量处理** 667 | 668 | - 声明操作(claim action):assetid参数已更改为assetsids数组。添加了多个声明逻辑。 669 | 670 | - 报价操作(offer action):assetid参数已更改为assetsids数组。添加了多个提供逻辑。 671 | 672 | - 取消报价操作(canceloffer action):assetid参数已更改为assetsids数组。添加了多个取消逻辑。 673 | 674 | - 传输操作(transfer action):assetid参数已更改为assetsids数组。添加了多个资产转移逻辑。 675 | 676 | - 烧录操作(burn action):assetid参数已更改为assetsids数组。添加了多个刻录逻辑。 677 | 678 | - 委托/非委托操作(delegate / undelegated action):assetid参数已更改为assetsids数组。添加了多个委托/取消授权逻辑。 679 | -------------------------------------------------------------------------------- /README_ZH.md: -------------------------------------------------------------------------------- 1 | 2 | 简单资产(Simple Assets) 3 | ========================= 4 | 5 | ## 目录 6 | 7 | 1.[简介](#简介) 8 | 9 | 2.[合约操作](#合约操作) 10 | 11 | 3.[数据结构](#数据结构) 12 | 13 | 4.[示例: 如何在智能合约中使用简单资产](#示例如何在智能合约中使用简单资产) 14 | 15 | 5.[更新日志](#更新日志) 16 | 17 | 18 | --- 19 | # 简介 20 | 21 | 一款EOSIO区块链上的数字资产标准,适用于不可替代代币(Non-Fungible Tokens,NFTs)、可替代代币(Fungible Tokens,FTs) 和 不可转让代币(Non-Transferable Tokens,NTTs),由[CryptoLions](https://CryptoLions.io)开发创建。 22 | 23 | web: [http://simpleassets.io](http://simpleassets.io/) 24 | 25 | Git: [https://github.com/CryptoLions/SimpleAssets](https://github.com/CryptoLions/SimpleAssets) 26 | 27 | Telegram: [https://t.me/simpleassets](https://t.me/simpleassets) 28 | 29 | 简介和演示:https://medium.com/\@cryptolions/introducing-simple-assets-b4e17caafaa4 30 | 31 | 作者的事件接收器示例:https://github.com/CryptoLions/SimpleAssets-EventReceiverExample 32 | 33 | **警告**现在最小基于eosio.cdt v1.6.3版。 34 | 35 | --- 36 | 37 | 通过调用简单资产(Simple Assets)合约来使用Simple Assets。这就像是Dapps的Dapp。 38 | 39 | 丛林测试网:**`simpleassets`** 40 | 41 | EOS 主网: **`simpleassets`** 42 | WAX 主网: **`simpleassets`** 43 | MEETONE 主网: **`smplassets.m`** 44 | TELOS 主网: **`simpleassets`** 45 | PROTON: **`simpleassets`** 46 | 47 | 简单资产(Simple Assets)是一个独立的合约,其他Dapps可以直接调用它来管理自己的数字资产。这为Dapp用户提供了额外的保证,即资产的所有权由信誉良好的外部机构管理,并且一旦创建,Dapp只能管理资产的mdata部分。 所有与所有权相关的功能都存在于游戏之外。 48 | 49 | 我们正在创建一个DAC,它将在部署至EOSIO主网后对简单资产(Simple Assets)策划更新。 50 | 51 | [相关信息:理解所有权。](https://medium.com/@cryptolions/digital-assets-we-need-to-think-about-ownership-authority-a2b0465c17f6) 52 | 53 | 运用regauthor操作发送自己的NFTs信息至第三方商城。 54 | 55 | 或者,dapps可以自行部署简单资产(Simple Assets)副本并进行修改以更好地控制其功能。部署前,应修改简单资产(Simple Assets)以防止任何人创建资产。 56 | 57 | --- 58 | 59 | ## RAM使用情况 60 | 61 | NFT的RAM使用量取决于idata和mdata字段中存储的数据量。如果它们都为空,则每个NFT占用276个字节。 62 | 63 | idata和mdata中的每个符号都是+1字节。 64 | 65 | --- 66 | 67 | ## 可替代代币(FTs) 68 | 69 | 需要可替代代币的Dapps应该在使用标准eosio.token合约和“简单资产(Simple Assets)”合约之间做出决定。 区别如下: 70 | 71 | 在简单资产中(Simple Assets) 72 | 73 | ``` 74 | * Scope is Author instead of Symbol 75 | * Stat table includes also additional data about each FT (see [Currency Stats](#currency-stats-fungible-token) below) 76 | * For transfers you need to use ```transferf``` action from SA contract. 77 | * If author sets ```authorcontrol``` flag, the author can transfers/burn/etc user's FTs independent of user's consent. 78 | * The table which tracks FTs includes the author's account name, allowing different dapps to have FTs with the 79 | same name. (Example: https://bloks.io/contract?tab=Tables&table=accounts&account=simpleassets&scope=bohdanbohdan&limit=100) 80 | ``` 81 | 82 | --- 83 | 84 | ## 不可转让代币(NTTs) 85 | 86 | 不可转让代币(NTTs)最可能的的两种用例是 87 | ``` 88 | * licenses which can be granted to an account, but not transfered. 89 | * prizes and awards given to a particular account. 90 | ``` 91 | 92 | 使用不可转让代币(NTTs)的原因: 93 | ``` 94 | * the NTTs appearing in third party asset explorers. 95 | * some functionality is handled by Simple Assets. 96 | ``` 97 | 98 | 更多有关NTTs的信息: https://medium.com/@cryptolions/introducing-non-transferable-tokens-ntts-2f1a532bf170 99 | 100 | --- 101 | # 合约操作 102 | 103 | 可在此处找到每个参数的说明:https://github.com/CryptoLions/SimpleAssets/blob/master/include/SimpleAssets.hpp 104 | 105 | ``` 106 | authorreg ( name author, string dappinfo, string fieldtypes, string priorityimg ) 107 | authorupdate ( name author, string dappinfo, string fieldtypes, string priorityimg ) 108 | 109 | \# -- For Non-Fungible Tokens (NTFs) --- 110 | 111 | create (author, category, owner, idata, mdata, requireсlaim) 112 | update (author, owner, assetid, mdata) 113 | transfer (from, to , [assetid1,..,assetidn], memo) 114 | burn (owner, [assetid1,..,assetidn], memo) 115 | 116 | offer (owner, newowner, [assetid1,..,assetidn], memo) 117 | canceloffer (owner, [assetid1,..,assetidn]) 118 | claim (claimer, [assetid1,..,assetidn]) 119 | 120 | delegate (owner, to, [assetid1,..,assetidn], period, memo) 121 | undelegate (owner, from, [assetid1,..,assetidn]) 122 | delegatemore (owner, assetid, period) 123 | 124 | attach (owner, assetidc, [assetid1,..,assetidn]) 125 | detach (owner, assetidc, [assetid1,..,assetidn]) 126 | 127 | attachf (owner, author, quantity, assetidc) 128 | detachf (owner, author, quantity, assetidc) 129 | 130 | mdadd (author, data) 131 | mdupdate (id, author, data) 132 | mdremove (id) 133 | mdaddlog (id, author, data) 134 | 135 | \# -- For Fungible Tokens (FTs)--- 136 | 137 | createf (author, maximum_supply, authorctrl, data) 138 | updatef (author, sym, data) 139 | issuef (to, author, quantity, memo) 140 | transferf (from, to, author, quantity, memo) 141 | burnf (from, author, quantity, memo) 142 | 143 | offerf (owner, newowner, author, quantity, memo) 144 | cancelofferf (owner, [ftofferid1,...,ftofferidn]) 145 | claimf (claimer, [ftofferid1,...,ftofferidn]) 146 | 147 | openf (owner, author, symbol, ram_payer) 148 | closef (owner, author, symbol) 149 | 150 | \# -- For Non-Transferable Tokens (NTTs) --- 151 | 152 | createntt (author, category, owner, idata, mdata, requireсlaim) 153 | updatentt (author, owner, assetid, mdata) 154 | burnntt (owner, [assetid1,..,assetidn], memo) 155 | claimntt (claimer, [assetid1,..,assetidn]) 156 | ``` 157 | 158 | --- 159 | # 数据结构 160 | 161 | ## 资产 162 | ``` 163 | sasset { 164 | 165 | uint64_t id; // 用于转移和搜索的资产ID 166 | name owner; // 资产所有者(可变更 — 由所有者决定!!!) 167 | name author; // 资产创建者(游戏合约,不可变更) 168 | name category; // 资产类别,由创建者选择,不可变更 169 | string idata; // 不可变更资产数据。 它可以是字符串化“JSON”或只是字符串“sha256” 170 | string mdata; // 可变资产数据,由创建者在创建或资产更新时添加。 它可以是字符串化“JSON”或只是字符串“sha256” 171 | sasset[] container; // 其它NFTs(可替代和不可替代代币)附加到此资产 172 | account[] containerf; // FTs(可替代代币)附加到此资产 173 | 174 | } 175 | ``` 176 | //为帮助第三方资产浏览器,我们建议在`idata`或`mdata`请包含以下字段://`name`(文本)//`img` (图像的网页链接) //以及 `desc`(文本描述)的信息。 177 | 178 | --- 179 | 180 | ## 报价 181 | ``` 182 | offers { 183 | 184 | uint64_t assetid; // 提供 claim 的资产ID 185 | name owner; // 资产所有者 186 | name offeredto; // 可以 claim 此资产的人 187 | uint64_t cdate; // 创建日期 188 | } 189 | ``` 190 | 191 | --- 192 | 193 | ## 创建者 194 | ``` 195 | authors { 196 | 197 | name author; // 资产创建者,将能够创建和更新资产 198 | 199 | string data; // 创建者的数据(json)将被商城用于更好的展示 200 | // 建议:形象徽标(logo),信息,网址; 201 | 202 | string stemplate; // 数据(json)模式将告诉第三方市场如何显示每个NFT field。 203 | //key:状态值,其中 key 是 idata 或 mdata 的字段名 204 | //建议格式: 205 | //txt | 默认类型 206 | //url | 显示可点击的网页链接 207 | //img | 链接至img文件 208 | //webgl | 链接至webgl文件 209 | //mp3 | 链接至mp3文件 210 | //video | 链接至视频文件 211 | //hide | 不显示 212 | //imgb | 图片作为二进制字符串 213 | //webglb | webgl二进制 214 | //mp3b | mp3二进制 215 | //videob | 视频二进制 216 | 217 | string imgpriority; //指定NFTs类别的主图像字段 218 | // 219 | // 这用于当您想把自己的NFTs主要图像移作他用 220 | // 不仅是一个指向image field中指定的img图片URL链接, 也允许您创建具有不同image field的NFTs类别 221 | // 222 | //数据是分层的json 223 | //value: 来自idata或mdata field, 将用作 224 | //所有类别NFTs的主要图像 225 | 226 | } 227 | ``` 228 | 229 | --- 230 | 231 | ## 委托 232 | ``` 233 | delegates{ 234 | 235 | uint64_t assetid; // 提供用于claim的资产ID; 236 | name owner; // 资产所有者; 237 | name delegatedto; // claim该资产者; 238 | uint64_t cdate; // 提供创建日期; 239 | uint64_t period; // 借出资产时间(以秒为单位),借出人不可取消,直到期限到期 240 | // 期限到期,但接收方可随时转回 241 | string memo; // 合约参数备忘录,最长64字节 242 | 243 | } 244 | ``` 245 | 246 | --- 247 | 248 | ## 货币统计(可替代代币) 249 | ``` 250 | stat { 251 | 252 | asset supply; // 提供代币 253 | asset max_supply; // 提供最大量代币 254 | name issuer; // 可替代代币(Fungible token)创建者 255 | uint64_t id; // 此代币的唯一ID 256 | bool authorctrl; // 如果 true(1)允许代币创建者(而不仅仅是所有者)进行烧录和传输 257 | string data; // 字符串化的json。 建议的keys包括: img,name 258 | 259 | } 260 | ``` 261 | 262 | --- 263 | 264 | ## 账户(可替代代币) 265 | ``` 266 | accounts { 267 | 268 | uint64_t id; // 代币ID,来自 stat 表 269 | name author; // 代币创建者 270 | asset balance; // 代币余额 271 | 272 | } 273 | ``` 274 | 275 | ``` 276 | offerfs { 277 | 278 | uint64_t id; // claim 此 offer 的ID(自动递增) 279 | 280 | name author; // 可替代代币(fungible token)创建者 281 | name owner; // 可替代代币(fungible token)所有者 282 | asset quantity; // 资产数量 283 | name offeredto; // 可以 claim 此 offer 的帐户 284 | uint64_t cdate; // offer创建日期 285 | 286 | } 287 | ``` 288 | 289 | --- 290 | 291 | ## NTT 292 | ``` 293 | snttassets { 294 | uint64_t id; // NTT id 用于 claim 或 burn; 295 | name owner; // 资产所有者 (可变 - 基于所有者!!!); 296 | name author; // 资产创建者 (游戏合约, 不可变); 297 | name category; // 资产类别, 有创建者选择, 不可变; 298 | string idata; // 不可变资产数据. 可以是 JSON 字符串化或只是 sha256 字符串; 299 | string mdata; // 可变资产数据, 有创建者创建或更新资产时添加 300 | // 可以是 JSON 字符串化或只是 sha256 字符串; 301 | } 302 | ``` 303 | 304 | ``` 305 | nttoffers { 306 | uint64_t id; // 用于 claim 的 offer id (自动递增) 307 | name author; // ft 创建者 308 | name owner; // ft 所有者 309 | asset quantity; // 数量 310 | name offeredto; // 可以 claim the offer 的账户 311 | uint64_t cdate; // offer 的创建日期 312 | } 313 | ``` 314 | ## More Data 315 | ``` 316 | moredata{ 317 | uint64_t id; // id of the more data 318 | name author; // author of the more data 319 | string data; // more data 320 | } 321 | ``` 322 | --- 323 | # 示例:如何在智能合约中使用简单资产 324 | 325 | ## 创建资产并转移到所有者帐户ownerowner22: 326 | ``` 327 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 328 | name author = get_self(); 329 | name category = "weapon"_n; 330 | name owner = "ownerowner22"_n; 331 | 332 | string idata = "{\\"power\\": 10, \\"speed\\": 2.2, \\"name\\": \\"Magic 333 | Sword\\" }"; 334 | 335 | string mdata = "{\\"color\\": \\"bluegold\\", \\"level\\": 3, \\"stamina\\": 5, 336 | \\"img\\": \\"https://bit.ly/2MYh8EA\\" }"; 337 | 338 | action createAsset = action( 339 | permission_level{author, "active"_n}, 340 | SIMPLEASSETSCONTRACT, 341 | "create"_n, 342 | std::make_tuple( author, category, owner, idata, mdata, 0 ) 343 | 344 | ); 345 | 346 | createAsset.send(); 347 | ``` 348 | 349 | ## 使用ownerowner22的requireclaim选项创建资产: 350 | ``` 351 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 352 | name author = get_self(); 353 | name category = "balls"_n; 354 | name owner = "ownerowner22"_n; 355 | 356 | string idata = "{\\"radius\\": 2, \\"weigh\\": 5, \\"material\\": \\"rubber\\", 357 | \\"name\\": \\"Baseball\\" }"; 358 | 359 | string mdata = "{\\"color\\": \\"white\\", \\"decay\\": 99, \\"img\\": 360 | \\"https://i.imgur.com/QoTcosp.png\\" }"; 361 | 362 | action createAsset = action( 363 | permission_level{author, "active"_n}, 364 | SIMPLEASSETSCONTRACT, 365 | "create"_n, 366 | std::make_tuple( author, category, owner, idata, mdata, 1 ) 367 | 368 | ); 369 | 370 | createAsset.send(); 371 | ``` 372 | 373 | ## 搜索资产并获取资产信息 374 | 1. 请添加有关资产结构的hpp文件信息。 375 | ``` 376 | TABLE account { 377 | 378 | uint64_t id; 379 | name author; 380 | asset balance; 381 | uint64_t primary_key()const { 382 | return id; 383 | 384 | } 385 | 386 | }; 387 | 388 | typedef eosio::multi_index\< "accounts"_n, account \> accounts; 389 | 390 | TABLE sasset { 391 | 392 | uint64_t id; 393 | name owner; 394 | name author; 395 | name category; 396 | string idata; 397 | string mdata; 398 | std::vector\ container; 399 | std::vector\ containerf; 400 | auto primary_key() const { 401 | return id; 402 | 403 | } 404 | 405 | uint64_t by_author() const { 406 | 407 | return author.value; 408 | 409 | } 410 | 411 | }; 412 | 413 | typedef eosio::multi_index\< "sassets"_n, sasset, 414 | 415 | eosio::indexed_by\< "author"_n, eosio::const_mem_fun\ \> 417 | 418 | \> sassets; 419 | ``` 420 | 421 | 2. 搜索和使用信息 422 | ``` 423 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 424 | name author = get_self(); 425 | name owner = "lioninjungle"_n; 426 | uint64_t assetid = 100000000000187 427 | sassets assets(SIMPLEASSETSCONTRACT, owner.value); 428 | auto idx = assets.find(assetid); 429 | check(idx != assets.end(), "Asset not found or not yours"); 430 | check (idx-\>author == author, "Asset is not from this author"); 431 | auto idata = json::parse(idx-\>idata); // for parsing json here is used nlohmann 432 | lib 433 | auto mdata = json::parse(idx-\>mdata); // https://github.com/nlohmann/json 434 | check(mdata["cd"] \< now(), "Not ready yet for usage"); 435 | ``` 436 | 437 | ## 更新资产 438 | ``` 439 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 440 | auto mdata = json::parse(idxp-\>mdata); 441 | mdata["cd"] = now() + 84600; 442 | name author = get_self(); 443 | name owner = "ownerowner22"_n; 444 | uint64_t assetid = 100000000000187; 445 | action saUpdate = action( 446 | permission_level{author, "active"_n}, 447 | SIMPLEASSETSCONTRACT, 448 | "update"_n, 449 | std::make_tuple(author, owner, assetid, mdata.dump()) 450 | 451 | ); 452 | 453 | saUpdate.send(); 454 | ``` 455 | 456 | ## 将两个资产转移到具有相同备忘录的同一接收器 457 | ``` 458 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 459 | name author = get_self(); 460 | name from = "lioninjungle"_n; 461 | name to = "ohtigertiger"_n; 462 | std::vector\ assetids; 463 | assetids.push_back(assetid1); 464 | assetids.push_back(assetid2); 465 | string memo = "Transfer two asset" 466 | action saUpdate = action( 467 | permission_level{author, "active"_n}, 468 | SIMPLEASSETSCONTRACT, 469 | "transfer"_n, 470 | std::make_tuple(from, to, assetids, memo) 471 | ); 472 | 473 | saUpdate.send(); 474 | ``` 475 | 476 | ## issuef创建代币问题(可替代代币) 477 | ``` 478 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 479 | 480 | asset wood; 481 | wood.amount = 100; 482 | wood.symbol = symbol("WOOD", 0); 483 | 484 | name author = get_self(); 485 | name to = "lioninjungle"_n; 486 | 487 | std::string memo = "WOOD faucet"; 488 | action saRes1 = action( 489 | permission_level{author, "active"_n}, 490 | SIMPLEASSETSCONTRACT, 491 | "issuef"_n, 492 | std::make_tuple(to, author, wood, memo) 493 | ); 494 | saRes1.send(); 495 | ``` 496 | 497 | ## 如果启用了authorctrl,则由创建者转让代币(可替代) 498 | ``` 499 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 500 | 501 | asset wood; 502 | wood.amount = 20; 503 | wood.symbol = symbol("WOOD", 0); 504 | name from = "lioninjungle"_n; 505 | name to = get_self(); 506 | name author = get_self(); 507 | 508 | std::string memo = "best WOOD"; 509 | action saRes1 = action( 510 | permission_level{author, "active"_n}, 511 | SIMPLEASSETSCONTRACT, 512 | "transferf"_n, 513 | std::make_tuple(from, to, author, wood, memo) 514 | ); 515 | saRes1.send(); 516 | ``` 517 | 518 | ## 如果启用了authorctrl,则由创建者烧录代币(可替代) 519 | ``` 520 | name SIMPLEASSETSCONTRACT = "simpleassets"_n; 521 | 522 | asset wood; 523 | wood.amount = 20; 524 | wood.symbol = symbol("WOOD", 0); 525 | 526 | name author = get_self(); 527 | name from = "lioninjungle"_n; 528 | 529 | std::string memo = "WOOD for oven"; 530 | action saRes1 = action( 531 | permission_level{author, "active"_n}, 532 | SIMPLEASSETSCONTRACT, 533 | "burnf"_n, 534 | std::make_tuple(from, author, wood, memo) 535 | ); 536 | saRes1.send(); 537 | ``` 538 | 539 | --- 540 | # 更新日志 541 | 542 | ## 更新日志v1.5.2 543 | * 重新启用事件通知,执行如下操作: 544 | saeburn, saeclaim, saetransfer, saechauthor, saecreate. 545 | * 更改了通知的逻辑 546 | 如果需要将有关资产范围的变化通知给创建者的合约,请参考例子 547 | https://github.com/CryptoLions/SimpleAssets-EventReceiverExample 548 | 549 | --- 550 | ## 更新日志v1.5.1 551 | * 增加了burnlog, burnflog, burnnttlog 552 | * 增加了对集装器中附加资产的烧录的限制 553 | * 增加了对附加到委托资产的限制 554 | * 代码更新 555 | * SAE通知暂停使用 556 | 557 | --- 558 | ## 更新日志v1.5.0 559 | * 增加了将SimpleAssets.hpp添加或包含至其他项目中的可能性。这有助于技术开发人员轻松地将简单资产(Simple Assets)集成整合至其它合约中 560 | * 增加了技术开发人员功能sa_getnextid,用来轻松获取新创建资产的id 561 | * 增加了更多数据功能(actions mdremove, mdupdate, mdaddlog, mdadd)。这提供了一个简单资产列表,该列表可以存储NFTs的其它或者重复的信息,并且保持最小占用RAM 562 | 563 | --- 564 | ## 更新日志v1.4.1 565 | * 重命名"Author Registration"(创建者注册)中的字段和操作,以提高工作效率 566 | regauthor -> authorreg 567 | data -> dappinfo 568 | stemplate -> fieldtypes 569 | imgpriority -> priorityimg 570 | * 在自述文件中添加了"Author Registration"(创建者注册)文档 571 | 572 | --- 573 | ## 更新日志v1.4.0 574 | * 重新委托资产。(资产的借出人可以允许他们重新借出) 575 | * 在委托动作中添加了新的参数`bool reelegate`,它允许资产重新委托 576 | * 在表委托中添加了新的字段`bool reelegate`=>在自部署合约的情况下需要迁移! 577 | * 取消删除操作中的参数,已从中删除。 (在委托人表中可以找到借款人的身份) 578 | * 固定转移空资产数组 579 | * 错误消息已改进,更加清晰 580 | * 代码重构 581 | 582 | --- 583 | ## 更新日志v1.3.0 584 | * 使用最新的合约开发工具包(CDT v1.6.3)进行升级(解决了此编译问题 585 | * 次要代码重构 586 | 587 | --- 588 | ## 更新日志v1.2.0 589 | * 不可转让代币(NTTs)-新tables: snttassets 和 nttoffers 590 | * 新 NTT 操作: createntt, createnttlog, claimntt, updatentt, burnntt 591 | * 委托更多修复操作(感谢 cc32d9) 592 | * ricardian 合约更新 593 | * 为NTT添加外部逻辑测试 594 | 595 | --- 596 | ## 更新日志v1.1.3 597 | * ricardian 合约更新 598 | * 可替代代币报价问题修复 599 | 600 | --- 601 | ## 更新日志v1.1.2 602 | * 把`string imgpriority`字段添加至`sauthor`表以及`regauthor`和`authorupdate` 操作中 603 | * 重要信息:自我部署简单资产可能需要迁移 regauthor 表(如果使用) 604 | 605 | --- 606 | ## 更新日志v1.1.1 607 | * 优化 claim/transfer/burn 功能 608 | * 备注字段已添加至delegates表(这允许出租者/游戏创建不同类别的借入资产-例如高风险/低风险)。在进行delegate操作时,操作参数的备忘录将存储至此新字段。最多64字节 609 | * 为delegate备忘录添加三个新测试单元 610 | 611 | --- 612 | ## 更新日志v1.1.0 613 | * 代码重构 614 | * 修复了为委托和转让的NFTs的分离批量处理功能 615 | * 新合约允许延长借用NFT的委托期限 616 | * 增加了外部(bash)单元测试 617 | 618 | ## 更新日志v1.0.1 619 | * `createlog`操作中的新参数`requireclaim`,用于`create`操作历史记录日志 620 | 621 | --- 622 | ## 更新日志v1.0.0 623 | * 阻止所有者向自己提供资产 624 | 625 | --- 626 | ## 更新日志v0.4.2 627 | * `saeclaim`事项的格式已更改:由 map 替换asseti数组 628 | 629 | ## 更新日志v0.4.1 630 | * 添加了`require_recipient`(所有者)来执行`create`操作 631 | 632 | --- 633 | ## 更新日志v0.4.0 634 | 635 | **轻松找到可替代代币的信息(可替换代币有创建者范围):** 636 | * FT的`account`表中的新字段`author`(更容易找到可替代代币信息) 637 | 638 | **更多可替代代币信息** 639 | 640 | * 新领域`data`中`currency_stats`的表-字符串化JSON其中可能包括键 `img`,`name`(建议最好通过市场显示) 641 | * 新参数`data`在`createf`操作中 642 | * updatef改变FT的新举措data 643 | 644 | **提供/声明可替代的代币** 645 | 646 | * `sofferf`用于`offer` / `calim` FT的新表 647 | * 新的操作`ffer`,`cancelofferf` 和 `claimf` 648 | 对`closef`检查如果没有公开招股(内部) 649 | 650 | **集装资产** 651 | 652 | * nft资产结构中用于附加和分离其他NFT或FT的新字段`container`和`containerf` 653 | * 新操作`attach`,`detach` 654 | * 新操作`attachf`,`detach` 655 | 656 | **杂项** 657 | 658 | * 字段重命名`lasted`- >`lnftid`,`spare`- > `defid`(内部用法)在表 `global` 中 659 | * 字段 `providedTo` 在 `soffer` 表中重命名为 `offersto` 660 | 661 | --- 662 | ## 更新日志v0.3.2 663 | * 为操作`offer`添加了`memo`参数 664 | * 为操作`delegate`添加了`memo`参数 665 | 666 | --- 667 | ## 更新日志v0.3.1 668 | * 增加了NFT的内部操作`createlog`。由创建操作用于记录资产ID,以便第三方资源管理器可以轻松获取新的资产ID和其他信息。 669 | * 增加了新的单例表`tokenconfigs`。它有助于外部合约正确解析操作和表格(对于分散交换,市场和使用多个代币的其他合约有用)。市场,交易所和其他依赖合约将能够使用以下代码查看此信息。 670 | ``` 671 | Configs configs("simpleassets"_n, "simpleassets"_n.value); 672 | 673 | configs.get("simpleassets"_n); 674 | ``` 675 | * 增加了操作`updatever`。它为第三方钱包,市场等更新了SimpleAstes部署的版本; 676 | * 事件通知的新示例: https://github.com/CryptoLions/SimpleAssets-EventReceiverExample 677 | 678 | --- 679 | ## 更新日志v0.3.0 680 | * 使用延迟事务添加了事件通知。资产作者将收到有关资产创建,转移,索赔或烧录的通知。要收到它,请为您的创建者合约添加以下操作: 681 | ``` 682 | ACTION saecreate ( name owner, uint64_t assetid ); 683 | 684 | ACTION saetransfer ( name from, name to, std::vector\& assetids, 685 | std::string memo ); 686 | 687 | ACTION saeclaim ( name account, std::vector\& assetids ); 688 | 689 | ACTION saeburn ( name account, std::vector\& assetids, std::string 690 | memo ); 691 | ``` 692 | * `untildate`参数更改为`period`(以秒为单位)的操作`delegate`和表`sdelegates` 693 | 694 | --- 695 | ## 更新日志v0.2.0 696 | **使用eosio.token合约添加了可替代代币(Fungible Token)表和逻辑,但有一些更改** 697 | * 新的操作和逻辑:`createf`,`issuef`,`transfer`,`burnf`,`openf`,`closef` 698 | * 添加了新表 `stat(supply, max_supply, issuer, id) `和`accounts (id, balance)` 699 | * 统计表的范围(关于可替代代币的信息)已更改为创建者 700 | * `accountstable`的主索引是在`create f`操作上创建的 uniq id 并存储在 stats 表中。 701 | * 添加`createf`与 parameter 可替代代币操作`authorctrl` 至`stats`表。如果为true(1)允许代币创建者(而不仅仅是所有者)使用burnf和transferf。创建后无法更改! 702 | * 李嘉图合约已更新 703 | * 以下有更多用法示例 704 | 705 | --- 706 | ## 更新日志v0.1.1 707 | **杂项** 708 | * sdelagate 表结构重命名为 sdelegate(typo) 709 | * 创建操作参数重命名:requireClaim - > requireclaim 710 | * assetID操作参数在所有要声明的操作中重命名 711 | 712 | **借入资产** 713 | * sdelegate表 - 添加了新字段:untildate 714 | * 委托操作添加参数untildate。如果参数输入正确(零或将来),操作会进行简单检查。 715 | * undelegate在不公开之前不会工作(这保证了资产贷款的最低期限)。 716 | * 如果被委托,允许转移资产(返还)早于截至时间(借款人可以提前返还) 717 | 718 | **批量处理** 719 | * 声明操作(claim action):assetid参数已更改为assetsids数组。添加了多个声明逻辑 720 | * 报价操作(offer action):assetid参数已更改为assetsids数组。添加了多个提供逻辑 721 | * 取消报价操作(canceloffer action):assetid参数已更改为assetsids数组。添加了多个取消逻辑 722 | * 传输操作(transfer action):assetid参数已更改为assetsids数组。添加了多个资产转移逻辑。 723 | * 烧录操作(burn action):assetid参数已更改为assetsids数组。添加了多个刻录逻辑。 724 | * 委托/非委托操作(delegate / undelegated action):assetid参数已更改为assetsids数组。添加了多个委托/取消授权逻辑。 725 | -------------------------------------------------------------------------------- /build.sh: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | ########################################################################################### 3 | ########################################################################################### 4 | ## 5 | ## SimpleAssets (Digital Assets) 6 | ## (C) 2019 by CryptoLions [ https://CryptoLions.io ] 7 | ## 8 | ## A simple standard for digital assets (ie. Non-Fungible Tokens) for EOSIO blockchains 9 | ## 10 | ## WebSite: https://simpleassets.io 11 | ## GitHub: https://github.com/CryptoLions/SimpleAssets. 12 | ## Presentation: https://medium.com/@cryptolions/introducing-simple-assets-b4e17caafaa4 13 | ## 14 | ########################################################################################### 15 | ########################################################################################### 16 | 17 | 18 | rm -r ./build/ 19 | printf "\t=========== Building SimpleAssets Contract [by CryptoLions.io] ===========\n\n" 20 | 21 | RED='\033[0;31m' 22 | NC='\033[0m' 23 | 24 | CORES=`getconf _NPROCESSORS_ONLN` 25 | mkdir -p build 26 | pushd build &> /dev/null 27 | cmake ../ 28 | #exit 29 | make -j${CORES} 30 | popd &> /dev/null 31 | 32 | cat << "EOF" 33 |                             ':,                                              34 |                            ,ccc;                                             35 |                          .:cccccc.                                           36 |                         ,ccccccccc;                                          37 |                       .:cccccccccccc.                                        38 |                      ,ccccccccccccccc;     ......                            39 |                    .:cccccccccccccccccccccccccc:.  .                         40 |                   ,ccccccccccccccccccccccccccc'..;ccc'                       41 |                 .:ccccccccccccccccccccccccccccccccccccc:::::'                42 |                ,cccccccccccccccccccccccccccccccccccoxkkO0xcccc.              43 |              .:cccccclolccccccccccccldlccccclxdcccccldxOMMXdccc.             44 |             'ccccccclNMMWNkdolcccco0WMMXOdd0WMMNOoccccccdWM0ccc.             45 |           .:cccccccc0MMMMkccccccdKMMMMMMMMMMMMMMMMXklccccxMdccc.             46 |          'cccccccccoMMMMNdccclxXMMMMMMMMMMMMMMMWWNNNXklcccxcccc,             47 |        .:ccccccccccckWMMMMXxOWMMWOkkkkkWMMMMMMMNdcccccccccccllll,            48 |       'ccccccccccccccdWMMMMMMMMMMWxllccoNMMMMMMMMKooxxxdlllllllll;           49 |      ;cccccccccccccckWMMMMMWWMMMMMMMMWNKOWMMMMMMMMW0MMMkllllllllll;          50 |    'cccccccccccccclKMMMMMMNodWMMMMMMMMMMMMXKKKKKKKKKKNXlllllllllll:          51 |   ;ccccccccccccccdNMMMMMMXlccoNMMMMMMMMMMMOlllllllllllllllllllllll:          52 | .cccccccccccccclOMMMMMMMKlccccoNMMMMMMMMMMMMNKolllllO0Okllllllllll:          53 | 'cccccccccccccoNMMMMMMMOlcccccclddddxNMMMMMMMMWxlllKMMMMolllllllll:          54 | 'cccccccccccckWMMMMMMMkcccccclllllllllOWMMMMMMMNolo0WMMNllllllllll:          55 | 'cccccccccclKMMMMMMMWdcccloO0lllllllllloKMMMMKxlllllokNKllllllllll:          56 | 'cccccccccxWMMMMMMMNolllkXMMMdlllllllllllxXOolokkkdlllllllllllllll:          57 | 'cccccccl0MMMMMMMMXllxKMMMMMM0llllllllllllllo0MMMWolllllllllllllll:          58 | 'ccccccdNMMMMMMMM0d0WMMMMMMMMWollllllllllllo00000xlllllllllllllllll.         59 | 'cccclOMMMMMMMMMWNMMMMMMMMMMMMklllllllllllllllllllllllllllllllllllll:.       60 | 'clloXMMMMMMMMMMMMMMMMMMMMMMMMXlllllllllllllllllllllllllllllllllllllll,      61 | 'llxWMMMMMMMMMMMMMMMMMMMMMMMMMMdlllllllllllxxllllllllllllllllllllllllllc.    62 | 'l0MMMMMMMMMMMMMMMMMMMMMMMMMMMMKlllllllld0WMWolllllllllllllllllllllllllll;   63 | :NMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMolllllkXMMMMMKlllllllllllllllllllllllllllll. 64 | dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOlld0WMMMMMMMMxllllllllllllllllllllllllllll. 65 | dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMNkXMMMMMMMMMMMNolllllllllllllllllllllllllll. 66 | dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMOlllllllllllllllllllllllllll. 67 | dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWdllllllllllllllllllllllllll. 68 | dMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMXllllllllllllllllllllllllll. 69 | lXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXoccccccccccccccccccccccccc. 70 | _____ _ _ _ _ 71 | / ____| | | | | (_) (_) 72 | | | _ __ _ _ _ __ | |_ ___ | | _ ___ _ __ ___ _ ___ 73 | | | | '__| | | | '_ \| __/ _ \| | | |/ _ \| '_ \/ __| | |/ _ \ 74 | | |____| | | |_| | |_) | || (_) | |____| | (_) | | | \__ \_| | (_) | 75 | \_____|_| \__, | .__/ \__\___/|______|_|\___/|_| |_|___(_)_|\___/ 76 | __/ | | 77 | |___/|_| 78 | EOF 79 | 80 | -------------------------------------------------------------------------------- /build/SimpleAssets/SimpleAssets.wasm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CryptoLions/SimpleAssets/e6a042f75256008edf38c73cc55f6499fc306a7a/build/SimpleAssets/SimpleAssets.wasm -------------------------------------------------------------------------------- /include/backtoken.hpp: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace eosio; 9 | using namespace std; 10 | 11 | class[[eosio::contract("backtoken")]] backtoken : public contract{ 12 | public: 13 | using contract::contract; 14 | struct symbol_ex; 15 | struct token_ex; 16 | 17 | backtoken(name receiver, name code, datastream ds) 18 | : contract(receiver, code, ds) {} 19 | 20 | ACTION tokenprep(name owner, uint64_t nft_id, const vector& symbols); 21 | using tokenprep_action = action_wrapper< "tokenprep"_n, &backtoken::tokenprep >; 22 | #ifdef DEBUG 23 | ACTION delbtoken(uint64_t nft_id); 24 | using delbtoken_action = action_wrapper< "delbtoken"_n, &backtoken::delbtoken >; 25 | #endif 26 | 27 | ACTION onburn(name owner, uint64_t nft_id); 28 | using onburn_action = action_wrapper< "onburn"_n, &backtoken::onburn >; 29 | 30 | ACTION getversion(); 31 | using getversion_action = action_wrapper<"getversion"_n, &backtoken::getversion>; 32 | 33 | [[eosio::on_notify("simpleassets::transfer")]] void ontransfersa(name from, name to, vector& assetids, string memo); 34 | [[eosio::on_notify("*::transfer")]] void ontransfer(name from, name to, asset quantity, string memo); 35 | [[eosio::on_notify("simpleassets::transferf")]] void ontransferf(name from, name to, name author, asset quantity, string memo); 36 | 37 | void send_tokens(name owner, const vector& tokens, string memo); 38 | void process_memo(name from, name to, const vector & tokens, const string& memo); 39 | 40 | public: 41 | enum token_type { SA_NFT = 0, SA_FT = 1, TOKEN = 2 }; 42 | 43 | typedef uint64_t token_type_t; 44 | 45 | struct symbol_ex 46 | { 47 | extended_symbol symbol_ex; 48 | token_type_t token_type; 49 | 50 | name get_contract() const 51 | { 52 | return symbol_ex.get_contract(); 53 | } 54 | 55 | symbol get_symbol() const 56 | { 57 | return symbol_ex.get_symbol(); 58 | } 59 | }; 60 | 61 | struct token_ex 62 | { 63 | uint64_t token_id; 64 | extended_asset quantity_ex; 65 | token_type_t token_type; 66 | 67 | symbol get_symbol() const 68 | { 69 | return quantity_ex.quantity.symbol; 70 | } 71 | 72 | bool is_token_valid() const 73 | { 74 | return token_id != 0; 75 | } 76 | 77 | uint64_t get_amount() const 78 | { 79 | return quantity_ex.quantity.amount; 80 | } 81 | 82 | asset get_quantity() const 83 | { 84 | return quantity_ex.quantity; 85 | } 86 | 87 | name get_contract() const 88 | { 89 | return quantity_ex.contract; 90 | } 91 | 92 | bool operator==(token_ex const & rhs) const 93 | { 94 | auto result = false; 95 | if (this->token_type == rhs.token_type) 96 | { 97 | if (this->is_nft()) 98 | { 99 | result = this->token_id == rhs.token_id; 100 | } 101 | else if (this->is_ft() || this->is_token()) 102 | { 103 | result = this->get_contract() == rhs.get_contract() && this->get_quantity() == rhs.get_quantity(); 104 | } 105 | } 106 | return result; 107 | } 108 | 109 | void prepare_tokenex(const symbol_ex& sym) 110 | { 111 | switch (sym.token_type) 112 | { 113 | case SA_NFT: 114 | { 115 | set_nft(0); 116 | break; 117 | } 118 | case SA_FT: 119 | { 120 | extended_asset ext_asset{ 0, sym.symbol_ex }; 121 | set_ft(ext_asset); 122 | break; 123 | } 124 | case TOKEN: 125 | { 126 | extended_asset ext_asset{ 0, sym.symbol_ex }; 127 | set_token(ext_asset); 128 | break; 129 | } 130 | } 131 | } 132 | 133 | void set_token(extended_asset token_quantity_ex) 134 | { 135 | token_id = 0; 136 | token_type = TOKEN; 137 | quantity_ex = token_quantity_ex; 138 | } 139 | 140 | void set_token(name contract, asset quantity) 141 | { 142 | token_id = 0; 143 | token_type = TOKEN; 144 | quantity_ex.contract = contract; 145 | quantity_ex.quantity = quantity; 146 | } 147 | 148 | void set_ft(extended_asset ft_quantity_ex) 149 | { 150 | token_id = 0; 151 | token_type = SA_FT; 152 | quantity_ex = ft_quantity_ex; 153 | } 154 | 155 | void set_ft(name ft_author, asset ft_quantity) 156 | { 157 | token_id = 0; 158 | token_type = SA_FT; 159 | quantity_ex.contract = ft_author; 160 | quantity_ex.quantity = ft_quantity; 161 | } 162 | 163 | void set_nft(uint64_t tokenid) 164 | { 165 | token_id = tokenid; 166 | token_type = SA_NFT; 167 | quantity_ex = extended_asset(); 168 | } 169 | 170 | bool is_ft() const 171 | { 172 | return (token_type == SA_FT); 173 | } 174 | 175 | bool is_token() const 176 | { 177 | return (token_type == TOKEN); 178 | } 179 | 180 | bool is_nft() const 181 | { 182 | return (token_type == SA_NFT); 183 | } 184 | 185 | string to_print_type() const 186 | { 187 | string result; 188 | switch (token_type) 189 | { 190 | case SA_NFT: 191 | { 192 | result = "SA_NFT"; 193 | break; 194 | } 195 | case SA_FT: 196 | { 197 | result = "SA_FT"; 198 | break; 199 | } 200 | case TOKEN: 201 | { 202 | result = "TOKEN"; 203 | break; 204 | } 205 | } 206 | return result; 207 | } 208 | 209 | static vector token_to_tokenexs(name author, asset quantity) { 210 | 211 | vector result; 212 | token_ex token; 213 | token.set_token(author, quantity); 214 | result.emplace_back(token); 215 | 216 | return result; 217 | } 218 | 219 | static vector ft_to_tokenexs(name author, asset quantity) { 220 | 221 | vector result; 222 | token_ex token; 223 | token.set_ft(author, quantity); 224 | result.emplace_back(token); 225 | 226 | return result; 227 | } 228 | 229 | static vector nfts_to_tokenexs(vector& assetids) { 230 | vector result; 231 | 232 | for (auto i = 0; i < assetids.size(); i++) { 233 | token_ex token; 234 | token.set_nft(assetids[i]); 235 | result.emplace_back(token); 236 | } 237 | 238 | return result; 239 | } 240 | 241 | }; 242 | 243 | /* 244 | * Back token table 245 | */ 246 | TABLE sbacktoken{ 247 | uint64_t nft_id; 248 | vector tokens; 249 | 250 | auto primary_key() const { 251 | return nft_id; 252 | } 253 | 254 | void prepare_tokens(const vector& symbols) 255 | { 256 | for (auto it_symbol_ex = symbols.begin(); it_symbol_ex != symbols.end(); it_symbol_ex++) 257 | { 258 | const auto& it = find_if(tokens.begin(), tokens.end(), 259 | [&](const token_ex& one_token) { return one_token.get_contract() == it_symbol_ex->get_contract() 260 | && one_token.get_symbol() == it_symbol_ex->get_symbol() 261 | && one_token.token_type == it_symbol_ex->token_type; }); 262 | 263 | if (it == tokens.end()){ 264 | token_ex tkn; 265 | tkn.prepare_tokenex(*it_symbol_ex); 266 | tokens.emplace_back(tkn); 267 | } 268 | } 269 | } 270 | 271 | void append_token(const token_ex& token) 272 | { 273 | if (token.token_type == SA_FT || token.token_type == TOKEN) 274 | { 275 | const auto author = token.quantity_ex.contract; 276 | const auto symbol = token.quantity_ex.quantity.symbol; 277 | const auto token_type = token.token_type; 278 | 279 | const auto& it = find_if(tokens.begin(), tokens.end(), 280 | [&](const token_ex& one_token) { return one_token.quantity_ex.contract == author 281 | && one_token.get_symbol() == symbol 282 | && one_token.token_type == token_type; }); 283 | 284 | if (it != tokens.end()) 285 | { 286 | it->quantity_ex.quantity.amount += token.quantity_ex.quantity.amount; 287 | } 288 | else 289 | { 290 | check(false, 291 | "Prepare tokens before append. Tokenex for contract: " + author.to_string() 292 | + " symbol : " + symbol.code().to_string() + " type : " + token.to_print_type() + " does not exist "); 293 | } 294 | 295 | } 296 | else if (token.token_type == SA_NFT) 297 | { 298 | const auto contract = token.quantity_ex.contract; 299 | const auto token_type = token.token_type; 300 | 301 | const auto& it = find_if(tokens.begin(), tokens.end(), 302 | [&](const token_ex& one_token) { return one_token.get_contract() == contract 303 | && one_token.token_id == 0 304 | && one_token.token_type == token_type; }); 305 | 306 | if (it != tokens.end()) 307 | { 308 | it->token_id = token.token_id; 309 | } 310 | else 311 | { 312 | check(false, "Prepare tokens before append. Token with type SA_NFT and token_id = 0 does no exist"); 313 | } 314 | } 315 | } 316 | 317 | void append_tokens(const vector& append_tokens) 318 | { 319 | for (auto it_append_token = append_tokens.begin(); it_append_token != append_tokens.end(); it_append_token++) 320 | { 321 | append_token(*it_append_token); 322 | } 323 | } 324 | 325 | }; 326 | typedef eosio::multi_index< "backtokens"_n, sbacktoken > backtokens; 327 | 328 | backtokens backtokent = { _self, _self.value }; 329 | 330 | }; -------------------------------------------------------------------------------- /ricardian/SimpleAssets.clauses.md: -------------------------------------------------------------------------------- 1 |

Warranty

2 | The invoker of the contract action shall uphold its Obligations under this Contract in a timely and workmanlike manner, using knowledge and recommendations for performing the services which meet generally acceptable standards set forth by EOS.IO Blockchain Block Producers. 3 | 4 |

Default

5 | The occurrence of any of the following shall constitute a material default under this Contract: 6 | 7 |

Remedies

8 | In addition to any and all other rights a party may have available according to law, if a party defaults by failing to substantially perform any provision, term or condition of this Contract, the other party may terminate the Contract by providing written notice to the defaulting party. This notice shall describe with sufficient detail the nature of the default. The party receiving such notice shall promptly be removed from being a Block Producer and this Contract shall be automatically terminated. 9 | 10 |

ForceMajeure

11 | If performance of this Contract or any obligation under this Contract is prevented, restricted, or interfered with by causes beyond either party's reasonable control ("Force Majeure"), and if the party unable to carry out its obligations gives the other party prompt written notice of such event, then the obligations of the party invoking this provision shall be suspended to the extent necessary by such event. The term Force Majeure shall include, without limitation, acts of God, fire, explosion, vandalism, storm or other similar occurrence, orders or acts of military or civil authority, or by national emergencies, insurrections, riots, or wars, or strikes, lock-outs, work stoppages, or supplier failures. The excused party shall use reasonable efforts under the circumstances to avoid or remove such causes of non-performance and shall proceed to perform with reasonable dispatch whenever such causes are removed or ceased. An act or omission shall be deemed within the reasonable control of a party if committed, omitted, or caused by such party, or its employees, officers, agents, or affiliates. 12 | 13 |

DisputeResolution

14 | Any controversies or disputes arising out of or relating to this Contract will be resolved by binding arbitration under the default rules set forth by the EOS.IO Blockchain. The arbitrator's award will be final, and judgment may be entered upon it by any court having proper jurisdiction. 15 | 16 |

EntireAgreement

17 | This Contract contains the entire agreement of the parties, and there are no other promises or conditions in any other agreement whether oral or written concerning the subject matter of this Contract. This Contract supersedes any prior written or oral agreements between the parties. 18 | 19 |

Severability

20 | If any provision of this Contract will be held to be invalid or unenforceable for any reason, the remaining provisions will continue to be valid and enforceable. If a court finds that any provision of this Contract is invalid or unenforceable, but that by limiting such provision it would become valid and enforceable, then such provision will be deemed to be written, construed, and enforced as so limited. 21 | 22 |

Amendment

23 | This Contract may be modified or amended in writing by mutual agreement between the parties, if the writing is signed by the party obligated under the amendment. 24 | 25 |

GoverningLaw

26 | This Contract shall be construed in accordance with the Maxims of Equity. 27 | 28 |

Notice

29 | Any notice or communication required or permitted under this Contract shall be sufficiently given if delivered to a verifiable email address or to such other email address as one party may have publicly furnished in writing, or published on a broadcast contract provided by this blockchain for purposes of providing notices of this type. 30 | 31 |

WaiverOfContractualRight

32 | The failure of either party to enforce any provision of this Contract shall not be construed as a waiver or limitation of that party's right to subsequently enforce and compel strict compliance with every provision of this Contract. 33 | 34 |

ArbitratorsFees_

35 | In any action arising hereunder or any separate action pertaining to the validity of this Agreement, both sides shall pay half the initial cost of arbitration, and the prevailing party shall be awarded reasonable arbitrator's fees and costs. 36 | 37 |

ConstructionAndInterpretation

38 | The rule requiring construction or interpretation against the drafter is waived. The document shall be deemed as if it were drafted by both parties in a mutual effort. 39 | 40 |

InWitnessWhereof

41 | In witness whereof, the parties hereto have caused this Agreement to be executed by themselves or their duly authorized representatives as of the date of execution, and authorized as proven by the cryptographic signature on the transaction that invokes this contract. 42 | 43 | 44 | -------------------------------------------------------------------------------- /ricardian/SimpleAssets.contracts.md: -------------------------------------------------------------------------------- 1 |

authorreg

2 | 3 | --- 4 | spec_version: 0.0.2 5 | title: New Author registration 6 | summary: New Author registration 7 | icon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e 8 | --- 9 | 10 | Action is not mandatory. Markets *may* choose to use information here to display info about the author, and to follow specifications expressed here for displaying asset fields. 11 | 12 | Input parameters: 13 | `author` - authors account who will create assets; 14 | `dappinfo` - stringified json. Recommendations to include: game, company, logo, url, desc; 15 | `fieldtypes` - stringified json with key:state values, where key is key from mdata or idata and 16 | state indicates recommended way of displaying field: 17 | url, img, webgl, mp3, video, hide (ie. don't display), etc. 18 | `priorityimg` - json with assosiation category with type of image or video 19 | txt - text (default) 20 | url - show as clickable URL 21 | img - link to img file 22 | webgl - link to webgl file 23 | mp3 - link to mp3 file 24 | video - link to video file 25 | hide - do not show 26 | imgb - image as string in binary format 27 | webglb - webgl binary 28 | mp3b - mp3 binary 29 | videob - video binary 30 | 31 | 32 | TERM 33 | This Contract expires at the conclusion of code execution. 34 | by CryptoLions [ https://cryptolions.io ] 35 | 36 |

authorupdate

37 | 38 | --- 39 | spec_version: 0.0.2 40 | title: Authors info update 41 | summary: Authors info update 42 | icon: https://cryptolions.io/assets/images/sa-icons-256/authorupdate.png#0b11c9c4e41b6ba1b00bd907c671f7ddc9e2f9caf26580f0b2e7c73e02f36ff3 43 | --- 44 | 45 | Used to updated author information, and asset display recommendations created with the authorreg action. This action replaces the fields dappinfo and fieldtypes. To remove author entry, call this action with null strings for dappinfo and fieldtypes. 46 | 47 | Input parameters: 48 | `author` - authors account who will create assets; 49 | `dappinfo` - stringified json. Recommendations to include: game, company, logo, url, desc; 50 | `fieldtypes` - stringified json with key:state values, where key is key from mdata or idata and 51 | state indicates recommended way of displaying field: 52 | url, img, webgl, mp3, video, hide (ie. don't display), etc. 53 | `priorityimg` - json with assosiation category with type of image or video 54 | txt - text (default) 55 | url - show as clickable URL 56 | img - link to img file 57 | webgl - link to webgl file 58 | mp3 - link to mp3 file 59 | video - link to video file 60 | hide - do not show 61 | imgb - image as string in binary format 62 | webglb - webgl binary 63 | mp3b - mp3 binary 64 | videob - video binary 65 | 66 | TERM 67 | This Contract expires at the conclusion of code execution. 68 | by CryptoLions [ https://cryptolions.io ] 69 | 70 |

changeauthor

71 | 72 | --- 73 | spec_version: 0.0.2 74 | title: Change author of assets 75 | summary: Change author of assets 76 | icon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e 77 | --- 78 | 79 | Input parameters: 80 | `author` - asset's author, who will able to change author name asset's; 81 | `newauthor` - asset's new author name; 82 | `owner` - assets owner; 83 | `assetids` - array of assetid's 84 | 85 | TERM 86 | This Contract expires at the conclusion of code execution. 87 | by CryptoLions [ https://cryptolions.io ] 88 | 89 |

create

90 | 91 | --- 92 | spec_version: 0.0.2 93 | title: Create a new asset 94 | summary: Create a new asset 95 | icon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70 96 | --- 97 | 98 | Input parameters: 99 | `author` - asset's author, who will able to updated asset's mdata; 100 | `category` - assets category; 101 | `owner` - assets owner; 102 | `idata` - stringified json with immutable assets data 103 | `mdata` - stringified json with mutable assets data, can be changed only by author 104 | `requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but 105 | but AUTHOR'S memory will be used until the asset is transferred again). If enabled, 106 | author will remain the owner, but an offer will be created for the account specified in 107 | the owner field to claim the asset using the account's RAM. 108 | 109 | TERM 110 | This Contract expires at the conclusion of code execution. 111 | by CryptoLions [ https://cryptolions.io ] 112 | 113 |

claim

114 | 115 | --- 116 | spec_version: 0.0.2 117 | title: Claim the specified asset 118 | summary: Claim the specified asset (assuming it was offered to claimer by the asset owner) 119 | icon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d 120 | --- 121 | 122 | Input parameters: 123 | `claimer` - account claiming the asset 124 | `assetids` - array of assetid's to claim 125 | 126 | TERM 127 | This Contract expires at the conclusion of code execution. 128 | by CryptoLions [ https://cryptolions.io ] 129 | 130 |

transfer

131 | 132 | --- 133 | spec_version: 0.0.2 134 | title: This actions transfers an asset 135 | summary: This actions transfers an asset 136 | icon: https://cryptolions.io/assets/images/sa-icons-256/transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf 137 | --- 138 | 139 | On transfer owner asset's and scope asset's changes to {{to}}'s. Senders RAM will be charged to transfer asset. Transfer will fail if asset is offered for claim or is delegated. 140 | 141 | Input parameters: 142 | `from` - account who sends the asset; 143 | `to` - account of receiver; 144 | `assetids` - array of assetid's to transfer; 145 | `memo` - transfers comment; 146 | 147 | TERM 148 | This Contract expires at the conclusion of code execution. 149 | by CryptoLions [ https://cryptolions.io ] 150 | 151 |

update

152 | 153 | --- 154 | spec_version: 0.0.2 155 | title: Update assets mutable data 156 | summary: Update assets mutable data (mdata) field. Action is available only for authors 157 | icon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e 158 | --- 159 | 160 | Input parameters: 161 | `author` - authors account; 162 | `owner` - current assets owner; 163 | `assetid` - assetid to update; 164 | `mdata` - stringified json with mutable assets data. All mdata will be replaced; 165 | 166 | TERM 167 | This Contract expires at the conclusion of code execution. 168 | by CryptoLions [ https://cryptolions.io ] 169 | 170 |

offer

171 | 172 | --- 173 | spec_version: 0.0.2 174 | title: Offer asset for claim 175 | summary: Offer asset for claim 176 | icon: https://cryptolions.io/assets/images/sa-icons-256/offer.png#4aea6612c87df6cde081689f861b55ddba2c277cc553f4faeb65a4cb26656c66 177 | --- 178 | 179 | This is an alternative to the transfer action. Offer can be used by an asset owner to transfer the asset without using their RAM. After an offer is made, the account specified in {{newowner}} is able to make a claim, and take control of the asset using their RAM. Offer action is not available if an asste is delegated (borrowed). 180 | 181 | Input parameters: 182 | `owner` - current asset owner account; 183 | `newowner` - new asset owner, who will able to claim; 184 | `assetids` - array of assetid's to offer; 185 | `memo` - memo for offer action 186 | 187 | TERM 188 | This Contract expires at the conclusion of code execution. 189 | by CryptoLions [ https://cryptolions.io ] 190 | 191 |

canceloffer

192 | 193 | --- 194 | spec_version: 0.0.2 195 | title: Cancel and remove offer 196 | summary: Cancel and remove offer. Available for the asset owner 197 | icon: https://cryptolions.io/assets/images/sa-icons-256/canceloffer.png#83328bae49f18f0aeca6d04c2e3003e49637a462b44a492d3439a9c44724a654 198 | --- 199 | 200 | Input parameters: 201 | `owner` - current asset owner account; 202 | `assetids` - array of assetid's to cancel offer; 203 | 204 | TERM 205 | This Contract expires at the conclusion of code execution. 206 | by CryptoLions [ https://cryptolions.io ] 207 | 208 |

burn

209 | 210 | --- 211 | spec_version: 0.0.2 212 | title: Burn asset 213 | summary: Burn asset 214 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 215 | --- 216 | 217 | This action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released. 218 | 219 | Input parameters: 220 | `owner` - current asset owner account; 221 | `assetids` - array of assetid's to burn; 222 | `memo` - memo for burn action; 223 | 224 | TERM 225 | This Contract expires at the conclusion of code execution. 226 | by CryptoLions [ https://cryptolions.io ] 227 | 228 |

delegatemore

229 | 230 | --- 231 | spec_version: 0.0.2 232 | title: Extend period of delegating of asset 233 | summary: Extend period of delegating of asset 234 | icon: https://cryptolions.io/assets/images/sa-icons-256/delegate_more.png#6d1f7319569e3780e25cfb717d83f4ad58c91c0890ab234f106d1593956dfd10 235 | --- 236 | 237 | Input parameters: 238 | `owner` - current asset owner account; 239 | `assetidc` - assetid to delegate; 240 | `period` - time in seconds that the asset will be lent. Lender cannot undelegate until 241 | the period expires, however the receiver can transfer back at any time. 242 | 243 | TERM 244 | This Contract expires at the conclusion of code execution. 245 | by CryptoLions [ https://cryptolions.io ] 246 | 247 |

delegate

248 | 249 | --- 250 | spec_version: 0.0.2 251 | title: Delegates asset 252 | summary: Delegates asset 253 | icon: https://cryptolions.io/assets/images/sa-icons-256/delegate.png#f8d91c1b9c0f376464e69aadf41142a17492af1e75d394601872b6a992b420bc 254 | --- 255 | 256 | This action changes the asset owner by calling the transfer action. It also adds a record in the delegates table to record the asset as borrowed. This block the asset from all owner actions (transfers, offers, burning by borrower). 257 | 258 | Input parameters: 259 | `owner` - current asset owner account; 260 | `to` - borrower account name; 261 | `assetids` - array of assetid's to delegate; 262 | `period` - time in seconds that the asset will be lent. Lender cannot undelegate until 263 | the period expires, however the receiver can transfer back at any time; 264 | `memo` - memo for delegate action; 265 | `autoreturn`- automatic return for delegated action; 266 | 267 | TERM 268 | This Contract expires at the conclusion of code execution. 269 | by CryptoLions [ https://cryptolions.io ] 270 | 271 |

undelegate

272 | 273 | --- 274 | spec_version: 0.0.2 275 | title: Undelegates an asset 276 | summary: Undelegates an asset 277 | icon: https://cryptolions.io/assets/images/sa-icons-256/updatef.png#f5d5af2ed6af508777f9f0b3c3a8e24b61eeca2ea623cfec6f6d0e9ea2c4d1a7 278 | --- 279 | 280 | Executing action by real owner will return asset immediately, and the entry in the delegates table recording the borrowing will be erased. 281 | 282 | Input parameters: 283 | `owner` - real asset owner account; 284 | `from` - current account owner (borrower); 285 | `assetids` - array of assetid's to undelegate; 286 | 287 | TERM 288 | This Contract expires at the conclusion of code execution. 289 | by CryptoLions [ https://cryptolions.io ] 290 | 291 |

createf

292 | 293 | --- 294 | spec_version: 0.0.2 295 | title: Creates fungible token 296 | summary: Creates fungible token 297 | icon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30 298 | --- 299 | 300 | Creates fungible token with specified maximum supply; You can not change anything after creation. 301 | 302 | Input parameters: 303 | `author` - fungible token author; 304 | `maximum_supply` - maximum token supply, example "10000000.0000 GOLD", "10000000 SEED", "100000000.00 WOOD". Precision is also important here; 305 | `authorctrl` - if true(1) allow token author (and not just owner) to burnf and transferf. Cannot be changed after creation! 306 | `data` - stringify json (recommend including keys `img` and `name` for better displaying by markets) 307 | 308 | TERM 309 | This Contract expires at the conclusion of code execution. 310 | by CryptoLions [ https://cryptolions.io ] 311 | 312 |

issuef

313 | 314 | --- 315 | spec_version: 0.0.2 316 | title: Issue a fungible token 317 | summary: This action issues a fungible token 318 | icon: https://cryptolions.io/assets/images/sa-icons-256/issuef.png#a40d77b2162d646cd3ce0488dfeab1cdfae8801fcc1d0c6ef1f16f2547b16551 319 | --- 320 | 321 | Input parameters: 322 | `to` - account receiver; 323 | `author` - fungible token author; 324 | `quantity` - amount to issue, example "1000.00 WOOD"; 325 | `memo` - transfers memo; 326 | 327 | TERM 328 | This Contract expires at the conclusion of code execution. 329 | by CryptoLions [ https://cryptolions.io ] 330 | 331 |

transferf

332 | 333 | --- 334 | spec_version: 0.0.2 335 | title: Transfer a fungible token 336 | summary: This action transfer the specified quantity of fungible tokens 337 | icon: https://cryptolions.io/assets/images/sa-icons-256/transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf 338 | --- 339 | 340 | Input parameters: 341 | `from` - account who sends the token; 342 | `to` - account of receiver; 343 | `author` - account of fungible token author; 344 | `quantity` - amount to transfer, example "1.00 WOOD"; 345 | `memo` - transfers comment; 346 | 347 | TERM 348 | This Contract expires at the conclusion of code execution. 349 | by CryptoLions [ https://cryptolions.io ] 350 | 351 |

burnf

352 | 353 | --- 354 | spec_version: 0.0.2 355 | title: Burns a fungible token 356 | summary: Burns a fungible token 357 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 358 | --- 359 | 360 | This action is available for the token owner and author. After executing, accounts balance and supply in stats table for this token will reduce by the specified quantity 361 | 362 | Input parameters: 363 | `from` - account who burns the token; 364 | `author` - account of fungible token author; 365 | `quantity` - amount to burn, example "1.00 WOOD"; 366 | `memo` - memo for burnf action; 367 | 368 | TERM 369 | This Contract expires at the conclusion of code execution. 370 | by CryptoLions [ https://cryptolions.io ] 371 | 372 |

openf

373 | 374 | --- 375 | spec_version: 0.0.2 376 | title: Opens accounts table for fungible token 377 | summary: Opens accounts table for specified fungible token 378 | icon: https://cryptolions.io/assets/images/sa-icons-256/attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452 379 | --- 380 | 381 | Input parameters: 382 | `owner` - account who woud like to close table with fungible token; 383 | `author` - account of fungible token author; 384 | `symbol` - token symbol, example "WOOD", "ROCK", "GOLD"; 385 | `ram_payer` - account who will pay for ram used for table creation; 386 | 387 | TERM 388 | This Contract expires at the conclusion of code execution. 389 | by CryptoLions [ https://cryptolions.io ] 390 | 391 |

closef

392 | 393 | --- 394 | spec_version: 0.0.2 395 | title: Closes accounts table 396 | summary: Action works only if balance is 0. for provided fungible token and releases RAM 397 | icon: https://cryptolions.io/assets/images/sa-icons-256/attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452 398 | --- 399 | 400 | Input parameters: 401 | `owner` - account who woud like to close table with fungible token; 402 | `author` - account of fungible token author; 403 | `symbol` - token symbol, example "WOOD", "ROCK", "GOLD"; 404 | 405 | TERM 406 | This Contract expires at the conclusion of code execution. 407 | by CryptoLions [ https://cryptolions.io ] 408 | 409 |

attach

410 | 411 | --- 412 | spec_version: 0.0.2 413 | title: Attach other NFTs to the specified NFT 414 | summary: Attach other NFTs to the specified NFT 415 | icon: https://cryptolions.io/assets/images/sa-icons-256/attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452 416 | --- 417 | 418 | Restrictions. Only the Asset Author can do this. All assets must have the same author. All assets much have the same owner. 419 | 420 | Input parameters: 421 | `owner` - owner of NFTs 422 | `assetidc` - id of container NFT 423 | `assetids` - array of asset ids to attach 424 | 425 | TERM 426 | This Contract expires at the conclusion of code execution. 427 | by CryptoLions [ https://cryptolions.io ] 428 | 429 |

detach

430 | 431 | --- 432 | spec_version: 0.0.2 433 | title: Detach NFTs from the specified NFT 434 | summary: Detach NFTs from the specified NFT 435 | icon: https://cryptolions.io/assets/images/sa-icons-256/detach.png#a075de69e2cf8eed78306834cc5688b64ce6ed660c0db762ae20c7c7a1d19a6b 436 | --- 437 | 438 | Input parameters: 439 | `owner` - owner of NFTs 440 | `assetidc` - the id of the NFT from which we are detaching 441 | `assetids` - the ids of the NFTS to be detached 442 | 443 | TERM 444 | This Contract expires at the conclusion of code execution. 445 | by CryptoLions [ https://cryptolions.io ] 446 | 447 |

attachf

448 | 449 | --- 450 | spec_version: 0.0.2 451 | title: Attach FTs to the specified NFT 452 | summary: Attach FTs to the specified NFT 453 | icon: https://cryptolions.io/assets/images/sa-icons-256/attachf.png#2d190203c6ae474e01cd70963c82a54cb542d95e29174e7572acb8c7653d8a8c 454 | --- 455 | 456 | Restrictions. Only the Asset Author can do this. All assets must have the same author. All assets much have the same owner 457 | 458 | Input parameters: 459 | `owner` - owner of assets 460 | `author` - author of the assets 461 | `assetidc` - id of container NFT 462 | `quantity` - quantity to attach and token name (for example: "10 WOOD", "42.00 GOLD") 463 | 464 | TERM 465 | This Contract expires at the conclusion of code execution. 466 | by CryptoLions [ https://cryptolions.io ] 467 | 468 |

detachf

469 | 470 | --- 471 | spec_version: 0.0.2 472 | title: Detach FTs from the specified NFT 473 | summary: Action is not mandatory 474 | icon: https://cryptolions.io/assets/images/sa-icons-256/detachf.png#2476bc6b7c02a4ec7e0e307b60f44a02486b4bebb4d91714817e5816063198e8 475 | --- 476 | 477 | Input parameters: 478 | `owner` - owner of NFTs 479 | `author` - author of the assets 480 | `assetidc` - id of the container NFT 481 | `quantity` - quantity to detach and token name (for example: "10 WOOD", "42.00 GOLD") 482 | 483 | TERM 484 | This Contract expires at the conclusion of code execution. 485 | by CryptoLions [ https://cryptolions.io ] 486 | 487 |

updatef

488 | 489 | --- 490 | spec_version: 0.0.2 491 | title: Update the data field of a fungible token 492 | summary: Update the data field of a fungible token 493 | icon: https://cryptolions.io/assets/images/sa-icons-256/updatef.png#f5d5af2ed6af508777f9f0b3c3a8e24b61eeca2ea623cfec6f6d0e9ea2c4d1a7 494 | --- 495 | 496 | Input parameters: 497 | `author` - fungible token author; 498 | `sym` - fingible token symbol ("GOLD", "WOOD", etc.) 499 | `data` - stringify json (recommend including keys `img` and `name` for better displaying by markets) 500 | 501 | TERM 502 | This Contract expires at the conclusion of code execution. 503 | by CryptoLions [ https://cryptolions.io ] 504 | 505 |

offerf

506 | 507 | --- 508 | spec_version: 0.0.2 509 | title: Offer fungible tokens to claim 510 | summary: Offer fungible tokens for another EOS user to claim 511 | icon: https://cryptolions.io/assets/images/sa-icons-256/offerf.png#a34462918e536372610a523225e5221cd2685eff3c329499ded7298907f8524b 512 | --- 513 | 514 | This is an alternative to the transfer action. Offer can be used by a FT owner to transfer the FTs without using their RAM. After an offer is made, the account specified in new owner is able to make a claim, and take control of the asset using their RAM. FTs will be removed from the owner's balance while the offer is open 515 | 516 | Input parameters: 517 | `owner` - original owner of the FTs 518 | `newowner` - account which will be able to claim the offer 519 | `author` - account of fungible token author; 520 | `quantity` - amount to transfer, example "1.00 WOOD"; 521 | `memo` - offer's comment; 522 | 523 | TERM 524 | This Contract expires at the conclusion of code execution. 525 | by CryptoLions [ https://cryptolions.io ] 526 | 527 |

cancelofferf

528 | 529 | --- 530 | spec_version: 0.0.2 531 | title: Cancels offer of FTs 532 | summary: Cancels offer of FTs 533 | icon: https://cryptolions.io/assets/images/sa-icons-256/cancelofferf.png#9c35f488e2c53464f430e0e31e5a4b3bd2e914fe3b6db126722166a8a408fa83 534 | --- 535 | 536 | Input parameters: 537 | `owner` - riginal owner of the FT 538 | `ftofferids` - id of the FT offer 539 | 540 | TERM 541 | This Contract expires at the conclusion of code execution. 542 | by CryptoLions [ https://cryptolions.io ] 543 | 544 |

claimf

545 | 546 | --- 547 | spec_version: 0.0.2 548 | title: Claim FTs which have been offered 549 | summary: Claim FTs which have been offered 550 | icon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30 551 | --- 552 | 553 | Input parameters: 554 | `claimer` - Account claiming FTs which have been offered 555 | `ftofferids` - array of FT offer ids 556 | 557 | TERM 558 | This Contract expires at the conclusion of code execution. 559 | by CryptoLions [ https://cryptolions.io ] 560 | 561 |

updatever

562 | 563 | --- 564 | spec_version: 0.0.2 565 | title: Update version (internal) 566 | summary: Update version (internal) 567 | icon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30 568 | --- 569 | 570 |

createlog

571 | 572 | --- 573 | spec_version: 0.0.2 574 | title: createlog (internal) 575 | summary: createlog (internal) 576 | icon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30 577 | --- 578 | 579 |

burnlog

580 | 581 | --- 582 | spec_version: 0.0.2 583 | title: burnlog (internal) 584 | summary: burnlog (internal) 585 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 586 | --- 587 | 588 |

burnflog

589 | 590 | --- 591 | spec_version: 0.0.2 592 | title: burnflog (internal) 593 | summary: burnflog (internal) 594 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 595 | --- 596 | 597 |

burnnttlog

598 | 599 | --- 600 | spec_version: 0.0.2 601 | title: burnnttlog (internal) 602 | summary: burnnttlog (internal) 603 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 604 | --- 605 | 606 |

createntt

607 | 608 | --- 609 | spec_version: 0.0.2 610 | title: create Non transferable token (NTT) 611 | summary: This action create a new Non transferable token (NTT). 612 | icon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70 613 | --- 614 | 615 | Input parameters: 616 | `owner` - original owner of the FTs 617 | `newowner` - account which will be able to claim the offer 618 | `author` - account of fungible token author; 619 | `quantity` - amount to transfer, example "1.00 WOOD"; 620 | `memo` - offer's comment; 621 | 622 | TERM 623 | This Contract expires at the conclusion of code execution. 624 | by CryptoLions [ https://cryptolions.io ] 625 | 626 |

claimntt

627 | 628 | --- 629 | spec_version: 0.0.2 630 | title: Claim the specified asset 631 | summary: Claim the specified asset (assuming it was offered to claimer by the asset owner) 632 | icon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d 633 | --- 634 | 635 | Input parameters: 636 | `claimer` - account claiming the asset 637 | `assetids` - array of assetid's to claim 638 | 639 | TERM 640 | This Contract expires at the conclusion of code execution. 641 | by CryptoLions [ https://cryptolions.io ] 642 | 643 | 644 |

createnttlog

645 | 646 | --- 647 | spec_version: 0.0.2 648 | title: createlog (internal) 649 | summary: createlog (internal) 650 | icon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30 651 | --- 652 | 653 |

burnntt

654 | 655 | --- 656 | spec_version: 0.0.2 657 | title: Burn non transferable asset 658 | summary: Burn non transferable asset 659 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 660 | --- 661 | 662 | This action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released. 663 | 664 | Input parameters: 665 | `owner` - current asset owner account; 666 | `assetids` - array of assetid's to burn; 667 | `memo` - memo for burn action; 668 | 669 | TERM 670 | This Contract expires at the conclusion of code execution. 671 | by CryptoLions [ https://cryptolions.io ] 672 | 673 |

updatentt

674 | 675 | --- 676 | spec_version: 0.0.2 677 | title: Update assets mutable data 678 | summary: Update assets mutable data (mdata) field. Action is available only for authors 679 | icon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e 680 | --- 681 | 682 | Input parameters: 683 | `author` - authors account; 684 | `owner` - current assets owner; 685 | `assetid` - assetid to update; 686 | `mdata` - stringified json with mutable assets data. All mdata will be replaced; 687 | 688 | TERM 689 | This Contract expires at the conclusion of code execution. 690 | by CryptoLions [ https://cryptolions.io ] 691 | 692 |

mdadd

693 | 694 | --- 695 | spec_version: 0.0.2 696 | title: Create new more date 697 | summary: Create new more date 698 | icon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e 699 | --- 700 | 701 | Input parameters: 702 | `author` - authors account; 703 | `data` - stringified json with mutable assets data; 704 | 705 | TERM 706 | This Contract expires at the conclusion of code execution. 707 | by CryptoLions [ https://cryptolions.io ] 708 | 709 |

mdaddlog

710 | 711 | --- 712 | spec_version: 0.0.2 713 | title: Internal action used for creating log 714 | summary: Internal action used for creating log 715 | icon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e 716 | --- 717 | 718 | Input parameters: 719 | `id` - is id of more data; 720 | `author` - authors account; 721 | `data` - stringified json with mutable assets data; 722 | 723 | TERM 724 | This Contract expires at the conclusion of code execution. 725 | by CryptoLions [ https://cryptolions.io ] 726 | 727 |

mdupdate

728 | 729 | --- 730 | spec_version: 0.0.2 731 | title: Update existing more data 732 | summary: Update existing more data 733 | icon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e 734 | --- 735 | 736 | Input parameters: 737 | `id` - is id of more data; 738 | `author` - authors account; 739 | `data` - stringified json with mutable assets data; 740 | 741 | TERM 742 | This Contract expires at the conclusion of code execution. 743 | by CryptoLions [ https://cryptolions.io ] 744 | 745 |

mdremove

746 | 747 | --- 748 | spec_version: 0.0.2 749 | title: Update existing more data 750 | summary: Update existing more data 751 | icon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e 752 | --- 753 | 754 | Input parameters: 755 | `id` - is id of more data; 756 | 757 | TERM 758 | This Contract expires at the conclusion of code execution. 759 | by CryptoLions [ https://cryptolions.io ] 760 | 761 |

saetransfer

762 | 763 | --- 764 | spec_version: 0.0.2 765 | title: Internal action used for creating log 766 | summary: Internal action used for creating log 767 | icon: https://cryptolions.io/assets/images/sa-icons-256/transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf 768 | --- 769 | 770 | This action is called during transfer in deferred transaction 771 | 772 | Input parameters: 773 | `author` - asset's author; 774 | `from` - account who sends the asset; 775 | `to` - account of receiver; 776 | `assetids` - array of assetid's to transfer; 777 | `memo` - transfers comment; 778 | 779 | TERM 780 | This Contract expires at the conclusion of code execution. 781 | by CryptoLions [ https://cryptolions.io ] 782 | 783 |

saeburn

784 | 785 | --- 786 | spec_version: 0.0.2 787 | title: Internal action used for creating log 788 | summary: Internal action used for creating log 789 | icon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84 790 | --- 791 | 792 | This action is called during burn in deferred transaction 793 | 794 | Input parameters: 795 | `author` - asset's author; 796 | `owner` - current asset owner account; 797 | `assetids` - array of assetid's to burn; 798 | `memo` - memo for burn action; 799 | 800 | TERM 801 | This Contract expires at the conclusion of code execution. 802 | by CryptoLions [ https://cryptolions.io ] 803 | 804 |

saechauthor

805 | 806 | --- 807 | spec_version: 0.0.2 808 | title: Internal action used for creating log 809 | summary: Internal action used for creating log 810 | icon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e 811 | --- 812 | 813 | Input parameters: 814 | `author` - asset's author, who will able to change author name asset's; 815 | `newauthor` - asset's new author name; 816 | `owner` - assets owner; 817 | `assetids` - array of assetid's 818 | 819 | TERM 820 | This Contract expires at the conclusion of code execution. 821 | by CryptoLions [ https://cryptolions.io ] 822 | 823 |

saecreate

824 | 825 | --- 826 | spec_version: 0.0.2 827 | title: Internal action used for creating log 828 | summary: Internal action used for creating log 829 | icon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70 830 | --- 831 | 832 | Input parameters: 833 | `author` - asset's author, who will able to updated asset's mdata; 834 | `category` - assets category; 835 | `owner` - assets owner; 836 | `idata` - stringified json with immutable assets data 837 | `mdata` - stringified json with mutable assets data, can be changed only by author 838 | `requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but 839 | but AUTHOR'S memory will be used until the asset is transferred again). If enabled, 840 | author will remain the owner, but an offer will be created for the account specified in 841 | the owner field to claim the asset using the account's RAM. 842 | 843 | TERM 844 | This Contract expires at the conclusion of code execution. 845 | by CryptoLions [ https://cryptolions.io ] 846 | 847 |

saeclaim

848 | 849 | --- 850 | spec_version: 0.0.2 851 | title: Internal action used for creating log 852 | summary: Internal action used for creating log 853 | icon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d 854 | --- 855 | 856 | Input parameters: 857 | `author` - asset's author, who will able to updated asset's mdata; 858 | `claimer` - account claiming the asset; 859 | `assetids` - array of assetid's to claim; 860 | 861 | TERM 862 | This Contract expires at the conclusion of code execution. 863 | by CryptoLions [ https://cryptolions.io ] 864 | 865 |

setarampayer

866 | 867 | --- 868 | spec_version: 0.0.2 869 | title: Action for setting a ram payer for author and category. 870 | summary: Action for setting a ram payer for author and category. 871 | icon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d 872 | --- 873 | 874 | Input parameters: 875 | `author` - asset's author, who will able to updated asset's mdata; 876 | `category` - assets category; 877 | `usearam` - flag for on or off author is a ram payer functionaity; 878 | 879 | TERM 880 | This Contract expires at the conclusion of code execution. 881 | by CryptoLions [ https://cryptolions.io ] 882 | 883 |

delarampayer

884 | 885 | --- 886 | spec_version: 0.0.2 887 | title: Action for deleting a ram payer record; 888 | summary: Action for deleting a ram payer record; 889 | icon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d 890 | --- 891 | 892 | Input parameters: 893 | `id` - is id of a ram payer record; 894 | 895 | TERM 896 | This Contract expires at the conclusion of code execution. 897 | by CryptoLions [ https://cryptolions.io ] 898 | 899 | -------------------------------------------------------------------------------- /ricardian/SimpleAssets.contracts.md.in: -------------------------------------------------------------------------------- 1 |

authorreg

2 | 3 | --- 4 | spec_version: 0.0.2 5 | title: New Author registration 6 | summary: New Author registration 7 | icon: @ICON_BASE_URL@/@REGAUTHOR_ICON_URI@ 8 | --- 9 | 10 | Action is not mandatory. Markets *may* choose to use information here to display info about the author, and to follow specifications expressed here for displaying asset fields. 11 | 12 | Input parameters: 13 | `author` - authors account who will create assets; 14 | `dappinfo` - stringified json. Recommendations to include: game, company, logo, url, desc; 15 | `fieldtypes` - stringified json with key:state values, where key is key from mdata or idata and 16 | state indicates recommended way of displaying field: 17 | url, img, webgl, mp3, video, hide (ie. don't display), etc. 18 | `priorityimg` - json with assosiation category with type of image or video 19 | txt - text (default) 20 | url - show as clickable URL 21 | img - link to img file 22 | webgl - link to webgl file 23 | mp3 - link to mp3 file 24 | video - link to video file 25 | hide - do not show 26 | imgb - image as string in binary format 27 | webglb - webgl binary 28 | mp3b - mp3 binary 29 | videob - video binary 30 | 31 | 32 | TERM 33 | This Contract expires at the conclusion of code execution. 34 | by CryptoLions [ https://cryptolions.io ] 35 | 36 |

authorupdate

37 | 38 | --- 39 | spec_version: 0.0.2 40 | title: Authors info update 41 | summary: Authors info update 42 | icon: @ICON_BASE_URL@/@AUTHORUPDATE_ICON_URI@ 43 | --- 44 | 45 | Used to updated author information, and asset display recommendations created with the authorreg action. This action replaces the fields dappinfo and fieldtypes. To remove author entry, call this action with null strings for dappinfo and fieldtypes. 46 | 47 | Input parameters: 48 | `author` - authors account who will create assets; 49 | `dappinfo` - stringified json. Recommendations to include: game, company, logo, url, desc; 50 | `fieldtypes` - stringified json with key:state values, where key is key from mdata or idata and 51 | state indicates recommended way of displaying field: 52 | url, img, webgl, mp3, video, hide (ie. don't display), etc. 53 | `priorityimg` - json with assosiation category with type of image or video 54 | txt - text (default) 55 | url - show as clickable URL 56 | img - link to img file 57 | webgl - link to webgl file 58 | mp3 - link to mp3 file 59 | video - link to video file 60 | hide - do not show 61 | imgb - image as string in binary format 62 | webglb - webgl binary 63 | mp3b - mp3 binary 64 | videob - video binary 65 | 66 | TERM 67 | This Contract expires at the conclusion of code execution. 68 | by CryptoLions [ https://cryptolions.io ] 69 | 70 |

changeauthor

71 | 72 | --- 73 | spec_version: 0.0.2 74 | title: Change author of assets 75 | summary: Change author of assets 76 | icon: @ICON_BASE_URL@/@REGAUTHOR_ICON_URI@ 77 | --- 78 | 79 | Input parameters: 80 | `author` - asset's author, who will able to change author name asset's; 81 | `newauthor` - asset's new author name; 82 | `owner` - assets owner; 83 | `assetids` - array of assetid's 84 | 85 | TERM 86 | This Contract expires at the conclusion of code execution. 87 | by CryptoLions [ https://cryptolions.io ] 88 | 89 |

create

90 | 91 | --- 92 | spec_version: 0.0.2 93 | title: Create a new asset 94 | summary: Create a new asset 95 | icon: @ICON_BASE_URL@/@CREATE_ICON_URI@ 96 | --- 97 | 98 | Input parameters: 99 | `author` - asset's author, who will able to updated asset's mdata; 100 | `category` - assets category; 101 | `owner` - assets owner; 102 | `idata` - stringified json with immutable assets data 103 | `mdata` - stringified json with mutable assets data, can be changed only by author 104 | `requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but 105 | but AUTHOR'S memory will be used until the asset is transferred again). If enabled, 106 | author will remain the owner, but an offer will be created for the account specified in 107 | the owner field to claim the asset using the account's RAM. 108 | 109 | TERM 110 | This Contract expires at the conclusion of code execution. 111 | by CryptoLions [ https://cryptolions.io ] 112 | 113 |

claim

114 | 115 | --- 116 | spec_version: 0.0.2 117 | title: Claim the specified asset 118 | summary: Claim the specified asset (assuming it was offered to claimer by the asset owner) 119 | icon: @ICON_BASE_URL@/@CLAIM_ICON_URI@ 120 | --- 121 | 122 | Input parameters: 123 | `claimer` - account claiming the asset 124 | `assetids` - array of assetid's to claim 125 | 126 | TERM 127 | This Contract expires at the conclusion of code execution. 128 | by CryptoLions [ https://cryptolions.io ] 129 | 130 |

transfer

131 | 132 | --- 133 | spec_version: 0.0.2 134 | title: This actions transfers an asset 135 | summary: This actions transfers an asset 136 | icon: @ICON_BASE_URL@/@TRANSFER_ICON_URI@ 137 | --- 138 | 139 | On transfer owner asset's and scope asset's changes to {{to}}'s. Senders RAM will be charged to transfer asset. Transfer will fail if asset is offered for claim or is delegated. 140 | 141 | Input parameters: 142 | `from` - account who sends the asset; 143 | `to` - account of receiver; 144 | `assetids` - array of assetid's to transfer; 145 | `memo` - transfers comment; 146 | 147 | TERM 148 | This Contract expires at the conclusion of code execution. 149 | by CryptoLions [ https://cryptolions.io ] 150 | 151 |

update

152 | 153 | --- 154 | spec_version: 0.0.2 155 | title: Update assets mutable data 156 | summary: Update assets mutable data (mdata) field. Action is available only for authors 157 | icon: @ICON_BASE_URL@/@UPDATE_ICON_URI@ 158 | --- 159 | 160 | Input parameters: 161 | `author` - authors account; 162 | `owner` - current assets owner; 163 | `assetid` - assetid to update; 164 | `mdata` - stringified json with mutable assets data. All mdata will be replaced; 165 | 166 | TERM 167 | This Contract expires at the conclusion of code execution. 168 | by CryptoLions [ https://cryptolions.io ] 169 | 170 |

offer

171 | 172 | --- 173 | spec_version: 0.0.2 174 | title: Offer asset for claim 175 | summary: Offer asset for claim 176 | icon: @ICON_BASE_URL@/@OFFER_ICON_URI@ 177 | --- 178 | 179 | This is an alternative to the transfer action. Offer can be used by an asset owner to transfer the asset without using their RAM. After an offer is made, the account specified in {{newowner}} is able to make a claim, and take control of the asset using their RAM. Offer action is not available if an asste is delegated (borrowed). 180 | 181 | Input parameters: 182 | `owner` - current asset owner account; 183 | `newowner` - new asset owner, who will able to claim; 184 | `assetids` - array of assetid's to offer; 185 | `memo` - memo for offer action 186 | 187 | TERM 188 | This Contract expires at the conclusion of code execution. 189 | by CryptoLions [ https://cryptolions.io ] 190 | 191 |

canceloffer

192 | 193 | --- 194 | spec_version: 0.0.2 195 | title: Cancel and remove offer 196 | summary: Cancel and remove offer. Available for the asset owner 197 | icon: @ICON_BASE_URL@/@CANCELOFFER_ICON_URI@ 198 | --- 199 | 200 | Input parameters: 201 | `owner` - current asset owner account; 202 | `assetids` - array of assetid's to cancel offer; 203 | 204 | TERM 205 | This Contract expires at the conclusion of code execution. 206 | by CryptoLions [ https://cryptolions.io ] 207 | 208 |

burn

209 | 210 | --- 211 | spec_version: 0.0.2 212 | title: Burn asset 213 | summary: Burn asset 214 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 215 | --- 216 | 217 | This action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released. 218 | 219 | Input parameters: 220 | `owner` - current asset owner account; 221 | `assetids` - array of assetid's to burn; 222 | `memo` - memo for burn action; 223 | 224 | TERM 225 | This Contract expires at the conclusion of code execution. 226 | by CryptoLions [ https://cryptolions.io ] 227 | 228 |

delegatemore

229 | 230 | --- 231 | spec_version: 0.0.2 232 | title: Extend period of delegating of asset 233 | summary: Extend period of delegating of asset 234 | icon: @ICON_BASE_URL@/@DELEGATE_MORE_ICON_URI@ 235 | --- 236 | 237 | Input parameters: 238 | `owner` - current asset owner account; 239 | `assetidc` - assetid to delegate; 240 | `period` - time in seconds that the asset will be lent. Lender cannot undelegate until 241 | the period expires, however the receiver can transfer back at any time. 242 | 243 | TERM 244 | This Contract expires at the conclusion of code execution. 245 | by CryptoLions [ https://cryptolions.io ] 246 | 247 |

delegate

248 | 249 | --- 250 | spec_version: 0.0.2 251 | title: Delegates asset 252 | summary: Delegates asset 253 | icon: @ICON_BASE_URL@/@DELEGATE_ICON_URI@ 254 | --- 255 | 256 | This action changes the asset owner by calling the transfer action. It also adds a record in the delegates table to record the asset as borrowed. This block the asset from all owner actions (transfers, offers, burning by borrower). 257 | 258 | Input parameters: 259 | `owner` - current asset owner account; 260 | `to` - borrower account name; 261 | `assetids` - array of assetid's to delegate; 262 | `period` - time in seconds that the asset will be lent. Lender cannot undelegate until 263 | the period expires, however the receiver can transfer back at any time; 264 | `memo` - memo for delegate action; 265 | `autoreturn`- automatic return for delegated action; 266 | 267 | TERM 268 | This Contract expires at the conclusion of code execution. 269 | by CryptoLions [ https://cryptolions.io ] 270 | 271 |

undelegate

272 | 273 | --- 274 | spec_version: 0.0.2 275 | title: Undelegates an asset 276 | summary: Undelegates an asset 277 | icon: @ICON_BASE_URL@/@UPDATEF_ICON_URI@ 278 | --- 279 | 280 | Executing action by real owner will return asset immediately, and the entry in the delegates table recording the borrowing will be erased. 281 | 282 | Input parameters: 283 | `owner` - real asset owner account; 284 | `from` - current account owner (borrower); 285 | `assetids` - array of assetid's to undelegate; 286 | 287 | TERM 288 | This Contract expires at the conclusion of code execution. 289 | by CryptoLions [ https://cryptolions.io ] 290 | 291 |

createf

292 | 293 | --- 294 | spec_version: 0.0.2 295 | title: Creates fungible token 296 | summary: Creates fungible token 297 | icon: @ICON_BASE_URL@/@CLAIMF_ICON_URI@ 298 | --- 299 | 300 | Creates fungible token with specified maximum supply; You can not change anything after creation. 301 | 302 | Input parameters: 303 | `author` - fungible token author; 304 | `maximum_supply` - maximum token supply, example "10000000.0000 GOLD", "10000000 SEED", "100000000.00 WOOD". Precision is also important here; 305 | `authorctrl` - if true(1) allow token author (and not just owner) to burnf and transferf. Cannot be changed after creation! 306 | `data` - stringify json (recommend including keys `img` and `name` for better displaying by markets) 307 | 308 | TERM 309 | This Contract expires at the conclusion of code execution. 310 | by CryptoLions [ https://cryptolions.io ] 311 | 312 |

issuef

313 | 314 | --- 315 | spec_version: 0.0.2 316 | title: Issue a fungible token 317 | summary: This action issues a fungible token 318 | icon: @ICON_BASE_URL@/@ISSUEF_ICON_URI@ 319 | --- 320 | 321 | Input parameters: 322 | `to` - account receiver; 323 | `author` - fungible token author; 324 | `quantity` - amount to issue, example "1000.00 WOOD"; 325 | `memo` - transfers memo; 326 | 327 | TERM 328 | This Contract expires at the conclusion of code execution. 329 | by CryptoLions [ https://cryptolions.io ] 330 | 331 |

transferf

332 | 333 | --- 334 | spec_version: 0.0.2 335 | title: Transfer a fungible token 336 | summary: This action transfer the specified quantity of fungible tokens 337 | icon: @ICON_BASE_URL@/@TRANSFER_ICON_URI@ 338 | --- 339 | 340 | Input parameters: 341 | `from` - account who sends the token; 342 | `to` - account of receiver; 343 | `author` - account of fungible token author; 344 | `quantity` - amount to transfer, example "1.00 WOOD"; 345 | `memo` - transfers comment; 346 | 347 | TERM 348 | This Contract expires at the conclusion of code execution. 349 | by CryptoLions [ https://cryptolions.io ] 350 | 351 |

burnf

352 | 353 | --- 354 | spec_version: 0.0.2 355 | title: Burns a fungible token 356 | summary: Burns a fungible token 357 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 358 | --- 359 | 360 | This action is available for the token owner and author. After executing, accounts balance and supply in stats table for this token will reduce by the specified quantity 361 | 362 | Input parameters: 363 | `from` - account who burns the token; 364 | `author` - account of fungible token author; 365 | `quantity` - amount to burn, example "1.00 WOOD"; 366 | `memo` - memo for burnf action; 367 | 368 | TERM 369 | This Contract expires at the conclusion of code execution. 370 | by CryptoLions [ https://cryptolions.io ] 371 | 372 |

openf

373 | 374 | --- 375 | spec_version: 0.0.2 376 | title: Opens accounts table for fungible token 377 | summary: Opens accounts table for specified fungible token 378 | icon: @ICON_BASE_URL@/@ATTACH_ICON_URI@ 379 | --- 380 | 381 | Input parameters: 382 | `owner` - account who woud like to close table with fungible token; 383 | `author` - account of fungible token author; 384 | `symbol` - token symbol, example "WOOD", "ROCK", "GOLD"; 385 | `ram_payer` - account who will pay for ram used for table creation; 386 | 387 | TERM 388 | This Contract expires at the conclusion of code execution. 389 | by CryptoLions [ https://cryptolions.io ] 390 | 391 |

closef

392 | 393 | --- 394 | spec_version: 0.0.2 395 | title: Closes accounts table 396 | summary: Action works only if balance is 0. for provided fungible token and releases RAM 397 | icon: @ICON_BASE_URL@/@ATTACH_ICON_URI@ 398 | --- 399 | 400 | Input parameters: 401 | `owner` - account who woud like to close table with fungible token; 402 | `author` - account of fungible token author; 403 | `symbol` - token symbol, example "WOOD", "ROCK", "GOLD"; 404 | 405 | TERM 406 | This Contract expires at the conclusion of code execution. 407 | by CryptoLions [ https://cryptolions.io ] 408 | 409 |

attach

410 | 411 | --- 412 | spec_version: 0.0.2 413 | title: Attach other NFTs to the specified NFT 414 | summary: Attach other NFTs to the specified NFT 415 | icon: @ICON_BASE_URL@/@ATTACH_ICON_URI@ 416 | --- 417 | 418 | Restrictions. Only the Asset Author can do this. All assets must have the same author. All assets much have the same owner. 419 | 420 | Input parameters: 421 | `owner` - owner of NFTs 422 | `assetidc` - id of container NFT 423 | `assetids` - array of asset ids to attach 424 | 425 | TERM 426 | This Contract expires at the conclusion of code execution. 427 | by CryptoLions [ https://cryptolions.io ] 428 | 429 |

detach

430 | 431 | --- 432 | spec_version: 0.0.2 433 | title: Detach NFTs from the specified NFT 434 | summary: Detach NFTs from the specified NFT 435 | icon: @ICON_BASE_URL@/@DETACH_ICON_URI@ 436 | --- 437 | 438 | Input parameters: 439 | `owner` - owner of NFTs 440 | `assetidc` - the id of the NFT from which we are detaching 441 | `assetids` - the ids of the NFTS to be detached 442 | 443 | TERM 444 | This Contract expires at the conclusion of code execution. 445 | by CryptoLions [ https://cryptolions.io ] 446 | 447 |

attachf

448 | 449 | --- 450 | spec_version: 0.0.2 451 | title: Attach FTs to the specified NFT 452 | summary: Attach FTs to the specified NFT 453 | icon: @ICON_BASE_URL@/@ATTACHF_ICON_URI@ 454 | --- 455 | 456 | Restrictions. Only the Asset Author can do this. All assets must have the same author. All assets much have the same owner 457 | 458 | Input parameters: 459 | `owner` - owner of assets 460 | `author` - author of the assets 461 | `assetidc` - id of container NFT 462 | `quantity` - quantity to attach and token name (for example: "10 WOOD", "42.00 GOLD") 463 | 464 | TERM 465 | This Contract expires at the conclusion of code execution. 466 | by CryptoLions [ https://cryptolions.io ] 467 | 468 |

detachf

469 | 470 | --- 471 | spec_version: 0.0.2 472 | title: Detach FTs from the specified NFT 473 | summary: Action is not mandatory 474 | icon: @ICON_BASE_URL@/@DETACHF_ICON_URI@ 475 | --- 476 | 477 | Input parameters: 478 | `owner` - owner of NFTs 479 | `author` - author of the assets 480 | `assetidc` - id of the container NFT 481 | `quantity` - quantity to detach and token name (for example: "10 WOOD", "42.00 GOLD") 482 | 483 | TERM 484 | This Contract expires at the conclusion of code execution. 485 | by CryptoLions [ https://cryptolions.io ] 486 | 487 |

updatef

488 | 489 | --- 490 | spec_version: 0.0.2 491 | title: Update the data field of a fungible token 492 | summary: Update the data field of a fungible token 493 | icon: @ICON_BASE_URL@/@UPDATEF_ICON_URI@ 494 | --- 495 | 496 | Input parameters: 497 | `author` - fungible token author; 498 | `sym` - fingible token symbol ("GOLD", "WOOD", etc.) 499 | `data` - stringify json (recommend including keys `img` and `name` for better displaying by markets) 500 | 501 | TERM 502 | This Contract expires at the conclusion of code execution. 503 | by CryptoLions [ https://cryptolions.io ] 504 | 505 |

offerf

506 | 507 | --- 508 | spec_version: 0.0.2 509 | title: Offer fungible tokens to claim 510 | summary: Offer fungible tokens for another EOS user to claim 511 | icon: @ICON_BASE_URL@/@OFFERF_ICON_URI@ 512 | --- 513 | 514 | This is an alternative to the transfer action. Offer can be used by a FT owner to transfer the FTs without using their RAM. After an offer is made, the account specified in new owner is able to make a claim, and take control of the asset using their RAM. FTs will be removed from the owner's balance while the offer is open 515 | 516 | Input parameters: 517 | `owner` - original owner of the FTs 518 | `newowner` - account which will be able to claim the offer 519 | `author` - account of fungible token author; 520 | `quantity` - amount to transfer, example "1.00 WOOD"; 521 | `memo` - offer's comment; 522 | 523 | TERM 524 | This Contract expires at the conclusion of code execution. 525 | by CryptoLions [ https://cryptolions.io ] 526 | 527 |

cancelofferf

528 | 529 | --- 530 | spec_version: 0.0.2 531 | title: Cancels offer of FTs 532 | summary: Cancels offer of FTs 533 | icon: @ICON_BASE_URL@/@CANCELOFFERF_ICON_URI@ 534 | --- 535 | 536 | Input parameters: 537 | `owner` - riginal owner of the FT 538 | `ftofferids` - id of the FT offer 539 | 540 | TERM 541 | This Contract expires at the conclusion of code execution. 542 | by CryptoLions [ https://cryptolions.io ] 543 | 544 |

claimf

545 | 546 | --- 547 | spec_version: 0.0.2 548 | title: Claim FTs which have been offered 549 | summary: Claim FTs which have been offered 550 | icon: @ICON_BASE_URL@/@CLAIMF_ICON_URI@ 551 | --- 552 | 553 | Input parameters: 554 | `claimer` - Account claiming FTs which have been offered 555 | `ftofferids` - array of FT offer ids 556 | 557 | TERM 558 | This Contract expires at the conclusion of code execution. 559 | by CryptoLions [ https://cryptolions.io ] 560 | 561 |

updatever

562 | 563 | --- 564 | spec_version: 0.0.2 565 | title: Update version (internal) 566 | summary: Update version (internal) 567 | icon: @ICON_BASE_URL@/@CLAIMF_ICON_URI@ 568 | --- 569 | 570 |

createlog

571 | 572 | --- 573 | spec_version: 0.0.2 574 | title: createlog (internal) 575 | summary: createlog (internal) 576 | icon: @ICON_BASE_URL@/@CLAIMF_ICON_URI@ 577 | --- 578 | 579 |

burnlog

580 | 581 | --- 582 | spec_version: 0.0.2 583 | title: burnlog (internal) 584 | summary: burnlog (internal) 585 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 586 | --- 587 | 588 |

burnflog

589 | 590 | --- 591 | spec_version: 0.0.2 592 | title: burnflog (internal) 593 | summary: burnflog (internal) 594 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 595 | --- 596 | 597 |

burnnttlog

598 | 599 | --- 600 | spec_version: 0.0.2 601 | title: burnnttlog (internal) 602 | summary: burnnttlog (internal) 603 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 604 | --- 605 | 606 |

createntt

607 | 608 | --- 609 | spec_version: 0.0.2 610 | title: create Non transferable token (NTT) 611 | summary: This action create a new Non transferable token (NTT). 612 | icon: @ICON_BASE_URL@/@CREATE_ICON_URI@ 613 | --- 614 | 615 | Input parameters: 616 | `owner` - original owner of the FTs 617 | `newowner` - account which will be able to claim the offer 618 | `author` - account of fungible token author; 619 | `quantity` - amount to transfer, example "1.00 WOOD"; 620 | `memo` - offer's comment; 621 | 622 | TERM 623 | This Contract expires at the conclusion of code execution. 624 | by CryptoLions [ https://cryptolions.io ] 625 | 626 |

claimntt

627 | 628 | --- 629 | spec_version: 0.0.2 630 | title: Claim the specified asset 631 | summary: Claim the specified asset (assuming it was offered to claimer by the asset owner) 632 | icon: @ICON_BASE_URL@/@CLAIM_ICON_URI@ 633 | --- 634 | 635 | Input parameters: 636 | `claimer` - account claiming the asset 637 | `assetids` - array of assetid's to claim 638 | 639 | TERM 640 | This Contract expires at the conclusion of code execution. 641 | by CryptoLions [ https://cryptolions.io ] 642 | 643 | 644 |

createnttlog

645 | 646 | --- 647 | spec_version: 0.0.2 648 | title: createlog (internal) 649 | summary: createlog (internal) 650 | icon: @ICON_BASE_URL@/@CLAIMF_ICON_URI@ 651 | --- 652 | 653 |

burnntt

654 | 655 | --- 656 | spec_version: 0.0.2 657 | title: Burn non transferable asset 658 | summary: Burn non transferable asset 659 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 660 | --- 661 | 662 | This action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released. 663 | 664 | Input parameters: 665 | `owner` - current asset owner account; 666 | `assetids` - array of assetid's to burn; 667 | `memo` - memo for burn action; 668 | 669 | TERM 670 | This Contract expires at the conclusion of code execution. 671 | by CryptoLions [ https://cryptolions.io ] 672 | 673 |

updatentt

674 | 675 | --- 676 | spec_version: 0.0.2 677 | title: Update assets mutable data 678 | summary: Update assets mutable data (mdata) field. Action is available only for authors 679 | icon: @ICON_BASE_URL@/@UPDATE_ICON_URI@ 680 | --- 681 | 682 | Input parameters: 683 | `author` - authors account; 684 | `owner` - current assets owner; 685 | `assetid` - assetid to update; 686 | `mdata` - stringified json with mutable assets data. All mdata will be replaced; 687 | 688 | TERM 689 | This Contract expires at the conclusion of code execution. 690 | by CryptoLions [ https://cryptolions.io ] 691 | 692 |

mdadd

693 | 694 | --- 695 | spec_version: 0.0.2 696 | title: Create new more date 697 | summary: Create new more date 698 | icon: @ICON_BASE_URL@/@UPDATE_ICON_URI@ 699 | --- 700 | 701 | Input parameters: 702 | `author` - authors account; 703 | `data` - stringified json with mutable assets data; 704 | 705 | TERM 706 | This Contract expires at the conclusion of code execution. 707 | by CryptoLions [ https://cryptolions.io ] 708 | 709 |

mdaddlog

710 | 711 | --- 712 | spec_version: 0.0.2 713 | title: Internal action used for creating log 714 | summary: Internal action used for creating log 715 | icon: @ICON_BASE_URL@/@UPDATE_ICON_URI@ 716 | --- 717 | 718 | Input parameters: 719 | `id` - is id of more data; 720 | `author` - authors account; 721 | `data` - stringified json with mutable assets data; 722 | 723 | TERM 724 | This Contract expires at the conclusion of code execution. 725 | by CryptoLions [ https://cryptolions.io ] 726 | 727 |

mdupdate

728 | 729 | --- 730 | spec_version: 0.0.2 731 | title: Update existing more data 732 | summary: Update existing more data 733 | icon: @ICON_BASE_URL@/@UPDATE_ICON_URI@ 734 | --- 735 | 736 | Input parameters: 737 | `id` - is id of more data; 738 | `author` - authors account; 739 | `data` - stringified json with mutable assets data; 740 | 741 | TERM 742 | This Contract expires at the conclusion of code execution. 743 | by CryptoLions [ https://cryptolions.io ] 744 | 745 |

mdremove

746 | 747 | --- 748 | spec_version: 0.0.2 749 | title: Update existing more data 750 | summary: Update existing more data 751 | icon: @ICON_BASE_URL@/@UPDATE_ICON_URI@ 752 | --- 753 | 754 | Input parameters: 755 | `id` - is id of more data; 756 | 757 | TERM 758 | This Contract expires at the conclusion of code execution. 759 | by CryptoLions [ https://cryptolions.io ] 760 | 761 |

saetransfer

762 | 763 | --- 764 | spec_version: 0.0.2 765 | title: Internal action used for creating log 766 | summary: Internal action used for creating log 767 | icon: @ICON_BASE_URL@/@TRANSFER_ICON_URI@ 768 | --- 769 | 770 | This action is called during transfer in deferred transaction 771 | 772 | Input parameters: 773 | `author` - asset's author; 774 | `from` - account who sends the asset; 775 | `to` - account of receiver; 776 | `assetids` - array of assetid's to transfer; 777 | `memo` - transfers comment; 778 | 779 | TERM 780 | This Contract expires at the conclusion of code execution. 781 | by CryptoLions [ https://cryptolions.io ] 782 | 783 |

saeburn

784 | 785 | --- 786 | spec_version: 0.0.2 787 | title: Internal action used for creating log 788 | summary: Internal action used for creating log 789 | icon: @ICON_BASE_URL@/@BURN_ICON_URI@ 790 | --- 791 | 792 | This action is called during burn in deferred transaction 793 | 794 | Input parameters: 795 | `author` - asset's author; 796 | `owner` - current asset owner account; 797 | `assetids` - array of assetid's to burn; 798 | `memo` - memo for burn action; 799 | 800 | TERM 801 | This Contract expires at the conclusion of code execution. 802 | by CryptoLions [ https://cryptolions.io ] 803 | 804 |

saechauthor

805 | 806 | --- 807 | spec_version: 0.0.2 808 | title: Internal action used for creating log 809 | summary: Internal action used for creating log 810 | icon: @ICON_BASE_URL@/@REGAUTHOR_ICON_URI@ 811 | --- 812 | 813 | Input parameters: 814 | `author` - asset's author, who will able to change author name asset's; 815 | `newauthor` - asset's new author name; 816 | `owner` - assets owner; 817 | `assetids` - array of assetid's 818 | 819 | TERM 820 | This Contract expires at the conclusion of code execution. 821 | by CryptoLions [ https://cryptolions.io ] 822 | 823 |

saecreate

824 | 825 | --- 826 | spec_version: 0.0.2 827 | title: Internal action used for creating log 828 | summary: Internal action used for creating log 829 | icon: @ICON_BASE_URL@/@CREATE_ICON_URI@ 830 | --- 831 | 832 | Input parameters: 833 | `author` - asset's author, who will able to updated asset's mdata; 834 | `category` - assets category; 835 | `owner` - assets owner; 836 | `idata` - stringified json with immutable assets data 837 | `mdata` - stringified json with mutable assets data, can be changed only by author 838 | `requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but 839 | but AUTHOR'S memory will be used until the asset is transferred again). If enabled, 840 | author will remain the owner, but an offer will be created for the account specified in 841 | the owner field to claim the asset using the account's RAM. 842 | 843 | TERM 844 | This Contract expires at the conclusion of code execution. 845 | by CryptoLions [ https://cryptolions.io ] 846 | 847 |

saeclaim

848 | 849 | --- 850 | spec_version: 0.0.2 851 | title: Internal action used for creating log 852 | summary: Internal action used for creating log 853 | icon: @ICON_BASE_URL@/@CLAIM_ICON_URI@ 854 | --- 855 | 856 | Input parameters: 857 | `author` - asset's author, who will able to updated asset's mdata; 858 | `claimer` - account claiming the asset; 859 | `assetids` - array of assetid's to claim; 860 | 861 | TERM 862 | This Contract expires at the conclusion of code execution. 863 | by CryptoLions [ https://cryptolions.io ] 864 | 865 |

setarampayer

866 | 867 | --- 868 | spec_version: 0.0.2 869 | title: Action for setting a ram payer for author and category. 870 | summary: Action for setting a ram payer for author and category. 871 | icon: @ICON_BASE_URL@/@CLAIM_ICON_URI@ 872 | --- 873 | 874 | Input parameters: 875 | `author` - asset's author, who will able to updated asset's mdata; 876 | `category` - assets category; 877 | `usearam` - flag for on or off author is a ram payer functionaity; 878 | 879 | TERM 880 | This Contract expires at the conclusion of code execution. 881 | by CryptoLions [ https://cryptolions.io ] 882 | 883 |

delarampayer

884 | 885 | --- 886 | spec_version: 0.0.2 887 | title: Action for deleting a ram payer record; 888 | summary: Action for deleting a ram payer record; 889 | icon: @ICON_BASE_URL@/@CLAIM_ICON_URI@ 890 | --- 891 | 892 | Input parameters: 893 | `id` - is id of a ram payer record; 894 | 895 | TERM 896 | This Contract expires at the conclusion of code execution. 897 | by CryptoLions [ https://cryptolions.io ] 898 | 899 | -------------------------------------------------------------------------------- /src/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(SimpleAssets) 2 | 3 | set(EOSIO_WASM_OLD_BEHAVIOR "Off") 4 | find_package(eosio.cdt) 5 | 6 | add_contract( SimpleAssets SimpleAssets SimpleAssets.cpp ) 7 | target_include_directories( SimpleAssets PUBLIC ${CMAKE_SOURCE_DIR}/../include ) 8 | target_ricardian_directory( SimpleAssets ${CMAKE_SOURCE_DIR}/../ricardian ) 9 | 10 | 11 | 12 | --------------------------------------------------------------------------------