Skip to content

Commit

Permalink
chore: fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed May 30, 2024
1 parent e87c591 commit 82b38b4
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 56 deletions.
79 changes: 36 additions & 43 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,46 @@
# Karst

Karst is a web3 social graph on Starknet. it aims to build a social Graph for the starknet ecosystem.

## TODOS

- [x] Implement `create profiles contract` functionality using `erc6551`
- [x] Implement `create profile` functionality
- [x] Implement `setProfileMetadataURI` functionality
- [x] Write test for `createProfile` and related `profile` functions
- [ ] implement `Publications` contract
- [ ] Make contract upgradable, preferably uups.
- [ ] implement `post` functionality
- [ ] Implement `like` functionality
- [ ] Implement `comment` functionality
- [ ] Implement `mirror` functionality
- [ ] Implement `quote` functionality
- [ ] implement `tipPost` functionality
- [ ] implement `follow` functionality from followNFT
- [x] Implement `FollowNFT` contract
- [x] implement `unwrap` functionality
- [x] Implement `approveFollow` functionality
- [x] Implement `removeFollower` functionality
- [x] Implement `wrap` functionality
- [x] Implement `follow` functionality
- [x] Implement `unfollow` functionality
- [x] Implement `getOriginalFollowTimestamp` functionality
- [x] Implement `getFollowTimestamp` functionality
- [x] Implement `getProfileIdAllowedToRecover` functionality
- [x] Implement `getFollowData` functionality
- [x] Implement `getFollowApproved` functionality
- [x] Implement `getFollowerCount` functionality
- Implement `addDelegate` functionality
- [ ] Implement indexing of publish contract
- [ ] indexing shall be done with [arweave](https://www.arweave.org/)
- [ ] index all events emitted by the publications contract
- [ ] set up api endpoints to query the indexer
- [ ] not important at the moment
- [ ] create a custom explorer for querying the content layer

## Remarks

our implementation may defer from lens by they both achieve the same goal
link to [Lens protocol](https://polygonscan.com/address/0x176c2a1c54e8b028eeec14bf0a059e354408ff47#code) contracts
Karst is a permissionless and composable social graph built on Starknet, empowering creators to own every part of their social experience.

With Karst, creators no longer need to worry about losing their content, audience, and livelihood based on the whims of an individual platform's algorithms and policies.

## Development Setup
You will need to have Scarb and Starknet Foundry installed on your system. Refer to the documentations below:

- [Starknet Foundry](https://foundry-rs.github.io/starknet-foundry/index.html)
- [Scarb](https://docs.swmansion.com/scarb/download.html)

To use this repository, first clone it:
```
git clone [email protected]:horuslabsio/karst-core.git
cd karst-core
```

### Building contracts
To build the contracts, run the command:
```
scarb build
```

### Running Tests
To run the tests contained within the `tests` folder, run the command:
```
snforge test
```

### Formatting contracts
We use the in-built formatter that comes with Scarb. To format your contracts, simply run the command:
```
scarb fmt
```

For more information on writing and running tests, refer to the [Starknet-Foundry documentation](https://foundry-rs.github.io/starknet-foundry/index.html)

## Architecture

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

*Architecture Preview.*
<img width="614" alt="Screenshot 2024-05-24 at 00 11 16" src="https://github.com/horuslabsio/karst-core/assets/60871378/25f001ff-b198-4cd1-aaff-866b1d0bd4f8">
<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">


2 changes: 1 addition & 1 deletion src/interfaces.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pub mod IERC721;
pub mod IRegistry;
pub mod IProfile;
pub mod IFollowNFT;
pub mod IHandle;
pub mod IHandle;
2 changes: 1 addition & 1 deletion src/interfaces/IHandle.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ pub trait IHandle<TState> {
fn exists(self: @TState, token_id: u256) -> bool;
fn total_supply(self: @TState) -> u256;
fn get_handle_token_uri(self: @TState, token_id: u256, local_name: felt252) -> ByteArray;
}
}
2 changes: 1 addition & 1 deletion src/namespaces.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mod handles;
mod handle_registry;
mod handle_registry;
1 change: 1 addition & 0 deletions src/namespaces/handle_registry.cairo
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

25 changes: 15 additions & 10 deletions src/namespaces/handles.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,24 @@ mod Handles {
// *************************************************************************
#[abi(embed_v0)]
impl HandlesImpl of IHandle<ContractState> {
fn mint_handle(ref self: ContractState, address: ContractAddress, local_name: felt252) -> u256 {
fn mint_handle(
ref self: ContractState, address: ContractAddress, local_name: felt252
) -> u256 {
// TODO
return 123;
}

fn burn_handle(ref self: ContractState, token_id: u256) {
// TODO
fn burn_handle(ref self: ContractState, token_id: u256) { // TODO
}

fn set_handle_token_uri(ref self: ContractState, token_id: u256, local_name: felt252) {
// TODO
fn set_handle_token_uri(
ref self: ContractState, token_id: u256, local_name: felt252
) { // TODO
}

fn migrate_handle(ref self: ContractState, address: ContractAddress, local_name: felt252) -> u256 {
fn migrate_handle(
ref self: ContractState, address: ContractAddress, local_name: felt252
) -> u256 {
// TODO
return 123;
}
Expand Down Expand Up @@ -168,7 +172,9 @@ mod Handles {
self.total_supply.read()
}

fn get_handle_token_uri(self: @ContractState, token_id: u256, local_name: felt252) -> ByteArray {
fn get_handle_token_uri(
self: @ContractState, token_id: u256, local_name: felt252
) -> ByteArray {
// TODO
return "TODO";
}
Expand All @@ -184,13 +190,12 @@ mod Handles {
return 123;
}

fn _validate_local_name(local_name: felt252) {
// TODO
fn _validate_local_name(local_name: felt252) { // TODO
}

fn _is_alpha_numeric(char: felt252) -> bool {
// TODO
return false;
}
}
}
}

0 comments on commit 82b38b4

Please sign in to comment.