From 56276b438c9022615bb56853803199f497649e89 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 15:26:39 +0800 Subject: [PATCH 1/7] OEP-74 --- OEPS/OEP-74.mediawiki | 271 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 271 insertions(+) create mode 100644 OEPS/OEP-74.mediawiki diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki new file mode 100644 index 0000000..8a97f32 --- /dev/null +++ b/OEPS/OEP-74.mediawiki @@ -0,0 +1,271 @@ +
+  OEP: 74
+  Title: DDXF DToken+Oep4 Standard
+  Author:
+  Type: Standard
+  Status: Accepted
+  Created: 2020-08-03
+
+ +==Abstract== + +DToken and Oep4 implementation + +==Motivation== + + +==Specification== + +===Methods=== + +====create_token_template==== + +
+fn create_token_template(creator: &Address, tt_bs: &[u8]) -> bool
+
+ +this method will store the TokenTemplate to chain. +the TokenTemplate is defined as follow: +``` +#[derive(Clone, Encoder, Decoder)] +pub struct TokenTemplate { + pub data_id: Option>, + pub token_hash: Vec>, + pub endpoint: Vec, + pub token_name: Vec, + pub token_symbol: Vec, +} +``` + +* `data_id` is the ontid of data. +* `token_hash` is bytearray of token_hash +* `endpoint` is the api of the seller, +* `token_name` is oep8 Token name which will be generated by this TokenTemplate +* `token_symbol` is oep8 Token symbol + + +The parameters are of the following type: + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type| Parameter Description +|- +| creator +| Address +| the owner of token template +|- +| tt_bs +| &[u8] +| the serialization result of token template +|} + +Event + +This method will launch the following events: +["createTokenTemplate", creator, tt_bs, token_template_id] + +====update_token_template==== + +
+fn update_token_template(token_template_id: &[u8], tt_bs: &[u8]) -> bool
+
+ +Update the TokenTemplate on the chain according to the TokenTemplateId + + +The parameters are of the following type: + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| token_template_id +| &[u8] +| used to mark the only TokenTemplate in the chain +|- +| tt_bs +| &[u8] +| the serialization result of token template +|} + +event + +["updateTokenTemplate", token_template_id, tt_bs] + +=========removeTokenTemplate======= + +
+fn remove_token_template(token_template_id: &[u8]) -> bool
+
+ +Delete TokenTemplate based on TokenTemPlateId + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| token_template_id +| &[u8] +| used to mark the only TokenTemplate in the chain +|} + + +event + +["removeTokenTemplate", token_template_id] + + +====authorizeTokenTemplate==== + +
+fn authorize_token_template(token_template_id: &[u8], authorized_addr: &[Address]) -> bool
+
+ +TokenTemplate creator authorizes other addresses to generate DTokens based on the TokenTemplateId + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| token_template_id +| &[u8] +| used to mark the only TokenTemplate in the chain +|- +| authorized_addr +| &[Address] +| Authorized address +|} + + +event + +["authorizeTokenTemplate", token_template_id, authorized_addr] + + + +====removeAuthorizeAddr==== + +
+fn remove_authorize_addr(token_template_id: &[u8], authorized_addr: &[Address]) -> bool
+
+ +Delete the specified authorized address according to TokenTemplateId + + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| token_template_id +| &[u8] +| used to mark the only TokenTemplate in the chain +|- +| authorized_addr +| &[Address] +| Authorized address +|} + +event + +["removeAuthorizeAddr", token_template_id, authorized_addr] + +====generateDToken==== + +
+fn generate_dtoken(acc: &Address, token_template_id: &[u8], n: U128) -> bool
+
+ +The authorized address generates DToken according to the TokenTemplateId, and records the DToken in the input parameter acc. + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| acc +| &Address +| authorized address or creator address +|- +| token_template_id +| &[u8] +| used to mark the only TokenTemplate in the chain +|- +| n +| U128 +| Number of DTokens generated +|} + +event + +["generateDToken", acc, acc, token_template_id,n, token_id] + +====useToken==== + +
+fn use_token(account: &Address, token_id: &[u8], n: U128) -> bool
+
+ +the buyer of the token has the right to consume the token + + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| account +| &Address +| buyer address +|- +| token_id +| &[u8] +| the number of purchases +|- +| n +| U128 +| represents the number of consuming token +|} + +event + +["useToken", account, token_id, n] + + +====deleteToken==== + +
+fn delete_token(account: &Address, token_id: &[u8]) -> bool
+
+ +The Tokentemplate creator can invoke this method to delete token. + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| account +| &Address +| buyer address +|- +| token_id +| &[u8] +| token id +|} + +event + +["deleteToken", account, token_id] + + + +For methods related to the oep8 standard, please refer to +[Oep4](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-4.mediawiki) + + +===Implementation=== + From 90e913bdfb5b774d4976c2ca704b36e73c7601df Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 16:17:42 +0800 Subject: [PATCH 2/7] update --- OEPS/OEP-74.mediawiki | 247 +----------------------------------------- 1 file changed, 4 insertions(+), 243 deletions(-) diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki index 8a97f32..30aebb0 100644 --- a/OEPS/OEP-74.mediawiki +++ b/OEPS/OEP-74.mediawiki @@ -18,252 +18,13 @@ DToken and Oep4 implementation ===Methods=== -====create_token_template==== - -
-fn create_token_template(creator: &Address, tt_bs: &[u8]) -> bool
-
- -this method will store the TokenTemplate to chain. -the TokenTemplate is defined as follow: -``` -#[derive(Clone, Encoder, Decoder)] -pub struct TokenTemplate { - pub data_id: Option>, - pub token_hash: Vec>, - pub endpoint: Vec, - pub token_name: Vec, - pub token_symbol: Vec, -} -``` - -* `data_id` is the ontid of data. -* `token_hash` is bytearray of token_hash -* `endpoint` is the api of the seller, -* `token_name` is oep8 Token name which will be generated by this TokenTemplate -* `token_symbol` is oep8 Token symbol - - -The parameters are of the following type: - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type| Parameter Description -|- -| creator -| Address -| the owner of token template -|- -| tt_bs -| &[u8] -| the serialization result of token template -|} - -Event - -This method will launch the following events: -["createTokenTemplate", creator, tt_bs, token_template_id] - -====update_token_template==== - -
-fn update_token_template(token_template_id: &[u8], tt_bs: &[u8]) -> bool
-
- -Update the TokenTemplate on the chain according to the TokenTemplateId - - -The parameters are of the following type: - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| token_template_id -| &[u8] -| used to mark the only TokenTemplate in the chain -|- -| tt_bs -| &[u8] -| the serialization result of token template -|} - -event - -["updateTokenTemplate", token_template_id, tt_bs] - -=========removeTokenTemplate======= - -
-fn remove_token_template(token_template_id: &[u8]) -> bool
-
- -Delete TokenTemplate based on TokenTemPlateId - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| token_template_id -| &[u8] -| used to mark the only TokenTemplate in the chain -|} - - -event - -["removeTokenTemplate", token_template_id] - - -====authorizeTokenTemplate==== - -
-fn authorize_token_template(token_template_id: &[u8], authorized_addr: &[Address]) -> bool
-
- -TokenTemplate creator authorizes other addresses to generate DTokens based on the TokenTemplateId - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| token_template_id -| &[u8] -| used to mark the only TokenTemplate in the chain -|- -| authorized_addr -| &[Address] -| Authorized address -|} - - -event - -["authorizeTokenTemplate", token_template_id, authorized_addr] - - - -====removeAuthorizeAddr==== - -
-fn remove_authorize_addr(token_template_id: &[u8], authorized_addr: &[Address]) -> bool
-
- -Delete the specified authorized address according to TokenTemplateId - - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| token_template_id -| &[u8] -| used to mark the only TokenTemplate in the chain -|- -| authorized_addr -| &[Address] -| Authorized address -|} - -event - -["removeAuthorizeAddr", token_template_id, authorized_addr] - -====generateDToken==== - -
-fn generate_dtoken(acc: &Address, token_template_id: &[u8], n: U128) -> bool
-
- -The authorized address generates DToken according to the TokenTemplateId, and records the DToken in the input parameter acc. - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| acc -| &Address -| authorized address or creator address -|- -| token_template_id -| &[u8] -| used to mark the only TokenTemplate in the chain -|- -| n -| U128 -| Number of DTokens generated -|} - -event - -["generateDToken", acc, acc, token_template_id,n, token_id] - -====useToken==== - -
-fn use_token(account: &Address, token_id: &[u8], n: U128) -> bool
-
- -the buyer of the token has the right to consume the token - - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| account -| &Address -| buyer address -|- -| token_id -| &[u8] -| the number of purchases -|- -| n -| U128 -| represents the number of consuming token -|} - -event - -["useToken", account, token_id, n] - - -====deleteToken==== - -
-fn delete_token(account: &Address, token_id: &[u8]) -> bool
-
- -The Tokentemplate creator can invoke this method to delete token. - -{| class = "wikitable" -! style = "text-align:center;"| Parameter -! Type -! Desc -|- -| account -| &Address -| buyer address -|- -| token_id -| &[u8] -| token id -|} - -event - -["deleteToken", account, token_id] +For methods related to the DToken standard, please refer to +[DToken](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-71.mediawiki) and it's extensions, +e.g.,[DToken+Agent OEP-72](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-72.mediawiki). -For methods related to the oep8 standard, please refer to +For methods related to the oep4 standard, please refer to [Oep4](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-4.mediawiki) From f479fd527433a2a97b27f384f7741ed5e19010ae Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 17:24:23 +0800 Subject: [PATCH 3/7] update --- OEPS/OEP-74.mediawiki | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki index 30aebb0..478336f 100644 --- a/OEPS/OEP-74.mediawiki +++ b/OEPS/OEP-74.mediawiki @@ -1,7 +1,7 @@
   OEP: 74
   Title: DDXF DToken+Oep4 Standard
