From b6f0958f46095d2f85f8e00cd80dfcc0d6905e21 Mon Sep 17 00:00:00 2001 From: boostmultifruit <50024381+boostmultifruit@users.noreply.github.com> Date: Wed, 21 Aug 2019 02:55:11 +0300 Subject: [PATCH] Review golos.social in Eng #88 --- .../golos_contracts/golos.social_contract.md | 45 ++++++++++--------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/devportal/application_contracts/golos_contracts/golos.social_contract.md b/devportal/application_contracts/golos_contracts/golos.social_contract.md index 8b1d8b9..ba3ea0e 100644 --- a/devportal/application_contracts/golos_contracts/golos.social_contract.md +++ b/devportal/application_contracts/golos_contracts/golos.social_contract.md @@ -1,23 +1,23 @@ # The Social Smart Contract ## Purpose of golos.social smart contract -The `golos.social` smart contract provides users with the following features: +The `golos.social` smart contract provides users the following features: * creating and editing user profiles (metadata). - * pin-list establishment that allows its owner to receive information about the publications of interest to its users. + * pin-list establishment that allows its owner to receive information about the publications of users thst he/she is interested in. * the establishment of a so-called «black» list allowing to block communication between the owner of this list and any unwanted users. ## Terminology used in the description of golos.social smart contract -**User profile** — user metadata stored in the client application database in the form of a structure characterizing the user. The user profile is created and edited by the user. The `golos.social` smart contract is not responsible for the safety of user metadata, but only controls whether the user has the right to change or delete metadata. +**User profile** — user metadata stored in the client application database in the form of a structure characterizing the user. The user profile is created and edited by the user. The `golos.social` smart contract is not responsible for the storing of user metadata, but only controls whether the user has the right to change or delete metadata. **A user’s pin list** — a database item containing a list of account names that a given user is interested in. The user’s pin list is created and edited by the user. It can be used in the client application to create subscriptions, including informing the given user (subscriber) about the appearance of a new post whose author’s name is contained in the pin list. -**«Black» list** — a database item containing a list of account names that this user characterizes as unwanted. The «black» list is created and edited by the user. Using the «black» list allows the user to block comments and votes of accounts whose names are contained in this list. The `golos.publication` smart contract verifies the presence of the account name in this list when performing `createmsg`, `upvote` and `downvote` actions. +**«Black» list** — a database item containing a list of account names that this user characterizes as unwanted. The «black» list is created and edited by the user. Using the «black» list allows the user to block comments and votes of accounts whose names are contained in this list. The `golos.publication` smart contract verifies the absence of the account name in this list when performing `createmssg` action. ## Actions supported by golos.social smart contract The `golos.social` smart contract supports the following actions: [pin](#pin), [unpin](#unpin), [block](#block), [unblock](#unblock), [updatemeta](#updatemeta) and [deletemeta](#deletemeta). -## accountmeta declaration -The `accountmeta` notification is used to describe the user profile and comes in the following structure: +## accountmeta type +The `accountmeta` type is intented to describe the user profile and comes in the following structure: ```cpp struct accountmeta { optional type; // Type @@ -30,6 +30,8 @@ struct accountmeta { optional instagram; // User’s instagram account optional telegram; // User’s telegram account optional vk; // User’s vk account + optional whatsapp; // User’s whatsapp account + optional wechat; // User’s wechat account optional website; // Personal website url optional first_name; // User first name @@ -58,20 +60,20 @@ struct accountmeta { optional target_point_b; // Intermediate target B } ``` -The `accountmeta` declaration is set as a parameter in the `updatemeta` and `deletemeta` actions. +The `accountmeta` type is used as a parameter in the `updatemeta` action. ## pinblock table The `pinblock` table is a database item and contains information about the relationship of one user to another. The data from the table is used to create a pin-list and a list of blocked users. The `pinblock` table contains the following fields: - * `(name) SERVICE.scope` — the account name (the first name taken from a pair), which puts a user name of interest in one of the lists — the pin-list or the list of blocked users; + * `(name) SERVICE.scope` — the account name (the first name taken from a pair), which puts a user name of interest into one of the lists — the pin-list or the list of blocked users; * `(name) account` — the account name that was added to one of the lists — the pin-list or the list of blocked accounts; * `(bool) pinning` — «true» means that the account name has been added to the pin list; * `(bool) blocking` — «true» means that the account name has been added to the list of blocked accounts. > **Please note:** -> Having «true» in both `pinning` and `blocking` fields simultaneously is unacceptable. -> The account name is removed from the pin-list and the list of blocked accounts if the `pinning` and `blocking` fields are «false». +> Both `pinning` and `blocking` fields cannot be set to «true». +> The record is removing from the table if the `pinning` and `blocking` fields are «false». ## pin The `pin` action is used to add an account name of interest to a pin-list. This action can only be performed by the pin-list owner. The `pin` action has the following form: @@ -89,7 +91,7 @@ The rights to run the `pin` action belong to `pinner` account. The `pin` action is introducing the following restrictions: * a user is not allowed to add own name to the pin-list, that is, the `pinning` field must not contain the `pinner` field value. - * it is not allowed to add account name to the pin-list if this name is in the pin-list. + * it is not allowed to add account name to the pin-list if pin-list already contains this name. * it is not allowed to add account name to the pin-list if this name has been blocked by the `pinner` account, that is, this name is in the list of blocked accounts. ## unpin @@ -108,7 +110,7 @@ void unpin( The rights to run the `pin` action belong to `pinner` account. The `unpin` action is introducing the following restrictions: - * it is not allowed to remove the account name which is the pin-list owner, that is, the `pinning` field must never contain the value of `pinner` filed. + * it is not allowed to remove the account name which is the pin-list owner, that is, the `pinning` field must never be equal to `pinner` filed. * it is not allowed to remove an account name that is not present in the pin-list. ## block @@ -127,9 +129,9 @@ void block( The rights to run the `block` action belong to `blocker` account. The `block` action is introducing the following restrictions: - * deleting your own account name from the «black» list is not allowed meaning the `blocking` field must never contain the value of the `blocker` field. - * deleting an account name that is not present in the «black» list is not allowed. - + * a user is not allowed to block him/herself, that is, the `blocking` field must not be equal to `blocker` field value. + * it is not allowed to add account name to the black-list if black-list already contains this name. + ## unblock The `unblock` action is used to remove an account name from a «black» list. The `unblock` action has the following form: @@ -146,12 +148,12 @@ void unblock( The rights to run the `unblock` action belong to `blocker` account. The `unblock` action is introducing the following restrictions: - * it is not allowed to remove the account name which is the «black» list owner, that is, the `blocking` field must never contain the value of the `blocker` field; + * it is not allowed to remove the account name which is the «black» list owner, that is, the `blocking` field must never be equal to `blocker` field; * it is not allowed to remove an account name that is not present in the «black» list. ## updatemeta The `updatemeta` action is used to fill, update, or delete account profile field values. -The `updatemet`action has the following form: +The `updatemeta` action has the following form: ```cpp void updatemeta( name account, @@ -160,11 +162,11 @@ void updatemeta( ``` **Parameters:** * `account` — name of the account whose profile is being edited. - * `meta` — a value in the form of the `accountmeta` structure. + * `meta` — a value of type of the `accountmeta` structure. The rights to run the `updatemeta` action belong to the account that is specified in the `account` field. The updatemeta action does not interact with the database. It only checks the rights of the user who changes her/his profile. -Updating user metadata within the database has been implemented in the client application. +Updating user metadata within the database should be implemented in the client application. ## deletemeta The `deletemeta` action is used for deleting an account profile. @@ -174,9 +176,8 @@ void deletemeta(name account); ``` The parameter `account` is a name of the account whose profile is being deleted. -The `deletemeta` action does not interact with the database. It only checks the rights of the user who is about to delete her/his profile. - -Removal of user metadata from the database has been implemented in the client application. The rights to run `deletemeta` action belong to the account that is deleting her/his profille. +The `deletemeta` action does not interact with the database. It only checks the rights of the user who is about to delete her/his profile. +Removal of user metadata from the database should be implemented in the client application. ****