From 457f3b4f9f0298510d0d8d21a36aa8a6b582f822 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 15:31:04 +0800 Subject: [PATCH 1/7] OEP-77 --- OEPS/OEP-77.mediawiki | 185 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 OEPS/OEP-77.mediawiki diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki new file mode 100644 index 0000000..c412563 --- /dev/null +++ b/OEPS/OEP-77.mediawiki @@ -0,0 +1,185 @@ +
+  OEP: 77
+  Title: DDXF Accountant Standard
+  Author:
+  Type: Standard
+  Status: Accepted
+  Created: 2020-08-03
+
+ +==Abstract== + +The contract is used to agree on the profit distribution ratio between the marketplace and the seller + +==Motivation== + + +==Specification== + +===Methods=== + +====setFeeSplitModel==== + +
+fn set_fee_split_model(seller_acc: &Address, fsm_bytes: &[u8]) -> bool
+
+ +set charging model, need mp and seller signature + +the FeeSplitModel is defined as follow: +``` +#[derive(Encoder, Decoder, Clone)] +pub struct FeeSplitModel { + pub weight: u16, +} +``` + +* `weight` Marketplace fee ratio + + +The parameters are of the following type: + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type| Parameter Description +|- +| seller_acc +| &Address +| the owner of token template +|- +| fsm_bytes +| &[u8] +| the serialization result of FeeSplitModel +|} + +Event + +This method will launch the following events: +["setFeeSplitModel", seller_acc, fsm_bytes] + + +====getFeeSplitModel==== + +
+fn get_fee_split_model(seller_acc: &Address) -> FeeSplitModel
+
+ +query charging model + +The parameters are of the following type: + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type| Parameter Description +|- +| seller_acc +| &Address +| seller address +|} + + +====transferAmount==== + +
+pub fn transfer_amount(
+    order_id_bytes: &[u8],
+    buyer_acc: &Address,
+    split_contract_address: &Address,
+    fee: &[u8],
+    n: U128,
+) -> bool
+
+ +transfer fee to the contract and register the income distribution balance of this order + +The parameters are of the following type: + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| order_id_bytes +| &[u8] +| the serialization result of OrderId +|- +| buyer_acc +| &[u8] +| buyer address +|- +| split_contract_address +| &Address +| split contract address which register the distribution strategy +|- +| fee +| &[u8] +| the cost of one share +|- +| n +| U128 +| the number of shares purchased +|} + +event + +["transferAmount", order_id_bytes, buyer_acc, split_contract_address,fee_bytes,n] + +=========getSettleInfo======= + +
+pub fn get_settle_info(order_id: &[u8]) -> SettleInfo
+
+ +query settle info by order id + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| order_id +| &[u8] +| the serialization result of OrderId +|} + +return type is `SettleInfo` is defined as follows: +``` +#[derive(Encoder, Decoder)] +pub struct SettleInfo { + pub split_contract_addr: Address, + pub fee: Fee, + pub n: U128, +} +``` + +====settle==== + +
+pub fn settle(seller_acc: &Address, order_id: &[u8]) -> bool
+
+ +expense settlement, first transfer fee to mp, second invoke "transferWithdraw" method of split contract + +{| class = "wikitable" +! style = "text-align:center;"| Parameter +! Type +! Desc +|- +| seller_acc +| &Address +| the seller address, need the address signature +|- +| order_id +| &[u8] +| the serialization result of OrderId +|} + + +event + +["settle", seller_acc, order_id] + + +===Implementation=== + +[oep-69](https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant) \ No newline at end of file From 41bd31ea13cb5b5cbb7944c57b380ade48ec77f4 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 16:26:32 +0800 Subject: [PATCH 2/7] update --- OEPS/OEP-77.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki index c412563..c70c3c3 100644 --- a/OEPS/OEP-77.mediawiki +++ b/OEPS/OEP-77.mediawiki @@ -182,4 +182,4 @@ event ===Implementation=== -[oep-69](https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant) \ No newline at end of file +[oep-77](https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant) \ No newline at end of file From 658ed6af8a6ba44fd03bac1ed378512a753f8671 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 17:32:51 +0800 Subject: [PATCH 3/7] update --- OEPS/OEP-77.mediawiki | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki index c70c3c3..b5636b8 100644 --- a/OEPS/OEP-77.mediawiki +++ b/OEPS/OEP-77.mediawiki @@ -1,7 +1,7 @@
   OEP: 77
   Title: DDXF Accountant Standard
