Skip to content

Commit

Permalink
chore: modify readme, add license
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Jun 1, 2024
1 parent bc7da91 commit c88e279
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 19 deletions.
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2024 HORUS LABS

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
19 changes: 16 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,18 @@
# Karst
<!-- logo -->
<p align="center">
<img width='300' src="https://avatars.githubusercontent.com/u/123994955?s=200&v=4">
</p>

<!-- primary badges -->
<p align="center">
<a href="https://github.com/argentlabs/starknetkit/blob/main/LICENSE/">
<img src="https://img.shields.io/badge/license-MIT-black">
</a>
</p>

<div align="center">
<h1> Karst </h1>
</div>

Karst is a permissionless and composable social graph built on Starknet, empowering creators to own every part of their social experience.

Expand Down Expand Up @@ -38,9 +52,8 @@ For more information on writing and running tests, refer to the [Starknet-Foundr

## Architecture

Check out the architecture below, and also reference [lens protocol](https://github.com/lens-protocol/core/tree/master) to understand more.
Check out the contract architecture below.

*Architecture Preview.*
<img width="100%" alt="Screenshot 2024-05-24 at 00 11 16" src="https://github.com/horuslabsio/karst-core/blob/main/img/architecture.png?raw=true">


41 changes: 27 additions & 14 deletions src/base/types.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,23 @@ pub struct FollowData {
follow_timestamp: u64
}

// /**
// * @notice A struct containing the parameters supplied to the post method
// *
// * @param contentURI URI pointing to the post content
// * @param profile_address profile address that owns the post
// */
#[derive(Drop, Serde, starknet::Store)]
pub struct PostParams {
contentURI: ByteArray,
profile_address: ContractAddress,
}
// * @notice A struct containing profile data.
// * profile_address The profile ID of a karst profile
// * profile_owner The address that created the profile_address
// * @param pub_count The number of publications made to this profile.
// * @param metadataURI MetadataURI is used to store the profile's metadata, for example: displayed name, description, interests, etc.

// * @notice A struct containing profile data.
// * profile_address The profile ID of a karst profile
// * profile_owner The address that created the profile_address
// * @param pub_count The number of publications made to this profile.
// * @param metadataURI MetadataURI is used to store the profile's metadata, for example: displayed name, description, interests, etc.
#[derive(Drop, Serde, starknet::Store)]
pub struct Profile {
profile_address: ContractAddress,
Expand All @@ -49,7 +55,6 @@ pub struct Profile {
// * @param root_profile_address The profile ID of the root post (to determine if comments/quotes and mirrors come from it).
// * @param root_pub_id The publication ID of the root post (to determine if comments/quotes and mirrors come from it).
// */

#[derive(Debug, Drop, Serde, starknet::Store)]
pub struct Publication {
pointed_profile_address: ContractAddress,
Expand Down Expand Up @@ -78,20 +83,28 @@ enum PublicationType {
Quote
}


// /**
// * @notice A struct containing the parameters supplied to the comment method
// *
// * @param profile_address profile address that owns the comment
// * @param contentURI URI pointing to the comment content
// * @param pointed_profile_address profile address of the referenced publication/comment
// * @param pointed_pub_id ID of the pointed publication
// */
#[derive(Drop, Serde, starknet::Store)]
struct ReferencePubParams {
struct CommentParams {
profile_address: ContractAddress,
content_URI: ByteArray,
contentURI: ByteArray,
pointed_profile_address: ContractAddress,
pointed_pub_id: u256
pointed_pub_id: u256,
}


#[derive(Drop, Serde, starknet::Store)]
struct CommentParams {
struct ReferencePubParams {
profile_address: ContractAddress,
contentURI: ByteArray,
pointedProfile_address: ContractAddress,
pointedPubId: u256,
content_URI: ByteArray,
pointed_profile_address: ContractAddress,
pointed_pub_id: u256
}

7 changes: 7 additions & 0 deletions src/interfaces/IPublication.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use karst::base::types::{PostParams, ReferencePubParams, PublicationType, Public

#[starknet::interface]
pub trait IKarstPublications<T> {
// *************************************************************************
// EXTERNALS
// *************************************************************************
fn post(
ref self: T,
contentURI: ByteArray,
Expand All @@ -20,6 +23,10 @@ pub trait IKarstPublications<T> {
pointed_pub_id: u256,
profile_contract_address: ContractAddress,
) -> u256;

// *************************************************************************
// GETTERS
// *************************************************************************
fn get_publication(self: @T, user: ContractAddress, pubIdAssigned: u256) -> Publication;
fn get_publication_type(
self: @T, profile_address: ContractAddress, pub_id_assigned: u256
Expand Down
7 changes: 7 additions & 0 deletions src/interfaces/IRegistry.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ use starknet::ContractAddress;
// *************************************************************************
#[starknet::interface]
pub trait IRegistry<TContractState> {
// *************************************************************************
// EXTERNALS
// *************************************************************************
fn create_account(
ref self: TContractState,
implementation_hash: felt252,
token_contract: ContractAddress,
token_id: u256,
salt: felt252
) -> ContractAddress;

// *************************************************************************
// GETTERS
// *************************************************************************
fn get_account(
self: @TContractState,
implementation_hash: felt252,
Expand Down
3 changes: 1 addition & 2 deletions tests/test_publication.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ fn __setup__() -> (
stop_prank(
CheatTarget::Multiple(array![publication_contract_address, profile_contract_address]),
);
//////

return (
nft_contract_address,
registry_contract_address,
Expand Down Expand Up @@ -171,7 +171,6 @@ fn test_post() {
);
}


#[test]
fn test_comment() {
let (
Expand Down

0 comments on commit c88e279

Please sign in to comment.