Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev #17

Merged
merged 6 commits into from
Sep 18, 2024
Merged

Dev #17

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions src/state.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
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)]
Expand All @@ -13,25 +14,25 @@ pub enum GameStatus {

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct GlobalState {
// pub count: u64,
// pub owner: Addr
pub count: u64,
pub owner: Addr
}


#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
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<GlobalState> = Item::new("global_state");
// pub const GAME_STATE: Map<u64, GameState> = Map::new("game_state");
// pub const TICKET_STATUS: Map<(u64, u64), Addr> = Map::new("ticket_status");
// pub const WALLET_TICKETS: Map<(u64, Addr), Vec<u64>> = Map::new("wallet_tickets");
pub const GLOBAL_STATE: Item<GlobalState> = Item::new("global_state");
pub const GAME_STATE: Map<u64, GameState> = Map::new("game_state");
pub const TICKET_STATUS: Map<(u64, u64), Addr> = Map::new("ticket_status");
pub const WALLET_TICKETS: Map<(u64, Addr), Vec<u64>> = Map::new("wallet_tickets");
Loading