-  Author:
+  Author: lucas7788
   Type: Standard
   Status: Accepted
   Created: 2020-08-03
@@ -24,9 +24,9 @@ The contract is used to agree on the profit distribution ratio between the marke
 fn set_fee_split_model(seller_acc: &Address, fsm_bytes: &[u8]) -> bool
 
-set charging model, need mp and seller signature +Set charging model, need mp and seller signature. -the FeeSplitModel is defined as follow: +The FeeSplitModel is defined as follow: ``` #[derive(Encoder, Decoder, Clone)] pub struct FeeSplitModel { @@ -64,7 +64,7 @@ This method will launch the following events: fn get_fee_split_model(seller_acc: &Address) -> FeeSplitModel -query charging model +Query charging model The parameters are of the following type: @@ -90,7 +90,7 @@ pub fn transfer_amount( ) -> bool -transfer fee to the contract and register the income distribution balance of this order +Transfer fee to the contract and register the income distribution balance of this order. The parameters are of the following type: @@ -130,7 +130,7 @@ event pub fn get_settle_info(order_id: &[u8]) -> SettleInfo -query settle info by order id +Query settle info by order id. {| class = "wikitable" ! style = "text-align:center;"| Parameter @@ -158,7 +158,7 @@ pub struct SettleInfo { pub fn settle(seller_acc: &Address, order_id: &[u8]) -> bool -expense settlement, first transfer fee to mp, second invoke "transferWithdraw" method of split contract +Expense settlement, first transfer fee to mp, second invoke "transferWithdraw" method of split contract. {| class = "wikitable" ! style = "text-align:center;"| Parameter From a85342f6b87f4838c67575393c3fba1339625831 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 18:08:29 +0800 Subject: [PATCH 4/7] update --- OEPS/OEP-77.mediawiki | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki index b5636b8..ac061c7 100644 --- a/OEPS/OEP-77.mediawiki +++ b/OEPS/OEP-77.mediawiki @@ -120,7 +120,7 @@ The parameters are of the following type: | the number of shares purchased |} -event +Event ["transferAmount", order_id_bytes, buyer_acc, split_contract_address,fee_bytes,n] @@ -175,7 +175,7 @@ Expense settlement, first transfer fee to mp, second invoke "transferWithdraw" m |} -event +Event ["settle", seller_acc, order_id] From 5fd6f28a40b50a46da10d9366f223626dde860ec Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 18:41:28 +0800 Subject: [PATCH 5/7] update --- OEPS/OEP-77.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki index ac061c7..df183b9 100644 --- a/OEPS/OEP-77.mediawiki +++ b/OEPS/OEP-77.mediawiki @@ -182,4 +182,4 @@ Event ===Implementation=== -[oep-77](https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant) \ No newline at end of file +[[https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant | oep-77]] \ No newline at end of file From 1eae191c59090c34b207fc695635951eb7b917fa Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 19:00:56 +0800 Subject: [PATCH 6/7] update --- OEPS/OEP-77.mediawiki | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki index df183b9..57ac751 100644 --- a/OEPS/OEP-77.mediawiki +++ b/OEPS/OEP-77.mediawiki @@ -182,4 +182,4 @@ Event ===Implementation=== -[[https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant | oep-77]] \ No newline at end of file +[[https://github.com/ont-bizsuite/ddxf-contract-suite/tree/master/contracts/accountant | OEP-77]] \ No newline at end of file From a39fc867511ce30a17009f68c2cf3e605ff3a6f9 Mon Sep 17 00:00:00 2001 From: lucas7788 Date: Mon, 3 Aug 2020 20:20:35 +0800 Subject: [PATCH 7/7] update --- OEPS/OEP-77.mediawiki | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/OEPS/OEP-77.mediawiki b/OEPS/OEP-77.mediawiki index 57ac751..a3f4ee0 100644 --- a/OEPS/OEP-77.mediawiki +++ b/OEPS/OEP-77.mediawiki @@ -9,10 +9,14 @@ ==Abstract== -The contract is used to agree on the profit distribution ratio between the marketplace and the seller +The contract is used to agree on the profit distribution ratio between the marketplace and the token owner(s). ==Motivation== +Sub-contract of DDXF series, provides fee split services between the marketplace and the token owner(s). + +The marketplace provides a place for token/DToken owner to manage their published items, and enable token exchange between token owner and token acquiers. +The digital asset paid by token acquiers will be split between marketplace and token owners, by Accountant. ==Specification==