Skip to content

Commit 369f34c

Browse files
authored
Feature/user type (#20)
* Add user_type to the community contract * Adjust make file * Adjust contract name so abigen works * Change behavior of the expiration feature * Has kyc
1 parent b1038f9 commit 369f34c

File tree

3 files changed

+44
-22
lines changed

3 files changed

+44
-22
lines changed

community/community.abi

Lines changed: 42 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -726,102 +726,102 @@
726726
{
727727
"name": "claimaction",
728728
"type": "claimaction",
729-
"ricardian_contract": ""
729+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
730730
},
731731
{
732732
"name": "clean",
733733
"type": "clean",
734-
"ricardian_contract": ""
734+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: clean placeholder\nsummary: placeholder\nicon:"
735735
},
736736
{
737737
"name": "create",
738738
"type": "create",
739-
"ricardian_contract": ""
739+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Create new community\nsummary: Creates a new community on BeSpiral. It requires you to send: `cmm_asset`, `creator`, `logo`, `name`, `description`, `inviter_reward` and `invited_reward`. A BeSpiral community is closelly tied to a BeSpiral Token. A community allows a group of people with common goals and objectives to connect and allow the creation of incentives to reach those objectives. It also help to buy and sell products\nicon:"
740740
},
741741
{
742742
"name": "createsale",
743743
"type": "createsale",
744-
"ricardian_contract": ""
744+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Create a sale on a given community\nsummary: Enable a single user to create a new sale (either buy or sell) on a given community. It requires you to send: `from`, `title`, `description`, `quantity`, `image`, `is_buy` and `units`. All information sent is going to be saved. Note that `quantity` is related to price and `units` to number of items available.\nicon:"
745745
},
746746
{
747747
"name": "deleteact",
748748
"type": "deleteact",
749-
"ricardian_contract": ""
749+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: deleteact placeholder\nsummary: placeholder\nicon:"
750750
},
751751
{
752752
"name": "deleteobj",
753753
"type": "deleteobj",
754-
"ricardian_contract": ""
754+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: deleteobj placeholder\nsummary: placeholder\nicon:"
755755
},
756756
{
757757
"name": "deletesale",
758758
"type": "deletesale",
759-
"ricardian_contract": ""
759+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Delete a sale\nsummary: Enable the sale creator to remove a single sale. It requires you to send: `sale_id`. No information is going to be saved.\nicon:"
760760
},
761761
{
762762
"name": "migrate",
763763
"type": "migrate",
764-
"ricardian_contract": ""
764+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: migrate placeholder\nsummary: placeholder\nicon:"
765765
},
766766
{
767767
"name": "migrateafter",
768768
"type": "migrateafter",
769-
"ricardian_contract": ""
769+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: migrateafter placeholder\nsummary: placeholder\nicon:"
770770
},
771771
{
772772
"name": "netlink",
773773
"type": "netlink",
774-
"ricardian_contract": ""
774+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Invites a new account to a given community\nsummary: Add a user to the BeSpiral community network. It requires you to send: `cmm_asset`, `inviter` and `new_user`. We'll save who invited the new account and on which community\nicon:"
775775
},
776776
{
777777
"name": "newobjective",
778778
"type": "newobjective",
779-
"ricardian_contract": ""
779+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
780780
},
781781
{
782782
"name": "reactsale",
783783
"type": "reactsale",
784-
"ricardian_contract": ""
784+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: React to a sale\nsummary: Enable any user in the same community (except by creator) to react to a sale. It requires you to send: `sale_id`, `from` and `type`. No information is going to be saved.\nicon:"
785785
},
786786
{
787787
"name": "setindices",
788788
"type": "setindices",
789-
"ricardian_contract": ""
789+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: setindices placeholder\nsummary: placeholder\nicon:"
790790
},
791791
{
792792
"name": "transfersale",
793793
"type": "transfersale",
794-
"ricardian_contract": ""
794+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Process a sale transfer\nsummary: Enable different users to exchange value for a given sale. It requires you to send: `sale_id`, `from`, `to`, `quantity` and `units`. No information is going to be saved, only used to update previous sale information. Note that `from` is the one interested in the sale, `to` the sale creator, `quantity` is related to price and `units` to number of items available.\nicon:"
795795
},
796796
{
797797
"name": "update",
798798
"type": "update",
799-
"ricardian_contract": ""
799+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Update some information about a community\nsummary: Update information on a existing community on BeSpiral. It requires you to send: `cmm_asset`, `logo`, `name`, `description`, `inviter_reward` and `invited_reward`. All information will be saved, with the exception of the asset that cannot be changed\nicon:"
800800
},
801801
{
802802
"name": "updatesale",
803803
"type": "updatesale",
804-
"ricardian_contract": ""
804+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: Update a sale\nsummary: Enable the sale creator to update some details of a single sale. It requires you to send: `sale_id`, `title`, `description`, `quantity`, `image` and `units`. Except by `sale_id`, all information sent is going to be updated. Note that `quantity` is related to price and `units` to number of items available.\nicon:"
805805
},
806806
{
807807
"name": "updobjective",
808808
"type": "updobjective",
809-
"ricardian_contract": ""
809+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: updobjective placeholder\nsummary: placeholder\nicon:"
810810
},
811811
{
812812
"name": "upsertaction",
813813
"type": "upsertaction",
814-
"ricardian_contract": ""
814+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: upsertaction placeholder\nsummary: placeholder\nicon:"
815815
},
816816
{
817817
"name": "verifyaction",
818818
"type": "verifyaction",
819-
"ricardian_contract": ""
819+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
820820
},
821821
{
822822
"name": "verifyclaim",
823823
"type": "verifyclaim",
824-
"ricardian_contract": ""
824+
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
825825
}
826826
],
827827
"tables": [
@@ -889,6 +889,27 @@
889889
"key_types": []
890890
}
891891
],
892-
"ricardian_clauses": [],
892+
"ricardian_clauses": [
893+
{
894+
"id": "Data Storage",
895+
"body": "---\nspec-version: 0.0.1\ntitle: General Data Storage\nsummary: This smart contract will store data added by the user. The user consents to the storage of this data by signing the transaction.\nicon:"
896+
},
897+
{
898+
"id": "Data Usage",
899+
"body": "---\nspec-version: 0.0.1\ntitle: General Data Use\nsummary: This smart contract will store user data. The smart contract will not use the stored data for any purpose outside store and delete.\nicon:"
900+
},
901+
{
902+
"id": "Data Ownership",
903+
"body": "---\nspec-version: 0.0.1\ntitle: Data Ownership\nsummary: The user of this smart contract verifies that the data is owned by the smart contract, and that the smart contract can use the data in accordance to the terms defined in the Ricardian Contract.\nicon:"
904+
},
905+
{
906+
"id": "Data Distribution",
907+
"body": "---\nspec-version: 0.0.1\ntitle: Data Ownership\nsummary: The smart contract promises to not actively share or distribute the address data. The user of the smart contract understands that data stored in a multi index table is not private data and can be accessed by any user of the blockchain.\nicon:"
908+
},
909+
{
910+
"id": "Data Future",
911+
"body": "---\nspec-version: 0.0.1\ntitle: Data Ownership\nsummary: The smart contract promises to only use the data in accordance of the terms defined in the Ricardian Contract, now and at all future dates.\nicon:"
912+
}
913+
],
893914
"variants": []
894915
}

community/community.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,12 @@ class [[eosio::contract("community")]] cambiatus : public eosio::contract
2424

2525
std::uint8_t has_objectives;
2626
std::uint8_t has_shop;
27+
std::uint8_t has_kyc;
2728

2829
uint64_t primary_key() const { return symbol.raw(); };
2930

3031
EOSLIB_SERIALIZE(community,
31-
(symbol)(creator)(logo)(name)(description)(inviter_reward)(invited_reward)(has_objectives)(has_shop));
32+
(symbol)(creator)(logo)(name)(description)(inviter_reward)(invited_reward)(has_objectives)(has_shop)(has_kyc));
3233
};
3334

3435
TABLE network

community/community.wasm

14.4 KB
Binary file not shown.

0 commit comments

Comments
 (0)