diff --git a/Scarb.lock b/Scarb.lock index 0295b6c..0030b4e 100644 --- a/Scarb.lock +++ b/Scarb.lock @@ -1,10 +1,52 @@ # Code generated by scarb DO NOT EDIT. version = 1 +[[package]] +name = "alexandria_data_structures" +version = "0.2.0" +source = "git+https://github.com/keep-starknet-strange/alexandria.git?tag=cairo-v2.6.0#946e6e2f9d390ad9f345882a352c0dd6f02ef3ad" +dependencies = [ + "alexandria_encoding", +] + +[[package]] +name = "alexandria_encoding" +version = "0.1.0" +source = "git+https://github.com/keep-starknet-strange/alexandria.git?tag=cairo-v2.6.0#946e6e2f9d390ad9f345882a352c0dd6f02ef3ad" +dependencies = [ + "alexandria_math", + "alexandria_numeric", +] + +[[package]] +name = "alexandria_math" +version = "0.2.0" +source = "git+https://github.com/keep-starknet-strange/alexandria.git?tag=cairo-v2.6.0#946e6e2f9d390ad9f345882a352c0dd6f02ef3ad" +dependencies = [ + "alexandria_data_structures", +] + +[[package]] +name = "alexandria_numeric" +version = "0.1.0" +source = "git+https://github.com/keep-starknet-strange/alexandria.git?tag=cairo-v2.6.0#946e6e2f9d390ad9f345882a352c0dd6f02ef3ad" +dependencies = [ + "alexandria_math", +] + +[[package]] +name = "alexandria_sorting" +version = "0.1.0" +source = "git+https://github.com/keep-starknet-strange/alexandria.git?tag=cairo-v2.6.0#946e6e2f9d390ad9f345882a352c0dd6f02ef3ad" +dependencies = [ + "alexandria_data_structures", +] + [[package]] name = "bytebeasts" version = "0.1.0" dependencies = [ + "alexandria_sorting", "dojo", ] diff --git a/Scarb.toml b/Scarb.toml index 7a14c65..d6e5e76 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -13,5 +13,7 @@ move = "./scripts/move.sh" [dependencies] dojo = { git = "https://github.com/dojoengine/dojo", tag = "v1.0.0-alpha.5" } +# Alexandria versions with tag greater that "cairo-v2.5.4" conflict with dojo engine +alexandria_sorting = { git = "https://github.com/keep-starknet-strange/alexandria.git", tag = "cairo-v2.6.0" } [[target.dojo]] diff --git a/manifests/dev/base/abis/models/bytebeasts-Leaderboard-7e680376.json b/manifests/dev/base/abis/models/bytebeasts-Leaderboard-7e680376.json new file mode 100644 index 0000000..462aba6 --- /dev/null +++ b/manifests/dev/base/abis/models/bytebeasts-Leaderboard-7e680376.json @@ -0,0 +1,467 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "leaderboardImpl", + "interface_name": "bytebeasts::models::leaderboard::Ileaderboard" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::LeaderboardEntry", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "score", + "type": "core::integer::u32" + }, + { + "name": "wins", + "type": "core::integer::u32" + }, + { + "name": "losses", + "type": "core::integer::u32" + }, + { + "name": "highest_score", + "type": "core::integer::u32" + }, + { + "name": "is_active", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::Leaderboard", + "members": [ + { + "name": "leaderboard_id", + "type": "core::integer::u64" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "description", + "type": "core::felt252" + }, + { + "name": "entries", + "type": "core::array::Array::" + }, + { + "name": "last_updated", + "type": "core::integer::u64" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::leaderboard::Ileaderboard", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::leaderboard::Leaderboard" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::leaderboard::leaderboard::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/manifests/dev/base/abis/models/bytebeasts-LeaderboardEntry-7237950c.json b/manifests/dev/base/abis/models/bytebeasts-LeaderboardEntry-7237950c.json new file mode 100644 index 0000000..6723d2a --- /dev/null +++ b/manifests/dev/base/abis/models/bytebeasts-LeaderboardEntry-7237950c.json @@ -0,0 +1,441 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "leaderboard_entryImpl", + "interface_name": "bytebeasts::models::leaderboard::Ileaderboard_entry" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::LeaderboardEntry", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "score", + "type": "core::integer::u32" + }, + { + "name": "wins", + "type": "core::integer::u32" + }, + { + "name": "losses", + "type": "core::integer::u32" + }, + { + "name": "highest_score", + "type": "core::integer::u32" + }, + { + "name": "is_active", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::leaderboard::Ileaderboard_entry", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::leaderboard::LeaderboardEntry" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::leaderboard::leaderboard_entry::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/manifests/dev/base/models/bytebeasts-Leaderboard-7e680376.toml b/manifests/dev/base/models/bytebeasts-Leaderboard-7e680376.toml new file mode 100644 index 0000000..b32b775 --- /dev/null +++ b/manifests/dev/base/models/bytebeasts-Leaderboard-7e680376.toml @@ -0,0 +1,31 @@ +kind = "DojoModel" +class_hash = "0x13d964c4091be478133a4aadbb278da14229f77225ce8da5dd246e42abc7ac0" +original_class_hash = "0x13d964c4091be478133a4aadbb278da14229f77225ce8da5dd246e42abc7ac0" +abi = "manifests/dev/base/abis/models/bytebeasts-Leaderboard-7e680376.json" +tag = "bytebeasts-Leaderboard" +manifest_name = "bytebeasts-Leaderboard-7e680376" + +[[members]] +name = "leaderboard_id" +type = "u64" +key = true + +[[members]] +name = "name" +type = "felt252" +key = false + +[[members]] +name = "description" +type = "felt252" +key = false + +[[members]] +name = "entries" +type = "Array" +key = false + +[[members]] +name = "last_updated" +type = "u64" +key = false diff --git a/manifests/dev/base/models/bytebeasts-LeaderboardEntry-7237950c.toml b/manifests/dev/base/models/bytebeasts-LeaderboardEntry-7237950c.toml new file mode 100644 index 0000000..b460d64 --- /dev/null +++ b/manifests/dev/base/models/bytebeasts-LeaderboardEntry-7237950c.toml @@ -0,0 +1,41 @@ +kind = "DojoModel" +class_hash = "0x4f9ca94349981f722e598f396bcca466289aca05dcfb277ef562ee02fee333c" +original_class_hash = "0x4f9ca94349981f722e598f396bcca466289aca05dcfb277ef562ee02fee333c" +abi = "manifests/dev/base/abis/models/bytebeasts-LeaderboardEntry-7237950c.json" +tag = "bytebeasts-LeaderboardEntry" +manifest_name = "bytebeasts-LeaderboardEntry-7237950c" + +[[members]] +name = "player_id" +type = "u32" +key = true + +[[members]] +name = "player_name" +type = "felt252" +key = false + +[[members]] +name = "score" +type = "u32" +key = false + +[[members]] +name = "wins" +type = "u32" +key = false + +[[members]] +name = "losses" +type = "u32" +key = false + +[[members]] +name = "highest_score" +type = "u32" +key = false + +[[members]] +name = "is_active" +type = "bool" +key = false diff --git a/manifests/dev/deployment/abis/contracts/bytebeasts-tournament_system-1f2bbf20.json b/manifests/dev/deployment/abis/contracts/bytebeasts-tournament_system-1f2bbf20.json new file mode 100644 index 0000000..2d4cb03 --- /dev/null +++ b/manifests/dev/deployment/abis/contracts/bytebeasts-tournament_system-1f2bbf20.json @@ -0,0 +1,383 @@ +[ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "TournamentActionImpl", + "interface_name": "bytebeasts::systems::tournament::ITournamentAction" + }, + { + "type": "enum", + "name": "bytebeasts::models::tournament::TournamentStatus", + "variants": [ + { + "name": "Pending", + "type": "()" + }, + { + "name": "Ongoing", + "type": "()" + }, + { + "name": "Completed", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::player::Player", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "beast_1", + "type": "core::integer::u32" + }, + { + "name": "beast_2", + "type": "core::integer::u32" + }, + { + "name": "beast_3", + "type": "core::integer::u32" + }, + { + "name": "beast_4", + "type": "core::integer::u32" + }, + { + "name": "potions", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::tournament::Tournament", + "members": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "status", + "type": "bytebeasts::models::tournament::TournamentStatus" + }, + { + "name": "entry_fee", + "type": "core::integer::u32" + }, + { + "name": "max_participants", + "type": "core::integer::u32" + }, + { + "name": "current_participants", + "type": "core::array::Array::" + }, + { + "name": "prize_pool", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::systems::tournament::ITournamentAction", + "items": [ + { + "type": "function", + "name": "create_tournament", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "status", + "type": "bytebeasts::models::tournament::TournamentStatus" + }, + { + "name": "entry_fee", + "type": "core::integer::u32" + }, + { + "name": "max_participants", + "type": "core::integer::u32" + }, + { + "name": "current_participants", + "type": "core::array::Array::" + }, + { + "name": "prize_pool", + "type": "core::integer::u32" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_player", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "new_player", + "type": "bytebeasts::models::player::Player" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "start_tournament", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_tournament", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + } + ], + "outputs": [ + { + "type": "bytebeasts::models::tournament::Tournament" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "bytebeasts::systems::tournament::tournament_system::IDojoInit" + }, + { + "type": "interface", + "name": "bytebeasts::systems::tournament::tournament_system::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::systems::tournament::tournament_system::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } +] \ No newline at end of file diff --git a/manifests/dev/deployment/abis/models/bytebeasts-Leaderboard-7e680376.json b/manifests/dev/deployment/abis/models/bytebeasts-Leaderboard-7e680376.json new file mode 100644 index 0000000..462aba6 --- /dev/null +++ b/manifests/dev/deployment/abis/models/bytebeasts-Leaderboard-7e680376.json @@ -0,0 +1,467 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "leaderboardImpl", + "interface_name": "bytebeasts::models::leaderboard::Ileaderboard" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::LeaderboardEntry", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "score", + "type": "core::integer::u32" + }, + { + "name": "wins", + "type": "core::integer::u32" + }, + { + "name": "losses", + "type": "core::integer::u32" + }, + { + "name": "highest_score", + "type": "core::integer::u32" + }, + { + "name": "is_active", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::Leaderboard", + "members": [ + { + "name": "leaderboard_id", + "type": "core::integer::u64" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "description", + "type": "core::felt252" + }, + { + "name": "entries", + "type": "core::array::Array::" + }, + { + "name": "last_updated", + "type": "core::integer::u64" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::leaderboard::Ileaderboard", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::leaderboard::Leaderboard" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::leaderboard::leaderboard::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/manifests/dev/deployment/abis/models/bytebeasts-LeaderboardEntry-7237950c.json b/manifests/dev/deployment/abis/models/bytebeasts-LeaderboardEntry-7237950c.json new file mode 100644 index 0000000..6723d2a --- /dev/null +++ b/manifests/dev/deployment/abis/models/bytebeasts-LeaderboardEntry-7237950c.json @@ -0,0 +1,441 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "leaderboard_entryImpl", + "interface_name": "bytebeasts::models::leaderboard::Ileaderboard_entry" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::LeaderboardEntry", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "score", + "type": "core::integer::u32" + }, + { + "name": "wins", + "type": "core::integer::u32" + }, + { + "name": "losses", + "type": "core::integer::u32" + }, + { + "name": "highest_score", + "type": "core::integer::u32" + }, + { + "name": "is_active", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::leaderboard::Ileaderboard_entry", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::leaderboard::LeaderboardEntry" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::leaderboard::leaderboard_entry::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/manifests/dev/deployment/abis/models/bytebeasts-Tournament-12bdecb1.json b/manifests/dev/deployment/abis/models/bytebeasts-Tournament-12bdecb1.json new file mode 100644 index 0000000..73bd005 --- /dev/null +++ b/manifests/dev/deployment/abis/models/bytebeasts-Tournament-12bdecb1.json @@ -0,0 +1,479 @@ +[ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "tournamentImpl", + "interface_name": "bytebeasts::models::tournament::Itournament" + }, + { + "type": "enum", + "name": "bytebeasts::models::tournament::TournamentStatus", + "variants": [ + { + "name": "Pending", + "type": "()" + }, + { + "name": "Ongoing", + "type": "()" + }, + { + "name": "Completed", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::player::Player", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "beast_1", + "type": "core::integer::u32" + }, + { + "name": "beast_2", + "type": "core::integer::u32" + }, + { + "name": "beast_3", + "type": "core::integer::u32" + }, + { + "name": "beast_4", + "type": "core::integer::u32" + }, + { + "name": "potions", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::tournament::Tournament", + "members": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "status", + "type": "bytebeasts::models::tournament::TournamentStatus" + }, + { + "name": "entry_fee", + "type": "core::integer::u32" + }, + { + "name": "max_participants", + "type": "core::integer::u32" + }, + { + "name": "current_participants", + "type": "core::array::Array::" + }, + { + "name": "prize_pool", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::tournament::Itournament", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::tournament::Tournament" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::tournament::tournament::Event", + "kind": "enum", + "variants": [] + } +] \ No newline at end of file diff --git a/manifests/dev/deployment/manifest.json b/manifests/dev/deployment/manifest.json index 5647cd5..fb19fa0 100644 --- a/manifests/dev/deployment/manifest.json +++ b/manifests/dev/deployment/manifest.json @@ -2861,9 +2861,9 @@ }, { "kind": "DojoContract", - "address": "0x1a0997571ba63300bba592512cc9ac1daa8911ee08c049b5693d93c06377d25", - "class_hash": "0xad9d2da0783e3a31f6198d7c355bd293e496019e0e335449377a2c0146880", - "original_class_hash": "0xad9d2da0783e3a31f6198d7c355bd293e496019e0e335449377a2c0146880", + "address": "0x2671b8a136f1441cbd5fb6d3d9c5bdc45a3fbf184970b334cfd31ed98cf0b69", + "class_hash": "0x7bbd215ec46e02f1c7aad934c54a58b9081c43939d8afe0e7843e8202d8cea7", + "original_class_hash": "0x7bbd215ec46e02f1c7aad934c54a58b9081c43939d8afe0e7843e8202d8cea7", "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", "abi": [ { @@ -2995,30 +2995,189 @@ }, { "type": "impl", - "name": "WorldSetupImpl", - "interface_name": "bytebeasts::systems::world_setup::IWorldSetup" + "name": "TournamentActionImpl", + "interface_name": "bytebeasts::systems::tournament::ITournamentAction" + }, + { + "type": "enum", + "name": "bytebeasts::models::tournament::TournamentStatus", + "variants": [ + { + "name": "Pending", + "type": "()" + }, + { + "name": "Ongoing", + "type": "()" + }, + { + "name": "Completed", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::player::Player", + "members": [ + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "beast_1", + "type": "core::integer::u32" + }, + { + "name": "beast_2", + "type": "core::integer::u32" + }, + { + "name": "beast_3", + "type": "core::integer::u32" + }, + { + "name": "beast_4", + "type": "core::integer::u32" + }, + { + "name": "potions", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::tournament::Tournament", + "members": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "status", + "type": "bytebeasts::models::tournament::TournamentStatus" + }, + { + "name": "entry_fee", + "type": "core::integer::u32" + }, + { + "name": "max_participants", + "type": "core::integer::u32" + }, + { + "name": "current_participants", + "type": "core::array::Array::" + }, + { + "name": "prize_pool", + "type": "core::integer::u32" + } + ] }, { "type": "interface", - "name": "bytebeasts::systems::world_setup::IWorldSetup", + "name": "bytebeasts::systems::tournament::ITournamentAction", "items": [ { "type": "function", - "name": "setWorld", - "inputs": [], + "name": "create_tournament", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "status", + "type": "bytebeasts::models::tournament::TournamentStatus" + }, + { + "name": "entry_fee", + "type": "core::integer::u32" + }, + { + "name": "max_participants", + "type": "core::integer::u32" + }, + { + "name": "current_participants", + "type": "core::array::Array::" + }, + { + "name": "prize_pool", + "type": "core::integer::u32" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "register_player", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "new_player", + "type": "bytebeasts::models::player::Player" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "start_tournament", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + } + ], "outputs": [], "state_mutability": "external" + }, + { + "type": "function", + "name": "get_tournament", + "inputs": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + } + ], + "outputs": [ + { + "type": "bytebeasts::models::tournament::Tournament" + } + ], + "state_mutability": "view" } ] }, { "type": "impl", "name": "IDojoInitImpl", - "interface_name": "bytebeasts::systems::world_setup::world_setup::IDojoInit" + "interface_name": "bytebeasts::systems::tournament::tournament_system::IDojoInit" }, { "type": "interface", - "name": "bytebeasts::systems::world_setup::world_setup::IDojoInit", + "name": "bytebeasts::systems::tournament::tournament_system::IDojoInit", "items": [ { "type": "function", @@ -3065,85 +3224,1802 @@ ] }, { - "type": "event", - "name": "dojo::contract::upgradeable::upgradeable::Event", - "kind": "enum", - "variants": [ + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::systems::tournament::tournament_system::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [], + "init_calldata": [], + "tag": "bytebeasts-tournament_system", + "manifest_name": "bytebeasts-tournament_system-1f2bbf20" + }, + { + "kind": "DojoContract", + "address": "0x1a0997571ba63300bba592512cc9ac1daa8911ee08c049b5693d93c06377d25", + "class_hash": "0xad9d2da0783e3a31f6198d7c355bd293e496019e0e335449377a2c0146880", + "original_class_hash": "0xad9d2da0783e3a31f6198d7c355bd293e496019e0e335449377a2c0146880", + "base_class_hash": "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2", + "abi": [ + { + "type": "impl", + "name": "ContractImpl", + "interface_name": "dojo::contract::contract::IContract" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "interface", + "name": "dojo::contract::contract::IContract", + "items": [ + { + "type": "function", + "name": "contract_name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldProviderImpl", + "interface_name": "dojo::world::world_contract::IWorldProvider" + }, + { + "type": "struct", + "name": "dojo::world::world_contract::IWorldDispatcher", + "members": [ + { + "name": "contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "dojo::world::world_contract::IWorldProvider", + "items": [ + { + "type": "function", + "name": "world", + "inputs": [], + "outputs": [ + { + "type": "dojo::world::world_contract::IWorldDispatcher" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "WorldSetupImpl", + "interface_name": "bytebeasts::systems::world_setup::IWorldSetup" + }, + { + "type": "interface", + "name": "bytebeasts::systems::world_setup::IWorldSetup", + "items": [ + { + "type": "function", + "name": "setWorld", + "inputs": [], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "IDojoInitImpl", + "interface_name": "bytebeasts::systems::world_setup::world_setup::IDojoInit" + }, + { + "type": "interface", + "name": "bytebeasts::systems::world_setup::world_setup::IDojoInit", + "items": [ + { + "type": "function", + "name": "dojo_init", + "inputs": [], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "UpgradableImpl", + "interface_name": "dojo::contract::upgradeable::IUpgradeable" + }, + { + "type": "interface", + "name": "dojo::contract::upgradeable::IUpgradeable", + "items": [ + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "dojo::contract::upgradeable::upgradeable::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::systems::world_setup::world_setup::Event", + "kind": "enum", + "variants": [ + { + "name": "UpgradeableEvent", + "type": "dojo::contract::upgradeable::upgradeable::Event", + "kind": "nested" + } + ] + } + ], + "reads": [], + "writes": [ + "bytebeasts-Beast", + "bytebeasts-Mt", + "bytebeasts-Player", + "bytebeasts-Potion", + "bytebeasts-Position" + ], + "init_calldata": [], + "tag": "bytebeasts-world_setup", + "manifest_name": "bytebeasts-world_setup-674b640b" + } + ], + "models": [ + { + "kind": "DojoModel", + "members": [ + { + "name": "achievement_id", + "type": "u64", + "key": true + }, + { + "name": "achievement_type", + "type": "AchievementType", + "key": false + }, + { + "name": "rarity", + "type": "AchievementRarity", + "key": false + }, + { + "name": "name", + "type": "felt252", + "key": false + }, + { + "name": "description", + "type": "ByteArray", + "key": false + }, + { + "name": "is_hidden", + "type": "bool", + "key": false + }, + { + "name": "is_unlocked", + "type": "bool", + "key": false + } + ], + "class_hash": "0x41f50347f6f957bc556346a2cdea3f31523f3c25966826e7ca7dea1de185c40", + "original_class_hash": "0x41f50347f6f957bc556346a2cdea3f31523f3c25966826e7ca7dea1de185c40", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "achievementImpl", + "interface_name": "bytebeasts::models::achievements::Iachievement" + }, + { + "type": "enum", + "name": "bytebeasts::models::achievement_type::AchievementType", + "variants": [ + { + "name": "FirstWin", + "type": "()" + }, + { + "name": "TenWins", + "type": "()" + }, + { + "name": "HundredWins", + "type": "()" + }, + { + "name": "FirstBeast", + "type": "()" + }, + { + "name": "TenBeasts", + "type": "()" + }, + { + "name": "RareBeast", + "type": "()" + }, + { + "name": "FirstNPCInteraction", + "type": "()" + }, + { + "name": "RandomBattleChampion", + "type": "()" + }, + { + "name": "BeastMaster", + "type": "()" + }, + { + "name": "LegendaryPlayer", + "type": "()" + }, + { + "name": "TopScorer", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "bytebeasts::models::achievement_rarity::AchievementRarity", + "variants": [ + { + "name": "Common", + "type": "()" + }, + { + "name": "Uncommon", + "type": "()" + }, + { + "name": "Rare", + "type": "()" + }, + { + "name": "Epic", + "type": "()" + }, + { + "name": "Legendary", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::achievements::Achievement", + "members": [ + { + "name": "achievement_id", + "type": "core::integer::u64" + }, + { + "name": "achievement_type", + "type": "bytebeasts::models::achievement_type::AchievementType" + }, + { + "name": "rarity", + "type": "bytebeasts::models::achievement_rarity::AchievementRarity" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "description", + "type": "core::byte_array::ByteArray" + }, + { + "name": "is_hidden", + "type": "core::bool" + }, + { + "name": "is_unlocked", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::achievements::Iachievement", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::achievements::Achievement" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::achievements::achievement::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "bytebeasts-Achievement", + "manifest_name": "bytebeasts-Achievement-58a03b97" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "player_id", + "type": "u64", + "key": true + }, + { + "name": "achievement_id", + "type": "u64", + "key": false + }, + { + "name": "progress", + "type": "u32", + "key": false + }, + { + "name": "is_unlocked", + "type": "bool", + "key": false + } + ], + "class_hash": "0x494e5a6534846cd68b493aab6f9954333c64c854dbe99144c427f4301477f15", + "original_class_hash": "0x494e5a6534846cd68b493aab6f9954333c64c854dbe99144c427f4301477f15", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "achievement_progressImpl", + "interface_name": "bytebeasts::models::achievements::Iachievement_progress" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::achievements::AchievementProgress", + "members": [ + { + "name": "player_id", + "type": "core::integer::u64" + }, + { + "name": "achievement_id", + "type": "core::integer::u64" + }, + { + "name": "progress", + "type": "core::integer::u32" + }, + { + "name": "is_unlocked", + "type": "core::bool" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::achievements::Iachievement_progress", + "items": [ + { + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::achievements::AchievementProgress" + } + ], + "outputs": [], + "state_mutability": "view" + } + ] + }, + { + "type": "event", + "name": "bytebeasts::models::achievements::achievement_progress::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "bytebeasts-AchievementProgress", + "manifest_name": "bytebeasts-AchievementProgress-221f2719" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "bag_id", + "type": "u32", + "key": true + }, + { + "name": "player_id", + "type": "u32", + "key": true + }, + { + "name": "max_capacity", + "type": "u32", + "key": false + }, + { + "name": "potions", + "type": "Array", + "key": false + } + ], + "class_hash": "0x4e0fab7bc052de0008be5606ad3b37576afd2bda323443fc98a8f37bcc10c1c", + "original_class_hash": "0x4e0fab7bc052de0008be5606ad3b37576afd2bda323443fc98a8f37bcc10c1c", + "abi": [ + { + "type": "impl", + "name": "DojoModelImpl", + "interface_name": "dojo::model::model::IModel" + }, + { + "type": "struct", + "name": "core::byte_array::ByteArray", + "members": [ + { + "name": "data", + "type": "core::array::Array::" + }, + { + "name": "pending_word", + "type": "core::felt252" + }, + { + "name": "pending_word_len", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "core::option::Option::", + "variants": [ + { + "name": "Some", + "type": "core::integer::u32" + }, + { + "name": "None", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::layout::FieldLayout", + "members": [ + { + "name": "selector", + "type": "core::felt252" + }, + { + "name": "layout", + "type": "dojo::model::layout::Layout" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::layout::Layout", + "variants": [ + { + "name": "Fixed", + "type": "core::array::Span::" + }, + { + "name": "Struct", + "type": "core::array::Span::" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + }, + { + "name": "Enum", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Member", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "ty", + "type": "dojo::model::introspect::Ty" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Struct", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "dojo::model::introspect::Enum", + "members": [ + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "attrs", + "type": "core::array::Span::" + }, + { + "name": "children", + "type": "core::array::Span::<(core::felt252, dojo::model::introspect::Ty)>" + } + ] + }, + { + "type": "struct", + "name": "core::array::Span::", + "members": [ + { + "name": "snapshot", + "type": "@core::array::Array::" + } + ] + }, + { + "type": "enum", + "name": "dojo::model::introspect::Ty", + "variants": [ + { + "name": "Primitive", + "type": "core::felt252" + }, + { + "name": "Struct", + "type": "dojo::model::introspect::Struct" + }, + { + "name": "Enum", + "type": "dojo::model::introspect::Enum" + }, + { + "name": "Tuple", + "type": "core::array::Span::" + }, + { + "name": "Array", + "type": "core::array::Span::" + }, + { + "name": "ByteArray", + "type": "()" + } + ] + }, + { + "type": "interface", + "name": "dojo::model::model::IModel", + "items": [ + { + "type": "function", + "name": "name", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "tag", + "inputs": [], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "version", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u8" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "selector", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "name_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "namespace_hash", + "inputs": [], + "outputs": [ + { + "type": "core::felt252" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "unpacked_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "packed_size", + "inputs": [], + "outputs": [ + { + "type": "core::option::Option::" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "layout", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::layout::Layout" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "schema", + "inputs": [], + "outputs": [ + { + "type": "dojo::model::introspect::Ty" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "bagImpl", + "interface_name": "bytebeasts::models::bag::Ibag" + }, + { + "type": "struct", + "name": "bytebeasts::models::potion::Potion", + "members": [ + { + "name": "potion_id", + "type": "core::integer::u32" + }, + { + "name": "potion_name", + "type": "core::felt252" + }, + { + "name": "potion_effect", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::bag::Bag", + "members": [ + { + "name": "bag_id", + "type": "core::integer::u32" + }, + { + "name": "player_id", + "type": "core::integer::u32" + }, + { + "name": "max_capacity", + "type": "core::integer::u32" + }, + { + "name": "potions", + "type": "core::array::Array::" + } + ] + }, + { + "type": "interface", + "name": "bytebeasts::models::bag::Ibag", + "items": [ { - "name": "Upgraded", - "type": "dojo::contract::upgradeable::upgradeable::Upgraded", - "kind": "nested" + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::bag::Bag" + } + ], + "outputs": [], + "state_mutability": "view" } ] }, { "type": "event", - "name": "bytebeasts::systems::world_setup::world_setup::Event", + "name": "bytebeasts::models::bag::bag::Event", "kind": "enum", - "variants": [ - { - "name": "UpgradeableEvent", - "type": "dojo::contract::upgradeable::upgradeable::Event", - "kind": "nested" - } - ] + "variants": [] } ], - "reads": [], - "writes": [ - "bytebeasts-Beast", - "bytebeasts-Mt", - "bytebeasts-Player", - "bytebeasts-Potion", - "bytebeasts-Position" - ], - "init_calldata": [], - "tag": "bytebeasts-world_setup", - "manifest_name": "bytebeasts-world_setup-674b640b" - } - ], - "models": [ + "tag": "bytebeasts-Bag", + "manifest_name": "bytebeasts-Bag-2571b77d" + }, { "kind": "DojoModel", "members": [ { - "name": "achievement_id", - "type": "u64", + "name": "battle_id", + "type": "u32", "key": true }, { - "name": "achievement_type", - "type": "AchievementType", + "name": "player_id", + "type": "u32", "key": false }, { - "name": "rarity", - "type": "AchievementRarity", + "name": "opponent_id", + "type": "u32", "key": false }, { - "name": "name", - "type": "felt252", + "name": "active_beast_player", + "type": "u32", "key": false }, { - "name": "description", - "type": "ByteArray", + "name": "active_beast_opponent", + "type": "u32", "key": false }, { - "name": "is_hidden", - "type": "bool", + "name": "battle_active", + "type": "u32", "key": false }, { - "name": "is_unlocked", - "type": "bool", + "name": "turn", + "type": "u32", "key": false } ], - "class_hash": "0x41f50347f6f957bc556346a2cdea3f31523f3c25966826e7ca7dea1de185c40", - "original_class_hash": "0x41f50347f6f957bc556346a2cdea3f31523f3c25966826e7ca7dea1de185c40", + "class_hash": "0x239c54e950b5c50d445f9a8db758ea0af1440b75a5f1921dfe014b927476c32", + "original_class_hash": "0x239c54e950b5c50d445f9a8db758ea0af1440b75a5f1921dfe014b927476c32", "abi": [ { "type": "impl", @@ -3509,187 +5385,152 @@ }, { "type": "impl", - "name": "achievementImpl", - "interface_name": "bytebeasts::models::achievements::Iachievement" + "name": "battleImpl", + "interface_name": "bytebeasts::models::battle::Ibattle" }, { - "type": "enum", - "name": "bytebeasts::models::achievement_type::AchievementType", - "variants": [ - { - "name": "FirstWin", - "type": "()" - }, - { - "name": "TenWins", - "type": "()" - }, - { - "name": "HundredWins", - "type": "()" - }, - { - "name": "FirstBeast", - "type": "()" - }, + "type": "struct", + "name": "bytebeasts::models::battle::Battle", + "members": [ { - "name": "TenBeasts", - "type": "()" + "name": "battle_id", + "type": "core::integer::u32" }, { - "name": "RareBeast", - "type": "()" + "name": "player_id", + "type": "core::integer::u32" }, { - "name": "FirstNPCInteraction", - "type": "()" + "name": "opponent_id", + "type": "core::integer::u32" }, { - "name": "RandomBattleChampion", - "type": "()" + "name": "active_beast_player", + "type": "core::integer::u32" }, { - "name": "BeastMaster", - "type": "()" + "name": "active_beast_opponent", + "type": "core::integer::u32" }, { - "name": "LegendaryPlayer", - "type": "()" + "name": "battle_active", + "type": "core::integer::u32" }, { - "name": "TopScorer", - "type": "()" + "name": "turn", + "type": "core::integer::u32" } ] }, { - "type": "enum", - "name": "bytebeasts::models::achievement_rarity::AchievementRarity", - "variants": [ - { - "name": "Common", - "type": "()" - }, - { - "name": "Uncommon", - "type": "()" - }, - { - "name": "Rare", - "type": "()" - }, - { - "name": "Epic", - "type": "()" - }, + "type": "interface", + "name": "bytebeasts::models::battle::Ibattle", + "items": [ { - "name": "Legendary", - "type": "()" + "type": "function", + "name": "ensure_abi", + "inputs": [ + { + "name": "model", + "type": "bytebeasts::models::battle::Battle" + } + ], + "outputs": [], + "state_mutability": "view" } ] }, { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] + "type": "event", + "name": "bytebeasts::models::battle::battle::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "bytebeasts-Battle", + "manifest_name": "bytebeasts-Battle-55b5860b" + }, + { + "kind": "DojoModel", + "members": [ + { + "name": "beast_id", + "type": "u32", + "key": true }, { - "type": "struct", - "name": "bytebeasts::models::achievements::Achievement", - "members": [ - { - "name": "achievement_id", - "type": "core::integer::u64" - }, - { - "name": "achievement_type", - "type": "bytebeasts::models::achievement_type::AchievementType" - }, - { - "name": "rarity", - "type": "bytebeasts::models::achievement_rarity::AchievementRarity" - }, - { - "name": "name", - "type": "core::felt252" - }, - { - "name": "description", - "type": "core::byte_array::ByteArray" - }, - { - "name": "is_hidden", - "type": "core::bool" - }, - { - "name": "is_unlocked", - "type": "core::bool" - } - ] + "name": "beast_name", + "type": "felt252", + "key": false + }, + { + "name": "beast_type", + "type": "WorldElements", + "key": false + }, + { + "name": "beast_description", + "type": "felt252", + "key": false + }, + { + "name": "player_id", + "type": "u32", + "key": false + }, + { + "name": "hp", + "type": "u32", + "key": false + }, + { + "name": "current_hp", + "type": "u32", + "key": false + }, + { + "name": "attack", + "type": "u32", + "key": false }, { - "type": "interface", - "name": "bytebeasts::models::achievements::Iachievement", - "items": [ - { - "type": "function", - "name": "ensure_abi", - "inputs": [ - { - "name": "model", - "type": "bytebeasts::models::achievements::Achievement" - } - ], - "outputs": [], - "state_mutability": "view" - } - ] + "name": "defense", + "type": "u32", + "key": false }, { - "type": "event", - "name": "bytebeasts::models::achievements::achievement::Event", - "kind": "enum", - "variants": [] - } - ], - "tag": "bytebeasts-Achievement", - "manifest_name": "bytebeasts-Achievement-58a03b97" - }, - { - "kind": "DojoModel", - "members": [ + "name": "mt1", + "type": "u32", + "key": false + }, { - "name": "player_id", - "type": "u64", - "key": true + "name": "mt2", + "type": "u32", + "key": false }, { - "name": "achievement_id", - "type": "u64", + "name": "mt3", + "type": "u32", "key": false }, { - "name": "progress", + "name": "mt4", "type": "u32", "key": false }, { - "name": "is_unlocked", - "type": "bool", + "name": "level", + "type": "u32", + "key": false + }, + { + "name": "experience_to_next_level", + "type": "u64", "key": false } ], - "class_hash": "0x494e5a6534846cd68b493aab6f9954333c64c854dbe99144c427f4301477f15", - "original_class_hash": "0x494e5a6534846cd68b493aab6f9954333c64c854dbe99144c427f4301477f15", + "class_hash": "0x7bef5c17e52dab476cd7ae664bbb0f0024aae955ed8b12592e2d6faf7ff6a3c", + "original_class_hash": "0x7bef5c17e52dab476cd7ae664bbb0f0024aae955ed8b12592e2d6faf7ff6a3c", "abi": [ { "type": "impl", @@ -4055,48 +5896,104 @@ }, { "type": "impl", - "name": "achievement_progressImpl", - "interface_name": "bytebeasts::models::achievements::Iachievement_progress" + "name": "beastImpl", + "interface_name": "bytebeasts::models::beast::Ibeast" }, { "type": "enum", - "name": "core::bool", + "name": "bytebeasts::models::world_elements::WorldElements", "variants": [ { - "name": "False", + "name": "Crystal", "type": "()" }, { - "name": "True", + "name": "Draconic", + "type": "()" + }, + { + "name": "Shadow", + "type": "()" + }, + { + "name": "Light", + "type": "()" + }, + { + "name": "Titanium", "type": "()" } ] }, { "type": "struct", - "name": "bytebeasts::models::achievements::AchievementProgress", + "name": "bytebeasts::models::beast::Beast", "members": [ + { + "name": "beast_id", + "type": "core::integer::u32" + }, + { + "name": "beast_name", + "type": "core::felt252" + }, + { + "name": "beast_type", + "type": "bytebeasts::models::world_elements::WorldElements" + }, + { + "name": "beast_description", + "type": "core::felt252" + }, { "name": "player_id", - "type": "core::integer::u64" + "type": "core::integer::u32" }, { - "name": "achievement_id", - "type": "core::integer::u64" + "name": "hp", + "type": "core::integer::u32" }, { - "name": "progress", + "name": "current_hp", "type": "core::integer::u32" }, { - "name": "is_unlocked", - "type": "core::bool" + "name": "attack", + "type": "core::integer::u32" + }, + { + "name": "defense", + "type": "core::integer::u32" + }, + { + "name": "mt1", + "type": "core::integer::u32" + }, + { + "name": "mt2", + "type": "core::integer::u32" + }, + { + "name": "mt3", + "type": "core::integer::u32" + }, + { + "name": "mt4", + "type": "core::integer::u32" + }, + { + "name": "level", + "type": "core::integer::u32" + }, + { + "name": "experience_to_next_level", + "type": "core::integer::u64" } ] }, { "type": "interface", - "name": "bytebeasts::models::achievements::Iachievement_progress", + "name": "bytebeasts::models::beast::Ibeast", "items": [ { "type": "function", @@ -4104,7 +6001,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::achievements::AchievementProgress" + "type": "bytebeasts::models::beast::Beast" } ], "outputs": [], @@ -4114,40 +6011,55 @@ }, { "type": "event", - "name": "bytebeasts::models::achievements::achievement_progress::Event", + "name": "bytebeasts::models::beast::beast::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-AchievementProgress", - "manifest_name": "bytebeasts-AchievementProgress-221f2719" + "tag": "bytebeasts-Beast", + "manifest_name": "bytebeasts-Beast-27809d20" }, { "kind": "DojoModel", "members": [ { - "name": "bag_id", - "type": "u32", + "name": "game_id", + "type": "u128", "key": true }, { - "name": "player_id", - "type": "u32", - "key": true + "name": "player_1", + "type": "ContractAddress", + "key": false }, { - "name": "max_capacity", - "type": "u32", + "name": "player_2", + "type": "ContractAddress", "key": false }, { - "name": "potions", - "type": "Array", + "name": "player_3", + "type": "ContractAddress", + "key": false + }, + { + "name": "player_4", + "type": "ContractAddress", + "key": false + }, + { + "name": "status", + "type": "GameStatus", + "key": false + }, + { + "name": "is_private", + "type": "bool", "key": false } ], - "class_hash": "0x4e0fab7bc052de0008be5606ad3b37576afd2bda323443fc98a8f37bcc10c1c", - "original_class_hash": "0x4e0fab7bc052de0008be5606ad3b37576afd2bda323443fc98a8f37bcc10c1c", + "class_hash": "0x57c477846284e274054c78c5b265af51f8815abbf0147828080c274b0639764", + "original_class_hash": "0x57c477846284e274054c78c5b265af51f8815abbf0147828080c274b0639764", "abi": [ { "type": "impl", @@ -4513,52 +6425,78 @@ }, { "type": "impl", - "name": "bagImpl", - "interface_name": "bytebeasts::models::bag::Ibag" + "name": "gameImpl", + "interface_name": "bytebeasts::models::game::Igame" }, { - "type": "struct", - "name": "bytebeasts::models::potion::Potion", - "members": [ + "type": "enum", + "name": "bytebeasts::models::game::GameStatus", + "variants": [ { - "name": "potion_id", - "type": "core::integer::u32" + "name": "Pending", + "type": "()" }, { - "name": "potion_name", - "type": "core::felt252" + "name": "InProgress", + "type": "()" }, { - "name": "potion_effect", - "type": "core::integer::u32" + "name": "Finished", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" } ] }, { "type": "struct", - "name": "bytebeasts::models::bag::Bag", + "name": "bytebeasts::models::game::Game", "members": [ { - "name": "bag_id", - "type": "core::integer::u32" + "name": "game_id", + "type": "core::integer::u128" }, { - "name": "player_id", - "type": "core::integer::u32" + "name": "player_1", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "max_capacity", - "type": "core::integer::u32" + "name": "player_2", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "potions", - "type": "core::array::Array::" + "name": "player_3", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "player_4", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "status", + "type": "bytebeasts::models::game::GameStatus" + }, + { + "name": "is_private", + "type": "core::bool" } ] }, { "type": "interface", - "name": "bytebeasts::models::bag::Ibag", + "name": "bytebeasts::models::game::Igame", "items": [ { "type": "function", @@ -4566,7 +6504,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::bag::Bag" + "type": "bytebeasts::models::game::Game" } ], "outputs": [], @@ -4576,55 +6514,30 @@ }, { "type": "event", - "name": "bytebeasts::models::bag::bag::Event", + "name": "bytebeasts::models::game::game::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Bag", - "manifest_name": "bytebeasts-Bag-2571b77d" + "tag": "bytebeasts-Game", + "manifest_name": "bytebeasts-Game-e91217d7" }, { "kind": "DojoModel", "members": [ { - "name": "battle_id", + "name": "id", "type": "u32", "key": true }, { - "name": "player_id", - "type": "u32", - "key": false - }, - { - "name": "opponent_id", - "type": "u32", - "key": false - }, - { - "name": "active_beast_player", - "type": "u32", - "key": false - }, - { - "name": "active_beast_opponent", - "type": "u32", - "key": false - }, - { - "name": "battle_active", - "type": "u32", - "key": false - }, - { - "name": "turn", - "type": "u32", + "name": "game_id", + "type": "u128", "key": false } ], - "class_hash": "0x239c54e950b5c50d445f9a8db758ea0af1440b75a5f1921dfe014b927476c32", - "original_class_hash": "0x239c54e950b5c50d445f9a8db758ea0af1440b75a5f1921dfe014b927476c32", + "class_hash": "0x7dc1689aa3f1e6b123cadfed4066a70f09be69c9a166bfe824c61b916925efe", + "original_class_hash": "0x7dc1689aa3f1e6b123cadfed4066a70f09be69c9a166bfe824c61b916925efe", "abi": [ { "type": "impl", @@ -4990,46 +6903,26 @@ }, { "type": "impl", - "name": "battleImpl", - "interface_name": "bytebeasts::models::battle::Ibattle" + "name": "game_idImpl", + "interface_name": "bytebeasts::models::game_id::Igame_id" }, { "type": "struct", - "name": "bytebeasts::models::battle::Battle", + "name": "bytebeasts::models::game_id::GameId", "members": [ { - "name": "battle_id", - "type": "core::integer::u32" - }, - { - "name": "player_id", - "type": "core::integer::u32" - }, - { - "name": "opponent_id", - "type": "core::integer::u32" - }, - { - "name": "active_beast_player", - "type": "core::integer::u32" - }, - { - "name": "active_beast_opponent", - "type": "core::integer::u32" - }, - { - "name": "battle_active", + "name": "id", "type": "core::integer::u32" }, { - "name": "turn", - "type": "core::integer::u32" + "name": "game_id", + "type": "core::integer::u128" } ] }, { "type": "interface", - "name": "bytebeasts::models::battle::Ibattle", + "name": "bytebeasts::models::game_id::Igame_id", "items": [ { "type": "function", @@ -5037,7 +6930,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::battle::Battle" + "type": "bytebeasts::models::game_id::GameId" } ], "outputs": [], @@ -5047,95 +6940,70 @@ }, { "type": "event", - "name": "bytebeasts::models::battle::battle::Event", + "name": "bytebeasts::models::game_id::game_id::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Battle", - "manifest_name": "bytebeasts-Battle-55b5860b" + "tag": "bytebeasts-GameId", + "manifest_name": "bytebeasts-GameId-344511d3" }, { "kind": "DojoModel", "members": [ { - "name": "beast_id", - "type": "u32", + "name": "address", + "type": "ContractAddress", "key": true }, { - "name": "beast_name", - "type": "felt252", - "key": false - }, - { - "name": "beast_type", - "type": "WorldElements", - "key": false - }, - { - "name": "beast_description", - "type": "felt252", - "key": false - }, - { - "name": "player_id", - "type": "u32", - "key": false - }, - { - "name": "hp", - "type": "u32", - "key": false - }, - { - "name": "current_hp", - "type": "u32", - "key": false + "name": "game_id", + "type": "u128", + "key": true }, { - "name": "attack", - "type": "u32", + "name": "beast_1", + "type": "u8", "key": false }, { - "name": "defense", - "type": "u32", + "name": "beast_2", + "type": "u8", "key": false }, { - "name": "mt1", - "type": "u32", + "name": "beast_3", + "type": "u8", "key": false }, { - "name": "mt2", - "type": "u32", + "name": "beast_4", + "type": "u8", "key": false }, { - "name": "mt3", - "type": "u32", + "name": "bag_id", + "type": "u8", "key": false }, { - "name": "mt4", - "type": "u32", + "name": "active_mount", + "type": "u8", "key": false }, { - "name": "level", - "type": "u32", + "name": "mounts", + "type": "Array", "key": false }, { - "name": "experience_to_next_level", - "type": "u64", + "name": "position", + "type": "Array", "key": false } ], - "class_hash": "0x7bef5c17e52dab476cd7ae664bbb0f0024aae955ed8b12592e2d6faf7ff6a3c", - "original_class_hash": "0x7bef5c17e52dab476cd7ae664bbb0f0024aae955ed8b12592e2d6faf7ff6a3c", + "class_hash": "0x52df62dec799bbf7ba4725f74e32e579dec2d90a7a995638761646157bb7e18", + "original_class_hash": "0x52df62dec799bbf7ba4725f74e32e579dec2d90a7a995638761646157bb7e18", "abi": [ { "type": "impl", @@ -5501,104 +7369,58 @@ }, { "type": "impl", - "name": "beastImpl", - "interface_name": "bytebeasts::models::beast::Ibeast" - }, - { - "type": "enum", - "name": "bytebeasts::models::world_elements::WorldElements", - "variants": [ - { - "name": "Crystal", - "type": "()" - }, - { - "name": "Draconic", - "type": "()" - }, - { - "name": "Shadow", - "type": "()" - }, - { - "name": "Light", - "type": "()" - }, - { - "name": "Titanium", - "type": "()" - } - ] + "name": "game_playerImpl", + "interface_name": "bytebeasts::models::game_player::Igame_player" }, { "type": "struct", - "name": "bytebeasts::models::beast::Beast", + "name": "bytebeasts::models::game_player::GamePlayer", "members": [ { - "name": "beast_id", - "type": "core::integer::u32" - }, - { - "name": "beast_name", - "type": "core::felt252" - }, - { - "name": "beast_type", - "type": "bytebeasts::models::world_elements::WorldElements" - }, - { - "name": "beast_description", - "type": "core::felt252" - }, - { - "name": "player_id", - "type": "core::integer::u32" - }, - { - "name": "hp", - "type": "core::integer::u32" + "name": "address", + "type": "core::starknet::contract_address::ContractAddress" }, { - "name": "current_hp", - "type": "core::integer::u32" + "name": "game_id", + "type": "core::integer::u128" }, { - "name": "attack", - "type": "core::integer::u32" + "name": "beast_1", + "type": "core::integer::u8" }, { - "name": "defense", - "type": "core::integer::u32" + "name": "beast_2", + "type": "core::integer::u8" }, { - "name": "mt1", - "type": "core::integer::u32" + "name": "beast_3", + "type": "core::integer::u8" }, { - "name": "mt2", - "type": "core::integer::u32" + "name": "beast_4", + "type": "core::integer::u8" }, { - "name": "mt3", - "type": "core::integer::u32" + "name": "bag_id", + "type": "core::integer::u8" }, { - "name": "mt4", - "type": "core::integer::u32" + "name": "active_mount", + "type": "core::integer::u8" }, { - "name": "level", - "type": "core::integer::u32" + "name": "mounts", + "type": "core::array::Array::" }, { - "name": "experience_to_next_level", - "type": "core::integer::u64" + "name": "position", + "type": "core::array::Array::" } ] }, { "type": "interface", - "name": "bytebeasts::models::beast::Ibeast", + "name": "bytebeasts::models::game_player::Igame_player", "items": [ { "type": "function", @@ -5606,7 +7428,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::beast::Beast" + "type": "bytebeasts::models::game_player::GamePlayer" } ], "outputs": [], @@ -5616,55 +7438,45 @@ }, { "type": "event", - "name": "bytebeasts::models::beast::beast::Event", + "name": "bytebeasts::models::game_player::game_player::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Beast", - "manifest_name": "bytebeasts-Beast-27809d20" + "tag": "bytebeasts-GamePlayer", + "manifest_name": "bytebeasts-GamePlayer-596ef4a1" }, { "kind": "DojoModel", "members": [ { - "name": "game_id", - "type": "u128", + "name": "leaderboard_id", + "type": "u64", "key": true }, { - "name": "player_1", - "type": "ContractAddress", - "key": false - }, - { - "name": "player_2", - "type": "ContractAddress", - "key": false - }, - { - "name": "player_3", - "type": "ContractAddress", + "name": "name", + "type": "felt252", "key": false }, { - "name": "player_4", - "type": "ContractAddress", + "name": "description", + "type": "felt252", "key": false }, { - "name": "status", - "type": "GameStatus", + "name": "entries", + "type": "Array", "key": false }, { - "name": "is_private", - "type": "bool", + "name": "last_updated", + "type": "u64", "key": false } ], - "class_hash": "0x57c477846284e274054c78c5b265af51f8815abbf0147828080c274b0639764", - "original_class_hash": "0x57c477846284e274054c78c5b265af51f8815abbf0147828080c274b0639764", + "class_hash": "0x13d964c4091be478133a4aadbb278da14229f77225ce8da5dd246e42abc7ac0", + "original_class_hash": "0x13d964c4091be478133a4aadbb278da14229f77225ce8da5dd246e42abc7ac0", "abi": [ { "type": "impl", @@ -6030,26 +7842,8 @@ }, { "type": "impl", - "name": "gameImpl", - "interface_name": "bytebeasts::models::game::Igame" - }, - { - "type": "enum", - "name": "bytebeasts::models::game::GameStatus", - "variants": [ - { - "name": "Pending", - "type": "()" - }, - { - "name": "InProgress", - "type": "()" - }, - { - "name": "Finished", - "type": "()" - } - ] + "name": "leaderboardImpl", + "interface_name": "bytebeasts::models::leaderboard::Ileaderboard" }, { "type": "enum", @@ -6067,41 +7861,67 @@ }, { "type": "struct", - "name": "bytebeasts::models::game::Game", + "name": "bytebeasts::models::leaderboard::LeaderboardEntry", "members": [ { - "name": "game_id", - "type": "core::integer::u128" + "name": "player_id", + "type": "core::integer::u32" }, { - "name": "player_1", - "type": "core::starknet::contract_address::ContractAddress" + "name": "player_name", + "type": "core::felt252" }, { - "name": "player_2", - "type": "core::starknet::contract_address::ContractAddress" + "name": "score", + "type": "core::integer::u32" }, { - "name": "player_3", - "type": "core::starknet::contract_address::ContractAddress" + "name": "wins", + "type": "core::integer::u32" }, { - "name": "player_4", - "type": "core::starknet::contract_address::ContractAddress" + "name": "losses", + "type": "core::integer::u32" }, { - "name": "status", - "type": "bytebeasts::models::game::GameStatus" + "name": "highest_score", + "type": "core::integer::u32" }, { - "name": "is_private", + "name": "is_active", "type": "core::bool" } ] }, + { + "type": "struct", + "name": "bytebeasts::models::leaderboard::Leaderboard", + "members": [ + { + "name": "leaderboard_id", + "type": "core::integer::u64" + }, + { + "name": "name", + "type": "core::felt252" + }, + { + "name": "description", + "type": "core::felt252" + }, + { + "name": "entries", + "type": "core::array::Array::" + }, + { + "name": "last_updated", + "type": "core::integer::u64" + } + ] + }, { "type": "interface", - "name": "bytebeasts::models::game::Igame", + "name": "bytebeasts::models::leaderboard::Ileaderboard", "items": [ { "type": "function", @@ -6109,7 +7929,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::game::Game" + "type": "bytebeasts::models::leaderboard::Leaderboard" } ], "outputs": [], @@ -6119,30 +7939,55 @@ }, { "type": "event", - "name": "bytebeasts::models::game::game::Event", + "name": "bytebeasts::models::leaderboard::leaderboard::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Game", - "manifest_name": "bytebeasts-Game-e91217d7" + "tag": "bytebeasts-Leaderboard", + "manifest_name": "bytebeasts-Leaderboard-7e680376" }, { "kind": "DojoModel", "members": [ { - "name": "id", + "name": "player_id", "type": "u32", "key": true }, { - "name": "game_id", - "type": "u128", + "name": "player_name", + "type": "felt252", + "key": false + }, + { + "name": "score", + "type": "u32", + "key": false + }, + { + "name": "wins", + "type": "u32", + "key": false + }, + { + "name": "losses", + "type": "u32", + "key": false + }, + { + "name": "highest_score", + "type": "u32", + "key": false + }, + { + "name": "is_active", + "type": "bool", "key": false } ], - "class_hash": "0x7dc1689aa3f1e6b123cadfed4066a70f09be69c9a166bfe824c61b916925efe", - "original_class_hash": "0x7dc1689aa3f1e6b123cadfed4066a70f09be69c9a166bfe824c61b916925efe", + "class_hash": "0x4f9ca94349981f722e598f396bcca466289aca05dcfb277ef562ee02fee333c", + "original_class_hash": "0x4f9ca94349981f722e598f396bcca466289aca05dcfb277ef562ee02fee333c", "abi": [ { "type": "impl", @@ -6508,26 +8353,60 @@ }, { "type": "impl", - "name": "game_idImpl", - "interface_name": "bytebeasts::models::game_id::Igame_id" + "name": "leaderboard_entryImpl", + "interface_name": "bytebeasts::models::leaderboard::Ileaderboard_entry" + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] }, { "type": "struct", - "name": "bytebeasts::models::game_id::GameId", + "name": "bytebeasts::models::leaderboard::LeaderboardEntry", "members": [ { - "name": "id", + "name": "player_id", "type": "core::integer::u32" }, { - "name": "game_id", - "type": "core::integer::u128" + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "score", + "type": "core::integer::u32" + }, + { + "name": "wins", + "type": "core::integer::u32" + }, + { + "name": "losses", + "type": "core::integer::u32" + }, + { + "name": "highest_score", + "type": "core::integer::u32" + }, + { + "name": "is_active", + "type": "core::bool" } ] }, { "type": "interface", - "name": "bytebeasts::models::game_id::Igame_id", + "name": "bytebeasts::models::leaderboard::Ileaderboard_entry", "items": [ { "type": "function", @@ -6535,7 +8414,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::game_id::GameId" + "type": "bytebeasts::models::leaderboard::LeaderboardEntry" } ], "outputs": [], @@ -6545,70 +8424,45 @@ }, { "type": "event", - "name": "bytebeasts::models::game_id::game_id::Event", + "name": "bytebeasts::models::leaderboard::leaderboard_entry::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-GameId", - "manifest_name": "bytebeasts-GameId-344511d3" + "tag": "bytebeasts-LeaderboardEntry", + "manifest_name": "bytebeasts-LeaderboardEntry-7237950c" }, { "kind": "DojoModel", "members": [ { - "name": "address", - "type": "ContractAddress", - "key": true - }, - { - "name": "game_id", - "type": "u128", + "name": "mt_id", + "type": "u32", "key": true }, { - "name": "beast_1", - "type": "u8", - "key": false - }, - { - "name": "beast_2", - "type": "u8", - "key": false - }, - { - "name": "beast_3", - "type": "u8", - "key": false - }, - { - "name": "beast_4", - "type": "u8", - "key": false - }, - { - "name": "bag_id", - "type": "u8", + "name": "mt_name", + "type": "felt252", "key": false }, { - "name": "active_mount", - "type": "u8", + "name": "mt_type", + "type": "WorldElements", "key": false }, { - "name": "mounts", - "type": "Array", + "name": "mt_power", + "type": "u32", "key": false }, { - "name": "position", - "type": "Array", + "name": "mt_accuracy", + "type": "u32", "key": false } ], - "class_hash": "0x52df62dec799bbf7ba4725f74e32e579dec2d90a7a995638761646157bb7e18", - "original_class_hash": "0x52df62dec799bbf7ba4725f74e32e579dec2d90a7a995638761646157bb7e18", + "class_hash": "0x341a07493baed313e741253a241aa31fc9d40a9c373cd2bae49f85ab66f98cc", + "original_class_hash": "0x341a07493baed313e741253a241aa31fc9d40a9c373cd2bae49f85ab66f98cc", "abi": [ { "type": "impl", @@ -6974,58 +8828,64 @@ }, { "type": "impl", - "name": "game_playerImpl", - "interface_name": "bytebeasts::models::game_player::Igame_player" + "name": "mtImpl", + "interface_name": "bytebeasts::models::mt::Imt" }, { - "type": "struct", - "name": "bytebeasts::models::game_player::GamePlayer", - "members": [ + "type": "enum", + "name": "bytebeasts::models::world_elements::WorldElements", + "variants": [ { - "name": "address", - "type": "core::starknet::contract_address::ContractAddress" + "name": "Crystal", + "type": "()" }, { - "name": "game_id", - "type": "core::integer::u128" + "name": "Draconic", + "type": "()" }, { - "name": "beast_1", - "type": "core::integer::u8" + "name": "Shadow", + "type": "()" }, { - "name": "beast_2", - "type": "core::integer::u8" + "name": "Light", + "type": "()" }, { - "name": "beast_3", - "type": "core::integer::u8" - }, + "name": "Titanium", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::mt::Mt", + "members": [ { - "name": "beast_4", - "type": "core::integer::u8" + "name": "mt_id", + "type": "core::integer::u32" }, { - "name": "bag_id", - "type": "core::integer::u8" + "name": "mt_name", + "type": "core::felt252" }, { - "name": "active_mount", - "type": "core::integer::u8" + "name": "mt_type", + "type": "bytebeasts::models::world_elements::WorldElements" }, { - "name": "mounts", - "type": "core::array::Array::" + "name": "mt_power", + "type": "core::integer::u32" }, { - "name": "position", - "type": "core::array::Array::" + "name": "mt_accuracy", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "bytebeasts::models::game_player::Igame_player", + "name": "bytebeasts::models::mt::Imt", "items": [ { "type": "function", @@ -7033,7 +8893,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::game_player::GamePlayer" + "type": "bytebeasts::models::mt::Mt" } ], "outputs": [], @@ -7043,45 +8903,80 @@ }, { "type": "event", - "name": "bytebeasts::models::game_player::game_player::Event", + "name": "bytebeasts::models::mt::mt::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-GamePlayer", - "manifest_name": "bytebeasts-GamePlayer-596ef4a1" + "tag": "bytebeasts-Mt", + "manifest_name": "bytebeasts-Mt-37360d30" }, { "kind": "DojoModel", "members": [ { - "name": "mt_id", + "name": "npc_id", "type": "u32", "key": true }, { - "name": "mt_name", + "name": "npc_name", "type": "felt252", "key": false }, { - "name": "mt_type", - "type": "WorldElements", + "name": "npc_description", + "type": "felt252", "key": false }, { - "name": "mt_power", - "type": "u32", + "name": "npc_role", + "type": "Role", "key": false }, { - "name": "mt_accuracy", - "type": "u32", + "name": "dialogue", + "type": "ByteArray", + "key": false + }, + { + "name": "is_active", + "type": "bool", + "key": false + }, + { + "name": "location", + "type": "Coordinates", + "key": false + }, + { + "name": "importance_level", + "type": "u8", + "key": false + }, + { + "name": "mission_status", + "type": "MissionStatus", + "key": false + }, + { + "name": "reward", + "type": "u16", + "key": false + }, + { + "name": "experience_points", + "type": "u16", + "key": false + }, + { + "name": "potions", + "type": "Array", "key": false } ], - "class_hash": "0x341a07493baed313e741253a241aa31fc9d40a9c373cd2bae49f85ab66f98cc", - "original_class_hash": "0x341a07493baed313e741253a241aa31fc9d40a9c373cd2bae49f85ab66f98cc", + "class_hash": "0x3ba44df67a037c20f004b7f5ab7725932d4519eed6beb6bc223a03e96c0f0f9", + "original_class_hash": "0x3ba44df67a037c20f004b7f5ab7725932d4519eed6beb6bc223a03e96c0f0f9", "abi": [ { "type": "impl", @@ -7447,64 +9342,156 @@ }, { "type": "impl", - "name": "mtImpl", - "interface_name": "bytebeasts::models::mt::Imt" + "name": "npcImpl", + "interface_name": "bytebeasts::models::npc::Inpc" }, { "type": "enum", - "name": "bytebeasts::models::world_elements::WorldElements", + "name": "bytebeasts::models::role::Role", "variants": [ { - "name": "Crystal", + "name": "Vendor", "type": "()" }, { - "name": "Draconic", + "name": "Trainer", "type": "()" }, { - "name": "Shadow", + "name": "Guide", "type": "()" }, { - "name": "Light", + "name": "QuestGiver", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", "type": "()" }, { - "name": "Titanium", + "name": "True", "type": "()" } ] }, { "type": "struct", - "name": "bytebeasts::models::mt::Mt", + "name": "bytebeasts::models::coordinates::Coordinates", "members": [ { - "name": "mt_id", + "name": "x", "type": "core::integer::u32" }, { - "name": "mt_name", - "type": "core::felt252" + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "enum", + "name": "bytebeasts::models::mission_status::MissionStatus", + "variants": [ + { + "name": "NotStarted", + "type": "()" }, { - "name": "mt_type", - "type": "bytebeasts::models::world_elements::WorldElements" + "name": "InProgress", + "type": "()" }, { - "name": "mt_power", + "name": "Completed", + "type": "()" + }, + { + "name": "Failed", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::potion::Potion", + "members": [ + { + "name": "potion_id", "type": "core::integer::u32" }, { - "name": "mt_accuracy", + "name": "potion_name", + "type": "core::felt252" + }, + { + "name": "potion_effect", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::npc::NPC", + "members": [ + { + "name": "npc_id", "type": "core::integer::u32" + }, + { + "name": "npc_name", + "type": "core::felt252" + }, + { + "name": "npc_description", + "type": "core::felt252" + }, + { + "name": "npc_role", + "type": "bytebeasts::models::role::Role" + }, + { + "name": "dialogue", + "type": "core::byte_array::ByteArray" + }, + { + "name": "is_active", + "type": "core::bool" + }, + { + "name": "location", + "type": "bytebeasts::models::coordinates::Coordinates" + }, + { + "name": "importance_level", + "type": "core::integer::u8" + }, + { + "name": "mission_status", + "type": "bytebeasts::models::mission_status::MissionStatus" + }, + { + "name": "reward", + "type": "core::integer::u16" + }, + { + "name": "experience_points", + "type": "core::integer::u16" + }, + { + "name": "potions", + "type": "core::array::Array::" } ] }, { "type": "interface", - "name": "bytebeasts::models::mt::Imt", + "name": "bytebeasts::models::npc::Inpc", "items": [ { "type": "function", @@ -7512,7 +9499,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::mt::Mt" + "type": "bytebeasts::models::npc::NPC" } ], "outputs": [], @@ -7521,81 +9508,56 @@ ] }, { - "type": "event", - "name": "bytebeasts::models::mt::mt::Event", - "kind": "enum", - "variants": [] - } - ], - "tag": "bytebeasts-Mt", - "manifest_name": "bytebeasts-Mt-37360d30" - }, - { - "kind": "DojoModel", - "members": [ - { - "name": "npc_id", - "type": "u32", - "key": true - }, - { - "name": "npc_name", - "type": "felt252", - "key": false - }, - { - "name": "npc_description", - "type": "felt252", - "key": false - }, - { - "name": "npc_role", - "type": "Role", - "key": false - }, - { - "name": "dialogue", - "type": "ByteArray", - "key": false - }, + "type": "event", + "name": "bytebeasts::models::npc::npc::Event", + "kind": "enum", + "variants": [] + } + ], + "tag": "bytebeasts-NPC", + "manifest_name": "bytebeasts-NPC-4c5239ac" + }, + { + "kind": "DojoModel", + "members": [ { - "name": "is_active", - "type": "bool", - "key": false + "name": "player_id", + "type": "u32", + "key": true }, { - "name": "location", - "type": "Coordinates", + "name": "player_name", + "type": "felt252", "key": false }, { - "name": "importance_level", - "type": "u8", + "name": "beast_1", + "type": "u32", "key": false }, { - "name": "mission_status", - "type": "MissionStatus", + "name": "beast_2", + "type": "u32", "key": false }, { - "name": "reward", - "type": "u16", + "name": "beast_3", + "type": "u32", "key": false }, { - "name": "experience_points", - "type": "u16", + "name": "beast_4", + "type": "u32", "key": false }, { "name": "potions", - "type": "Array", + "type": "u32", "key": false } ], - "class_hash": "0x3ba44df67a037c20f004b7f5ab7725932d4519eed6beb6bc223a03e96c0f0f9", - "original_class_hash": "0x3ba44df67a037c20f004b7f5ab7725932d4519eed6beb6bc223a03e96c0f0f9", + "class_hash": "0x5d992305e6f7ce0965d5bbe71e33cab817c31514ba83c8fca4610ab574e8016", + "original_class_hash": "0x5d992305e6f7ce0965d5bbe71e33cab817c31514ba83c8fca4610ab574e8016", "abi": [ { "type": "impl", @@ -7961,156 +9923,46 @@ }, { "type": "impl", - "name": "npcImpl", - "interface_name": "bytebeasts::models::npc::Inpc" - }, - { - "type": "enum", - "name": "bytebeasts::models::role::Role", - "variants": [ - { - "name": "Vendor", - "type": "()" - }, - { - "name": "Trainer", - "type": "()" - }, - { - "name": "Guide", - "type": "()" - }, - { - "name": "QuestGiver", - "type": "()" - } - ] - }, - { - "type": "enum", - "name": "core::bool", - "variants": [ - { - "name": "False", - "type": "()" - }, - { - "name": "True", - "type": "()" - } - ] - }, - { - "type": "struct", - "name": "bytebeasts::models::coordinates::Coordinates", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", - "type": "core::integer::u32" - } - ] - }, - { - "type": "enum", - "name": "bytebeasts::models::mission_status::MissionStatus", - "variants": [ - { - "name": "NotStarted", - "type": "()" - }, - { - "name": "InProgress", - "type": "()" - }, - { - "name": "Completed", - "type": "()" - }, - { - "name": "Failed", - "type": "()" - } - ] + "name": "playerImpl", + "interface_name": "bytebeasts::models::player::Iplayer" }, { "type": "struct", - "name": "bytebeasts::models::potion::Potion", + "name": "bytebeasts::models::player::Player", "members": [ { - "name": "potion_id", + "name": "player_id", "type": "core::integer::u32" }, { - "name": "potion_name", + "name": "player_name", "type": "core::felt252" }, { - "name": "potion_effect", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "bytebeasts::models::npc::NPC", - "members": [ - { - "name": "npc_id", + "name": "beast_1", "type": "core::integer::u32" }, { - "name": "npc_name", - "type": "core::felt252" - }, - { - "name": "npc_description", - "type": "core::felt252" - }, - { - "name": "npc_role", - "type": "bytebeasts::models::role::Role" - }, - { - "name": "dialogue", - "type": "core::byte_array::ByteArray" - }, - { - "name": "is_active", - "type": "core::bool" - }, - { - "name": "location", - "type": "bytebeasts::models::coordinates::Coordinates" - }, - { - "name": "importance_level", - "type": "core::integer::u8" - }, - { - "name": "mission_status", - "type": "bytebeasts::models::mission_status::MissionStatus" + "name": "beast_2", + "type": "core::integer::u32" }, { - "name": "reward", - "type": "core::integer::u16" + "name": "beast_3", + "type": "core::integer::u32" }, { - "name": "experience_points", - "type": "core::integer::u16" + "name": "beast_4", + "type": "core::integer::u32" }, { "name": "potions", - "type": "core::array::Array::" + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "bytebeasts::models::npc::Inpc", + "name": "bytebeasts::models::player::Iplayer", "items": [ { "type": "function", @@ -8118,7 +9970,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::npc::NPC" + "type": "bytebeasts::models::player::Player" } ], "outputs": [], @@ -8128,55 +9980,30 @@ }, { "type": "event", - "name": "bytebeasts::models::npc::npc::Event", + "name": "bytebeasts::models::player::player::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-NPC", - "manifest_name": "bytebeasts-NPC-4c5239ac" + "tag": "bytebeasts-Player", + "manifest_name": "bytebeasts-Player-14f5e45e" }, { "kind": "DojoModel", "members": [ { - "name": "player_id", - "type": "u32", + "name": "player", + "type": "Player", "key": true }, { - "name": "player_name", - "type": "felt252", - "key": false - }, - { - "name": "beast_1", - "type": "u32", - "key": false - }, - { - "name": "beast_2", - "type": "u32", - "key": false - }, - { - "name": "beast_3", - "type": "u32", - "key": false - }, - { - "name": "beast_4", - "type": "u32", - "key": false - }, - { - "name": "potions", - "type": "u32", + "name": "coordinates", + "type": "Coordinates", "key": false } ], - "class_hash": "0x5d992305e6f7ce0965d5bbe71e33cab817c31514ba83c8fca4610ab574e8016", - "original_class_hash": "0x5d992305e6f7ce0965d5bbe71e33cab817c31514ba83c8fca4610ab574e8016", + "class_hash": "0x91da9f380b960e2dc7f9a59d4e1242ed718590d2270fd28e2311a5e1ee54f2", + "original_class_hash": "0x91da9f380b960e2dc7f9a59d4e1242ed718590d2270fd28e2311a5e1ee54f2", "abi": [ { "type": "impl", @@ -8542,8 +10369,8 @@ }, { "type": "impl", - "name": "playerImpl", - "interface_name": "bytebeasts::models::player::Iplayer" + "name": "positionImpl", + "interface_name": "bytebeasts::models::position::Iposition" }, { "type": "struct", @@ -8579,9 +10406,37 @@ } ] }, + { + "type": "struct", + "name": "bytebeasts::models::coordinates::Coordinates", + "members": [ + { + "name": "x", + "type": "core::integer::u32" + }, + { + "name": "y", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::position::Position", + "members": [ + { + "name": "player", + "type": "bytebeasts::models::player::Player" + }, + { + "name": "coordinates", + "type": "bytebeasts::models::coordinates::Coordinates" + } + ] + }, { "type": "interface", - "name": "bytebeasts::models::player::Iplayer", + "name": "bytebeasts::models::position::Iposition", "items": [ { "type": "function", @@ -8589,7 +10444,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::player::Player" + "type": "bytebeasts::models::position::Position" } ], "outputs": [], @@ -8599,30 +10454,35 @@ }, { "type": "event", - "name": "bytebeasts::models::player::player::Event", + "name": "bytebeasts::models::position::position::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Player", - "manifest_name": "bytebeasts-Player-14f5e45e" + "tag": "bytebeasts-Position", + "manifest_name": "bytebeasts-Position-78f28df6" }, { "kind": "DojoModel", "members": [ { - "name": "player", - "type": "Player", + "name": "potion_id", + "type": "u32", "key": true }, { - "name": "coordinates", - "type": "Coordinates", + "name": "potion_name", + "type": "felt252", + "key": false + }, + { + "name": "potion_effect", + "type": "u32", "key": false } ], - "class_hash": "0x91da9f380b960e2dc7f9a59d4e1242ed718590d2270fd28e2311a5e1ee54f2", - "original_class_hash": "0x91da9f380b960e2dc7f9a59d4e1242ed718590d2270fd28e2311a5e1ee54f2", + "class_hash": "0x4eac23f35a0e71954b8f000d9d8999579ba49ffc918e8b78924562449bdf8d4", + "original_class_hash": "0x4eac23f35a0e71954b8f000d9d8999579ba49ffc918e8b78924562449bdf8d4", "abi": [ { "type": "impl", @@ -8988,74 +10848,30 @@ }, { "type": "impl", - "name": "positionImpl", - "interface_name": "bytebeasts::models::position::Iposition" + "name": "potionImpl", + "interface_name": "bytebeasts::models::potion::Ipotion" }, { "type": "struct", - "name": "bytebeasts::models::player::Player", + "name": "bytebeasts::models::potion::Potion", "members": [ { - "name": "player_id", + "name": "potion_id", "type": "core::integer::u32" }, { - "name": "player_name", + "name": "potion_name", "type": "core::felt252" }, { - "name": "beast_1", - "type": "core::integer::u32" - }, - { - "name": "beast_2", - "type": "core::integer::u32" - }, - { - "name": "beast_3", - "type": "core::integer::u32" - }, - { - "name": "beast_4", - "type": "core::integer::u32" - }, - { - "name": "potions", - "type": "core::integer::u32" - } - ] - }, - { - "type": "struct", - "name": "bytebeasts::models::coordinates::Coordinates", - "members": [ - { - "name": "x", - "type": "core::integer::u32" - }, - { - "name": "y", + "name": "potion_effect", "type": "core::integer::u32" } ] }, - { - "type": "struct", - "name": "bytebeasts::models::position::Position", - "members": [ - { - "name": "player", - "type": "bytebeasts::models::player::Player" - }, - { - "name": "coordinates", - "type": "bytebeasts::models::coordinates::Coordinates" - } - ] - }, { "type": "interface", - "name": "bytebeasts::models::position::Iposition", + "name": "bytebeasts::models::potion::Ipotion", "items": [ { "type": "function", @@ -9063,7 +10879,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::position::Position" + "type": "bytebeasts::models::potion::Potion" } ], "outputs": [], @@ -9073,35 +10889,30 @@ }, { "type": "event", - "name": "bytebeasts::models::position::position::Event", + "name": "bytebeasts::models::potion::potion::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Position", - "manifest_name": "bytebeasts-Position-78f28df6" + "tag": "bytebeasts-Potion", + "manifest_name": "bytebeasts-Potion-6a2114b0" }, { "kind": "DojoModel", "members": [ { - "name": "potion_id", + "name": "player_id", "type": "u32", "key": true }, { - "name": "potion_name", + "name": "message", "type": "felt252", "key": false - }, - { - "name": "potion_effect", - "type": "u32", - "key": false } ], - "class_hash": "0x4eac23f35a0e71954b8f000d9d8999579ba49ffc918e8b78924562449bdf8d4", - "original_class_hash": "0x4eac23f35a0e71954b8f000d9d8999579ba49ffc918e8b78924562449bdf8d4", + "class_hash": "0xe446a8c3773fbfae6e2e0e87a6d1db12143224cf47e217e12bf9cfc76428ef", + "original_class_hash": "0xe446a8c3773fbfae6e2e0e87a6d1db12143224cf47e217e12bf9cfc76428ef", "abi": [ { "type": "impl", @@ -9467,30 +11278,26 @@ }, { "type": "impl", - "name": "potionImpl", - "interface_name": "bytebeasts::models::potion::Ipotion" + "name": "statusImpl", + "interface_name": "bytebeasts::systems::battle::battle_system::Istatus" }, { "type": "struct", - "name": "bytebeasts::models::potion::Potion", + "name": "bytebeasts::systems::battle::battle_system::Status", "members": [ { - "name": "potion_id", + "name": "player_id", "type": "core::integer::u32" }, { - "name": "potion_name", + "name": "message", "type": "core::felt252" - }, - { - "name": "potion_effect", - "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "bytebeasts::models::potion::Ipotion", + "name": "bytebeasts::systems::battle::battle_system::Istatus", "items": [ { "type": "function", @@ -9498,7 +11305,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::models::potion::Potion" + "type": "bytebeasts::systems::battle::battle_system::Status" } ], "outputs": [], @@ -9508,19 +11315,19 @@ }, { "type": "event", - "name": "bytebeasts::models::potion::potion::Event", + "name": "bytebeasts::systems::battle::battle_system::status::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Potion", - "manifest_name": "bytebeasts-Potion-6a2114b0" + "tag": "bytebeasts-Status", + "manifest_name": "bytebeasts-Status-6595af0f" }, { "kind": "DojoModel", "members": [ { - "name": "player_id", + "name": "battle_id", "type": "u32", "key": true }, @@ -9530,8 +11337,8 @@ "key": false } ], - "class_hash": "0xe446a8c3773fbfae6e2e0e87a6d1db12143224cf47e217e12bf9cfc76428ef", - "original_class_hash": "0xe446a8c3773fbfae6e2e0e87a6d1db12143224cf47e217e12bf9cfc76428ef", + "class_hash": "0x5ba495f80b653be6df964eb97ac2e7b3f7f72508d17b54b1d51595231db8fae", + "original_class_hash": "0x5ba495f80b653be6df964eb97ac2e7b3f7f72508d17b54b1d51595231db8fae", "abi": [ { "type": "impl", @@ -9897,15 +11704,15 @@ }, { "type": "impl", - "name": "statusImpl", - "interface_name": "bytebeasts::systems::battle::battle_system::Istatus" + "name": "status_battleImpl", + "interface_name": "bytebeasts::systems::battle::battle_system::Istatus_battle" }, { "type": "struct", - "name": "bytebeasts::systems::battle::battle_system::Status", + "name": "bytebeasts::systems::battle::battle_system::StatusBattle", "members": [ { - "name": "player_id", + "name": "battle_id", "type": "core::integer::u32" }, { @@ -9916,7 +11723,7 @@ }, { "type": "interface", - "name": "bytebeasts::systems::battle::battle_system::Istatus", + "name": "bytebeasts::systems::battle::battle_system::Istatus_battle", "items": [ { "type": "function", @@ -9924,7 +11731,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::systems::battle::battle_system::Status" + "type": "bytebeasts::systems::battle::battle_system::StatusBattle" } ], "outputs": [], @@ -9934,30 +11741,55 @@ }, { "type": "event", - "name": "bytebeasts::systems::battle::battle_system::status::Event", + "name": "bytebeasts::systems::battle::battle_system::status_battle::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-Status", - "manifest_name": "bytebeasts-Status-6595af0f" + "tag": "bytebeasts-StatusBattle", + "manifest_name": "bytebeasts-StatusBattle-161fdb64" }, { "kind": "DojoModel", "members": [ { - "name": "battle_id", + "name": "tournament_id", "type": "u32", "key": true }, { - "name": "message", + "name": "name", "type": "felt252", "key": false + }, + { + "name": "status", + "type": "TournamentStatus", + "key": false + }, + { + "name": "entry_fee", + "type": "u32", + "key": false + }, + { + "name": "max_participants", + "type": "u32", + "key": false + }, + { + "name": "current_participants", + "type": "Array", + "key": false + }, + { + "name": "prize_pool", + "type": "u32", + "key": false } ], - "class_hash": "0x5ba495f80b653be6df964eb97ac2e7b3f7f72508d17b54b1d51595231db8fae", - "original_class_hash": "0x5ba495f80b653be6df964eb97ac2e7b3f7f72508d17b54b1d51595231db8fae", + "class_hash": "0x3004c0d548b033db92ed628e38e940ee67b44cf73ffd50a0bc10c334a000aec", + "original_class_hash": "0x3004c0d548b033db92ed628e38e940ee67b44cf73ffd50a0bc10c334a000aec", "abi": [ { "type": "impl", @@ -10323,26 +12155,98 @@ }, { "type": "impl", - "name": "status_battleImpl", - "interface_name": "bytebeasts::systems::battle::battle_system::Istatus_battle" + "name": "tournamentImpl", + "interface_name": "bytebeasts::models::tournament::Itournament" + }, + { + "type": "enum", + "name": "bytebeasts::models::tournament::TournamentStatus", + "variants": [ + { + "name": "Pending", + "type": "()" + }, + { + "name": "Ongoing", + "type": "()" + }, + { + "name": "Completed", + "type": "()" + } + ] }, { "type": "struct", - "name": "bytebeasts::systems::battle::battle_system::StatusBattle", + "name": "bytebeasts::models::player::Player", "members": [ { - "name": "battle_id", + "name": "player_id", "type": "core::integer::u32" }, { - "name": "message", + "name": "player_name", + "type": "core::felt252" + }, + { + "name": "beast_1", + "type": "core::integer::u32" + }, + { + "name": "beast_2", + "type": "core::integer::u32" + }, + { + "name": "beast_3", + "type": "core::integer::u32" + }, + { + "name": "beast_4", + "type": "core::integer::u32" + }, + { + "name": "potions", + "type": "core::integer::u32" + } + ] + }, + { + "type": "struct", + "name": "bytebeasts::models::tournament::Tournament", + "members": [ + { + "name": "tournament_id", + "type": "core::integer::u32" + }, + { + "name": "name", "type": "core::felt252" + }, + { + "name": "status", + "type": "bytebeasts::models::tournament::TournamentStatus" + }, + { + "name": "entry_fee", + "type": "core::integer::u32" + }, + { + "name": "max_participants", + "type": "core::integer::u32" + }, + { + "name": "current_participants", + "type": "core::array::Array::" + }, + { + "name": "prize_pool", + "type": "core::integer::u32" } ] }, { "type": "interface", - "name": "bytebeasts::systems::battle::battle_system::Istatus_battle", + "name": "bytebeasts::models::tournament::Itournament", "items": [ { "type": "function", @@ -10350,7 +12254,7 @@ "inputs": [ { "name": "model", - "type": "bytebeasts::systems::battle::battle_system::StatusBattle" + "type": "bytebeasts::models::tournament::Tournament" } ], "outputs": [], @@ -10360,13 +12264,13 @@ }, { "type": "event", - "name": "bytebeasts::systems::battle::battle_system::status_battle::Event", + "name": "bytebeasts::models::tournament::tournament::Event", "kind": "enum", "variants": [] } ], - "tag": "bytebeasts-StatusBattle", - "manifest_name": "bytebeasts-StatusBattle-161fdb64" + "tag": "bytebeasts-Tournament", + "manifest_name": "bytebeasts-Tournament-12bdecb1" } ] } \ No newline at end of file diff --git a/manifests/dev/deployment/manifest.toml b/manifests/dev/deployment/manifest.toml index eb90f3f..b6bdae9 100644 --- a/manifests/dev/deployment/manifest.toml +++ b/manifests/dev/deployment/manifest.toml @@ -92,6 +92,19 @@ init_calldata = [] tag = "bytebeasts-spawn_action" manifest_name = "bytebeasts-spawn_action-5176c1e8" +[[contracts]] +kind = "DojoContract" +address = "0x2671b8a136f1441cbd5fb6d3d9c5bdc45a3fbf184970b334cfd31ed98cf0b69" +class_hash = "0x7bbd215ec46e02f1c7aad934c54a58b9081c43939d8afe0e7843e8202d8cea7" +original_class_hash = "0x7bbd215ec46e02f1c7aad934c54a58b9081c43939d8afe0e7843e8202d8cea7" +base_class_hash = "0x2427dd10a58850ac9a5ca6ce04b7771b05330fd18f2e481831ad903b969e6b2" +abi = "manifests/dev/deployment/abis/contracts/bytebeasts-tournament_system-1f2bbf20.json" +reads = [] +writes = [] +init_calldata = [] +tag = "bytebeasts-tournament_system" +manifest_name = "bytebeasts-tournament_system-1f2bbf20" + [[contracts]] kind = "DojoContract" address = "0x1a0997571ba63300bba592512cc9ac1daa8911ee08c049b5693d93c06377d25" @@ -455,6 +468,82 @@ name = "position" type = "Array" key = false +[[models]] +kind = "DojoModel" +class_hash = "0x13d964c4091be478133a4aadbb278da14229f77225ce8da5dd246e42abc7ac0" +original_class_hash = "0x13d964c4091be478133a4aadbb278da14229f77225ce8da5dd246e42abc7ac0" +abi = "manifests/dev/deployment/abis/models/bytebeasts-Leaderboard-7e680376.json" +tag = "bytebeasts-Leaderboard" +manifest_name = "bytebeasts-Leaderboard-7e680376" + +[[models.members]] +name = "leaderboard_id" +type = "u64" +key = true + +[[models.members]] +name = "name" +type = "felt252" +key = false + +[[models.members]] +name = "description" +type = "felt252" +key = false + +[[models.members]] +name = "entries" +type = "Array" +key = false + +[[models.members]] +name = "last_updated" +type = "u64" +key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x4f9ca94349981f722e598f396bcca466289aca05dcfb277ef562ee02fee333c" +original_class_hash = "0x4f9ca94349981f722e598f396bcca466289aca05dcfb277ef562ee02fee333c" +abi = "manifests/dev/deployment/abis/models/bytebeasts-LeaderboardEntry-7237950c.json" +tag = "bytebeasts-LeaderboardEntry" +manifest_name = "bytebeasts-LeaderboardEntry-7237950c" + +[[models.members]] +name = "player_id" +type = "u32" +key = true + +[[models.members]] +name = "player_name" +type = "felt252" +key = false + +[[models.members]] +name = "score" +type = "u32" +key = false + +[[models.members]] +name = "wins" +type = "u32" +key = false + +[[models.members]] +name = "losses" +type = "u32" +key = false + +[[models.members]] +name = "highest_score" +type = "u32" +key = false + +[[models.members]] +name = "is_active" +type = "bool" +key = false + [[models]] kind = "DojoModel" class_hash = "0x341a07493baed313e741253a241aa31fc9d40a9c373cd2bae49f85ab66f98cc" @@ -675,3 +764,46 @@ key = true name = "message" type = "felt252" key = false + +[[models]] +kind = "DojoModel" +class_hash = "0x3004c0d548b033db92ed628e38e940ee67b44cf73ffd50a0bc10c334a000aec" +original_class_hash = "0x3004c0d548b033db92ed628e38e940ee67b44cf73ffd50a0bc10c334a000aec" +abi = "manifests/dev/deployment/abis/models/bytebeasts-Tournament-12bdecb1.json" +tag = "bytebeasts-Tournament" +manifest_name = "bytebeasts-Tournament-12bdecb1" + +[[models.members]] +name = "tournament_id" +type = "u32" +key = true + +[[models.members]] +name = "name" +type = "felt252" +key = false + +[[models.members]] +name = "status" +type = "TournamentStatus" +key = false + +[[models.members]] +name = "entry_fee" +type = "u32" +key = false + +[[models.members]] +name = "max_participants" +type = "u32" +key = false + +[[models.members]] +name = "current_participants" +type = "Array" +key = false + +[[models.members]] +name = "prize_pool" +type = "u32" +key = false diff --git a/src/lib.cairo b/src/lib.cairo index 7b646f7..ae61d22 100644 --- a/src/lib.cairo +++ b/src/lib.cairo @@ -29,10 +29,12 @@ mod models { mod achievements; mod tournament; mod season; + mod leaderboard; } mod tests { mod test_battle; mod test_bag; mod test_tournament; + mod test_leaderboard; } diff --git a/src/models/leaderboard.cairo b/src/models/leaderboard.cairo new file mode 100644 index 0000000..78ee4ac --- /dev/null +++ b/src/models/leaderboard.cairo @@ -0,0 +1,244 @@ +use starknet::ContractAddress; +use core::{ + result::Result, + option::OptionTrait, + array::ArrayTrait +}; +use alexandria_data_structures::array_ext::ArrayTraitExt; +use alexandria_sorting::bubble_sort::bubble_sort_elements; + + +#[derive(Copy, Drop, Serde)] +#[dojo::model] +pub struct LeaderboardEntry { + #[key] + pub player_id: u32, // player ID + pub player_name: felt252, // Display name + pub score: u32, // Overall score + pub wins: u32, // Total wins + pub losses: u32, // Total losses + pub highest_score: u32, // Highest score in a single game + pub is_active: bool, // Whether the player is currently active +} + +//trait for sorting by score +impl LeaderboardEntryPartialOrd of PartialOrd { + fn le(lhs: LeaderboardEntry, rhs: LeaderboardEntry) -> bool { + lhs.score <= rhs.score + } + + fn ge(lhs: LeaderboardEntry, rhs: LeaderboardEntry) -> bool { + lhs.score >= rhs.score + } + + fn lt(lhs: LeaderboardEntry, rhs: LeaderboardEntry) -> bool { + lhs.score < rhs.score + } + + fn gt(lhs: LeaderboardEntry, rhs: LeaderboardEntry) -> bool { + lhs.score > rhs.score + } +} + +//trait for search by player_id +impl LeaderboardEntryPartialEq of PartialEq { + fn eq(lhs: @LeaderboardEntry, rhs: @LeaderboardEntry) -> bool { + lhs.player_id == rhs.player_id + } + + fn ne(lhs: @LeaderboardEntry, rhs: @LeaderboardEntry) -> bool { + lhs.player_id != rhs.player_id + } +} + + +#[derive(Drop, Serde)] +#[dojo::model] +pub struct Leaderboard { + #[key] + pub leaderboard_id: u64, // Unique ID for leaderboard (could be incremental) + pub name: felt252, // Leaderboard name (e.g., "Global", "Monthly") + pub description: felt252, // Description of what this leaderboard tracks + pub entries: Array, // List of leaderboard entries + pub last_updated: u64, // Timestamp of last update +} + + +#[generate_trait] +impl LeaderboardImpl of LeaderboardTrait { + // PRIVATE METHODS + + fn pop_front_n(ref self: Leaderboard, mut n: usize) -> Array { + // pops n elements from the front of the array, and returns them + // Alexandria implementation of pop_front_n does not return the popped elements + // in the current version of the library + let mut res: Array = array![]; + + while (n != 0) { + match self.entries.pop_front() { + Option::Some(e) => { + res.append(e); + n -= 1; + }, + Option::None => { break; }, + }; + }; + + res + } + + fn unsafe_add_entry(ref self: Leaderboard, entry: LeaderboardEntry) -> Result<(), felt252> { + // adds user entry to leaderboard without sorting + let res = self.entries.index_of(entry); + if res.is_some() { + return Result::Err('Entry already exists'); + } + self.entries.append(entry); + self.last_updated = starknet::get_block_timestamp(); + Result::Ok(()) + } + + + // PUBLIC METHODS + + fn get_leaderboard_length(ref self: Leaderboard) -> u32 { + // returns number of entries in the leaderboard + self.entries.len() + } + + + fn calculate_score (ref self: Leaderboard, wins: u32, highest_score: u32, losses: u32) -> u32 { + // calculates score based on wins, losses and highest score + wins * 100 + highest_score - losses * 70 + } + + + fn upgrade_entry_stats(ref self: Leaderboard, player_id: u32, new_wins: u32, new_losses: u32, new_highest_score: u32) -> Result<(), felt252> { + // recalculates score and updates entry in the leaderboard + // addning new wins, losses and changing highest score to an old entry + match self.get_index_by_player_id(player_id) { + Result::Ok(index) => { + let entry = self.entries.at(index); + let total_wins: u32 = *entry.wins + new_wins; + let total_losses: u32 = *entry.losses + new_losses; + let highest_score: u32 = if new_highest_score > *entry.highest_score { new_highest_score } else { *entry.highest_score }; + match self.update_entry( LeaderboardEntry { + score: self.calculate_score(total_wins, highest_score, total_losses), + wins: total_wins, + losses: total_losses, + highest_score: highest_score, + ..*entry + }) { + Result::Ok(_) => Result::Ok(()), + Result::Err(e) => Result::Err(e), + } + }, + Result::Err(e) => Result::Err(e), + } + } + + fn get_index_by_player_id(ref self: Leaderboard, player_id: u32) -> Result { + // returns index of entry with given player_id. Index stands for rank in the leaderboard + // player with highest score has index 0 + let entry = LeaderboardEntry { + player_id: player_id, + player_name: '', + score: 0, + wins: 0, + losses: 0, + highest_score: 0, + is_active: false, + }; + match self.entries.index_of(entry) { + Option::Some(index) => Result::Ok(index), + Option::None => Result::Err('Entry not found'), + } + } + + + fn add_entry(ref self: Leaderboard, entry: LeaderboardEntry) -> Result<(), felt252> { + // adds user entry to leaderboard and sorts internal Array + let res = self.entries.index_of(entry); + if res.is_some() { + return Result::Err('Entry already exists'); + } + self.entries.append(entry); + self.entries = bubble_sort_elements(self.entries, false); + self.last_updated = starknet::get_block_timestamp(); + Result::Ok(()) + } + + fn add_batch(ref self: Leaderboard, mut entries: Array) -> Array { + // adds multiple entries, sorts it and returns array of entries that were not added + let mut not_added: Array = array![]; + let mut res = entries.pop_front(); + while (res.is_some()) { + let entry = res.unwrap(); + match self.unsafe_add_entry(entry) { + Result::Err(_) => { not_added.append(entry); }, + Result::Ok(_) => {}, + }; + res = entries.pop_front(); + }; + self.entries = bubble_sort_elements(self.entries, false); + not_added + } + + fn remove_entry(ref self: Leaderboard, entry: LeaderboardEntry) -> Result<(), felt252> { + // removes user entry from leaderboard + match self.entries.index_of(entry) { + Option::Some(index) => { + let mut left = self.pop_front_n(index); + let _ = self.entries.pop_front(); + left.append_all(ref self.entries); + self.entries = left; + self.last_updated = starknet::get_block_timestamp(); + Result::Ok(()) + }, + Option::None => Result::Err('Entry not found'), + } + } + + fn update_entry(ref self: Leaderboard, entry: LeaderboardEntry) -> Result<(), felt252> { + // updates user entry in leaderboard, sorts array + match self.remove_entry(entry) { + Result::Ok(_) => { + match self.add_entry(entry) { + Result::Ok(_) => Result::Ok(()), + Result::Err(e) => Result::Err(e) + } + }, + Result::Err(e) => Result::Err(e), + } + } + + + fn get_entries(ref self: Leaderboard) -> Array { + // returns all entries in the leaderboard + self.entries.clone() + } + + fn get_slice(ref self: Leaderboard, start: u32, end: u32) -> Result, felt252> { + // returns entries from start to end (exclusive) + // can be used to get top of the leaderboard + let mut res: Array = array![]; + match self.entries.len() { + 0 => Result::Err('Leaderboard is empty'), + _ => { + if (start >= end) { + return Result::Err('Invalid range'); + } + if (end > self.entries.len()) { + return Result::Err('End index out of bounds'); + } + let mut i = start; + while (i < end) { + res.append(self.entries.at(i).clone()); + i += 1; + }; + Result::Ok(res) + }, + } + } + +} diff --git a/src/tests/test_leaderboard.cairo b/src/tests/test_leaderboard.cairo new file mode 100644 index 0000000..cda8fd7 --- /dev/null +++ b/src/tests/test_leaderboard.cairo @@ -0,0 +1,237 @@ +#[cfg(test)] +mod tests { + use core::{ + result::{Result, ResultTrait}, + array::ArrayTrait, + }; + use bytebeasts::models::leaderboard::{Leaderboard, LeaderboardEntry, LeaderboardTrait}; + use alexandria_data_structures::array_ext::ArrayTraitExt; + use alexandria_sorting::bubble_sort::bubble_sort_elements; + + fn create_mock_entry(player_id: u32, name: felt252, score: u32, wins: u32, losses: u32, highest_score: u32, is_active: bool) -> LeaderboardEntry { + LeaderboardEntry { + player_id: player_id, + player_name: name, + score: score, + wins: wins, + losses: losses, + highest_score: highest_score, + is_active: is_active, + } + } + + fn create_empty_leaderboard() -> Leaderboard { + Leaderboard { + leaderboard_id: 1, + name: 'Global Leaderboard', + description: 'Top players worldwide', + entries: ArrayTrait::new(), + last_updated: 0, + } + } + + #[test] + fn test_add_single_entry() { + let mut leaderboard = create_empty_leaderboard(); + let entry = create_mock_entry(1, 'Alice', 100, 10, 5, 100, true); + let res = leaderboard.add_entry(entry); + assert_eq!(res.is_ok(), true); + assert_eq!(leaderboard.entries.len(), 1); + assert_eq!(leaderboard.entries.at(0).player_name, @'Alice', "Wrong player name"); + + let duplicate_res = leaderboard.add_entry(entry); + assert_eq!(duplicate_res.is_err(), true, "Duplicate entry should return error"); + } + + #[test] + fn test_add_multiple_entry() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry3 = create_mock_entry(34, 'Charlie', 1300, 30, 15, 300, true); + let entry4 = create_mock_entry(9, 'David', 22400, 40, 20, 400, true); + let entry5 = create_mock_entry(5, 'Eve', 500, 50, 25, 500, true); + + let _ = leaderboard.add_entry(entry4); + let _ = leaderboard.add_entry(entry5); + let entries = array![entry1, entry2, entry3, entry4, entry5]; + let not_added = leaderboard.add_batch(entries); + assert_eq!(leaderboard.entries.len(), 5, "Wrong number of entries"); + assert_eq!(not_added.len(), 2, "Wrong number of not added entries"); + assert_eq!(leaderboard.entries.at(0).player_name, @'Bob', "Wrong first player name"); + assert_eq!(leaderboard.entries.at(4).player_name, @'Eve', "Wrong last player name"); + + let duplicate_entries = array![entry1, entry2]; + let not_added_duplicates = leaderboard.add_batch(duplicate_entries); + assert_eq!(not_added_duplicates.len(), 2, "Duplicate entries should not be added"); + } + + #[test] + fn test_pop_front_n() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry3 = create_mock_entry(34, 'Charlie', 1300, 30, 15, 300, true); + let _ = leaderboard.add_batch(array![entry1, entry2, entry3]); + let popped_entries = leaderboard.pop_front_n(2); + assert_eq!(popped_entries.len(), 2, "Wrong number of popped entries"); + assert_eq!(popped_entries.at(0).player_name, @'Bob', "Wrong first popped player name"); + assert_eq!(popped_entries.at(1).player_name, @'Charlie', "Wrong second popped player name"); + assert_eq!(leaderboard.entries.len(), 1, "Wrong number of remaining entries"); + assert_eq!(leaderboard.entries.at(0).player_name, @'Alice', "Wrong remaining player name"); + + let mut empty_leaderboard = create_empty_leaderboard(); + let popped_entries_empty = empty_leaderboard.pop_front_n(5); + assert_eq!(popped_entries_empty.len(), 0, "Popping from empty leaderboard should return empty array"); + } + + #[test] + fn test_remove_entry() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry3 = create_mock_entry(34, 'Charlie', 1300, 30, 15, 300, true); + let entry4 = create_mock_entry(9, 'David', 22400, 40, 20, 400, true); + let entry5 = create_mock_entry(5, 'Eve', 500, 50, 25, 500, true); + + let entries = array![entry1, entry2, entry3, entry4, entry5]; + let _ = leaderboard.add_batch(entries); + let res = leaderboard.remove_entry(entry3); + assert_eq!(res.is_ok(), true); + assert_eq!(leaderboard.entries.len(), 4, "Wrong number of entries"); + assert_eq!(leaderboard.entries.at(2).player_name, @'Alice', "Wrong player name"); + + let non_existent_entry = create_mock_entry(99, 'NonExistent', 0, 0, 0, 0, false); + let res_non_existent = leaderboard.remove_entry(non_existent_entry); + assert_eq!(res_non_existent.is_err(), true, "Removing non-existent entry should return error"); + } + + #[test] + fn test_get_index_by_player_id() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry3 = create_mock_entry(34, 'Charlie', 1300, 30, 15, 300, true); + let entry4 = create_mock_entry(9, 'David', 22400, 40, 20, 400, true); + let entry5 = create_mock_entry(5, 'Eve', 500, 50, 25, 500, true); + + let _ = leaderboard.add_batch(array![entry1, entry2, entry3, entry4, entry5]); + let rank = leaderboard.get_index_by_player_id(34).unwrap(); + assert_eq!(rank, 2, "Wrong rank for Charlie"); + let rank = leaderboard.get_index_by_player_id(2).unwrap(); + assert_eq!(rank, 0, "Wrong rank for Bob"); + let rank = leaderboard.get_index_by_player_id(5).unwrap(); + assert_eq!(rank, 4, "Wrong rank for Eve"); + + let non_existent_rank = leaderboard.get_index_by_player_id(99); + assert_eq!(non_existent_rank.is_err(), true, "Getting index of non-existent player should return error"); + } + + #[test] + fn test_update_entry() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry3 = create_mock_entry(34, 'Charlie', 1300, 30, 15, 300, true); + let entry4 = create_mock_entry(9, 'David', 22400, 40, 20, 400, true); + let entry5 = create_mock_entry(5, 'Eve', 500, 50, 25, 500, true); + + let _ = leaderboard.add_batch(array![entry1, entry2, entry3, entry4, entry5]); + let new_score: u32 = 100; + let new_wins: u32 = 31; + let updated_entry = create_mock_entry(34, 'Charlie', new_score, new_wins, 15, 300, true); + let res = leaderboard.update_entry(updated_entry); + let rank = leaderboard.get_index_by_player_id(34).unwrap(); + assert_eq!(res.is_ok(), true); + assert_eq!(rank, 4, "Wrong rank"); + assert_eq!(leaderboard.entries.len(), 5, "Wrong number of entries"); + assert_eq!(leaderboard.entries.at(rank).score, @new_score, "Wrong score"); + assert_eq!(leaderboard.entries.at(rank).wins, @new_wins, "Wrong wins"); + + let non_existent_entry = create_mock_entry(99, 'NonExistent', 0, 0, 0, 0, false); + let res_non_existent = leaderboard.update_entry(non_existent_entry); + assert_eq!(res_non_existent.is_err(), true, "Updating non-existent entry should return error"); + } + + #[test] + fn test_get_entries() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let _ = leaderboard.add_batch(array![entry1, entry2]); + let entries = leaderboard.get_entries(); + assert_eq!(entries.len(), 2, "Wrong number of entries"); + assert_eq!(entries.at(0).player_name, @'Bob', "Wrong first player name"); + assert_eq!(entries.at(1).player_name, @'Alice', "Wrong second player name"); + + let mut empty_leaderboard = create_empty_leaderboard(); + let entries_empty = empty_leaderboard.get_entries(); + assert_eq!(entries_empty.len(), 0, "Empty leaderboard should return empty array"); + } + + #[test] + fn test_get_slice() { + let mut leaderboard = create_empty_leaderboard(); + let entry1 = create_mock_entry(12, 'Alice', 1100, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry3 = create_mock_entry(34, 'Charlie', 1300, 30, 15, 300, true); + let entry4 = create_mock_entry(9, 'David', 22400, 40, 20, 400, true); + let entry5 = create_mock_entry(5, 'Eve', 500, 50, 25, 500, true); + + let _ = leaderboard.add_batch(array![entry1, entry2, entry3, entry4, entry5]); + let slice = leaderboard.get_slice(1, 4).unwrap(); + assert_eq!(slice.len(), 3, "Wrong number of entries in slice"); + assert_eq!(slice.at(0).player_name, @'David', "Wrong first player name in slice"); + assert_eq!(slice.at(2).player_name, @'Alice', "Wrong last player name in slice"); + + let invalid_slice = leaderboard.get_slice(4, 1); + assert_eq!(invalid_slice.is_err(), true, "Invalid slice range should return error"); + + let out_of_bounds_slice = leaderboard.get_slice(1, 10); + assert_eq!(out_of_bounds_slice.is_err(), true, "Out of bounds slice should return error"); + + let mut empty_leaderboard = create_empty_leaderboard(); + let empty_slice = empty_leaderboard.get_slice(0, 1); + assert_eq!(empty_slice.is_err(), true, "Empty leaderboard should return error"); + } + + #[test] + fn test_calculate_score() { + let mut leaderboard = create_empty_leaderboard(); + let wins: u32 = 10; + let losses: u32 = 5; + let highest_score: u32 = 100; + let score = leaderboard.calculate_score(wins, highest_score, losses); + let expected_score = wins * 100 + highest_score - losses * 70; + assert_eq!(score, expected_score, "Wrong score calculation"); + } + + #[test] + fn test_upgrade_entry_stats() { + let mut leaderboard = create_empty_leaderboard(); + let entry5 = create_mock_entry(5, 'Eve', 500, 50, 25, 500, true); + let entry3 = create_mock_entry(34, 'Charlie', 2250, 30, 15, 300, true); + let entry1 = create_mock_entry(12, 'Alice', 2400, 10, 5, 100, true); + let entry2 = create_mock_entry(2, 'Bob', 200121, 20, 10, 200, true); + let entry4 = create_mock_entry(9, 'David', 22400, 40, 20, 400, true); + + let _ = leaderboard.add_batch(array![entry1, entry2, entry3, entry4, entry5]); + let new_wins: u32 = 31; + let new_losses: u32 = 10; + let new_highest_score: u32 = 400; + let total_wins: u32 = entry3.wins + new_wins; + let total_losses: u32 = entry3.losses + new_losses; + let res = leaderboard.upgrade_entry_stats(34, new_wins, new_losses, new_highest_score); + let rank = leaderboard.get_index_by_player_id(34).unwrap(); + + let negative_res = leaderboard.upgrade_entry_stats(31, new_wins, new_losses, new_highest_score); + + assert_eq!(res.is_ok(), true); + assert_eq!(rank, 2, "Wrong rank after update"); + assert_eq!(leaderboard.entries.len(), 5, "Wrong number of entries"); + assert_eq!(leaderboard.entries.at(rank).wins, @total_wins, "Wrong wins"); + assert_eq!(leaderboard.entries.at(rank).losses, @total_losses, "Wrong losses"); + assert_eq!(leaderboard.entries.at(rank).highest_score, @new_highest_score, "Wrong highest score"); + assert_eq!(negative_res.is_err(), true, "Updating non-existent entry should return error"); + } +} \ No newline at end of file