diff --git a/README.md b/README.md index 8a79876..935d6a2 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,10 @@ # SimpleAssets -[中文翻译](#中文翻译) - -[한국어 번역](#한국어) - A simple standard for digital assets on EOSIO blockchains: Non-Fungible Tokens (NFTs), Fungible Tokens (FTs), and Non-Transferable Tokens (NTTs). by [CryptoLions](https://CryptoLions.io) + +中文翻译: https://github.com/CryptoLions/SimpleAssets/blob/master/README_ZH.md +한국어 번역: https://github.com/CryptoLions/SimpleAssets/blob/master/README_KR.md web: http://simpleassets.io Git: https://github.com/CryptoLions/SimpleAssets @@ -15,11 +14,8 @@ Intro & Demos: https://medium.com/@cryptolions/introducing-simple-assets-b4e17c Events Receiver Example for authors: https://github.com/CryptoLions/SimpleAssets-EventReceiverExample -**WARNING!!! CDT currently has a bug that doesn't allow compilation on v1.6.x. - 1.5.0 also has a bug "Segmentation fault (core dumped)", but only with abi generation. - Recommendation: Use 1.5.0 for contract compilation and use our abi** - issue: https://github.com/EOSIO/eosio.cdt/issues/527 - +**WARNING** The minimum dependency on eosio.cdt is now v1.6.3. + --------------------------- Use Simple Assets by making calls to the Simple Assets contract. It's like a Dapp for Dapps. @@ -54,7 +50,7 @@ Each symbol in imdata and mdata is +1 byte. 1. [Contract actions](#contract-actions) 2. [Data Structures](#data-structures) 3. [EXAMPLES: how to use Simple Assets in smart contracts](#examples-how-to-use-simple-assets-in-smart-contracts) -4. [ChangeLog](#change-log-v120) +4. [ChangeLog](#change-log-v130) --------------------------- # Contract actions @@ -292,8 +288,7 @@ createAsset.send(); ## Search asset and get assets info 1. Please add in your hpp file info about assets structure - **WARNING!!! CDT currently has a bug that doesn't allow compilation (v1.6.1). - 1.5.0 also has a bug "Segmentation fault (core dumped)", but only with abi generation (including array of self objects : std::vector container;)** + ``` TABLE account { uint64_t id; @@ -483,6 +478,12 @@ saRes1.send(); ----------------- +## Change Log v1.3.0 +- Upgrade work with latest Contract Develper Toolkit (CDT v1.6.3). + (Resolves this compilation [issue](https://github.com/EOSIO/eosio.cdt/issues/527)) +- minor code refactoring. + + ## Change Log v1.2.0 - NON TRANSFERRABLE TOKENS (NTTs) - new tables: snttassets and nttoffers - new NTT actions: createntt, createnttlog, claimntt, updatentt, burnntt diff --git a/SimpleAssets.abi b/SimpleAssets.abi deleted file mode 100644 index a80da48..0000000 --- a/SimpleAssets.abi +++ /dev/null @@ -1,1285 +0,0 @@ -{ - "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Mon Apr 15 20:43:11 2019", - "version": "eosio::abi/1.1", - "structs": [ - { - "name": "account", - "base": "", - "fields": [ - { - "name": "id", - "type": "uint64" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "balance", - "type": "asset" - } - ] - }, - { - "name": "attach", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetidc", - "type": "uint64" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "attachf", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "assetidc", - "type": "uint64" - } - ] - }, - { - "name": "authorupdate", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "data", - "type": "string" - }, - { - "name": "stemplate", - "type": "string" - }, - { - "name": "imgpriority", - "type": "string" - } - ] - }, - { - "name": "burn", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "burnf", - "base": "", - "fields": [ - { - "name": "from", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "canceloffer", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "cancelofferf", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "ftofferids", - "type": "uint64[]" - } - ] - }, - { - "name": "claim", - "base": "", - "fields": [ - { - "name": "claimer", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "claimf", - "base": "", - "fields": [ - { - "name": "claimer", - "type": "name" - }, - { - "name": "ftofferids", - "type": "uint64[]" - } - ] - }, - { - "name": "closef", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "symbol", - "type": "symbol" - } - ] - }, - { - "name": "create", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - }, - { - "name": "requireclaim", - "type": "bool" - } - ] - }, - { - "name": "createf", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "maximum_supply", - "type": "asset" - }, - { - "name": "authorctrl", - "type": "bool" - }, - { - "name": "data", - "type": "string" - } - ] - }, - { - "name": "createlog", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - }, - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "requireclaim", - "type": "bool" - } - ] - }, - { - "name": "currency_stats", - "base": "", - "fields": [ - { - "name": "supply", - "type": "asset" - }, - { - "name": "max_supply", - "type": "asset" - }, - { - "name": "issuer", - "type": "name" - }, - { - "name": "id", - "type": "uint64" - }, - { - "name": "authorctrl", - "type": "bool" - }, - { - "name": "data", - "type": "string" - } - ] - }, - { - "name": "delegate", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "to", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - }, - { - "name": "period", - "type": "uint64" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "detach", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetidc", - "type": "uint64" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "detachf", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "assetidc", - "type": "uint64" - } - ] - }, - { - "name": "global", - "base": "", - "fields": [ - { - "name": "lnftid", - "type": "uint64" - }, - { - "name": "defid", - "type": "uint64" - }, - { - "name": "spare1", - "type": "uint64" - }, - { - "name": "spare2", - "type": "uint64" - } - ] - }, - { - "name": "issuef", - "base": "", - "fields": [ - { - "name": "to", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "offer", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "newowner", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "offerf", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "newowner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "openf", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "symbol", - "type": "symbol" - }, - { - "name": "ram_payer", - "type": "name" - } - ] - }, - { - "name": "regauthor", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "data", - "type": "string" - }, - { - "name": "stemplate", - "type": "string" - }, - { - "name": "imgpriority", - "type": "string" - } - ] - }, - { - "name": "sasset", - "base": "", - "fields": [ - { - "name": "id", - "type": "uint64" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - }, - { - "name": "container", - "type": "sasset[]" - }, - { - "name": "containerf", - "type": "account[]" - } - ] - }, - { - "name": "sauthor", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "data", - "type": "string" - }, - { - "name": "stemplate", - "type": "string" - }, - { - "name": "imgpriority", - "type": "string" - } - ] - }, - { - "name": "sdelegate", - "base": "", - "fields": [ - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "delegatedto", - "type": "name" - }, - { - "name": "cdate", - "type": "uint64" - }, - { - "name": "period", - "type": "uint64" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "soffer", - "base": "", - "fields": [ - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "offeredto", - "type": "name" - }, - { - "name": "cdate", - "type": "uint64" - } - ] - }, - { - "name": "sofferf", - "base": "", - "fields": [ - { - "name": "id", - "type": "uint64" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "offeredto", - "type": "name" - }, - { - "name": "cdate", - "type": "uint64" - } - ] - }, - { - "name": "tokenconfigs", - "base": "", - "fields": [ - { - "name": "standard", - "type": "name" - }, - { - "name": "version", - "type": "string" - } - ] - }, - { - "name": "transfer", - "base": "", - "fields": [ - { - "name": "from", - "type": "name" - }, - { - "name": "to", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "transferf", - "base": "", - "fields": [ - { - "name": "from", - "type": "name" - }, - { - "name": "to", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "quantity", - "type": "asset" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "undelegate", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "from", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "update", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "mdata", - "type": "string" - } - ] - }, - { - "name": "updatef", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "sym", - "type": "symbol" - }, - { - "name": "data", - "type": "string" - } - ] - }, - { - "name": "updatever", - "base": "", - "fields": [ - { - "name": "version", - "type": "string" - } - ] - }, - { - "name": "delegatemore", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetidc", - "type": "uint64" - }, - { - "name": "period", - "type": "uint64" - } - ] - }, - { - "name": "snttasset", - "base": "", - "fields": [ - { - "name": "id", - "type": "uint64" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - } - ] - }, - { - "name": "snttoffer", - "base": "", - "fields": [ - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "offeredto", - "type": "name" - }, - { - "name": "cdate", - "type": "uint64" - } - ] - }, - { - "name": "createntt", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - }, - { - "name": "requireclaim", - "type": "bool" - } - ] - }, - { - "name": "burnntt", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - }, - { - "name": "memo", - "type": "string" - } - ] - }, - { - "name": "createnttlog", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - }, - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "requireclaim", - "type": "bool" - } - ] - }, - { - "name": "claimntt", - "base": "", - "fields": [ - { - "name": "claimer", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "updatentt", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "mdata", - "type": "string" - } - ] - } - ], - "types": [], - "actions": [ - { - "name": "updatentt", - "type": "updatentt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update assets mutable data\nsummary: Update assets mutable data (mdata) field. Action is available only for authors\nicon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e\n---\n\nInput parameters:\n`author` - authors account;\n`owner` - current assets owner;\n`assetid` - assetid to update;\n`mdata` - stringified json with mutable assets data. All mdata will be replaced;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "createntt", - "type": "createntt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Create a new non transferable asset\nsummary: Create a new asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70\n---\t\n\nInput parameters:\n`author` - asset's author, who will able to updated asset's mdata;\n`category` - assets category;\n`owner` - assets owner;\n`idata` - stringified json with immutable assets data\n`mdata` - stringified json with mutable assets data, can be changed only by author\n`requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but \n\t\t\t\t but AUTHOR'S memory will be used until the asset is transferred again). If enabled,\n\t\t\t\t author will remain the owner, but an offer will be created for the account specified in \n\t\t\t\t the owner field to claim the asset using the account's RAM.\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "createnttlog", - "type": "createnttlog", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: createlog (internal)\nsummary: createlog (internal) \nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---" - }, - { - "name": "claimntt", - "type": "claimntt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Claim the specified asset\nsummary: Claim the specified asset (assuming it was offered to claimer by the asset owner)\nicon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d\n---\n\nInput parameters:\n`claimer` - account claiming the asset\n`assetids` - array of assetid's to claim\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "burnntt", - "type": "burnntt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Burn non transferable asset\nsummary: Burn non transferable asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released.\n\nInput parameters:\n`owner` - current asset owner account;\n`assetids` - array of assetid's to burn;\n`memo` - memo for burn action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "attach", - "type": "attach", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Attach other NFTs to the specified NFT\nsummary: Attach other NFTs to the specified NFT\nicon: https://cryptolions.io/assets/images/sa-icons-256/attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452\n---\n\nRestrictions. Only the Asset Author can do this. All assets must have the same author. All assets much have the same owner. \n\nInput parameters:\n`owner`\t - owner of NFTs\n`assetidc` - id of container NFT\n`assetids` - array of asset ids to attach\t\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "attachf", - "type": "attachf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Attach FTs to the specified NFT\nsummary: Attach FTs to the specified NFT \nicon: https://cryptolions.io/assets/images/sa-icons-256/attachf.png#2d190203c6ae474e01cd70963c82a54cb542d95e29174e7572acb8c7653d8a8c\n---\n\nRestrictions. Only the Asset Author can do this. All assets must have the same author. All assets much have the same owner \n\nInput parameters:\n`owner`\t - owner of assets\n`author` - author of the assets\n`assetidc` - id of container NFT\n`quantity` - quantity to attach and token name (for example: \"10 WOOD\", \"42.00 GOLD\")\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "authorupdate", - "type": "authorupdate", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Authors info update\nsummary: Authors info update \nicon: https://cryptolions.io/assets/images/sa-icons-256/authorupdate.png#0b11c9c4e41b6ba1b00bd907c671f7ddc9e2f9caf26580f0b2e7c73e02f36ff3\n---\n\nUsed to updated author information, and asset display recommendations created with the regauthor action. This action replaces the fields data and stemplate. To remove author entry, call this action with null strings for data and stemplate.\n\nInput parameters:\n`author` - authors account who will create assets; \n`data` - stringified json. Recommendations to include: game, company, logo, url, desc;\n`stemplate` - stringified json with key:state values, where key is key from mdata or idata and \n\t\t\t\tstate indicates recommended way of displaying field: \n\t\t\t\turl, img, webgl, mp3, video, hide (ie. don't display), etc.\n`imgpriority` - json with assosiation category with type of image or video \n\t\t\t\ttxt\t- default\n\t\t\t\turl\t- show as clickable URL\n\t\t\t\timg\t- link to img file\n\t\t\t\twebgl\t- link to webgl file\n\t\t\t\tmp3\t- link to mp3 file\n\t\t\t\tvideo\t- link to video file\n\t\t\t\thide\t- do not show\n\t\t\t\timgb \t- image as string in binary format\n\t\t\t\twebglb\t- webgl binary\n\t\t\t\tmp3b \t- mp3 binary\n\t\t\t\tvideob \t- video binary\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "burn", - "type": "burn", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Burn asset\nsummary: Burn asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released.\n\nInput parameters:\n`owner` - current asset owner account;\n`assetids` - array of assetid's to burn;\n`memo` - memo for burn action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "burnf", - "type": "burnf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Burns a fungible token\nsummary: Burns a fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis 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\n\nInput parameters:\n`from` - account who burns the token;\n`author` - account of fungible token author;\n`quantity` - amount to burn, example \"1.00 WOOD\";\n`memo` - memo for burnf action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "canceloffer", - "type": "canceloffer", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Cancel and remove offer\nsummary: Cancel and remove offer. Available for the asset owner\nicon: https://cryptolions.io/assets/images/sa-icons-256/canceloffer.png#83328bae49f18f0aeca6d04c2e3003e49637a462b44a492d3439a9c44724a654\n---\n\nInput parameters:\n`owner` - current asset owner account;\n`assetids` - array of assetid's to cancel offer;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "cancelofferf", - "type": "cancelofferf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Cancels offer of FTs\nsummary: Cancels offer of FTs \nicon: https://cryptolions.io/assets/images/sa-icons-256/cancelofferf.png#9c35f488e2c53464f430e0e31e5a4b3bd2e914fe3b6db126722166a8a408fa83\n---\n\nInput parameters:\n`owner` - riginal owner of the FT\n`ftofferids` - id of the FT offer\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "claim", - "type": "claim", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Claim the specified asset\nsummary: Claim the specified asset (assuming it was offered to claimer by the asset owner)\nicon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d\n---\n\nInput parameters:\n`claimer` - account claiming the asset\n`assetids` - array of assetid's to claim\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "claimf", - "type": "claimf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Claim FTs which have been offered\nsummary: Claim FTs which have been offered\nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---\n\nInput parameters:\n`claimer` - Account claiming FTs which have been offered\n`ftofferids` - array of FT offer ids\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "closef", - "type": "closef", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Closes accounts table\nsummary: Action works only if balance is 0. for provided fungible token and releases RAM\nicon: https://cryptolions.io/assets/images/sa-icons-256/attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452\n---\n\nInput parameters:\n`owner` - account who woud like to close table with fungible token;\n`author` - account of fungible token author;\n`symbol` - token symbol, example \"WOOD\", \"ROCK\", \"GOLD\";\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "create", - "type": "create", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Create a new asset\nsummary: Create a new asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70\n---\t\n\nInput parameters:\n`author` - asset's author, who will able to updated asset's mdata;\n`category` - assets category;\n`owner` - assets owner;\n`idata` - stringified json with immutable assets data\n`mdata` - stringified json with mutable assets data, can be changed only by author\n`requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but \n\t\t\t\t but AUTHOR'S memory will be used until the asset is transferred again). If enabled,\n\t\t\t\t author will remain the owner, but an offer will be created for the account specified in \n\t\t\t\t the owner field to claim the asset using the account's RAM.\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "createf", - "type": "createf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Creates fungible token\nsummary: Creates fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/createf.png#5fb6788f19b8fb08ce46e765a9b0ae8758cba7e4da9895f840d34d143912fd3d\n---\n\nCreates fungible token with specified maximum supply; You can not change anything after creation.\n\nInput parameters:\n`author` - fungible token author;\n`maximum_supply` - maximum token supply, example \"10000000.0000 GOLD\", \"10000000 SEED\", \"100000000.00 WOOD\". Precision is also important here;\n`authorctrl` - if true(1) allow token author (and not just owner) to burnf and transferf. Cannot be changed after creation!\n`data` - stringify json (recommend including keys `img` and `name` for better displaying by markets)\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "createlog", - "type": "createlog", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: createlog (internal)\nsummary: createlog (internal) \nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---" - }, - { - "name": "delegate", - "type": "delegate", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Delegates asset\nsummary: Delegates asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/delegate.png#f8d91c1b9c0f376464e69aadf41142a17492af1e75d394601872b6a992b420bc\n---\n\nThis 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).\n\nInput parameters:\n`owner` - current asset owner account;\n`to` - borrower account name;\n`assetids` - array of assetid's to delegate;\n`period` - time in seconds that the asset will be lent. Lender cannot undelegate until \n\t\t\t the period expires, however the receiver can transfer back at any time;\n`memo` - memo for delegate action;\n`autoreturn`- automatic return for delegated action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "delegatemore", - "type": "delegatemore", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Extend period of delegating of asset\nsummary: Extend period of delegating of asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/delegate_more.png#6d1f7319569e3780e25cfb717d83f4ad58c91c0890ab234f106d1593956dfd10\n---\n\nInput parameters:\n`owner` - current asset owner account;\n`assetidc` - assetid to delegate;\n`period` - time in seconds that the asset will be lent. Lender cannot undelegate until \n\t\t\t the period expires, however the receiver can transfer back at any time.\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "detach", - "type": "detach", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Detach NFTs from the specified NFT\nsummary: Detach NFTs from the specified NFT\nicon: https://cryptolions.io/assets/images/sa-icons-256/detach.png#a075de69e2cf8eed78306834cc5688b64ce6ed660c0db762ae20c7c7a1d19a6b\n---\n\nInput parameters:\n`owner` - owner of NFTs\n`assetidc` - the id of the NFT from which we are detaching\n`assetids` - the ids of the NFTS to be detached\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "detachf", - "type": "detachf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Detach FTs from the specified NFT\nsummary: Action is not mandatory\nicon: https://cryptolions.io/assets/images/sa-icons-256/detachf.png#2476bc6b7c02a4ec7e0e307b60f44a02486b4bebb4d91714817e5816063198e8\n---\n\nInput parameters:\n`owner` - owner of NFTs\n`author` - author of the assets\n`assetidc` - id of the container NFT\n`quantity` - quantity to detach and token name (for example: \"10 WOOD\", \"42.00 GOLD\")\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "issuef", - "type": "issuef", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Issue a fungible token\nsummary: This action issues a fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/issuef.png#a40d77b2162d646cd3ce0488dfeab1cdfae8801fcc1d0c6ef1f16f2547b16551\n---\n\nInput parameters:\n`to` - account receiver;\n`author` - fungible token author;\n`quantity` - amount to issue, example \"1000.00 WOOD\";\n`memo` - transfers memo;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "offer", - "type": "offer", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Offer asset for claim\nsummary: Offer asset for claim\nicon: https://cryptolions.io/assets/images/sa-icons-256/offer.png#4aea6612c87df6cde081689f861b55ddba2c277cc553f4faeb65a4cb26656c66\n---\n\nThis 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). \n\nInput parameters:\n`owner` - current asset owner account;\n`newowner` - new asset owner, who will able to claim;\n`assetids` - array of assetid's to offer;\n`memo` - memo for offer action\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "offerf", - "type": "offerf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Offer fungible tokens to claim\nsummary: Offer fungible tokens for another EOS user to claim\nicon: https://cryptolions.io/assets/images/sa-icons-256/offerf.png#a34462918e536372610a523225e5221cd2685eff3c329499ded7298907f8524b\n---\n\nThis 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\n\nInput parameters:\n`owner` - original owner of the FTs\n`newowner` - account which will be able to claim the offer\n`author` - account of fungible token author;\t\n`quantity` - amount to transfer, example \"1.00 WOOD\";\n`memo` - offer's comment;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "openf", - "type": "openf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Opens accounts table for fungible token\nsummary: Opens accounts table for specified fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/attach.png#0b039adbbe1011a494959963917df4765dbae378004e00911464f865e58ef452\n---\n\nInput parameters:\n`owner` - account who woud like to close table with fungible token;\n`author` - account of fungible token author;\n`symbol` - token symbol, example \"WOOD\", \"ROCK\", \"GOLD\";\n`ram_payer` - account who will pay for ram used for table creation;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "regauthor", - "type": "regauthor", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: New Author registration\nsummary: New Author registration \nicon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e\n---\n\nAction 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.\n\nInput parameters:\n`author` -\tauthors account who will create assets;\n`data` - stringified json. Recommendations to include: game, company, logo, url, desc;\n`stemplate` - stringified json with key:state values, where key is key from mdata or idata and \n\t\t\t\tstate indicates recommended way of displaying field: \n\t\t\t\turl, img, webgl, mp3, video, hide (ie. don't display), etc.\n`imgpriority` - json with assosiation category with type of image or video \n\t\t\t\ttxt\t- default\n\t\t\t\turl\t- show as clickable URL\n\t\t\t\timg\t- link to img file\n\t\t\t\twebgl\t- link to webgl file\n\t\t\t\tmp3\t- link to mp3 file\n\t\t\t\tvideo\t- link to video file\n\t\t\t\thide\t- do not show\n\t\t\t\timgb \t- image as string in binary format\n\t\t\t\twebglb\t- webgl binary\n\t\t\t\tmp3b \t- mp3 binary\n\t\t\t\tvideob \t- video binary\n\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "transfer", - "type": "transfer", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: This actions transfers an asset\nsummary: This actions transfers an asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf\n---\n\nOn 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.\n\nInput parameters:\n`from` - account who sends the asset;\n`to` - account of receiver;\n`assetids` - array of assetid's to transfer;\n`memo` - transfers comment;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "transferf", - "type": "transferf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Transfer a fungible token\nsummary: This action transfer the specified quantity of fungible tokens\nicon: https://cryptolions.io/assets/images/sa-icons-256/transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf\n---\n\nInput parameters:\n`from` - account who sends the token;\n`to` - account of receiver;\n`author` - account of fungible token author;\n`quantity` - amount to transfer, example \"1.00 WOOD\";\n`memo` - transfers comment;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "undelegate", - "type": "undelegate", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Undelegates an asset\nsummary: Undelegates an asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/delegate.png#f8d91c1b9c0f376464e69aadf41142a17492af1e75d394601872b6a992b420bc\n---\n\nExecuting action by real owner will return asset immediately, and the entry in the delegates table recording the borrowing will be erased.\n\nInput parameters:\n`owner` - real asset owner account;\n`from` - current account owner (borrower);\n`assetids` - array of assetid's to undelegate;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "update", - "type": "update", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update assets mutable data\nsummary: Update assets mutable data (mdata) field. Action is available only for authors\nicon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e\n---\n\nInput parameters:\n`author` - authors account;\n`owner` - current assets owner;\n`assetid` - assetid to update;\n`mdata` - stringified json with mutable assets data. All mdata will be replaced;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "updatef", - "type": "updatef", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update the data field of a fungible token\nsummary: Update the data field of a fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/updatef.png#f5d5af2ed6af508777f9f0b3c3a8e24b61eeca2ea623cfec6f6d0e9ea2c4d1a7\n---\n\nInput parameters:\n`author` - fungible token author;\n`sym` - fingible token symbol (\"GOLD\", \"WOOD\", etc.)\n`data` - stringify json (recommend including keys `img` and `name` for better displaying by markets)\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "updatever", - "type": "updatever", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update version (internal)\nsummary: Update version (internal)\nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---" - } - ], - "tables": [ - { - "name": "accounts", - "type": "account", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "authors", - "type": "sauthor", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "delegates", - "type": "sdelegate", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "global", - "type": "global", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "offerfs", - "type": "sofferf", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "offers", - "type": "soffer", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "sassets", - "type": "sasset", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "stat", - "type": "currency_stats", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "tokenconfigs", - "type": "tokenconfigs", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "snttassets", - "type": "snttasset", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "nttoffers", - "type": "snttoffer", - "index_type": "i64", - "key_names": [], - "key_types": [] - } - ], - "ricardian_clauses": [ - { - "id": "Warranty", - "body": "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." - }, - { - "id": "Default", - "body": "The occurrence of any of the following shall constitute a material default under this Contract:" - }, - { - "id": "Remedies", - "body": "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." - }, - { - "id": "ForceMajeure", - "body": "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." - }, - { - "id": "DisputeResolution", - "body": "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." - }, - { - "id": "EntireAgreement", - "body": "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." - }, - { - "id": "Severability", - "body": "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." - }, - { - "id": "Amendment", - "body": "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." - }, - { - "id": "GoverningLaw", - "body": "This Contract shall be construed in accordance with the Maxims of Equity." - }, - { - "id": "Notice", - "body": "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." - }, - { - "id": "WaiverOfContractualRight", - "body": "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." - }, - { - "id": "ArbitratorsFees_", - "body": "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." - }, - { - "id": "ConstructionAndInterpretation", - "body": "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." - }, - { - "id": "InWitnessWhereof", - "body": "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." - } - ], - "variants": [], - "abi_extensions": [] -} \ No newline at end of file diff --git a/build.sh b/build.sh index 41e181b..e7acbb2 100755 --- a/build.sh +++ b/build.sh @@ -29,8 +29,6 @@ cmake ../ make -j${CORES} popd &> /dev/null -cp SimpleAssets.abi build/SimpleAssets/ -#exit cat << "EOF"                             ':,                                                                         ,ccc;                                             diff --git a/build/SimpleAssets/SimpleAssets.abi b/build/SimpleAssets/SimpleAssets.abi index a80da48..950522f 100644 --- a/build/SimpleAssets/SimpleAssets.abi +++ b/build/SimpleAssets/SimpleAssets.abi @@ -1,6 +1,7 @@ { - "____comment": "This file was generated with eosio-abigen. DO NOT EDIT Mon Apr 15 20:43:11 2019", + "____comment": "This file was generated with eosio-abigen. DO NOT EDIT ", "version": "eosio::abi/1.1", + "types": [], "structs": [ { "name": "account", @@ -122,6 +123,24 @@ } ] }, + { + "name": "burnntt", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "assetids", + "type": "uint64[]" + }, + { + "name": "memo", + "type": "string" + } + ] + }, { "name": "canceloffer", "base": "", @@ -178,6 +197,20 @@ } ] }, + { + "name": "claimntt", + "base": "", + "fields": [ + { + "name": "claimer", + "type": "name" + }, + { + "name": "assetids", + "type": "uint64[]" + } + ] + }, { "name": "closef", "base": "", @@ -282,6 +315,70 @@ } ] }, + { + "name": "createntt", + "base": "", + "fields": [ + { + "name": "author", + "type": "name" + }, + { + "name": "category", + "type": "name" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "idata", + "type": "string" + }, + { + "name": "mdata", + "type": "string" + }, + { + "name": "requireclaim", + "type": "bool" + } + ] + }, + { + "name": "createnttlog", + "base": "", + "fields": [ + { + "name": "author", + "type": "name" + }, + { + "name": "category", + "type": "name" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "idata", + "type": "string" + }, + { + "name": "mdata", + "type": "string" + }, + { + "name": "assetid", + "type": "uint64" + }, + { + "name": "requireclaim", + "type": "bool" + } + ] + }, { "name": "currency_stats", "base": "", @@ -338,6 +435,24 @@ } ] }, + { + "name": "delegatemore", + "base": "", + "fields": [ + { + "name": "owner", + "type": "name" + }, + { + "name": "assetidc", + "type": "uint64" + }, + { + "name": "period", + "type": "uint64" + } + ] + }, { "name": "detach", "base": "", @@ -604,6 +719,58 @@ } ] }, + { + "name": "snttasset", + "base": "", + "fields": [ + { + "name": "id", + "type": "uint64" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "author", + "type": "name" + }, + { + "name": "category", + "type": "name" + }, + { + "name": "idata", + "type": "string" + }, + { + "name": "mdata", + "type": "string" + } + ] + }, + { + "name": "snttoffer", + "base": "", + "fields": [ + { + "name": "assetid", + "type": "uint64" + }, + { + "name": "owner", + "type": "name" + }, + { + "name": "offeredto", + "type": "name" + }, + { + "name": "cdate", + "type": "uint64" + } + ] + }, { "name": "soffer", "base": "", @@ -777,231 +944,39 @@ ] }, { - "name": "updatever", - "base": "", - "fields": [ - { - "name": "version", - "type": "string" - } - ] - }, - { - "name": "delegatemore", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetidc", - "type": "uint64" - }, - { - "name": "period", - "type": "uint64" - } - ] - }, - { - "name": "snttasset", + "name": "updatentt", "base": "", "fields": [ - { - "name": "id", - "type": "uint64" - }, - { - "name": "owner", - "type": "name" - }, { "name": "author", "type": "name" }, - { - "name": "category", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - } - ] - }, - { - "name": "snttoffer", - "base": "", - "fields": [ - { - "name": "assetid", - "type": "uint64" - }, { "name": "owner", "type": "name" }, { - "name": "offeredto", - "type": "name" - }, - { - "name": "cdate", + "name": "assetid", "type": "uint64" - } - ] - }, - { - "name": "createntt", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "idata", - "type": "string" }, { "name": "mdata", "type": "string" - }, - { - "name": "requireclaim", - "type": "bool" - } - ] - }, - { - "name": "burnntt", - "base": "", - "fields": [ - { - "name": "owner", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - }, - { - "name": "memo", - "type": "string" } ] }, { - "name": "createnttlog", - "base": "", - "fields": [ - { - "name": "author", - "type": "name" - }, - { - "name": "category", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "idata", - "type": "string" - }, - { - "name": "mdata", - "type": "string" - }, - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "requireclaim", - "type": "bool" - } - ] - }, - { - "name": "claimntt", - "base": "", - "fields": [ - { - "name": "claimer", - "type": "name" - }, - { - "name": "assetids", - "type": "uint64[]" - } - ] - }, - { - "name": "updatentt", + "name": "updatever", "base": "", "fields": [ { - "name": "author", - "type": "name" - }, - { - "name": "owner", - "type": "name" - }, - { - "name": "assetid", - "type": "uint64" - }, - { - "name": "mdata", + "name": "version", "type": "string" } ] } ], - "types": [], "actions": [ - { - "name": "updatentt", - "type": "updatentt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update assets mutable data\nsummary: Update assets mutable data (mdata) field. Action is available only for authors\nicon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e\n---\n\nInput parameters:\n`author` - authors account;\n`owner` - current assets owner;\n`assetid` - assetid to update;\n`mdata` - stringified json with mutable assets data. All mdata will be replaced;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "createntt", - "type": "createntt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Create a new non transferable asset\nsummary: Create a new asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70\n---\t\n\nInput parameters:\n`author` - asset's author, who will able to updated asset's mdata;\n`category` - assets category;\n`owner` - assets owner;\n`idata` - stringified json with immutable assets data\n`mdata` - stringified json with mutable assets data, can be changed only by author\n`requireclaim` - true or false. If disabled, upon creation, the asset will be transfered to owner (but \n\t\t\t\t but AUTHOR'S memory will be used until the asset is transferred again). If enabled,\n\t\t\t\t author will remain the owner, but an offer will be created for the account specified in \n\t\t\t\t the owner field to claim the asset using the account's RAM.\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "createnttlog", - "type": "createnttlog", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: createlog (internal)\nsummary: createlog (internal) \nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---" - }, - { - "name": "claimntt", - "type": "claimntt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Claim the specified asset\nsummary: Claim the specified asset (assuming it was offered to claimer by the asset owner)\nicon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d\n---\n\nInput parameters:\n`claimer` - account claiming the asset\n`assetids` - array of assetid's to claim\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, - { - "name": "burnntt", - "type": "burnntt", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Burn non transferable asset\nsummary: Burn non transferable asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released.\n\nInput parameters:\n`owner` - current asset owner account;\n`assetids` - array of assetid's to burn;\n`memo` - memo for burn action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" - }, { "name": "attach", "type": "attach", @@ -1015,7 +990,7 @@ { "name": "authorupdate", "type": "authorupdate", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Authors info update\nsummary: Authors info update \nicon: https://cryptolions.io/assets/images/sa-icons-256/authorupdate.png#0b11c9c4e41b6ba1b00bd907c671f7ddc9e2f9caf26580f0b2e7c73e02f36ff3\n---\n\nUsed to updated author information, and asset display recommendations created with the regauthor action. This action replaces the fields data and stemplate. To remove author entry, call this action with null strings for data and stemplate.\n\nInput parameters:\n`author` - authors account who will create assets; \n`data` - stringified json. Recommendations to include: game, company, logo, url, desc;\n`stemplate` - stringified json with key:state values, where key is key from mdata or idata and \n\t\t\t\tstate indicates recommended way of displaying field: \n\t\t\t\turl, img, webgl, mp3, video, hide (ie. don't display), etc.\n`imgpriority` - json with assosiation category with type of image or video \n\t\t\t\ttxt\t- default\n\t\t\t\turl\t- show as clickable URL\n\t\t\t\timg\t- link to img file\n\t\t\t\twebgl\t- link to webgl file\n\t\t\t\tmp3\t- link to mp3 file\n\t\t\t\tvideo\t- link to video file\n\t\t\t\thide\t- do not show\n\t\t\t\timgb \t- image as string in binary format\n\t\t\t\twebglb\t- webgl binary\n\t\t\t\tmp3b \t- mp3 binary\n\t\t\t\tvideob \t- video binary\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Authors info update\nsummary: Authors info update \nicon: https://cryptolions.io/assets/images/sa-icons-256/authorupdate.png#0b11c9c4e41b6ba1b00bd907c671f7ddc9e2f9caf26580f0b2e7c73e02f36ff3\n---\n\nUsed to updated author information, and asset display recommendations created with the regauthor action. This action replaces the fields data and stemplate. To remove author entry, call this action with null strings for data and stemplate.\n\nInput parameters:\n`author` - authors account who will create assets; \n`data` - stringified json. Recommendations to include: game, company, logo, url, desc;\n`stemplate` - stringified json with key:state values, where key is key from mdata or idata and \n\t\t\t\tstate indicates recommended way of displaying field: \n\t\t\t\turl, img, webgl, mp3, video, hide (ie. don't display), etc.\n`imgpriority` - json with assosiation category with type of image or video \n\t\t\t\ttxt\t - default\n\t\t\t\turl\t - show as clickable URL\n\t\t\t\timg\t - link to img file\n\t\t\t\twebgl\t- link to webgl file\n\t\t\t\tmp3\t - link to mp3 file\n\t\t\t\tvideo\t- link to video file\n\t\t\t\thide\t- do not show\n\t\t\t\timgb \t- image as string in binary format\n\t\t\t\twebglb\t- webgl binary\n\t\t\t\tmp3b \t- mp3 binary\n\t\t\t\tvideob \t- video binary\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, { "name": "burn", @@ -1027,6 +1002,11 @@ "type": "burnf", "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Burns a fungible token\nsummary: Burns a fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis 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\n\nInput parameters:\n`from` - account who burns the token;\n`author` - account of fungible token author;\n`quantity` - amount to burn, example \"1.00 WOOD\";\n`memo` - memo for burnf action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, + { + "name": "burnntt", + "type": "burnntt", + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Burn non transferable asset\nsummary: Burn non transferable asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis action is only available for the asset owner. After executing, the asset will disappear forever, and RAM used for asset will be released.\n\nInput parameters:\n`owner` - current asset owner account;\n`assetids` - array of assetid's to burn;\n`memo` - memo for burn action;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + }, { "name": "canceloffer", "type": "canceloffer", @@ -1047,6 +1027,11 @@ "type": "claimf", "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Claim FTs which have been offered\nsummary: Claim FTs which have been offered\nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---\n\nInput parameters:\n`claimer` - Account claiming FTs which have been offered\n`ftofferids` - array of FT offer ids\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, + { + "name": "claimntt", + "type": "claimntt", + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Claim the specified asset\nsummary: Claim the specified asset (assuming it was offered to claimer by the asset owner)\nicon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d\n---\n\nInput parameters:\n`claimer` - account claiming the asset\n`assetids` - array of assetid's to claim\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + }, { "name": "closef", "type": "closef", @@ -1060,13 +1045,23 @@ { "name": "createf", "type": "createf", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Creates fungible token\nsummary: Creates fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/createf.png#5fb6788f19b8fb08ce46e765a9b0ae8758cba7e4da9895f840d34d143912fd3d\n---\n\nCreates fungible token with specified maximum supply; You can not change anything after creation.\n\nInput parameters:\n`author` - fungible token author;\n`maximum_supply` - maximum token supply, example \"10000000.0000 GOLD\", \"10000000 SEED\", \"100000000.00 WOOD\". Precision is also important here;\n`authorctrl` - if true(1) allow token author (and not just owner) to burnf and transferf. Cannot be changed after creation!\n`data` - stringify json (recommend including keys `img` and `name` for better displaying by markets)\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Creates fungible token\nsummary: Creates fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---\n\nCreates fungible token with specified maximum supply; You can not change anything after creation.\n\nInput parameters:\n`author` - fungible token author;\n`maximum_supply` - maximum token supply, example \"10000000.0000 GOLD\", \"10000000 SEED\", \"100000000.00 WOOD\". Precision is also important here;\n`authorctrl` - if true(1) allow token author (and not just owner) to burnf and transferf. Cannot be changed after creation!\n`data` - stringify json (recommend including keys `img` and `name` for better displaying by markets)\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, { "name": "createlog", "type": "createlog", "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: createlog (internal)\nsummary: createlog (internal) \nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---" }, + { + "name": "createntt", + "type": "createntt", + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: create Non transferable token (NTT)\nsummary: This action create a new Non transferable token (NTT).\nicon: https://cryptolions.io/assets/images/sa-icons-256/create.png#db2bc53cef5dbbce5247543a91234373ec4bd1baf743301a0d92a35b053eeb70\n---\n\nInput parameters:\n`owner` - original owner of the FTs\n`newowner` - account which will be able to claim the offer\n`author` - account of fungible token author;\t\n`quantity` - amount to transfer, example \"1.00 WOOD\";\n`memo` - offer's comment;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + }, + { + "name": "createnttlog", + "type": "createnttlog", + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: createlog (internal)\nsummary: createlog (internal) \nicon: https://cryptolions.io/assets/images/sa-icons-256/claimf.png#80086207646470fa9cbaf4638ba0dedec96ea0e84d5059b567adc9e4b8543c30\n---" + }, { "name": "delegate", "type": "delegate", @@ -1110,7 +1105,7 @@ { "name": "regauthor", "type": "regauthor", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: New Author registration\nsummary: New Author registration \nicon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e\n---\n\nAction 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.\n\nInput parameters:\n`author` -\tauthors account who will create assets;\n`data` - stringified json. Recommendations to include: game, company, logo, url, desc;\n`stemplate` - stringified json with key:state values, where key is key from mdata or idata and \n\t\t\t\tstate indicates recommended way of displaying field: \n\t\t\t\turl, img, webgl, mp3, video, hide (ie. don't display), etc.\n`imgpriority` - json with assosiation category with type of image or video \n\t\t\t\ttxt\t- default\n\t\t\t\turl\t- show as clickable URL\n\t\t\t\timg\t- link to img file\n\t\t\t\twebgl\t- link to webgl file\n\t\t\t\tmp3\t- link to mp3 file\n\t\t\t\tvideo\t- link to video file\n\t\t\t\thide\t- do not show\n\t\t\t\timgb \t- image as string in binary format\n\t\t\t\twebglb\t- webgl binary\n\t\t\t\tmp3b \t- mp3 binary\n\t\t\t\tvideob \t- video binary\n\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: New Author registration\nsummary: New Author registration \nicon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e\n---\n\nAction 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.\n\nInput parameters:\n`author` -\tauthors account who will create assets;\n`data` - stringified json. Recommendations to include: game, company, logo, url, desc;\n`stemplate` - stringified json with key:state values, where key is key from mdata or idata and \n\t\t\t\tstate indicates recommended way of displaying field: \n\t\t\t\turl, img, webgl, mp3, video, hide (ie. don't display), etc.\n`imgpriority` - json with assosiation category with type of image or video \n\t\t\t\ttxt\t - default\n\t\t\t\turl\t - show as clickable URL\n\t\t\t\timg\t - link to img file\n\t\t\t\twebgl\t- link to webgl file\n\t\t\t\tmp3\t - link to mp3 file\n\t\t\t\tvideo\t- link to video file\n\t\t\t\thide\t- do not show\n\t\t\t\timgb \t- image as string in binary format\n\t\t\t\twebglb\t- webgl binary\n\t\t\t\tmp3b \t- mp3 binary\n\t\t\t\tvideob \t- video binary\n\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, { "name": "transfer", @@ -1125,7 +1120,7 @@ { "name": "undelegate", "type": "undelegate", - "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Undelegates an asset\nsummary: Undelegates an asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/delegate.png#f8d91c1b9c0f376464e69aadf41142a17492af1e75d394601872b6a992b420bc\n---\n\nExecuting action by real owner will return asset immediately, and the entry in the delegates table recording the borrowing will be erased.\n\nInput parameters:\n`owner` - real asset owner account;\n`from` - current account owner (borrower);\n`assetids` - array of assetid's to undelegate;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Undelegates an asset\nsummary: Undelegates an asset\nicon: https://cryptolions.io/assets/images/sa-icons-256/updatef.png#f5d5af2ed6af508777f9f0b3c3a8e24b61eeca2ea623cfec6f6d0e9ea2c4d1a7\n---\n\nExecuting action by real owner will return asset immediately, and the entry in the delegates table recording the borrowing will be erased.\n\nInput parameters:\n`owner` - real asset owner account;\n`from` - current account owner (borrower);\n`assetids` - array of assetid's to undelegate;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, { "name": "update", @@ -1137,6 +1132,11 @@ "type": "updatef", "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update the data field of a fungible token\nsummary: Update the data field of a fungible token\nicon: https://cryptolions.io/assets/images/sa-icons-256/updatef.png#f5d5af2ed6af508777f9f0b3c3a8e24b61eeca2ea623cfec6f6d0e9ea2c4d1a7\n---\n\nInput parameters:\n`author` - fungible token author;\n`sym` - fingible token symbol (\"GOLD\", \"WOOD\", etc.)\n`data` - stringify json (recommend including keys `img` and `name` for better displaying by markets)\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" }, + { + "name": "updatentt", + "type": "updatentt", + "ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Update assets mutable data\nsummary: Update assets mutable data (mdata) field. Action is available only for authors\nicon: https://cryptolions.io/assets/images/sa-icons-256/update.png#305b640fe614876c6e6f5fed5ac21f8157c80f7bee39f3db26228986c1fc5e0e\n---\n\nInput parameters:\n`author` - authors account;\n`owner` - current assets owner;\n`assetid` - assetid to update;\n`mdata` - stringified json with mutable assets data. All mdata will be replaced;\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]" + }, { "name": "updatever", "type": "updatever", @@ -1172,6 +1172,13 @@ "key_names": [], "key_types": [] }, + { + "name": "nttoffers", + "type": "snttoffer", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, { "name": "offerfs", "type": "sofferf", @@ -1194,29 +1201,22 @@ "key_types": [] }, { - "name": "stat", - "type": "currency_stats", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, - { - "name": "tokenconfigs", - "type": "tokenconfigs", + "name": "snttassets", + "type": "snttasset", "index_type": "i64", "key_names": [], "key_types": [] }, { - "name": "snttassets", - "type": "snttasset", + "name": "stat", + "type": "currency_stats", "index_type": "i64", "key_names": [], "key_types": [] }, { - "name": "nttoffers", - "type": "snttoffer", + "name": "tokenconfigs", + "type": "tokenconfigs", "index_type": "i64", "key_names": [], "key_types": [] @@ -1280,6 +1280,5 @@ "body": "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." } ], - "variants": [], - "abi_extensions": [] + "variants": [] } \ No newline at end of file diff --git a/build/SimpleAssets/SimpleAssets.wasm b/build/SimpleAssets/SimpleAssets.wasm index 6950c93..4e8cf8c 100755 Binary files a/build/SimpleAssets/SimpleAssets.wasm and b/build/SimpleAssets/SimpleAssets.wasm differ diff --git a/include/SimpleAssets.hpp b/include/SimpleAssets.hpp index 45490b2..5e67d79 100644 --- a/include/SimpleAssets.hpp +++ b/include/SimpleAssets.hpp @@ -24,10 +24,10 @@ * Event Receiver: https://github.com/CryptoLions/SimpleAssets-EventReceiverExample */ -#include -#include -#include -#include +#include +#include +#include +#include using namespace eosio; using std::string; diff --git a/src/SimpleAssets.cpp b/src/SimpleAssets.cpp index aaae6ff..7000981 100644 --- a/src/SimpleAssets.cpp +++ b/src/SimpleAssets.cpp @@ -16,9 +16,9 @@ ACTION SimpleAssets::regauthor( name author, string data, string stemplate, stri if ( author_.find( author.value ) == author_.end() ) { author_.emplace( author, [&]( auto& s ) { - s.author = author; - s.data = data; - s.stemplate = stemplate; + s.author = author; + s.data = data; + s.stemplate = stemplate; s.imgpriority = imgpriority; }); } @@ -40,8 +40,8 @@ ACTION SimpleAssets::authorupdate( name author, string data, string stemplate, s } else { author_.modify( itr, author, [&]( auto& s ) { - s.data = data; - s.stemplate = stemplate; + s.data = data; + s.stemplate = stemplate; s.imgpriority = imgpriority; }); } @@ -61,21 +61,21 @@ ACTION SimpleAssets::create( name author, name category, name owner, string idat //add info to offers table offers offert( _self, _self.value ); offert.emplace( author, [&]( auto& s ) { - s.assetid = newID; + s.assetid = newID; s.offeredto = owner; - s.owner = author; - s.cdate = now(); + s.owner = author; + s.cdate = current_time_point().sec_since_epoch(); }); } sassets assets( _self, assetOwner.value ); assets.emplace( author, [&]( auto& s ) { - s.id = newID; - s.owner = assetOwner; - s.author = author; + s.id = newID; + s.owner = assetOwner; + s.author = author; s.category = category; - s.mdata = mdata; // mutable data - s.idata = idata; // immutable data + s.mdata = mdata; // mutable data + s.idata = idata; // immutable data }); //Events @@ -107,21 +107,21 @@ ACTION SimpleAssets::claim( name claimer, std::vector& assetids ) { check( itrc->owner.value == itr->owner.value, "Owner was changed for at least one of the items!?" ); assets_t.emplace( claimer, [&]( auto& s ) { - s.id = itr->id; - s.owner = claimer; - s.author = itr->author; - s.category = itr->category; - s.mdata = itr->mdata; // mutable data - s.idata = itr->idata; // immutable data - s.container = itr->container; + s.id = itr->id; + s.owner = claimer; + s.author = itr->author; + s.category = itr->category; + s.mdata = itr->mdata; // mutable data + s.idata = itr->idata; // immutable data + s.container = itr->container; s.containerf = itr->containerf; }); //Events uniqauthor[itr->author][assetids[i]] = itrc->owner; - assets_f.erase(itr); - offert.erase(itrc); + assets_f.erase( itr ); + offert.erase( itrc ); } for ( auto uniqauthorIt = uniqauthor.begin(); uniqauthorIt != uniqauthor.end(); ++uniqauthorIt ) { @@ -179,13 +179,13 @@ ACTION SimpleAssets::transfer( name from, name to, std::vector& asseti check( offert.find( assetids[i] ) == offert.end(), "At least one of the assets has been offered for a claim and cannot be transferred. Cancel offer?" ); assets_t.emplace( rampayer, [&]( auto& s ) { - s.id = itr->id; - s.owner = to; - s.author = itr->author; - s.category = itr->category; - s.idata = itr->idata; // immutable data - s.mdata = itr->mdata; // mutable data - s.container = itr->container; + s.id = itr->id; + s.owner = to; + s.author = itr->author; + s.category = itr->category; + s.idata = itr->idata; // immutable data + s.mdata = itr->mdata; // mutable data + s.container = itr->container; s.containerf = itr->containerf; }); @@ -233,10 +233,10 @@ ACTION SimpleAssets::offer( name owner, name newowner, std::vector& as check( delegatet.find( assetids[i] ) == delegatet.end(), "At least one of the assets is delegated and cannot be offered." ); offert.emplace( owner, [&]( auto& s ) { - s.assetid = assetids[i]; + s.assetid = assetids[i]; s.offeredto = newowner; - s.owner = owner; - s.cdate = now(); + s.owner = owner; + s.cdate = current_time_point().sec_since_epoch(); }); } } @@ -301,12 +301,12 @@ ACTION SimpleAssets::delegate( name owner, name to, std::vector& asset check( offert.find( assetids[i] ) == offert.end(), "At least one of the assets has an open offer and cannot be delegated." ); delegatet.emplace( owner, [&]( auto& s ) { - s.assetid = assetids[i]; - s.owner = owner; + s.assetid = assetids[i]; + s.owner = owner; s.delegatedto = to; - s.cdate = now(); - s.period = period; - s.memo = memo; + s.cdate = current_time_point().sec_since_epoch(); + s.period = period; + s.memo = memo; }); } @@ -346,7 +346,7 @@ ACTION SimpleAssets::undelegate( name owner, name from, std::vector& a check( owner == itrc->owner, "You are not the owner of at least one of these assets." ); check( from == itrc->delegatedto, "FROM does not match DELEGATEDTO for at least one of the assets." ); check( itr->owner == itrc->delegatedto, "FROM does not match DELEGATEDTO for at least one of the assets." ); - check( ( itrc->cdate + itrc->period ) < now(), "Cannot undelegate until the PERIOD expires." ); + check( ( itrc->cdate + itrc->period ) < current_time_point().sec_since_epoch(), "Cannot undelegate until the PERIOD expires." ); if ( i != 0 ) { assetidsmemo += ", "; @@ -403,13 +403,13 @@ ACTION SimpleAssets::detach( name owner, uint64_t assetidc, std::vectorcontainer[j]; if ( assetids[i] == acc.id ) { assets_f.emplace( owner, [&]( auto& s ) { - s.id = acc.id; - s.owner = owner; - s.author = acc.author; - s.category = acc.category; - s.idata = acc.idata; // immutable data - s.mdata = acc.mdata; // mutable data - s.container = acc.container; + s.id = acc.id; + s.owner = owner; + s.author = acc.author; + s.category = acc.category; + s.idata = acc.idata; // immutable data + s.mdata = acc.mdata; // mutable data + s.container = acc.container; s.containerf = acc.containerf; }); } @@ -448,11 +448,11 @@ ACTION SimpleAssets::createf( name author, asset maximum_supply, bool authorctrl statstable.emplace( author, [&]( auto& s ) { s.supply.symbol = maximum_supply.symbol; - s.max_supply = maximum_supply; - s.issuer = author; - s.id = getid(); - s.authorctrl = authorctrl; - s.data = data; + s.max_supply = maximum_supply; + s.issuer = author; + s.id = getid(); + s.authorctrl = authorctrl; + s.data = data; }); } @@ -553,7 +553,7 @@ ACTION SimpleAssets::offerf( name owner, name newowner, name author, asset quant if ( itr != offert.end() ) { offert.modify( itr, owner, [&](auto& s) { s.quantity.amount += quantity.amount; - s.cdate = now(); + s.cdate = current_time_point().sec_since_epoch(); }); sub_balancef( owner, author, quantity ); return ; @@ -562,12 +562,12 @@ ACTION SimpleAssets::offerf( name owner, name newowner, name author, asset quant } offert.emplace( owner, [&]( auto& s ) { - s.id = getid( true ); - s.author = author; - s.quantity = quantity; + s.id = getid( true ); + s.author = author; + s.quantity = quantity; s.offeredto = newowner; - s.owner = owner; - s.cdate = now(); + s.owner = owner; + s.cdate = current_time_point().sec_since_epoch(); }); sub_balancef( owner, author, quantity ); } @@ -635,8 +635,8 @@ ACTION SimpleAssets::openf( name owner, name author, const symbol& symbol, name if ( acnts.find( st.id ) == acnts.end() ) { acnts.emplace( ram_payer, [&]( auto& a ) { - a.id = st.id; - a.author = author; + a.id = st.id; + a.author = author; a.balance = asset{ 0, symbol }; }); } @@ -736,8 +736,8 @@ void SimpleAssets::attachdeatch( name owner, name author, asset quantity, uint64 if ( !found && attach ) { account addft; - addft.id = st.id; - addft.author = author; + addft.id = st.id; + addft.author = author; addft.balance = quantity; newcontainerf.push_back( addft ); @@ -778,9 +778,9 @@ void SimpleAssets::add_balancef( name owner, name author, asset value, name ram_ if ( to == to_acnts.end() ) { to_acnts.emplace( ram_payer, [&]( auto& a ) { - a.id = ftid; + a.id = ftid; a.balance = value; - a.author = author; + a.author = author; }); } else { @@ -807,7 +807,7 @@ ACTION SimpleAssets::createntt( name author, name category, name owner, string i s.assetid = newID; s.offeredto = owner; s.owner = author; - s.cdate = now(); + s.cdate = current_time_point().sec_since_epoch(); }); } @@ -862,11 +862,11 @@ ACTION SimpleAssets::claimntt( name claimer, std::vector& assetids ) { assets_claimer.emplace( claimer, [&](auto& s) { s.id = itr->id; - s.owner = claimer; - s.author = itr->author; + s.owner = claimer; + s.author = itr->author; s.category = itr->category; - s.mdata = itr->mdata; // mutable data - s.idata = itr->idata; // immutable data + s.mdata = itr->mdata; // mutable data + s.idata = itr->idata; // immutable data }); //Events