From 82b38b4bb28450c5457ab1e0a653ebcbb2753aab Mon Sep 17 00:00:00 2001 From: Darlington02 Date: Thu, 30 May 2024 01:38:17 +0100 Subject: [PATCH] chore: fix readme --- readme.md | 79 +++++++++++++--------------- src/interfaces.cairo | 2 +- src/interfaces/IHandle.cairo | 2 +- src/namespaces.cairo | 2 +- src/namespaces/handle_registry.cairo | 1 + src/namespaces/handles.cairo | 25 +++++---- 6 files changed, 55 insertions(+), 56 deletions(-) diff --git a/readme.md b/readme.md index 532ce41..406a041 100644 --- a/readme.md +++ b/readme.md @@ -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 git@github.com: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.* -Screenshot 2024-05-24 at 00 11 16 +Screenshot 2024-05-24 at 00 11 16 diff --git a/src/interfaces.cairo b/src/interfaces.cairo index e210e18..147d315 100644 --- a/src/interfaces.cairo +++ b/src/interfaces.cairo @@ -3,4 +3,4 @@ pub mod IERC721; pub mod IRegistry; pub mod IProfile; pub mod IFollowNFT; -pub mod IHandle; \ No newline at end of file +pub mod IHandle; diff --git a/src/interfaces/IHandle.cairo b/src/interfaces/IHandle.cairo index 8498a40..e4afc89 100644 --- a/src/interfaces/IHandle.cairo +++ b/src/interfaces/IHandle.cairo @@ -21,4 +21,4 @@ pub trait IHandle { 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; -} \ No newline at end of file +} diff --git a/src/namespaces.cairo b/src/namespaces.cairo index 626a4df..f3d58ad 100644 --- a/src/namespaces.cairo +++ b/src/namespaces.cairo @@ -1,2 +1,2 @@ mod handles; -mod handle_registry; \ No newline at end of file +mod handle_registry; diff --git a/src/namespaces/handle_registry.cairo b/src/namespaces/handle_registry.cairo index e69de29..8b13789 100644 --- a/src/namespaces/handle_registry.cairo +++ b/src/namespaces/handle_registry.cairo @@ -0,0 +1 @@ + diff --git a/src/namespaces/handles.cairo b/src/namespaces/handles.cairo index c160f7c..91aaf97 100644 --- a/src/namespaces/handles.cairo +++ b/src/namespaces/handles.cairo @@ -126,20 +126,24 @@ mod Handles { // ************************************************************************* #[abi(embed_v0)] impl HandlesImpl of IHandle { - 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; } @@ -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"; } @@ -184,8 +190,7 @@ 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 { @@ -193,4 +198,4 @@ mod Handles { return false; } } -} \ No newline at end of file +}