-  Author:
+  Author: lucas7788 
   Type: Standard
   Status: Accepted
   Created: 2020-08-03
@@ -30,3 +30,4 @@ For methods related to the oep4 standard, please refer to
 
 ===Implementation===
 
+To be done
\ No newline at end of file

From 7ccbb0bf8c4ed425a755462ad3ddc08474961b0b Mon Sep 17 00:00:00 2001
From: lucas7788 
Date: Mon, 3 Aug 2020 18:46:31 +0800
Subject: [PATCH 4/7] update

---
 OEPS/OEP-74.mediawiki | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki
index 478336f..74fa8c8 100644
--- a/OEPS/OEP-74.mediawiki
+++ b/OEPS/OEP-74.mediawiki
@@ -20,12 +20,12 @@ DToken and Oep4 implementation
 
 
 For methods related to the DToken standard, please refer to
-[DToken](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-71.mediawiki) and it's extensions,
-e.g.,[DToken+Agent OEP-72](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-72.mediawiki).
+[[https://github.com/ontio/OEPs/blob/master/OEPS/OEP-71.mediawiki | DToken]] and it's extensions,
+e.g.,[[https://github.com/ontio/OEPs/blob/master/OEPS/OEP-72.mediawiki | DToken+Agent+OEP-72]].
 
 
 For methods related to the oep4 standard, please refer to
-[Oep4](https://github.com/ontio/OEPs/blob/master/OEPS/OEP-4.mediawiki)
+[[https://github.com/ontio/OEPs/blob/master/OEPS/OEP-4.mediawiki | Oep4]]
 
 
 ===Implementation===

From f7e9bd7e71c0c4e695b87c713ea39b1364c77db8 Mon Sep 17 00:00:00 2001
From: lucas7788 
Date: Mon, 3 Aug 2020 18:56:40 +0800
Subject: [PATCH 5/7] update

---
 OEPS/OEP-74.mediawiki | 1 +
 1 file changed, 1 insertion(+)

diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki
index 74fa8c8..d898d8b 100644
--- a/OEPS/OEP-74.mediawiki
+++ b/OEPS/OEP-74.mediawiki
@@ -13,6 +13,7 @@ DToken and Oep4 implementation
 
 ==Motivation==
 
+Capitalize tokens on the basis of data tokenization, and use blockchain technology to realize the generation, transfer and transaction of capitalized tokens. This OEP is an OEP8-type asset support for DToken.
 
 ==Specification==
 

From 7f02e674f6a90549d28dda97d97090a292600538 Mon Sep 17 00:00:00 2001
From: lucas7788 
Date: Mon, 3 Aug 2020 19:02:36 +0800
Subject: [PATCH 6/7] update

---
 OEPS/OEP-74.mediawiki | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki
index d898d8b..6152352 100644
--- a/OEPS/OEP-74.mediawiki
+++ b/OEPS/OEP-74.mediawiki
@@ -9,11 +9,11 @@
 
 ==Abstract==
 
-DToken and Oep4 implementation
+DToken and OEP-4 implementation
 
 ==Motivation==
 
-Capitalize tokens on the basis of data tokenization, and use blockchain technology to realize the generation, transfer and transaction of capitalized tokens. This OEP is an OEP8-type asset support for DToken.
+Capitalize tokens on the basis of data tokenization, and use blockchain technology to realize the generation, transfer and transaction of capitalized tokens. This OEP is an OEP4-type asset support for DToken.
 
 ==Specification==
 
@@ -25,8 +25,8 @@ For methods related to the DToken standard, please refer to
 e.g.,[[https://github.com/ontio/OEPs/blob/master/OEPS/OEP-72.mediawiki | DToken+Agent+OEP-72]].
 
 
-For methods related to the oep4 standard, please refer to
-[[https://github.com/ontio/OEPs/blob/master/OEPS/OEP-4.mediawiki | Oep4]]
+For methods related to the OEP-4 standard, please refer to
+[[https://github.com/ontio/OEPs/blob/master/OEPS/OEP-4.mediawiki | OEP-4]]
 
 
 ===Implementation===

From 826df6672c95fb5dc9ee19b8d4708049e96f2e74 Mon Sep 17 00:00:00 2001
From: lucas7788 
Date: Mon, 3 Aug 2020 19:25:00 +0800
Subject: [PATCH 7/7] update

---
 OEPS/OEP-74.mediawiki | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/OEPS/OEP-74.mediawiki b/OEPS/OEP-74.mediawiki
index 6152352..6d6a1d0 100644
--- a/OEPS/OEP-74.mediawiki
+++ b/OEPS/OEP-74.mediawiki
@@ -3,13 +3,13 @@
   Title: DDXF DToken+Oep4 Standard
   Author: lucas7788 
   Type: Standard
-  Status: Accepted
+  Status: Draft
   Created: 2020-08-03
 
==Abstract== -DToken and OEP-4 implementation +Sub-contract of DDXF series, a standard proposal to combine off-chain access-token (tokenization) with on-chain token (assertization). Provides support for data management, esp., the permission control. This contract is a basic version for DToken, which cannot be retransferred. For the rest DToken contracts, which support OEP4. ==Motivation==