Skip to content

Commit 9c3158c

Browse files
committed
Correct bug on action completion
1 parent 57b0fc8 commit 9c3158c

File tree

4 files changed

+31
-45
lines changed

4 files changed

+31
-45
lines changed

community/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,14 @@
33
src = $(wildcard *.cpp)
44
obj = $(src:.cpp=.wasm)
55
OPTS = -D'__TOKEN_ACCOUNT__=cambiatus.tk' -D'__BACKEND_ACCOUNT__=cambiatus' -D'__PROOF_EXPIRATION_SECS__=1800'
6+
# url = https://app.cambiatus.io
7+
url = https://staging.cambiatus.io
68

79
community.wasm: $(src)
810
eosio-cpp $(OPTS) -o $@ -abigen -R ./ricardian $^
911

1012
clean:
1113
rm $(obj)
14+
15+
deploy:
16+
cleos -u $(url) set contract cambiatus.cm ../community

community/community.abi

Lines changed: 25 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"____comment": "This file was generated with eosio-abigen. DO NOT EDIT ",
3-
"version": "eosio::abi/1.1",
3+
"version": "eosio::abi/1.2",
44
"types": [],
55
"structs": [
66
{
@@ -806,102 +806,102 @@
806806
{
807807
"name": "claimaction",
808808
"type": "claimaction",
809-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
809+
"ricardian_contract": ""
810810
},
811811
{
812812
"name": "clean",
813813
"type": "clean",
814-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: clean placeholder\nsummary: placeholder\nicon:"
814+
"ricardian_contract": ""
815815
},
816816
{
817817
"name": "create",
818818
"type": "create",
819-
"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:"
819+
"ricardian_contract": ""
820820
},
821821
{
822822
"name": "createsale",
823823
"type": "createsale",
824-
"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:"
824+
"ricardian_contract": ""
825825
},
826826
{
827827
"name": "deleteact",
828828
"type": "deleteact",
829-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: deleteact placeholder\nsummary: placeholder\nicon:"
829+
"ricardian_contract": ""
830830
},
831831
{
832832
"name": "deleteobj",
833833
"type": "deleteobj",
834-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: deleteobj placeholder\nsummary: placeholder\nicon:"
834+
"ricardian_contract": ""
835835
},
836836
{
837837
"name": "deletesale",
838838
"type": "deletesale",
839-
"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:"
839+
"ricardian_contract": ""
840840
},
841841
{
842842
"name": "migrate",
843843
"type": "migrate",
844-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: migrate placeholder\nsummary: placeholder\nicon:"
844+
"ricardian_contract": ""
845845
},
846846
{
847847
"name": "migrateafter",
848848
"type": "migrateafter",
849-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: migrateafter placeholder\nsummary: placeholder\nicon:"
849+
"ricardian_contract": ""
850850
},
851851
{
852852
"name": "netlink",
853853
"type": "netlink",
854-
"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:"
854+
"ricardian_contract": ""
855855
},
856856
{
857857
"name": "newobjective",
858858
"type": "newobjective",
859-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
859+
"ricardian_contract": ""
860860
},
861861
{
862862
"name": "reactsale",
863863
"type": "reactsale",
864-
"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:"
864+
"ricardian_contract": ""
865865
},
866866
{
867867
"name": "setindices",
868868
"type": "setindices",
869-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: setindices placeholder\nsummary: placeholder\nicon:"
869+
"ricardian_contract": ""
870870
},
871871
{
872872
"name": "transfersale",
873873
"type": "transfersale",
874-
"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:"
874+
"ricardian_contract": ""
875875
},
876876
{
877877
"name": "update",
878878
"type": "update",
879-
"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:"
879+
"ricardian_contract": ""
880880
},
881881
{
882882
"name": "updatesale",
883883
"type": "updatesale",
884-
"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:"
884+
"ricardian_contract": ""
885885
},
886886
{
887887
"name": "updobjective",
888888
"type": "updobjective",
889-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: updobjective placeholder\nsummary: placeholder\nicon:"
889+
"ricardian_contract": ""
890890
},
891891
{
892892
"name": "upsertaction",
893893
"type": "upsertaction",
894-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle: upsertaction placeholder\nsummary: placeholder\nicon:"
894+
"ricardian_contract": ""
895895
},
896896
{
897897
"name": "verifyaction",
898898
"type": "verifyaction",
899-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
899+
"ricardian_contract": ""
900900
},
901901
{
902902
"name": "verifyclaim",
903903
"type": "verifyclaim",
904-
"ricardian_contract": "---\nspec-version: 0.0.1\ntitle:\nsummary:\nicon:"
904+
"ricardian_contract": ""
905905
}
906906
],
907907
"tables": [
@@ -969,27 +969,8 @@
969969
"key_types": []
970970
}
971971
],
972-
"ricardian_clauses": [
973-
{
974-
"id": "Data Storage",
975-
"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:"
976-
},
977-
{
978-
"id": "Data Usage",
979-
"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:"
980-
},
981-
{
982-
"id": "Data Ownership",
983-
"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:"
984-
},
985-
{
986-
"id": "Data Distribution",
987-
"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:"
988-
},
989-
{
990-
"id": "Data Future",
991-
"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:"
992-
}
993-
],
994-
"variants": []
972+
"kv_tables": {},
973+
"ricardian_clauses": [],
974+
"variants": [],
975+
"action_results": []
995976
}

community/community.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ void cambiatus::verifyclaim(std::uint64_t claim_id, eosio::name verifier, std::u
754754
action.modify(itr_objact, _self, [&](auto &a)
755755
{
756756
a.usages_left = objact.usages_left - 1;
757-
a.is_completed = (objact.usages_left - 1) == 0 ? 0 : 1;
757+
a.is_completed = (objact.usages_left - 1) == 0 ? 1 : 0;
758758
});
759759
}
760760
}

community/community.wasm

20.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)