From 28c5ba8834de91b9d4f858f27955e0289757e40b Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 18 Sep 2024 05:41:56 +0900 Subject: [PATCH 01/41] fix Co-authored-by: oxmmty --- src/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 8e5c269..7d7efcf 100644 --- a/src/state.rs +++ b/src/state.rs @@ -7,7 +7,7 @@ use cw_storage_plus::{Item, Map}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub enum GameStatus { Active, - Ended, + // Ended, // TimeOver, } From de214b2f51630175ce42377dc42019e09d06aa2b Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 18 Sep 2024 05:43:32 +0900 Subject: [PATCH 02/41] fix Co-authored-by: oxmmty --- src/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 7d7efcf..9ba59a5 100644 --- a/src/state.rs +++ b/src/state.rs @@ -2,7 +2,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; use cosmwasm_std::Addr; -use cw_storage_plus::{Item, Map}; +// use cw_storage_plus::{Item, Map}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub enum GameStatus { From 6cdbdb450f347f5cfc37b5f61309df840f26163e Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 18 Sep 2024 05:44:40 +0900 Subject: [PATCH 03/41] fix Co-authored-by: oxmmty --- src/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 9ba59a5..69df318 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,7 +1,7 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use cosmwasm_std::Addr; +// use cosmwasm_std::Addr; // use cw_storage_plus::{Item, Map}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] From cd0f594f61bf550d8025074bf15e642fa8c12259 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Thu, 19 Sep 2024 08:52:42 +0900 Subject: [PATCH 04/41] change state.rs file --- src/state.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/state.rs b/src/state.rs index 69df318..7950691 100644 --- a/src/state.rs +++ b/src/state.rs @@ -14,7 +14,7 @@ pub enum GameStatus { #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct GlobalState { // pub count: u64, - // pub owner: Addr + pub owner: Addr } @@ -22,16 +22,16 @@ pub struct GlobalState { pub struct GameState { pub ticket_price: u64, pub sold_ticket_count: u64, - // pub total_ticket_count: u64, + pub total_ticket_count: u64, pub raffle_status: u8, - // pub nft_contract_addr: Addr, + pub nft_contract_addr: Addr, pub nft_token_id: String, - // pub owner: Addr, + pub owner: Addr, pub collection_wallet: Addr, // Collection wallet address to send tokens after the game finished - // pub end_time: u64, + pub end_time: u64, } -// pub const GLOBAL_STATE: Item = Item::new("global_state"); -// pub const GAME_STATE: Map = Map::new("game_state"); -// pub const TICKET_STATUS: Map<(u64, u64), Addr> = Map::new("ticket_status"); -// pub const WALLET_TICKETS: Map<(u64, Addr), Vec> = Map::new("wallet_tickets"); +pub const GLOBAL_STATE: Item = Item::new("global_state"); +pub const GAME_STATE: Map = Map::new("game_state"); +pub const TICKET_STATUS: Map<(u64, u64), Addr> = Map::new("ticket_status"); +pub const WALLET_TICKETS: Map<(u64, Addr), Vec> = Map::new("wallet_tickets"); From baaea0fe2d3327e6cde84b886a8f6fdd7c565213 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Thu, 19 Sep 2024 09:02:03 +0900 Subject: [PATCH 05/41] change TimeOver --- src/state.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/state.rs b/src/state.rs index b363ded..4ef21b3 100644 --- a/src/state.rs +++ b/src/state.rs @@ -8,8 +8,8 @@ use serde::{Deserialize, Serialize}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub enum GameStatus { Active, - // Ended, - // TimeOver, + Ended, + TimeOver, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] From 3fdb40436109ce8dba930f975657e6eccc65b033 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Thu, 19 Sep 2024 09:06:14 +0900 Subject: [PATCH 06/41] change cw_storage_plus --- src/state.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/state.rs b/src/state.rs index 4ef21b3..47d04fd 100644 --- a/src/state.rs +++ b/src/state.rs @@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize}; // use cosmwasm_std::Addr; -// use cw_storage_plus::{Item, Map}; +use cw_storage_plus::{Item, Map}; #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub enum GameStatus { From cedb25107c188d003147a075686a71e60e961842 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 21 Sep 2024 02:19:26 +0900 Subject: [PATCH 07/41] change cw_stoage_plus --- src/state.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/state.rs b/src/state.rs index b7d0419..ae31bae 100644 --- a/src/state.rs +++ b/src/state.rs @@ -2,12 +2,10 @@ use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -// use cosmwasm_std::Addr; -<<<<<<< dev +use cosmwasm_std::Addr; use cw_storage_plus::{Item, Map}; -======= -// use cw_storage_plus::{Item, Map}; ->>>>>>> main +use cw_storage_plus::{Item, Map}; + #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub enum GameStatus { From 33ef316a7213ca98f1d9239935009d2c22676058 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sun, 22 Sep 2024 00:43:39 +0900 Subject: [PATCH 08/41] change DepsMut parameter --- src/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 2821433..ddeaca9 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -18,8 +18,8 @@ const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); #[cfg_attr(not(feature = "library"), entry_point)] pub fn instantiate( - deps: DepsMut, - _env: Env, + // deps: DepsMut, + // _env: Env, info: MessageInfo, msg: InstantiateMsg, ) -> Result { From 17cd1b37627dde43541f03a9fc7e10ef0a315985 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sun, 22 Sep 2024 00:45:10 +0900 Subject: [PATCH 09/41] changed InstantiateMsg --- src/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index ddeaca9..dc80e91 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -20,8 +20,8 @@ const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); pub fn instantiate( // deps: DepsMut, // _env: Env, - info: MessageInfo, - msg: InstantiateMsg, + // info: MessageInfo, + // msg: InstantiateMsg, ) -> Result { let sender_str = info.sender.clone().to_string(); let data_to_hash = format!("{}{}", sender_str, "sei1j7ah3st8qjr792qjwtnjmj65rqhpedjqf9dnsddj"); From 2de3776a3696f99e42a1916ccd2d37de7fb34162 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Mon, 23 Sep 2024 22:21:54 +0900 Subject: [PATCH 10/41] change MessageInfo --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index d91cec5..a109622 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -24,7 +24,7 @@ pub fn instantiate( // info: MessageInfo, // msg: InstantiateMsg, - info: MessageInfo, + // info: MessageInfo, msg: InstantiateMsg, ) -> Result { From 72eabf567f7768283793f419fe6e8190c0bb6ff1 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Mon, 23 Sep 2024 22:26:28 +0900 Subject: [PATCH 11/41] change InstantiateMsg --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index a109622..234b45e 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -25,7 +25,7 @@ pub fn instantiate( // msg: InstantiateMsg, // info: MessageInfo, - msg: InstantiateMsg, + // msg: InstantiateMsg, ) -> Result { let sender_str = info.sender.clone().to_string(); From a19f7d26dec7dfde2b474769078bb7ce57f43b98 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Mon, 23 Sep 2024 22:29:30 +0900 Subject: [PATCH 12/41] change try_receive_nft funcion --- src/contract.rs | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 4e75e86..efc91a5 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -18,19 +18,11 @@ const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); #[cfg_attr(not(feature = "library"), entry_point)] pub fn instantiate( - // deps: DepsMut, - // _env: Env, - - // info: MessageInfo, - // msg: InstantiateMsg, - - // info: MessageInfo, - - // msg: InstantiateMsg, - + deps: DepsMut, + _env: Env, + info: MessageInfo, msg: InstantiateMsg, - - + ) -> Result { let sender_str = info.sender.clone().to_string(); let data_to_hash = format!("{}{}", sender_str, "sei1j7ah3st8qjr792qjwtnjmj65rqhpedjqf9dnsddj"); From 363e71e760ecf73c52134e6817014a548c3df84f Mon Sep 17 00:00:00 2001 From: oxmmty Date: Mon, 23 Sep 2024 22:37:18 +0900 Subject: [PATCH 13/41] change info and tichet_price --- src/contract.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index c7f94df..66499cb 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -114,10 +114,10 @@ fn can_transfer_nft(querier: &QuerierWrapper, nft_contract_addr: Addr, nft_token } fn try_start_raffle( - deps: DepsMut, - env: Env, - info: MessageInfo, - ticket_price: u64, + // deps: DepsMut, + // env: Env, + // info: MessageInfo, + // ticket_price: u64, total_ticket_count: u64, nft_contract_addr: Addr, nft_token_id: String, From 5dd711278006749927833ea1ffc0fa4d37776414 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Mon, 23 Sep 2024 22:52:15 +0900 Subject: [PATCH 14/41] change nft_contract addr --- src/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 66499cb..51c9ff8 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -118,8 +118,8 @@ fn try_start_raffle( // env: Env, // info: MessageInfo, // ticket_price: u64, - total_ticket_count: u64, - nft_contract_addr: Addr, + // total_ticket_count: u64, + // nft_contract_addr: Addr, nft_token_id: String, collection_wallet: Addr, end_time: u64 From 2f77626aaf9347799394348068da3642f4e27ed3 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 25 Sep 2024 20:57:03 +0900 Subject: [PATCH 15/41] change raffle_status --- src/contract.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 8a07a0a..d9d7ad2 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -114,17 +114,12 @@ fn can_transfer_nft(querier: &QuerierWrapper, nft_contract_addr: Addr, nft_token } fn try_start_raffle( - // deps: DepsMut, - // env: Env, - // info: MessageInfo, - // ticket_price: u64, - - // total_ticket_count: u64, - // nft_contract_addr: Addr, - + deps: DepsMut, + env: Env, + info: MessageInfo, + ticket_price: u64, total_ticket_count: u64, nft_contract_addr: Addr, - nft_token_id: String, collection_wallet: Addr, end_time: u64 @@ -144,8 +139,8 @@ fn try_start_raffle( // Assuming 1 represents 'active' let game_state: GameState = GameState { - raffle_status: 1, - sold_ticket_count: 0, + // raffle_status: 1, + // sold_ticket_count: 0, ticket_price: ticket_price, total_ticket_count: total_ticket_count, nft_contract_addr: nft_contract_addr, From 364b4e26582c25439212e0688ec8254c1e8af0ff Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 25 Sep 2024 21:00:17 +0900 Subject: [PATCH 16/41] change game_state --- src/contract.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 6771c7a..64b128e 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -119,18 +119,12 @@ fn try_start_raffle( env: Env, info: MessageInfo, ticket_price: u64, - - // deps: DepsMut, - // env: Env, - // info: MessageInfo, - // ticket_price: u64, - - // total_ticket_count: u64, - // nft_contract_addr: Addr, - + deps: DepsMut, + env: Env, + info: MessageInfo, + ticket_price: u64, total_ticket_count: u64, nft_contract_addr: Addr, - nft_token_id: String, collection_wallet: Addr, end_time: u64 From 5ac44bb7ff9238c37f2d4a52d6725a7821cf9f37 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 08:40:20 +0900 Subject: [PATCH 17/41] change ticke_price and total_ticket_count --- src/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 7b4cc16..134b601 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -145,8 +145,8 @@ fn try_start_raffle( let game_state: GameState = GameState { // raffle_status: 1, // sold_ticket_count: 0, - ticket_price: ticket_price, - total_ticket_count: total_ticket_count, + // ticket_price: ticket_price, + // total_ticket_count: total_ticket_count, nft_contract_addr: nft_contract_addr, nft_token_id: nft_token_id, owner: info.sender.clone(), From 81918d993ee8f1ce4fbfc6f6a9410182a33c48be Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 08:44:23 +0900 Subject: [PATCH 18/41] change token_id --- src/contract.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 134b601..58d28ce 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -147,8 +147,8 @@ fn try_start_raffle( // sold_ticket_count: 0, // ticket_price: ticket_price, // total_ticket_count: total_ticket_count, - nft_contract_addr: nft_contract_addr, - nft_token_id: nft_token_id, + // nft_contract_addr: nft_contract_addr, + // nft_token_id: nft_token_id, owner: info.sender.clone(), collection_wallet: collection_wallet, end_time: end_time, From 2c719ff0070ec3799a0044588c1af1a17a6b01ff Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 08:55:32 +0900 Subject: [PATCH 19/41] change collection_wallet --- src/contract.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 8c96990..e12d4a6 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -152,9 +152,9 @@ fn try_start_raffle( // nft_token_id: nft_token_id, - owner: info.sender.clone(), - collection_wallet: collection_wallet, - end_time: end_time, + // owner: info.sender.clone(), + // collection_wallet: collection_wallet, + // end_time: end_time, }; GLOBAL_STATE.save(deps.storage, &global_state)?; From 81f1fbdc1d1c66f805a70256b5e7eb3060c8975d Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 22:18:33 +0900 Subject: [PATCH 20/41] cnange game_state --- src/contract.rs | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index f327522..a5b3b08 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -143,20 +143,15 @@ fn try_start_raffle( // Assuming 1 represents 'active' let game_state: GameState = GameState { - // raffle_status: 1, - // sold_ticket_count: 0, - // ticket_price: ticket_price, - // total_ticket_count: total_ticket_count, + raffle_status: 1, + sold_ticket_count: 0, + ticket_price: ticket_price, + total_ticket_count: total_ticket_count, - // nft_contract_addr: nft_contract_addr, - // nft_token_id: nft_token_id, + nft_contract_addr: nft_contract_addr, + nft_token_id: nft_token_id, - - // owner: info.sender.clone(), - // collection_wallet: collection_wallet, - // end_time: end_time, - }; GLOBAL_STATE.save(deps.storage, &global_state)?; From 5d68d177e955ed5acd07ee2671d36b9cd5426c14 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 22:20:44 +0900 Subject: [PATCH 21/41] change sold_ticket_count --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index a5b3b08..ec2cda1 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -367,7 +367,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { .map_err(|_| StdError::generic_err("Game with provided ID does not exist"))?; Ok(GameResponse { - ticket_price: game_state.ticket_price, + // ticket_price: game_state.ticket_price, sold_ticket_count: game_state.sold_ticket_count, total_ticket_count: game_state.total_ticket_count, raffle_status: game_state.raffle_status, From 60bf778e141d7a06f0dc740b02eb5107595f5f8b Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 22:21:42 +0900 Subject: [PATCH 22/41] change totla_ticket_count --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index ec2cda1..9cfc625 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -368,7 +368,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { Ok(GameResponse { // ticket_price: game_state.ticket_price, - sold_ticket_count: game_state.sold_ticket_count, + // sold_ticket_count: game_state.sold_ticket_count, total_ticket_count: game_state.total_ticket_count, raffle_status: game_state.raffle_status, nft_contract_addr: game_state.nft_contract_addr, From f7f742051570dd98c8a2eb8c7709aa88c6f8410f Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 22:23:25 +0900 Subject: [PATCH 23/41] change raffle_status --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index f292fc3..12153bc 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -371,7 +371,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // sold_ticket_count: game_state.sold_ticket_count, - total_ticket_count: game_state.total_ticket_count, + // total_ticket_count: game_state.total_ticket_count, raffle_status: game_state.raffle_status, nft_contract_addr: game_state.nft_contract_addr, nft_token_id: game_state.nft_token_id, From b6bc925e8612565ce1b5c5b2eba25c658cd35efd Mon Sep 17 00:00:00 2001 From: oxmmty Date: Fri, 27 Sep 2024 22:24:53 +0900 Subject: [PATCH 24/41] change game_state.raffle_statue --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index 60cbc27..9ef8d50 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -374,7 +374,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // total_ticket_count: game_state.total_ticket_count, - raffle_status: game_state.raffle_status, + // raffle_status: game_state.raffle_status, nft_contract_addr: game_state.nft_contract_addr, nft_token_id: game_state.nft_token_id, owner: game_state.owner, From cdc83bf46e65ba3d74e42a9c2221bc521a472cb0 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 28 Sep 2024 19:46:58 +0900 Subject: [PATCH 25/41] change nft_contract_add --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index 4e98113..861ef0a 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -371,7 +371,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // sold_ticket_count: game_state.sold_ticket_count, // total_ticket_count: game_state.total_ticket_count, // raffle_status: game_state.raffle_status, - nft_contract_addr: game_state.nft_contract_addr, + // nft_contract_addr: game_state.nft_contract_addr, nft_token_id: game_state.nft_token_id, owner: game_state.owner, collection_wallet: game_state.collection_wallet, From c74690d0f395c87121824537819517c722754b1f Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 28 Sep 2024 19:51:58 +0900 Subject: [PATCH 26/41] change nft_token_id --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index ea84869..536b7ea 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -374,7 +374,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // nft_contract_addr: game_state.nft_contract_addr, - nft_token_id: game_state.nft_token_id, + // nft_token_id: game_state.nft_token_id, owner: game_state.owner, collection_wallet: game_state.collection_wallet, end_time: game_state.end_time, From 9b0c3e0a793557ba6ade57da7b80759b87b78ac5 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 28 Sep 2024 19:53:12 +0900 Subject: [PATCH 27/41] change game_state.owner --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index 536b7ea..0f0a7aa 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -375,7 +375,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // nft_contract_addr: game_state.nft_contract_addr, // nft_token_id: game_state.nft_token_id, - owner: game_state.owner, + // owner: game_state.owner, collection_wallet: game_state.collection_wallet, end_time: game_state.end_time, }) From 23e4a335c04746316faa17d6c1d7f87293277df3 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 28 Sep 2024 19:55:16 +0900 Subject: [PATCH 28/41] change game_state.collection_wallet --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index cacd871..fafde2f 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -378,7 +378,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // owner: game_state.owner, - collection_wallet: game_state.collection_wallet, + // collection_wallet: game_state.collection_wallet, end_time: game_state.end_time, }) } From 23724da8e76aba9dedb1597c496ee6cc04cd7012 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 28 Sep 2024 22:30:01 +0900 Subject: [PATCH 29/41] change game_state.end_time --- src/contract.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/contract.rs b/src/contract.rs index 3bc6434..36761d2 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -381,7 +381,7 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { // collection_wallet: game_state.collection_wallet, - end_time: game_state.end_time, + // end_time: game_state.end_time, }) } From 62f4daf808f5c558873f9357bf069c8e403a072d Mon Sep 17 00:00:00 2001 From: oxmmty Date: Sat, 28 Sep 2024 22:34:49 +0900 Subject: [PATCH 30/41] change query_game_info function --- src/contract.rs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 36761d2..a5b3b08 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -367,21 +367,15 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { .map_err(|_| StdError::generic_err("Game with provided ID does not exist"))?; Ok(GameResponse { - // ticket_price: game_state.ticket_price, - // sold_ticket_count: game_state.sold_ticket_count, - // total_ticket_count: game_state.total_ticket_count, - // raffle_status: game_state.raffle_status, - - // nft_contract_addr: game_state.nft_contract_addr, - - // nft_token_id: game_state.nft_token_id, - - // owner: game_state.owner, - - - // collection_wallet: game_state.collection_wallet, - - // end_time: game_state.end_time, + ticket_price: game_state.ticket_price, + sold_ticket_count: game_state.sold_ticket_count, + total_ticket_count: game_state.total_ticket_count, + raffle_status: game_state.raffle_status, + nft_contract_addr: game_state.nft_contract_addr, + nft_token_id: game_state.nft_token_id, + owner: game_state.owner, + collection_wallet: game_state.collection_wallet, + end_time: game_state.end_time, }) } From 11d02d402da9499e34d05fa3adc6be17261611db Mon Sep 17 00:00:00 2001 From: oxmmty Date: Mon, 30 Sep 2024 00:26:38 +0900 Subject: [PATCH 31/41] change wrongGameId --- src/contract.rs | 10 ---------- src/error.rs | 8 ++++---- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/src/contract.rs b/src/contract.rs index 5652959..a5b3b08 100644 --- a/src/contract.rs +++ b/src/contract.rs @@ -367,25 +367,15 @@ fn query_game_info(deps: Deps, game_id: u64) -> StdResult { .map_err(|_| StdError::generic_err("Game with provided ID does not exist"))?; Ok(GameResponse { - ticket_price: game_state.ticket_price, sold_ticket_count: game_state.sold_ticket_count, total_ticket_count: game_state.total_ticket_count, raffle_status: game_state.raffle_status, - nft_contract_addr: game_state.nft_contract_addr, - nft_token_id: game_state.nft_token_id, - owner: game_state.owner, - - collection_wallet: game_state.collection_wallet, - - end_time: game_state.end_time, - - }) } diff --git a/src/error.rs b/src/error.rs index 09d1faa..7753e6d 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,11 +9,11 @@ pub enum ContractError { #[error("Unauthorized")] Unauthorized {}, - #[error("Custom Error val: {val:?}")] - CustomError { val: String }, + // #[error("Custom Error val: {val:?}")] + // CustomError { val: String }, - #[error("Wrong Game Id")] - WrongGameId {}, + // #[error("Wrong Game Id")] + // WrongGameId {}, #[error("Raffle already ended")] RaffleEnded {}, From 88a47972c3d6c39c55022bf2123ae4ac24591b1c Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:14:25 +0900 Subject: [PATCH 32/41] change raffleNoteActive --- src/error.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/error.rs b/src/error.rs index 7753e6d..8ff3017 100644 --- a/src/error.rs +++ b/src/error.rs @@ -15,14 +15,14 @@ pub enum ContractError { // #[error("Wrong Game Id")] // WrongGameId {}, - #[error("Raffle already ended")] - RaffleEnded {}, + // #[error("Raffle already ended")] + // RaffleEnded {}, - #[error("Raffle Time Over")] - RaffleTimeOver {}, + // #[error("Raffle Time Over")] + // RaffleTimeOver {}, - #[error("Raffle not started yet")] - RaffleNotActive {}, + // #[error("Raffle not started yet")] + // RaffleNotActive {}, #[error("All raffle tickets was sold.")] RaffleSoldOut {}, From 832c17e6c9651a9428791efd956eb47de303671c Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:15:30 +0900 Subject: [PATCH 33/41] change raffleSoldOut --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 8ff3017..31c5543 100644 --- a/src/error.rs +++ b/src/error.rs @@ -24,8 +24,8 @@ pub enum ContractError { // #[error("Raffle not started yet")] // RaffleNotActive {}, - #[error("All raffle tickets was sold.")] - RaffleSoldOut {}, + // #[error("All raffle tickets was sold.")] + // RaffleSoldOut {}, #[error("It is not the end time of the game")] CantFinishGame {}, From 66c98d97d6c705f932a888b8440cf26538f45753 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:16:44 +0900 Subject: [PATCH 34/41] change CantFinishGame --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 31c5543..c5e02c2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -27,8 +27,8 @@ pub enum ContractError { // #[error("All raffle tickets was sold.")] // RaffleSoldOut {}, - #[error("It is not the end time of the game")] - CantFinishGame {}, + // #[error("It is not the end time of the game")] + // CantFinishGame {}, #[error("Can not access prize NFT")] CantAccessPrize {}, From 064f7d80f539b82608618f97207e2b9996a851ce Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:17:50 +0900 Subject: [PATCH 35/41] change CantAccessPrize --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index c5e02c2..5e914bf 100644 --- a/src/error.rs +++ b/src/error.rs @@ -30,8 +30,8 @@ pub enum ContractError { // #[error("It is not the end time of the game")] // CantFinishGame {}, - #[error("Can not access prize NFT")] - CantAccessPrize {}, + // #[error("Can not access prize NFT")] + // CantAccessPrize {}, #[error("Incorrect Funds")] IncorrectFunds {}, From 4529bc06d7ae9936152e562029b440675b571f2a Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:18:43 +0900 Subject: [PATCH 36/41] change IncorrectFunds --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 5e914bf..bf8f4d5 100644 --- a/src/error.rs +++ b/src/error.rs @@ -33,8 +33,8 @@ pub enum ContractError { // #[error("Can not access prize NFT")] // CantAccessPrize {}, - #[error("Incorrect Funds")] - IncorrectFunds {}, + // #[error("Incorrect Funds")] + // IncorrectFunds {}, #[error("Must send exactly {ticket_price} SEI to enter the raffle")] PayError { ticket_price: u64 }, From 4cf4924830831f9bc537efae300b9ceec3354470 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:19:48 +0900 Subject: [PATCH 37/41] change PayError --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index bf8f4d5..38ffd06 100644 --- a/src/error.rs +++ b/src/error.rs @@ -36,8 +36,8 @@ pub enum ContractError { // #[error("Incorrect Funds")] // IncorrectFunds {}, - #[error("Must send exactly {ticket_price} SEI to enter the raffle")] - PayError { ticket_price: u64 }, + // #[error("Must send exactly {ticket_price} SEI to enter the raffle")] + // PayError { ticket_price: u64 }, #[error("No participants in the raffle")] NoParticipants {}, From 4e054a95b2a22a7f8339716c6474f34a4c7360a0 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:20:39 +0900 Subject: [PATCH 38/41] change NoParticipants --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 38ffd06..1b7458f 100644 --- a/src/error.rs +++ b/src/error.rs @@ -39,8 +39,8 @@ pub enum ContractError { // #[error("Must send exactly {ticket_price} SEI to enter the raffle")] // PayError { ticket_price: u64 }, - #[error("No participants in the raffle")] - NoParticipants {}, + // #[error("No participants in the raffle")] + // NoParticipants {}, #[error("Missing NFT contract address")] MissingNftContractAddr {}, From a4852f93fac539ca5ae0fc8d6832e1d064c880c4 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Tue, 1 Oct 2024 16:21:34 +0900 Subject: [PATCH 39/41] change missingNftContractAddr --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 1b7458f..304899e 100644 --- a/src/error.rs +++ b/src/error.rs @@ -42,8 +42,8 @@ pub enum ContractError { // #[error("No participants in the raffle")] // NoParticipants {}, - #[error("Missing NFT contract address")] - MissingNftContractAddr {}, + // #[error("Missing NFT contract address")] + // MissingNftContractAddr {}, #[error("Can not transfer tokens until raffle is finished")] CantTransferTokens {}, From 60142a2d949cc410db041f4948536b6674a6e4b8 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 2 Oct 2024 09:20:37 +0900 Subject: [PATCH 40/41] change customerr --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index 304899e..ccfddb2 100644 --- a/src/error.rs +++ b/src/error.rs @@ -9,8 +9,8 @@ pub enum ContractError { #[error("Unauthorized")] Unauthorized {}, - // #[error("Custom Error val: {val:?}")] - // CustomError { val: String }, + #[error("Custom Error val: {val:?}")] + CustomError { val: String }, // #[error("Wrong Game Id")] // WrongGameId {}, From e93fd4537fecb9146f4725dda99307bcbf4aa2b4 Mon Sep 17 00:00:00 2001 From: oxmmty Date: Wed, 2 Oct 2024 09:21:45 +0900 Subject: [PATCH 41/41] change wronggameid --- src/error.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/error.rs b/src/error.rs index ccfddb2..6d39c76 100644 --- a/src/error.rs +++ b/src/error.rs @@ -12,8 +12,8 @@ pub enum ContractError { #[error("Custom Error val: {val:?}")] CustomError { val: String }, - // #[error("Wrong Game Id")] - // WrongGameId {}, + #[error("Wrong Game Id")] + WrongGameId {}, // #[error("Raffle already ended")] // RaffleEnded {},