Skip to content

Commit

Permalink
v0.5.2
Browse files Browse the repository at this point in the history
  • Loading branch information
ansigroup committed Jul 14, 2020
1 parent 01af64a commit 0e74cf1
Show file tree
Hide file tree
Showing 7 changed files with 498 additions and 16 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SimpleAssets
*document version 7 July 2020*
*document version 14 July 2020*

## Scope:
1. [Introduction](#introduction)
Expand Down Expand Up @@ -34,8 +34,8 @@ EOS: **simpleassets**
WAX: **simpleassets**
MEETONE: **smplassets.m**
TELOS: **simpleassets**
PROTON: **simpleassets**
EUROPECHAIN: **simpleassets**
PROTON: **simpleassets**
EUROPECHAIN: **simpleassets**


Simple Assets is a separate contract which other Dapps can call to manage their digital assets. This serves as an additional guarantee to users of the Dapp that the ownership of assets is managed by a reputable outside authority, and that once created, the Dapp can only manage the asset's mdata. All the ownership-related functionality exists outside the game.
Expand Down Expand Up @@ -641,6 +641,13 @@ to be the main image.
-----------------
# Change Logs

## Change Log v1.5.2
- Re-enabled event notifications for the following actions:
saeburn, saeclaim, saetransfer, saechauthor, saecreate.
Changed notification logic.
If an author's contract needs to be notified about changes in scope of an asset, please see this example:
https://github.com/CryptoLions/SimpleAssets-EventReceiverExample

## Change Log v1.5.1
- Added burnlog, burnflog, burnnttlog added
- Added restriction for burning asset with assets attached in container
Expand Down
165 changes: 165 additions & 0 deletions build/SimpleAssets/SimpleAssets.abi
Original file line number Diff line number Diff line change
Expand Up @@ -777,6 +777,146 @@
}
]
},
{
"name": "pair_uint64_name",
"base": "",
"fields": [
{
"name": "key",
"type": "uint64"
},
{
"name": "value",
"type": "name"
}
]
},
{
"name": "saeburn",
"base": "",
"fields": [
{
"name": "author",
"type": "name"
},
{
"name": "owner",
"type": "name"
},
{
"name": "assetids",
"type": "uint64[]"
},
{
"name": "memo",
"type": "string"
}
]
},
{
"name": "saechauthor",
"base": "",
"fields": [
{
"name": "author",
"type": "name"
},
{
"name": "newauthor",
"type": "name"
},
{
"name": "owner",
"type": "name"
},
{
"name": "assetids",
"type": "pair_uint64_name[]"
},
{
"name": "memo",
"type": "string"
}
]
},
{
"name": "saeclaim",
"base": "",
"fields": [
{
"name": "author",
"type": "name"
},
{
"name": "claimer",
"type": "name"
},
{
"name": "assetids",
"type": "pair_uint64_name[]"
}
]
},
{
"name": "saecreate",
"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": "saetransfer",
"base": "",
"fields": [
{
"name": "author",
"type": "name"
},
{
"name": "from",
"type": "name"
},
{
"name": "to",
"type": "name"
},
{
"name": "assetids",
"type": "uint64[]"
},
{
"name": "memo",
"type": "string"
}
]
},
{
"name": "sasset",
"base": "",
Expand Down Expand Up @@ -1313,6 +1453,31 @@
"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": "saeburn",
"type": "saeburn",
"ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Internal action used for creating log\nsummary: Internal action used for creating log\nicon: https://cryptolions.io/assets/images/sa-icons-256/burn.png#76954820d84563187e968b461a706ab089a9c00f5332df96a4e5bb2e69ed5e84\n---\n\nThis action is called during burn in deferred transaction \n\nInput parameters:\n`author` - asset's author;\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": "saechauthor",
"type": "saechauthor",
"ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Internal action used for creating log\nsummary: Internal action used for creating log\nicon: https://cryptolions.io/assets/images/sa-icons-256/regauthor.png#c6a539be8e7dfd1a4c466ba9cabfd13571cd77d5c988c652d2e8f87096f3548e\n---\t\n\nInput parameters:\n`author` - asset's author, who will able to change author name asset's;\n`newauthor` - asset's new author name;\n`owner` - assets owner;\n`assetids` - array of assetid's\n\nTERM\nThis Contract expires at the conclusion of code execution.\nby CryptoLions [ https://cryptolions.io ]"
},
{
"name": "saeclaim",
"type": "saeclaim",
"ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Internal action used for creating log\nsummary: Internal action used for creating log\nicon: https://cryptolions.io/assets/images/sa-icons-256/claim.png#8c3fdf140ea14a3cb9762a0f6ec0f0d73f8c2eeeec3ea2f109f394a9f35f472d\n---\n\nInput parameters:\n`author` - asset's author, who will able to updated asset's mdata;\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": "saecreate",
"type": "saecreate",
"ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Internal action used for creating log\nsummary: Internal action used for creating log\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": "saetransfer",
"type": "saetransfer",
"ricardian_contract": "---\nspec_version: 0.0.2\ntitle: Internal action used for creating log\nsummary: Internal action used for creating log\nicon: https://cryptolions.io/assets/images/sa-icons-256/transfer.png#23227a4901414db5cd0973d1cc5df13f9b82375b21c6315fd3402cb4acd50cbf\n---\n\nThis action is called during transfer in deferred transaction \n\nInput parameters:\n`author` - asset's author;\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": "transfer",
"type": "transfer",
Expand Down
Binary file modified build/SimpleAssets/SimpleAssets.wasm
Binary file not shown.
85 changes: 83 additions & 2 deletions include/SimpleAssets.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* @file
* @author (C) 2019 by CryptoLions [ https://CryptoLions.io ]
* @version 1.1.0
* @author (C) 2020 by CryptoLions [ https://CryptoLions.io ]
* @version 1.5.2
*
* @section LICENSE
*
Expand Down Expand Up @@ -728,6 +728,87 @@ CONTRACT SimpleAssets : public contract{
ACTION mdremove( uint64_t id );
using mdremove_action = action_wrapper< "mdremove"_n, &SimpleAssets::mdremove >;

/*
* Action for notification after transfering one or more assets.
*
* This action will notify author with help of require_recepient
* after transfers one or more assets.
*
* @param author is author of the asset.
* @param from is account who sends the asset.
* @param to is account of receiver.
* @param assetids is array of assetid's to transfer.
* @param memo is transfers comment.
* @return no return value.
*/
ACTION saetransfer( name author, name from, name to, vector<uint64_t>& assetids, string memo );
using saetransfer_action = action_wrapper< "saetransfer"_n, &SimpleAssets::saetransfer >;

/*
* Action for notification after burning asset.
*
* This action will notify author with help of require_recepient
* after burn one or more assets.
*
* @param author is author of the asset.
* @param owner is current asset owner account.
* @param assetids is array of asset id's to burn.
* @param memo is memo for burn action.
* @return no return value.
*/
ACTION saeburn( name author, name owner, vector<uint64_t>& assetids, string memo );
using saeburn_action = action_wrapper< "saeburn"_n, &SimpleAssets::saeburn >;

/*
* Action for notification after changing author of asset.
*
* This action will notify author with help of require_recepient
* after chaning of one or more assets author.
*
* @param author is author of the asset.
* @param newauthor is new author of the asset.
* @param owner is current asset owner account.
* @param assetids is array of asset id's to change author.
* @param memo is memo for change author action.
* @return no return value.
*/
ACTION saechauthor( name author, name newauthor, name owner, map< uint64_t, name >& assetids, string memo );
using saechauthor_action = action_wrapper< "saechauthor"_n, &SimpleAssets::saechauthor >;

/*
* Action for notification after creating a new asset.
*
* This action will notify author with help of require_recepient
* after creating a new asset.
*
* @param author is the asset's author. This account is allowed to update the asset's mdata.
* @param category is asset category.
* @param owner is asset owner.
* @param idata is stringified JSON or sha256 string with immutable asset data.
* @param mdata is stringified JSON or sha256 string with mutable asset data. It can be changed only by author.
* @param assetid is new asset id.
* @param requireclaim is true or false. If set to "false", the newly created asset will be transferred to the
* owner (but author's RAM will be used until the asset is transferred again). If set to
* "true", the author will remain to be the owner, but an offer will be created for the
* account specified in the owner field to claim the asset using the owner's RAM.
* @return no return value.
*/
ACTION saecreate( name author, name category, name owner, string idata, string mdata, uint64_t assetid, bool requireclaim );
using saecreate_action = action_wrapper< "saecreate"_n, &SimpleAssets::saecreate >;

/*
* Action for notification after claiming the assets.
*
* This action will notify author with help of require_recepient
* after claiming the assets.
*
* @param claimer is account claiming the asset.
* @param assetids is array of asset id's to claim.
* @return no return value.
*/
ACTION saeclaim( name author, name claimer, map< uint64_t, name >& assetids );
using saeclaim_action = action_wrapper< "saeclaim"_n, &SimpleAssets::saeclaim >;

public:
enum id_type { asset_id = 0, deferred_id = 1, offer_id = 2, md_id = 3 };

Expand Down
Loading

0 comments on commit 0e74cf1

Please sign in to comment.