From 49d9a56bab972bda0ee69d7c3661f7eb20a6da3d Mon Sep 17 00:00:00 2001 From: Darlington02 Date: Wed, 15 Jan 2025 14:22:19 +0100 Subject: [PATCH] chore: fix gatekeep scripts --- scripts/.env.example | 2 +- scripts/src/abi/hub.json | 2766 +++++++++++++++++++++++++++- scripts/src/contracts/community.ts | 105 +- scripts/src/helpers/constants.ts | 2 +- scripts/src/index.ts | 2 +- 5 files changed, 2855 insertions(+), 22 deletions(-) diff --git a/scripts/.env.example b/scripts/.env.example index b57b70f..23e9ef6 100644 --- a/scripts/.env.example +++ b/scripts/.env.example @@ -1 +1 @@ -PRIVATE_KEY="9bd7e28ed81dde38ea2be0149868a95e8eed5e770cc2f11f7b8ef636715e24cb" \ No newline at end of file +PRIVATE_KEY="" \ No newline at end of file diff --git a/scripts/src/abi/hub.json b/scripts/src/abi/hub.json index ce04270..574c15d 100644 --- a/scripts/src/abi/hub.json +++ b/scripts/src/abi/hub.json @@ -1 +1,2765 @@ -[{"type":"impl","name":"colonizHubImpl","interface_name":"coloniz::hub::hub::IcolonizHub"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"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":"coloniz::hub::hub::IcolonizHub","items":[{"type":"function","name":"follow","inputs":[{"name":"follower_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"address_of_profiles_to_follow","type":"core::array::Array::"}],"outputs":[{"type":"core::array::Array::"}],"state_mutability":"external"},{"type":"function","name":"unfollow","inputs":[{"name":"address_of_profiles_to_unfollow","type":"core::array::Array::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"set_block_status","inputs":[{"name":"blocker_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"address_of_profiles_to_block","type":"core::array::Array::"},{"name":"block_status","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"is_following","inputs":[{"name":"followed_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"follower_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"},{"type":"function","name":"is_blocked","inputs":[{"name":"followed_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"follower_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"},{"type":"function","name":"get_handle_id","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_handle","inputs":[{"name":"handle_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"}]},{"type":"impl","name":"ProfileImpl","interface_name":"coloniz::interfaces::IProfile::IProfile"},{"type":"struct","name":"coloniz::base::constants::types::Profile","members":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"profile_owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_count","type":"core::integer::u256"},{"name":"metadata_URI","type":"core::byte_array::ByteArray"},{"name":"follow_nft","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"interface","name":"coloniz::interfaces::IProfile::IProfile","items":[{"type":"function","name":"initializer","inputs":[{"name":"coloniz_nft_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"hub_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"follow_nft_classhash","type":"core::felt252"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"create_profile","inputs":[{"name":"coloniznft_contract_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"registry_hash","type":"core::felt252"},{"name":"implementation_hash","type":"core::felt252"},{"name":"salt","type":"core::felt252"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"external"},{"type":"function","name":"set_profile_metadata_uri","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"metadata_uri","type":"core::byte_array::ByteArray"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_profile_metadata","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"get_profile","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"coloniz::base::constants::types::Profile"}],"state_mutability":"view"},{"type":"function","name":"get_user_publication_count","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"}]},{"type":"constructor","name":"constructor","inputs":[{"name":"coloniznft_contract_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"handle_contract_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"handle_registry_contract_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"follow_nft_classhash","type":"core::felt252"}]},{"type":"event","name":"coloniz::profile::profile::ProfileComponent::CreatedProfile","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"data"},{"name":"timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::profile::profile::ProfileComponent::Event","kind":"enum","variants":[{"name":"CreatedProfile","type":"coloniz::profile::profile::ProfileComponent::CreatedProfile","kind":"nested"}]},{"type":"struct","name":"coloniz::base::constants::types::PostParams","members":[{"name":"content_URI","type":"core::byte_array::ByteArray"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"channel_id","type":"core::felt252"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::Post","kind":"struct","members":[{"name":"post","type":"coloniz::base::constants::types::PostParams","kind":"data"},{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"transaction_executor","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"enum","name":"coloniz::base::constants::types::PublicationType","variants":[{"name":"Nonexistent","type":"()"},{"name":"Post","type":"()"},{"name":"Comment","type":"()"},{"name":"Repost","type":"()"}]},{"type":"struct","name":"coloniz::base::constants::types::CommentParams","members":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"content_URI","type":"core::byte_array::ByteArray"},{"name":"pointed_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pointed_pub_id","type":"core::integer::u256"},{"name":"reference_pub_type","type":"coloniz::base::constants::types::PublicationType"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::CommentCreated","kind":"struct","members":[{"name":"commentParams","type":"coloniz::base::constants::types::CommentParams","kind":"data"},{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"transaction_executor","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"struct","name":"coloniz::base::constants::types::RepostParams","members":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pointed_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pointed_pub_id","type":"core::integer::u256"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::RepostCreated","kind":"struct","members":[{"name":"repostParams","type":"coloniz::base::constants::types::RepostParams","kind":"data"},{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"transaction_executor","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::Upvoted","kind":"struct","members":[{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"transaction_executor","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::Downvoted","kind":"struct","members":[{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"transaction_executor","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::CollectedNFT","kind":"struct","members":[{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"transaction_executor","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::DeployedCollectNFT","kind":"struct","members":[{"name":"publication_id","type":"core::integer::u256","kind":"data"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"collect_nft","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::publication::publication::PublicationComponent::Event","kind":"enum","variants":[{"name":"Post","type":"coloniz::publication::publication::PublicationComponent::Post","kind":"nested"},{"name":"CommentCreated","type":"coloniz::publication::publication::PublicationComponent::CommentCreated","kind":"nested"},{"name":"RepostCreated","type":"coloniz::publication::publication::PublicationComponent::RepostCreated","kind":"nested"},{"name":"Upvoted","type":"coloniz::publication::publication::PublicationComponent::Upvoted","kind":"nested"},{"name":"Downvoted","type":"coloniz::publication::publication::PublicationComponent::Downvoted","kind":"nested"},{"name":"CollectedNFT","type":"coloniz::publication::publication::PublicationComponent::CollectedNFT","kind":"nested"},{"name":"DeployedCollectNFT","type":"coloniz::publication::publication::PublicationComponent::DeployedCollectNFT","kind":"nested"}]},{"type":"event","name":"coloniz::hub::hub::colonizHub::Event","kind":"enum","variants":[{"name":"ProfileEvent","type":"coloniz::profile::profile::ProfileComponent::Event","kind":"nested"},{"name":"PublicationEvent","type":"coloniz::publication::publication::PublicationComponent::Event","kind":"nested"}]}] \ No newline at end of file +[ + { + "type": "impl", + "name": "colonizHubImpl", + "interface_name": "coloniz::hub::hub::IColonizHub" + }, + { + "type": "struct", + "name": "core::integer::u256", + "members": [ + { + "name": "low", + "type": "core::integer::u128" + }, + { + "name": "high", + "type": "core::integer::u128" + } + ] + }, + { + "type": "enum", + "name": "core::bool", + "variants": [ + { + "name": "False", + "type": "()" + }, + { + "name": "True", + "type": "()" + } + ] + }, + { + "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": "coloniz::hub::hub::IColonizHub", + "items": [ + { + "type": "function", + "name": "follow", + "inputs": [ + { + "name": "address_of_profiles_to_follow", + "type": "core::array::Array::" + } + ], + "outputs": [ + { + "type": "core::array::Array::" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "unfollow", + "inputs": [ + { + "name": "address_of_profiles_to_unfollow", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_block_status", + "inputs": [ + { + "name": "address_of_profiles_to_block", + "type": "core::array::Array::" + }, + { + "name": "block_status", + "type": "core::bool" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "is_following", + "inputs": [ + { + "name": "followed_profile_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "follower_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_blocked", + "inputs": [ + { + "name": "followed_profile_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "follower_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_handle_id", + "inputs": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_handle", + "inputs": [ + { + "name": "handle_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "upgrade", + "inputs": [ + { + "name": "new_class_hash", + "type": "core::starknet::class_hash::ClassHash" + } + ], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "impl", + "name": "ProfileImpl", + "interface_name": "coloniz::interfaces::IProfile::IProfile" + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::BodyVariants", + "variants": [ + { + "name": "BODY1", + "type": "()" + }, + { + "name": "BODY2", + "type": "()" + }, + { + "name": "BODY3", + "type": "()" + }, + { + "name": "BODY4", + "type": "()" + }, + { + "name": "BODY5", + "type": "()" + }, + { + "name": "BODY6", + "type": "()" + }, + { + "name": "BODY7", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::ToolVariants", + "variants": [ + { + "name": "TOOL1", + "type": "()" + }, + { + "name": "TOOL2", + "type": "()" + }, + { + "name": "TOOL3", + "type": "()" + }, + { + "name": "TOOL4", + "type": "()" + }, + { + "name": "TOOL5", + "type": "()" + }, + { + "name": "TOOL6", + "type": "()" + }, + { + "name": "EMPTY", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::BackgroundVariants", + "variants": [ + { + "name": "BACKGROUND1", + "type": "()" + }, + { + "name": "BACKGROUND2", + "type": "()" + }, + { + "name": "BACKGROUND3", + "type": "()" + }, + { + "name": "BACKGROUND4", + "type": "()" + }, + { + "name": "BACKGROUND5", + "type": "()" + }, + { + "name": "EMPTY", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::ClothVariants", + "variants": [ + { + "name": "CLOTH1", + "type": "()" + }, + { + "name": "CLOTH2", + "type": "()" + }, + { + "name": "CLOTH3", + "type": "()" + }, + { + "name": "CLOTH4", + "type": "()" + }, + { + "name": "CLOTH5", + "type": "()" + }, + { + "name": "EMPTY", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::FaceVariants", + "variants": [ + { + "name": "FACE1", + "type": "()" + }, + { + "name": "FACE2", + "type": "()" + }, + { + "name": "FACE3", + "type": "()" + }, + { + "name": "FACE4", + "type": "()" + }, + { + "name": "FACE5", + "type": "()" + }, + { + "name": "FACE6", + "type": "()" + }, + { + "name": "FACE7", + "type": "()" + }, + { + "name": "FACE8", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::AccessoryVariants", + "variants": [ + { + "name": "ACCESSORY1", + "type": "()" + }, + { + "name": "ACCESSORY2", + "type": "()" + }, + { + "name": "ACCESSORY3", + "type": "()" + }, + { + "name": "ACCESSORY4", + "type": "()" + }, + { + "name": "ACCESSORY5", + "type": "()" + }, + { + "name": "ACCESSORY6", + "type": "()" + }, + { + "name": "ACCESSORY7", + "type": "()" + }, + { + "name": "EMPTY", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::ProfileVariants", + "members": [ + { + "name": "body", + "type": "coloniz::base::constants::types::BodyVariants" + }, + { + "name": "tool", + "type": "coloniz::base::constants::types::ToolVariants" + }, + { + "name": "background", + "type": "coloniz::base::constants::types::BackgroundVariants" + }, + { + "name": "cloth", + "type": "coloniz::base::constants::types::ClothVariants" + }, + { + "name": "face", + "type": "coloniz::base::constants::types::FaceVariants" + }, + { + "name": "accessory", + "type": "coloniz::base::constants::types::AccessoryVariants" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::Profile", + "members": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "profile_owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "pub_count", + "type": "core::integer::u256" + }, + { + "name": "metadata_URI", + "type": "core::byte_array::ByteArray" + }, + { + "name": "follow_nft", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "coloniz::interfaces::IProfile::IProfile", + "items": [ + { + "type": "function", + "name": "create_profile", + "inputs": [ + { + "name": "registry_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "implementation_hash", + "type": "core::felt252" + }, + { + "name": "salt", + "type": "core::felt252" + }, + { + "name": "profile_variants", + "type": "coloniz::base::constants::types::ProfileVariants" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_profile_metadata_uri", + "inputs": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_profile_metadata", + "inputs": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_profile", + "inputs": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "coloniz::base::constants::types::Profile" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_user_publication_count", + "inputs": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "communityImpl", + "interface_name": "coloniz::interfaces::ICommunity::ICommunity" + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::CommunityType", + "variants": [ + { + "name": "Free", + "type": "()" + }, + { + "name": "Standard", + "type": "()" + }, + { + "name": "Business", + "type": "()" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::GateKeepType", + "variants": [ + { + "name": "None", + "type": "()" + }, + { + "name": "NFTGating", + "type": "()" + }, + { + "name": "PermissionedGating", + "type": "()" + }, + { + "name": "PaidGating", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::CommunityDetails", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "community_owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "community_metadata_uri", + "type": "core::byte_array::ByteArray" + }, + { + "name": "community_nft_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "community_total_members", + "type": "core::integer::u256" + }, + { + "name": "community_censorship", + "type": "core::bool" + }, + { + "name": "community_premium_status", + "type": "core::bool" + }, + { + "name": "community_type", + "type": "coloniz::base::constants::types::CommunityType" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::CommunityMember", + "members": [ + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "total_publications", + "type": "core::integer::u256" + }, + { + "name": "community_token_id", + "type": "core::integer::u256" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::CommunityGateKeepDetails", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "gate_keep_type", + "type": "coloniz::base::constants::types::GateKeepType" + }, + { + "name": "gatekeep_nft_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "paid_gating_details", + "type": "(core::integer::u256, core::starknet::contract_address::ContractAddress, core::integer::u256)" + } + ] + }, + { + "type": "interface", + "name": "coloniz::interfaces::ICommunity::ICommunity", + "items": [ + { + "type": "function", + "name": "create_community", + "inputs": [], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "join_community", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "leave_community", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_community_metadata_uri", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "add_community_mods", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "moderators", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "remove_community_mods", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "moderators", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_ban_status", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "profiles", + "type": "core::array::Array::" + }, + { + "name": "ban_statuses", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_community_fee_address", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "_fee_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_community_censorship_status", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "censorship_status", + "type": "core::bool" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "upgrade_community", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "upgrade_type", + "type": "coloniz::base::constants::types::CommunityType" + }, + { + "name": "subscription_id", + "type": "core::integer::u256" + }, + { + "name": "renewal_status", + "type": "core::bool" + }, + { + "name": "renewal_iterations", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "gatekeep", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "gate_keep_type", + "type": "coloniz::base::constants::types::GateKeepType" + }, + { + "name": "nft_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "permissioned_addresses", + "type": "core::array::Array::" + }, + { + "name": "paid_gating_details", + "type": "(core::starknet::contract_address::ContractAddress, core::integer::u256)" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_community", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "coloniz::base::constants::types::CommunityDetails" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_community_metadata_uri", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_community_member", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "(core::bool, coloniz::base::constants::types::CommunityMember)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_total_members", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_community_mod", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_community_censorship_status", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_ban_status", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_community_fee_address", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_premium_community", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "(core::bool, coloniz::base::constants::types::CommunityType)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_gatekeeped", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "(core::bool, coloniz::base::constants::types::CommunityGateKeepDetails)" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "channelImpl", + "interface_name": "coloniz::interfaces::IChannel::IChannel" + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::ChannelDetails", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "community_id", + "type": "core::integer::u256" + }, + { + "name": "channel_owner", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel_metadata_uri", + "type": "core::byte_array::ByteArray" + }, + { + "name": "channel_total_members", + "type": "core::integer::u256" + }, + { + "name": "channel_censorship", + "type": "core::bool" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::ChannelMember", + "members": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "total_publications", + "type": "core::integer::u256" + } + ] + }, + { + "type": "interface", + "name": "coloniz::interfaces::IChannel::IChannel", + "items": [ + { + "type": "function", + "name": "create_channel", + "inputs": [ + { + "name": "community_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "join_channel", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "leave_channel", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_channel_metadata_uri", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "metadata_uri", + "type": "core::byte_array::ByteArray" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "add_channel_mods", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "moderators", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "remove_channel_mods", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "moderators", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_channel_censorship_status", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "censorship_status", + "type": "core::bool" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_channel_ban_status", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + }, + { + "name": "profiles", + "type": "core::array::Array::" + }, + { + "name": "ban_statuses", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_channel", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "coloniz::base::constants::types::ChannelDetails" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_channel_metadata_uri", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::byte_array::ByteArray" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_channel_member", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "(core::bool, coloniz::base::constants::types::ChannelMember)" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_channel_community", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_total_channel_members", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_channel_mod", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_channel_censorship_status", + "inputs": [ + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_channel_ban_status", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "channel_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "joltImpl", + "interface_name": "coloniz::interfaces::IJolt::IJolt" + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::JoltType", + "variants": [ + { + "name": "Tip", + "type": "()" + }, + { + "name": "Transfer", + "type": "()" + }, + { + "name": "Subscription", + "type": "()" + }, + { + "name": "Request", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::JoltParams", + "members": [ + { + "name": "jolt_type", + "type": "coloniz::base::constants::types::JoltType" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "memo", + "type": "core::byte_array::ByteArray" + }, + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "expiration_stamp", + "type": "core::integer::u64" + }, + { + "name": "subscription_details", + "type": "(core::integer::u256, core::bool, core::integer::u256)" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "enum", + "name": "coloniz::base::constants::types::JoltStatus", + "variants": [ + { + "name": "PENDING", + "type": "()" + }, + { + "name": "SUCCESSFUL", + "type": "()" + }, + { + "name": "EXPIRED", + "type": "()" + }, + { + "name": "REJECTED", + "type": "()" + }, + { + "name": "FAILED", + "type": "()" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::JoltData", + "members": [ + { + "name": "jolt_id", + "type": "core::integer::u256" + }, + { + "name": "jolt_type", + "type": "coloniz::base::constants::types::JoltType" + }, + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "memo", + "type": "core::byte_array::ByteArray" + }, + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "status", + "type": "coloniz::base::constants::types::JoltStatus" + }, + { + "name": "expiration_stamp", + "type": "core::integer::u64" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "struct", + "name": "coloniz::base::constants::types::SubscriptionData", + "members": [ + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "fee_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "interface", + "name": "coloniz::interfaces::IJolt::IJolt", + "items": [ + { + "type": "function", + "name": "jolt", + "inputs": [ + { + "name": "jolt_params", + "type": "coloniz::base::constants::types::JoltParams" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "auto_renew", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "sub_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "fulfill_request", + "inputs": [ + { + "name": "jolt_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "create_subscription", + "inputs": [ + { + "name": "fee_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "update_subscription", + "inputs": [ + { + "name": "sub_id", + "type": "core::integer::u256" + }, + { + "name": "fee_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "amount", + "type": "core::integer::u256" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_fee_address", + "inputs": [ + { + "name": "_fee_address", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "set_whitelisted_renewers", + "inputs": [ + { + "name": "renewers", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "remove_whitelisted_renewers", + "inputs": [ + { + "name": "renewers", + "type": "core::array::Array::" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "cancel_auto_renewal", + "inputs": [ + { + "name": "sub_id", + "type": "core::integer::u256" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "get_jolt", + "inputs": [ + { + "name": "jolt_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "coloniz::base::constants::types::JoltData" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_subscription_data", + "inputs": [ + { + "name": "subscription_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "coloniz::base::constants::types::SubscriptionData" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_renewal_iterations", + "inputs": [ + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "subscription_id", + "type": "core::integer::u256" + } + ], + "outputs": [ + { + "type": "core::integer::u256" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "get_fee_address", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "is_whitelisted_renewer", + "inputs": [ + { + "name": "renewer", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [ + { + "type": "core::bool" + } + ], + "state_mutability": "view" + } + ] + }, + { + "type": "impl", + "name": "OwnableMixinImpl", + "interface_name": "openzeppelin_access::ownable::interface::OwnableABI" + }, + { + "type": "interface", + "name": "openzeppelin_access::ownable::interface::OwnableABI", + "items": [ + { + "type": "function", + "name": "owner", + "inputs": [], + "outputs": [ + { + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "state_mutability": "view" + }, + { + "type": "function", + "name": "transfer_ownership", + "inputs": [ + { + "name": "new_owner", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "renounce_ownership", + "inputs": [], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "transferOwnership", + "inputs": [ + { + "name": "newOwner", + "type": "core::starknet::contract_address::ContractAddress" + } + ], + "outputs": [], + "state_mutability": "external" + }, + { + "type": "function", + "name": "renounceOwnership", + "inputs": [], + "outputs": [], + "state_mutability": "external" + } + ] + }, + { + "type": "constructor", + "name": "constructor", + "inputs": [ + { + "name": "coloniznft_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "handle_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "handle_registry_contract_address", + "type": "core::starknet::contract_address::ContractAddress" + }, + { + "name": "follow_nft_classhash", + "type": "core::felt252" + }, + { + "name": "community_nft_classhash", + "type": "core::felt252" + }, + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress" + } + ] + }, + { + "type": "event", + "name": "coloniz::profile::profile::ProfileComponent::CreatedProfile", + "kind": "struct", + "members": [ + { + "name": "owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "profile_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "token_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::profile::profile::ProfileComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "CreatedProfile", + "type": "coloniz::profile::profile::ProfileComponent::CreatedProfile", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::Jolted", + "kind": "struct", + "members": [ + { + "name": "jolt_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "jolt_type", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "amount", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::JoltRequested", + "kind": "struct", + "members": [ + { + "name": "jolt_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "jolt_type", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "amount", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "expiration_timestamp", + "type": "core::integer::u64", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::JoltRequestFullfilled", + "kind": "struct", + "members": [ + { + "name": "jolt_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "jolt_type", + "type": "core::felt252", + "kind": "data" + }, + { + "name": "sender", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "amount", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "recipient", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "expiration_timestamp", + "type": "core::integer::u64", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::SubscriptionCreated", + "kind": "struct", + "members": [ + { + "name": "sub_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "fee_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "amount", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::SubscriptionUpdated", + "kind": "struct", + "members": [ + { + "name": "sub_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "creator", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "fee_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "amount", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "erc20_contract_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::AutoRenewalCancelled", + "kind": "struct", + "members": [ + { + "name": "sub_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "subscriber", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::jolt::jolt::JoltComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "Jolted", + "type": "coloniz::jolt::jolt::JoltComponent::Jolted", + "kind": "nested" + }, + { + "name": "JoltRequested", + "type": "coloniz::jolt::jolt::JoltComponent::JoltRequested", + "kind": "nested" + }, + { + "name": "JoltRequestFullfilled", + "type": "coloniz::jolt::jolt::JoltComponent::JoltRequestFullfilled", + "kind": "nested" + }, + { + "name": "SubscriptionCreated", + "type": "coloniz::jolt::jolt::JoltComponent::SubscriptionCreated", + "kind": "nested" + }, + { + "name": "SubscriptionUpdated", + "type": "coloniz::jolt::jolt::JoltComponent::SubscriptionUpdated", + "kind": "nested" + }, + { + "name": "AutoRenewalCancelled", + "type": "coloniz::jolt::jolt::JoltComponent::AutoRenewalCancelled", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred", + "kind": "struct", + "members": [ + { + "name": "previous_owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "new_owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", + "kind": "struct", + "members": [ + { + "name": "previous_owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + }, + { + "name": "new_owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "key" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_access::ownable::ownable::OwnableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "OwnershipTransferred", + "type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferred", + "kind": "nested" + }, + { + "name": "OwnershipTransferStarted", + "type": "openzeppelin_access::ownable::ownable::OwnableComponent::OwnershipTransferStarted", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::CommunityCreated", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "community_owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "community_nft_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::JoinedCommunity", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "token_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::LeftCommunity", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "token_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::CommunityModAdded", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "mod_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::CommunityBanStatusUpdated", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "ban_status", + "type": "core::bool", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::CommunityModRemoved", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "mod_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::CommunityUpgraded", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "premiumType", + "type": "coloniz::base::constants::types::CommunityType", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::CommunityGatekeeped", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "gatekeepType", + "type": "coloniz::base::constants::types::GateKeepType", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::DeployedCommunityNFT", + "kind": "struct", + "members": [ + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "community_nft", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::community::community::CommunityComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "CommunityCreated", + "type": "coloniz::community::community::CommunityComponent::CommunityCreated", + "kind": "nested" + }, + { + "name": "JoinedCommunity", + "type": "coloniz::community::community::CommunityComponent::JoinedCommunity", + "kind": "nested" + }, + { + "name": "LeftCommunity", + "type": "coloniz::community::community::CommunityComponent::LeftCommunity", + "kind": "nested" + }, + { + "name": "CommunityModAdded", + "type": "coloniz::community::community::CommunityComponent::CommunityModAdded", + "kind": "nested" + }, + { + "name": "CommunityBanStatusUpdated", + "type": "coloniz::community::community::CommunityComponent::CommunityBanStatusUpdated", + "kind": "nested" + }, + { + "name": "CommunityModRemoved", + "type": "coloniz::community::community::CommunityComponent::CommunityModRemoved", + "kind": "nested" + }, + { + "name": "CommunityUpgraded", + "type": "coloniz::community::community::CommunityComponent::CommunityUpgraded", + "kind": "nested" + }, + { + "name": "CommunityGatekeeped", + "type": "coloniz::community::community::CommunityComponent::CommunityGatekeeped", + "kind": "nested" + }, + { + "name": "DeployedCommunityNFT", + "type": "coloniz::community::community::CommunityComponent::DeployedCommunityNFT", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::ChannelCreated", + "kind": "struct", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "community_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "channel_owner", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::JoinedChannel", + "kind": "struct", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::LeftChannel", + "kind": "struct", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::ChannelModAdded", + "kind": "struct", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "mod_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::ChannelModRemoved", + "kind": "struct", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "mod_address", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::ChannelBanStatusUpdated", + "kind": "struct", + "members": [ + { + "name": "channel_id", + "type": "core::integer::u256", + "kind": "data" + }, + { + "name": "transaction_executor", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "profile", + "type": "core::starknet::contract_address::ContractAddress", + "kind": "data" + }, + { + "name": "ban_status", + "type": "core::bool", + "kind": "data" + }, + { + "name": "block_timestamp", + "type": "core::integer::u64", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "coloniz::channel::channel::ChannelComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "ChannelCreated", + "type": "coloniz::channel::channel::ChannelComponent::ChannelCreated", + "kind": "nested" + }, + { + "name": "JoinedChannel", + "type": "coloniz::channel::channel::ChannelComponent::JoinedChannel", + "kind": "nested" + }, + { + "name": "LeftChannel", + "type": "coloniz::channel::channel::ChannelComponent::LeftChannel", + "kind": "nested" + }, + { + "name": "ChannelModAdded", + "type": "coloniz::channel::channel::ChannelComponent::ChannelModAdded", + "kind": "nested" + }, + { + "name": "ChannelModRemoved", + "type": "coloniz::channel::channel::ChannelComponent::ChannelModRemoved", + "kind": "nested" + }, + { + "name": "ChannelBanStatusUpdated", + "type": "coloniz::channel::channel::ChannelComponent::ChannelBanStatusUpdated", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded", + "kind": "struct", + "members": [ + { + "name": "class_hash", + "type": "core::starknet::class_hash::ClassHash", + "kind": "data" + } + ] + }, + { + "type": "event", + "name": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event", + "kind": "enum", + "variants": [ + { + "name": "Upgraded", + "type": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded", + "kind": "nested" + } + ] + }, + { + "type": "event", + "name": "coloniz::hub::hub::ColonizHub::Event", + "kind": "enum", + "variants": [ + { + "name": "ProfileEvent", + "type": "coloniz::profile::profile::ProfileComponent::Event", + "kind": "nested" + }, + { + "name": "JoltEvent", + "type": "coloniz::jolt::jolt::JoltComponent::Event", + "kind": "flat" + }, + { + "name": "OwnableEvent", + "type": "openzeppelin_access::ownable::ownable::OwnableComponent::Event", + "kind": "flat" + }, + { + "name": "CommunityEvent", + "type": "coloniz::community::community::CommunityComponent::Event", + "kind": "flat" + }, + { + "name": "ChannelEvent", + "type": "coloniz::channel::channel::ChannelComponent::Event", + "kind": "flat" + }, + { + "name": "UpgradeableEvent", + "type": "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event", + "kind": "flat" + } + ] + } + ] \ No newline at end of file diff --git a/scripts/src/contracts/community.ts b/scripts/src/contracts/community.ts index bdb1bde..9297db4 100644 --- a/scripts/src/contracts/community.ts +++ b/scripts/src/contracts/community.ts @@ -1,31 +1,35 @@ import { Call } from "starknet-tokenbound-sdk"; import { coloniz_HUB_CONTRACT_ADDRESS, PROFILE_ADDRESS_ONE, PROFILE_ADDRESS_TWO } from "../helpers/constants"; import tokenbound from "../index"; -import { cairo, CallData,CairoCustomEnum } from "starknet"; - +import { cairo, CallData,CairoCustomEnum, Uint256 } from "starknet"; +import abi from "../abi/hub.json"; +export const CommunityType = { + Free: "Free", + Standard: "Standard", + Business:"Business" + } as const; export const GateKeepType = { - None: "None", + Open: "Open", NFTGating: "NFTGating", - PermissionedGating:"PermissionedGating", + PermissionedGating: "PermissionedGating", PaidGating: "PaidGating", - } as const; +} as const; const execute_create_community = async() =>{ let call:Call = { to: coloniz_HUB_CONTRACT_ADDRESS, selector:"0x8945c258076d05a649eb76dca07fe609b43b360775b41226e3a345e9593ab4", calldata:[] - } - try { - const Resp = await tokenbound?.execute("0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f", [call]) - console.log('execution-response=:', Resp); - } catch (error) { - console.log(error) - } - + } + try { + const Resp = await tokenbound?.execute("0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f", [call]) + console.log('execution-response=:', Resp); + } catch (error) { + console.log(error) + } } const execute_create_channel = async() =>{ @@ -206,22 +210,84 @@ const execute_downvote = async () => { } }; +// create subscription +const create_subscription = async() => { + let erc20_address:string = "0x006e1698dcd0665757dd213a59aff489624bab8c970ce0482c23937a78879b04"; + let admin: string = "0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f"; + let amount = cairo.uint256(50); + + let call: Call = { + to: coloniz_HUB_CONTRACT_ADDRESS, + selector: + "0x030326c786e65473aacbd943f9dfef0e20cc86348cecd85b2aae83177847887b", + calldata: CallData.compile([admin, amount, erc20_address]), + } + + try { + const Resp = await tokenbound?.execute("0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f", [call]); + console.log("execution-response=:", Resp); + } catch (error) { + console.log(error); + } +} + +// execute upgrade +const execute_upgrade = async() => { + let community_id = cairo.uint256(1); + let community_type = new CairoCustomEnum({ Business: {} }); + let erc20_address:string = "0x006e1698dcd0665757dd213a59aff489624bab8c970ce0482c23937a78879b04"; + let sub_id: Uint256 = cairo.uint256( + '0x040e69be8f56d2da824600bc2861852e77f233e43ca1dce3152c9c08f671af87' + ); + + let call1: Call = { + to: erc20_address, + selector: + "0x0219209e083275171774dab1df80982e9df2096516f06319c5c6d71ae0a8480c", + calldata: CallData.compile([coloniz_HUB_CONTRACT_ADDRESS, cairo.uint256(50)]), + } + + const contractCallData: CallData = new CallData(abi); + let call2: Call = { + to: coloniz_HUB_CONTRACT_ADDRESS, + selector: + "0x027ead9fee9c84e7422ab84c28d91eea938d139fafc7d1102ef3982f3d087f88", + calldata: contractCallData.compile('upgrade_community', [community_id, community_type, sub_id, false, cairo.uint256(0)]), + } + + try { + const Resp = await tokenbound?.execute("0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f", [call1, call2]); + console.log("execution-response=:", Resp); + } catch (error) { + console.log(error); + } +} // execute gatekeep const execute_gatekeep = async() =>{ - let comm_id = 3; + let community_id = cairo.uint256(3); let gatekeep_type = new CairoCustomEnum({ [GateKeepType.PaidGating]: {} }); - let permissioned_address = [1,"0x07da6cca38Afcf430ea53581F2eFD957bCeDfF798211309812181C555978DCC3"]; + let permissioned_address = [1, "0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f"]; let erc20_address:string = "0x006e1698dcd0665757dd213a59aff489624bab8c970ce0482c23937a78879b04"; let amount = cairo.uint256(50); - let erc721_address = "0x0" - let paid_gating_details = cairo.tuple(erc20_address, amount) + let erc721_address = "0x036053a7520d7ff5cb1ce8ebec7acaf8b6364130865662937ab1e2a36d4e00c1"; + let paid_gating_details = { + "0": erc20_address, + "1": amount + }; + const contractCallData: CallData = new CallData(abi); let call: Call = { to: coloniz_HUB_CONTRACT_ADDRESS, selector: "0x3494f4762774ed2020c6906a4da6be06137fc4a0a5ee07fbb404b10c1ae60e8", - calldata: CallData.compile([comm_id, gatekeep_type, erc721_address , permissioned_address, paid_gating_details]), + calldata: contractCallData.compile('gatekeep', { + community_id: community_id, + gate_keep_type: gatekeep_type, + nft_contract_address: erc721_address, + permissioned_addresses: permissioned_address, + paid_gating_details + }), } try { const Resp = await tokenbound?.execute("0x075a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f", [call]); @@ -234,6 +300,8 @@ const execute_gatekeep = async() =>{ // execute_get_community(); // execute_create_community(); execute_gatekeep() +// create_subscription() +// execute_upgrade() // execute_create_channel(); // execute_join_community(); // execute_make_post(); @@ -243,3 +311,4 @@ execute_gatekeep() // execute_upvote(); // execute_downvote(); + diff --git a/scripts/src/helpers/constants.ts b/scripts/src/helpers/constants.ts index 5b7a6fa..23690b5 100644 --- a/scripts/src/helpers/constants.ts +++ b/scripts/src/helpers/constants.ts @@ -1,7 +1,7 @@ export const HANDLE_CONTRACT_ADDRESS:string = "0x4cb40ffd9120ab0ff7632fe27710d5f979ad18e1294737ac5838ad7a437677a"; export const REGISTRY_HANDLE_CONTRACT_ADDRESS:string = "0x7d750ed304612f346b9ca5555e26fc80b279487b90d56e86a07668b9f1b6492"; export const coloniz_NFT_CONTRACT_ADDRESS:string = "0x4dca9ec1ed78ce5cddbbcec63d3620514ae66bc73a3942d48a011bad452ffe" -export const coloniz_HUB_CONTRACT_ADDRESS:string ="0x7e3c4c5275b93d985699b86486848b0bee8d75b88fbaf36fea339eeb74b8aa8" +export const coloniz_HUB_CONTRACT_ADDRESS:string ="0x04bd89ef797c5a34a3c8bcc9dafca270959d9edcd568ea22a2364ffb3af959f0" export const FOLLOW_CONTRACT_ADDRESS:string = "0x60a56d724558a9cfbbf3a3fd4faebaa65678efe090d3dd49afa85d1bcc61eba" export const PROFILE_ADDRESS_ONE:string = "0x206b999eeed11da16898664d6ad251563e6796a564c6eaddfae4d84350d4cf1"; export const PROFILE_ADDRESS_TWO:string = "0x75a4558a2e9d8b10fdb3d94d51b35312703cc7aae43a1ff95e234512e83783f" \ No newline at end of file diff --git a/scripts/src/index.ts b/scripts/src/index.ts index d37dbe9..1362f0b 100644 --- a/scripts/src/index.ts +++ b/scripts/src/index.ts @@ -2,7 +2,7 @@ import {WalletClient, TBAChainID, TBAVersion, TokenboundClient} from "starknet-t const walletClient: WalletClient = { address: "0x07EadF65B6D96A7DEbB36380fF936F6701a053Be8f2824D6293f188fA542C502", - privateKey: process.env.ACCOUNT_TWO_PRIVATE_KEY!, + privateKey: "", }; const options = { walletClient: walletClient,