Skip to content

Commit

Permalink
Release Note v2.0.0 (#18)
Browse files Browse the repository at this point in the history
* 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 55ab08d.

* 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>
  • Loading branch information
quocle108 and danielvo11 committed Apr 23, 2020
1 parent c9808dc commit c6bf3e0
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 45 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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:

Expand Down
74 changes: 37 additions & 37 deletions cryptobadge.abi
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down Expand Up @@ -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": "",
Expand Down Expand Up @@ -439,13 +439,6 @@
}
],
"tables": [
{
"name": "community",
"type": "communityf",
"index_type": "i64",
"key_names": [],
"key_types": []
},
{
"name": "v1.badges",
"type": "v1_badge",
Expand All @@ -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",
Expand Down
Binary file modified cryptobadge.wasm
Binary file not shown.
4 changes: 2 additions & 2 deletions include/cryptobadge.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ class[[eosio::contract]] cryptobadge : public contract


//refer govenance design
TABLE communityf
TABLE v1_community
{
name community_account;
name creator;
Expand All @@ -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;
};
4 changes: 2 additions & 2 deletions src/cryptobadge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()){
Expand Down Expand Up @@ -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()) {
Expand Down

0 comments on commit c6bf3e0

Please sign in to comment.