Skip to content

Commit

Permalink
feat: kick off channel comp
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Oct 11, 2024
1 parent 5b7bce4 commit 78239de
Show file tree
Hide file tree
Showing 14 changed files with 1,285 additions and 35 deletions.
6 changes: 6 additions & 0 deletions src/base/constants/errors.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,10 @@ pub mod Errors {
pub const AUTO_RENEW_DURATION_ENDED: felt252 = 'Karst: auto renew ended!';
pub const INVALID_JOLT: felt252 = 'Karst: invalid jolt!';
pub const INVALID_JOLT_RECIPIENT: felt252 = 'Karst: not request recipient!';
pub const NOT_CHANNEL_OWNER: felt252 = 'Channel: not channel owner';
pub const NOT_CHANNEL_MODERATOR: felt252 = 'Channel: not channel moderator';
pub const NOT_CHANNEL_MEMBER: felt252 = 'Channel: not channel member';
pub const BANNED_FROM_CHANNEL: felt252 = 'Channel: banned from channel';
pub const CHANNEL_HAS_NO_MEMBER: felt252 = 'Channel has no members';
pub const UNAUTHORIZED_ACESS: felt252 = 'Karst : Unauthorized access';
}
83 changes: 54 additions & 29 deletions src/base/constants/types.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,27 @@ pub struct Profile {
pub follow_nft: ContractAddress
}

// *************************************************************************
// FOLLOW
// *************************************************************************

// /**
// * @notice A struct containing token follow-related data.
// *
// * @param followed_profile_address The ID of the profile being followed.
// * @param follower_profile_address The ID of the profile following.
// * @param followTimestamp The timestamp of the current follow, if a profile is using the token to
// follow.
// * @param block_status true if follower is blocked, false otherwise
// */
#[derive(Drop, Serde, starknet::Store)]
pub struct FollowData {
pub followed_profile_address: ContractAddress,
pub follower_profile_address: ContractAddress,
pub follow_timestamp: u64,
pub block_status: bool,
}

// *************************************************************************
// PUBLICATION
// *************************************************************************
Expand Down Expand Up @@ -144,6 +165,20 @@ pub struct QuoteParams {
pub reference_pub_type: PublicationType
}

#[derive(Debug, Drop, Serde, starknet::Store, Clone)]
pub struct Upvote {
pub publication_id: u256,
pub transaction_executor: ContractAddress,
pub block_timestamp: u64,
}

#[derive(Debug, Drop, Serde, starknet::Store, Clone)]
pub struct Downvote {
pub publication_id: u256,
pub transaction_executor: ContractAddress,
pub block_timestamp: u64,
}

// *************************************************************************
// COMMUNITY
// *************************************************************************
Expand Down Expand Up @@ -201,39 +236,29 @@ pub enum CommunityType {
Business
}

#[derive(Debug, Drop, Serde, starknet::Store, Clone)]
pub struct Upvote {
pub publication_id: u256,
pub transaction_executor: ContractAddress,
pub block_timestamp: u64,
}
// *************************************************************************
// CHANNEL
// *************************************************************************

#[derive(Debug, Drop, Serde, starknet::Store, Clone)]
pub struct Downvote {
pub publication_id: u256,
pub transaction_executor: ContractAddress,
pub block_timestamp: u64,
#[derive(Drop, Serde, Clone, starknet::Store)]
pub struct channelDetails {
pub channel_id: u256,
pub community_id: u256,
pub channel_owner: ContractAddress,
pub channel_metadata_uri: ByteArray,
pub channel_nft_address: ContractAddress,
pub channel_total_members: u256,
pub channel_censorship: bool,
}

// *************************************************************************
// FOLLOW
// *************************************************************************

// /**
// * @notice A struct containing token follow-related data.
// *
// * @param followed_profile_address The ID of the profile being followed.
// * @param follower_profile_address The ID of the profile following.
// * @param followTimestamp The timestamp of the current follow, if a profile is using the token to
// follow.
// * @param block_status true if follower is blocked, false otherwise
// */
#[derive(Drop, Serde, starknet::Store)]
pub struct FollowData {
pub followed_profile_address: ContractAddress,
pub follower_profile_address: ContractAddress,
pub follow_timestamp: u64,
pub block_status: bool,
#[derive(Drop, Serde, Clone, starknet::Store)]
pub struct channelMember {
pub profile: ContractAddress,
pub channel_id: u256,
pub total_publications: u256,
pub channel_token_id: u256,
pub ban_status: bool,
}

// *************************************************************************
Expand Down
1 change: 1 addition & 0 deletions src/base/token_uris.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ pub mod follow_token_uri;
pub mod handle_token_uri;
pub mod profile_token_uri;
pub mod community_token_uri;
pub mod channel_token_uri;
pub mod traits;
5 changes: 5 additions & 0 deletions src/base/token_uris/channel_token_uri.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pub mod ChannelTokenUri {
pub fn get_token_uri(token_id: u256, mint_timestamp: u64) -> ByteArray {
"TODO"
}
}
2 changes: 2 additions & 0 deletions src/channel.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pub mod channel;
pub mod channelNFT;
Loading

0 comments on commit 78239de

Please sign in to comment.