Skip to content
Open
Show file tree
Hide file tree
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
1,055 changes: 544 additions & 511 deletions ree-cookie-canister/Cargo.lock

Large diffs are not rendered by default.

27 changes: 13 additions & 14 deletions ree-cookie-canister/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ree-cookie"
version = "0.1.1"
version = "0.2.6"
edition = "2021"

[workspace]
Expand All @@ -12,13 +12,15 @@ crate-type = ["cdylib"]
[dependencies]

candid = "0.10"
ic-cdk = "0.17"
ic-cdk-macros = "0.17"
ic-stable-structures = "0.6"
ic-canisters-http-types = { git = "https://github.com/dfinity/ic", tag = "release-2024-03-06_23-01+p2p" }
ic-canister-log = { git = "https://github.com/dfinity/ic", tag = "release-2024-01-18_23-01" }
icrc-ledger-client-cdk = { git = "https://github.com/dfinity/ic", tag = "release-2024-01-18_23-01" }
icrc-ledger-types = { git = "https://github.com/dfinity/ic", tag = "release-2024-01-18_23-01" }
ic-cdk = "0.18.4"
ic-cdk-macros = "0.18.4"
ic-stable-structures = "0.7"
# ic-canisters-http-types = { git = "https://github.com/dfinity/ic", tag = "release-2025-08-14_03-27-base" }
ic-http-types = "0.1.0"
ic-canister-log = { git = "https://github.com/dfinity/ic", tag = "release-2025-08-14_03-27-base" }
# icp-ledger = { git = "https://github.com/dfinity/ic", tag = "release-2025-08-14_03-27-base" }
icrc-ledger-client = { git = "https://github.com/dfinity/ic", tag = "release-2025-08-14_03-27-base" }
icrc-ledger-types = { git = "https://github.com/dfinity/ic", tag = "release-2025-08-14_03-27-base" }

anyhow = "1"
thiserror = "1"
Expand All @@ -30,18 +32,15 @@ serde_json = "1.0"
cfg-if = "1.0"
time = "0.3"

# ree-types = { git = "https://github.com/octopus-network/ree-types.git", rev = "a48b38f16efdb1e9703e6e9c45af681ae2b61f59" }
# ree-types = "0.3"
# ree-types = { git = "https://github.com/octopus-network/ree-types.git", rev = "1bc6810a7aac2576c32bdca26b6dd399b1a307eb" }
# ree-types = { git = "https://github.com/octopus-network/ree-types.git", rev = "6d98cd59310a86d951105cbf4cf2a4feed2e2057" }
ree-types = { git = "https://github.com/octopus-network/ree-types.git", rev = "3d0fb503384082bdeaf368305c4229801ee9ebd3" }
# ree-exchange-sdk = { git = "https://github.com/octopus-network/ree-exchange-sdk.git", rev="b5bb7181449d3535de27239a6c0a03fbcf29e418" }
ree-exchange-sdk = { git = "https://github.com/octopus-network/ree-exchange-sdk.git", rev="9dedff405c1afccc31cb5551bc29616110483e48" }

bincode = "1.3.3"
itertools = "0.14.0"

[dev-dependencies]
tokio = { version = "1", features = ["full"] }
ic-agent = "0.39"
# ree-orchestrator = { git="https://github.com/octopus-network/ree-orchestrator.git", branch="main" }

