From c6bf3e0bed27c4da781ed29de475540403ac3c33 Mon Sep 17 00:00:00 2001 From: ChimGoKien <38057360+quocle108@users.noreply.github.com> Date: Tue, 21 Apr 2020 17:00:12 +0700 Subject: [PATCH] Release Note v2.0.0 (#18) * required 2 signatures to create-issue a badge * release v1.0.0 (#4) (#5) * release v1.0.0 * fixed remove unused * fix/correct params name and revove encrypted data in state data (#10) * Revert "fix/correct params name and revove encrypted data in state data (#10)" (#11) This reverts commit 55ab08da61860b7dea650746d77ffd87340af7cf. * fix/correct params name and remove encrypted data in cert state data (#13) * feat/gitlab#127 contract owner should be able to set governance contract name (#14) * Feat/issue badge non can account (#9) * issue badge to non CAN account * allow 3rd party pay RAM for all transactions * rename action issuecert to issuebadge * add claimbadge+logissue to ricardian contract * feat/#15 add unit test (#16) * add run binary file * update table name refer from governance design v2.0.0 Co-authored-by: danielAlvess <48626389+danielAlvess@users.noreply.github.com> --- README.md | 11 +++--- cryptobadge.abi | 74 ++++++++++++++++++++-------------------- cryptobadge.wasm | Bin 48038 -> 48036 bytes include/cryptobadge.hpp | 4 +-- src/cryptobadge.cpp | 4 +-- 5 files changed, 48 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index ab3bf3a..304b031 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ Crypto-Badge ---------- -Version 1.0.0 +Version 2.0.0 This contract provides multiple functionalities: - Users can register to become a badge issuer, - Issuer can create/update badge and assign to badge owner - Badge owner can create new certification based on the created badge -- Badge owner can create new certification and issue to users (issuer pay for RAM) directly or offer it to users (Users must pay RAM if they accept the offer) -- Badge owner can cancel the offered certification. -- User can accept the offer to receive certification from Badge owner +- Badge owner can create new certification and issue to users +- Badge owner can create new certification and reserved it for non CAN account +- Users who just have CAN account can claim badge which belong to them under verification from crypto-badge - User can choose to public certification detail Dependencies: @@ -56,6 +56,9 @@ yarn test cryptobadge.test.ts ***WARING*** Because test need to send many request to hydra server, test timeout error may sometime happend. Make sure your network connection is stable to run this test. +## Example to run contract with cleos: + +* [Example](https://github.com/canfoundation/cryptobadge/tree/master/example) ## Actions: diff --git a/cryptobadge.abi b/cryptobadge.abi index d9d156e..020ca43 100644 --- a/cryptobadge.abi +++ b/cryptobadge.abi @@ -21,36 +21,6 @@ } ] }, - { - "name": "communityf", - "base": "", - "fields": [ - { - "name": "community_account", - "type": "name" - }, - { - "name": "creator", - "type": "name" - }, - { - "name": "community_name", - "type": "string" - }, - { - "name": "member_badge", - "type": "uint64[]" - }, - { - "name": "community_url", - "type": "string" - }, - { - "name": "description", - "type": "string" - } - ] - }, { "name": "createbadge", "base": "", @@ -323,6 +293,36 @@ } ] }, + { + "name": "v1_community", + "base": "", + "fields": [ + { + "name": "community_account", + "type": "name" + }, + { + "name": "creator", + "type": "name" + }, + { + "name": "community_name", + "type": "string" + }, + { + "name": "member_badge", + "type": "uint64[]" + }, + { + "name": "community_url", + "type": "string" + }, + { + "name": "description", + "type": "string" + } + ] + }, { "name": "v1_global", "base": "", @@ -439,13 +439,6 @@ } ], "tables": [ - { - "name": "community", - "type": "communityf", - "index_type": "i64", - "key_names": [], - "key_types": [] - }, { "name": "v1.badges", "type": "v1_badge", @@ -467,6 +460,13 @@ "key_names": [], "key_types": [] }, + { + "name": "v1.community", + "type": "v1_community", + "index_type": "i64", + "key_names": [], + "key_types": [] + }, { "name": "v1.global", "type": "v1_global", diff --git a/cryptobadge.wasm b/cryptobadge.wasm index 834335e4f26873205285eb62cbd877dc23464710..bf963722de7abb9b9d836e0d81fc8bdd77b20729 100755 GIT binary patch delta 60 zcmZ4XooUH;rVaLNjF&b$urZ4<{@d&#!^*_@;Q6~NOHVFZ5V1K}j)$Ld@#X|wZe-C? HeZw9A4|*D? delta 62 zcmZ4TooU&3rVaLNj8`^0urZ4<{@?5(!^*_f&~V`V-Ib>&9c9=YB*(+gxMXv@E;ovB IvA$ss03HV!_5c6? diff --git a/include/cryptobadge.hpp b/include/cryptobadge.hpp index 412e545..bc20d38 100644 --- a/include/cryptobadge.hpp +++ b/include/cryptobadge.hpp @@ -268,7 +268,7 @@ class[[eosio::contract]] cryptobadge : public contract //refer govenance design - TABLE communityf + TABLE v1_community { name community_account; name creator; @@ -280,5 +280,5 @@ class[[eosio::contract]] cryptobadge : public contract uint64_t primary_key() const { return community_account.value; } }; - typedef eosio::multi_index<"community"_n, communityf> community_table; + typedef eosio::multi_index<"v1.community"_n, v1_community> v1_community_table; }; \ No newline at end of file diff --git a/src/cryptobadge.cpp b/src/cryptobadge.cpp index 3fef98d..36b323b 100644 --- a/src/cryptobadge.cpp +++ b/src/cryptobadge.cpp @@ -56,7 +56,7 @@ ACTION cryptobadge::createbadge(name issuer, uint64_t badge_id, string name, str if(has_auth(ram_payer_system)) ram_payer = ram_payer_system; v1_issuers _issuer(_self, _self.value); - community_table _community(g_state.governance_design, g_state.governance_design.value); + v1_community_table _community(g_state.governance_design, g_state.governance_design.value); auto issuer_itr = _issuer.find( issuer.value ); if(issuer_itr == _issuer.end()){ @@ -110,7 +110,7 @@ ACTION cryptobadge::issuebadge( name issuer, name owner, uint64_t badge_id, uint if(has_auth(ram_payer_system)) ram_payer = ram_payer_system; v1_issuers _issuer(_self, _self.value); - community_table _community(g_state.governance_design, g_state.governance_design.value); + v1_community_table _community(g_state.governance_design, g_state.governance_design.value); auto issuer_itr = _issuer.find( issuer.value ); if(issuer_itr == _issuer.end()) {