@@ -27,25 +27,25 @@ pub mod ProtocolCampagin {
2727
2828 #[storage]
2929 pub struct Storage {
30- protocol_id : u256 ,
30+ pub protocol_id : u256 ,
3131 protocol_counter : u256 ,
32- protocol_nft_class_hash : ClassHash , // The protocol nft class hash
32+ pub protocol_nft_class_hash : ClassHash , // The protocol nft class hash
3333 protocol_owner : Map <u256 , ContractAddress >, // map the owner address and the protocol id
3434 protocols : Map <u256 , ProtocolDetails >, // map the protocol details and the protocol id
3535 protocol_initialized : Map <u256 , bool >, // track if the protocol id has been used or not
3636 users_count : u256 ,
37- Campaign_members : Map <
37+ pub Campaign_members : Map <
3838 (u256 , ContractAddress ), CampaignMembers
3939 >, // map the protocol id and the users interested on the protocol campaign
4040 protocol_info : Map <u256 , ByteArray >, // map the protocol id to the protocol details
4141 protocol_tasks : Map <
4242 u256 , ProtocolCreateTask
4343 >, // map the protocol create task to the task_id
44- protocol_task_id : u256 ,
44+ pub protocol_task_id : u256 ,
4545 protocol_task_descriptions : Map <
4646 (u256 , u256 ), ByteArray
4747 >, // map the task description to the protocol_id and to the task_id
48- tasks : Map <
48+ pub tasks : Map <
4949 (u256 , ContractAddress ), u256
5050 >, // map the protocol_id and the protocol_owner to the task_id
5151 tasks_initialized : Map <u256 , bool >, // track if the task_id has been used or not
@@ -171,11 +171,13 @@ pub mod ProtocolCampagin {
171171
172172
173173 fn create_task (
174- ref self : ComponentState <TContractState >, task_id : u256 , task_description : ByteArray
174+ ref self : ComponentState <TContractState >, task_description : ByteArray
175175 ) -> u256 {
176176 // Get the caller as the protocol owner by using the get_caller_address()
177177 let protocol_owner = get_caller_address ();
178178
179+ let task_id = self . protocol_task_id. read ()+ 1 ;
180+
179181 // Check if the task_id exist by reading from state i.e tasks_initialized
180182 // and also assert if it exist Errors::TASK_ALREADY_EXIST
181183 let task_exists = self . tasks_initialized. read (task_id );
0 commit comments