[features]
default = ["testnet"]
Expand Down
Empty file added ree-cookie-canister/fomo10k.did
Empty file.
87 changes: 40 additions & 47 deletions ree-cookie-canister/ree_cookie.did
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ type AddLiquidityInfo = record {
rune_amount_for_add_liquidity : nat;
};
type CoinBalance = record { id : text; value : nat };
type CookiePoolState = record {
txid : text;
utxo : Utxo;
user_action : UserAction;
nonce : nat64;
};
type CreateGameArgs = record {
rune_premine_amount : nat;
create_address : text;
Expand All @@ -23,7 +29,6 @@ type ExchangeError = variant {
RuneNotFound : text;
CookieBalanceInsufficient : nat;
GameEnd;
ReorgError : ReorgError;
GamerAlreadyExist : text;
DuplicateBlock : record { nat32; text };
PoolStateExpired : nat64;
Expand All @@ -36,7 +41,7 @@ type ExchangeError = variant {
InvalidRuneId;
InvalidPool;
InvalidPsbt : text;
GameNotFound : nat64;
GameNotFound : text;
PoolAlreadyExists;
GamerCoolingDown : record { text; nat64 };
InvalidTxid : text;
Expand All @@ -56,9 +61,8 @@ type ExchangeError = variant {
PoolAddressMismatch : record { actual : text; expected : text };
};
type ExchangeState = record {
txid_game_map : vec record { text; nat64 };
orchestrator : principal;
games : vec record { nat64; Game };
txid_game_map : vec record { text; text };
games : vec record { text; Game };
};
type ExecuteTxArgs = record {
zero_confirmed_tx_queue_length : nat32;
Expand All @@ -72,17 +76,22 @@ type Game = record {
claimed_cookies : nat;
rune_premine_amount : nat;
creator_address : text;
pool : opt Pool;
rune_info : opt RuneInfo;
gamers : vec record { text; Gamer };
claim_amount_per_click : nat;
game_id : nat64;
game_id : text;
game_status : GameStatus;
game_name : text;
etch_rune_commit_tx : text;
pool_address : opt text;
claim_cooling_down : nat64;
gamer_register_fee : nat64;
};
type GameAndPool = record {
game : Game;
pool_state : opt CookiePoolState;
pool_metadata : opt Metadata;
};
type GameStatus = variant { WaitAddedLiquidity; Playing; Withdrawing; Etching };
type Gamer = record {
is_withdrawn : bool;
Expand All @@ -108,23 +117,19 @@ type IntentionSet = record {
initiator_address : text;
intentions : vec Intention;
};
type Metadata = record {
key : text;
name : text;
key_derivation_path : vec blob;
address : text;
};
type NewBlockInfo = record {
block_hash : text;
confirmed_txids : vec text;
block_timestamp : nat64;
block_height : nat32;
};
type OutputCoin = record { to : text; coin : CoinBalance };
type Pool = record {
states : vec PoolState;
name : text;
pubkey : text;
key_derivation_path : text;
attributes : text;
address : text;
nonce : nat64;
pending_transaction_counts : nat64;
};
type PoolBasic = record { name : text; address : text };
type PoolInfo = record {
key : text;
Expand All @@ -137,12 +142,6 @@ type PoolInfo = record {
nonce : nat64;
utxos : vec Utxo;
};
type PoolState = record {
id : text;
utxo : Utxo;
user_action : UserAction;
nonce : nat64;
};
type RejectionCode = variant {
NoError;
CanisterError;
Expand All @@ -152,44 +151,38 @@ type RejectionCode = variant {
SysFatal;
CanisterReject;
};
type ReorgError = variant {
DuplicateBlock : record { height : nat32; hash : text };
BlockNotFoundInState : record { height : nat32 };
Unrecoverable;
Recoverable : record { height : nat32; depth : nat32 };
};
type Result = variant { Ok : nat; Err : ExchangeError };
type Result_1 = variant { Ok : nat64; Err : text };
type Result_2 = variant { Ok : text; Err : text };
type Result_3 = variant { Ok; Err : text };
type RollbackTxArgs = record { txid : text };
type Result_1 = variant { Ok : text; Err : text };
type Result_2 = variant { Ok; Err : text };
type RollbackTxArgs = record { txid : text; reason_code : text };
type RuneInfo = record { rune_name : text; rune_id : text };
type UserAction = variant {
Withdraw : text;
Withdraw : record { text; text };
AddLiquidity;
Init;
Register : text;
Register : record { text; text };
};
type Utxo = record {
coins : vec CoinBalance;
sats : nat64;
txid : text;
vout : nat32;
};
service : (principal) -> {
claim : (nat64) -> (Result);
service : () -> {
claim : (text) -> (Result);
create_game : (CreateGameArgs) -> (Result_1);
etch_rune : (nat64, text) -> (Result_2);
execute_tx : (ExecuteTxArgs) -> (Result_2);
finalize_etch : (nat64) -> (Result_2);
etch_rune : (text, text) -> (Result_1);
execute_tx : (ExecuteTxArgs) -> (Result_1);
finalize_etch : (text) -> (Result_1);
game_address : (text) -> (Result_1);
get_exchange_state : () -> (ExchangeState) query;
get_game_info : (nat64) -> (opt Game) query;
get_game_pool_address : (nat64) -> (text);
get_games_info : () -> (vec Game) query;
get_game_info : (text) -> (opt GameAndPool) query;
get_game_pool_address : (text) -> (text);
get_games_info : () -> (vec GameAndPool) query;
get_pool_info : (GetPoolInfoArgs) -> (opt PoolInfo) query;
get_pool_list : () -> (vec PoolBasic) query;
new_block : (NewBlockInfo) -> (Result_3);
query_add_liquidity_info : (nat64) -> (AddLiquidityInfo) query;
reset_blocks : () -> ();
rollback_tx : (RollbackTxArgs) -> (Result_3);
new_block : (NewBlockInfo) -> (Result_2);
query_add_liquidity_info : (text) -> (AddLiquidityInfo) query;
rollback_tx : (RollbackTxArgs) -> (Result_2);
test : () -> ();
}
Loading