From 8986e769f6068b88ca8da554bc453dd114242241 Mon Sep 17 00:00:00 2001
From: Adegbite Ademola Kelvin
Date: Thu, 24 Oct 2024 00:10:13 +0100
Subject: [PATCH 1/2] feature: integrate publication contract with community &
channel contract
---
src/base/constants/types.cairo | 13 +-
src/channel/channel.cairo | 6 +-
src/channel/channelNFT.cairo | 4 +-
src/collectnft.cairo | 1 -
src/community/community.cairo | 6 +-
src/community/communitynft.cairo | 4 +-
src/hub/hub.cairo | 50 +-
src/interfaces.cairo | 2 +-
.../{ICommunityNft.cairo => ICustomNFT.cairo} | 2 +-
src/interfaces/IPublication.cairo | 30 +-
src/lib.cairo | 1 -
src/mocks/interfaces/IComposable.cairo | 32 +-
src/presets/publication.cairo | 52 +-
src/publication.cairo | 1 +
.../collectnft.cairo | 0
src/publication/publication.cairo | 223 +-
tests/test_hub.cairo | 11 +-
tests/test_publication.cairo | 1850 +++++++++++------
18 files changed, 1633 insertions(+), 655 deletions(-)
delete mode 100644 src/collectnft.cairo
rename src/interfaces/{ICommunityNft.cairo => ICustomNFT.cairo} (96%)
rename src/{collectnft => publication}/collectnft.cairo (100%)
diff --git a/src/base/constants/types.cairo b/src/base/constants/types.cairo
index b8316b1..e086fc4 100644
--- a/src/base/constants/types.cairo
+++ b/src/base/constants/types.cairo
@@ -71,9 +71,11 @@ pub struct Publication {
pub root_pub_id: u256,
pub upvote: u256,
pub downvote: u256,
- pub channel_id: felt252,
+ pub channel_id: u256,
pub collect_nft: ContractAddress,
- pub tipped_amount: u256
+ pub tipped_amount: u256,
+ pub community_id: u256,
+ pub approved: bool
}
// /**
@@ -103,7 +105,8 @@ pub enum PublicationType {
pub struct PostParams {
pub content_URI: ByteArray,
pub profile_address: ContractAddress,
- pub channel_id: felt252
+ pub channel_id: u256,
+ pub community_id: u256,
}
///**
@@ -121,6 +124,8 @@ pub struct CommentParams {
pub pointed_profile_address: ContractAddress,
pub pointed_pub_id: u256,
pub reference_pub_type: PublicationType,
+ pub channel_id: u256,
+ pub community_id: u256,
}
///**
@@ -153,6 +158,8 @@ pub struct RepostParams {
pub profile_address: ContractAddress,
pub pointed_profile_address: ContractAddress,
pub pointed_pub_id: u256,
+ pub channel_id: u256,
+ pub community_id: u256,
}
// /**
diff --git a/src/channel/channel.cairo b/src/channel/channel.cairo
index a0be793..fa2b4d4 100644
--- a/src/channel/channel.cairo
+++ b/src/channel/channel.cairo
@@ -18,7 +18,7 @@ pub mod ChannelComponent {
use karst::community::community::CommunityComponent;
use karst::interfaces::{
IChannel::IChannel, ICommunity::ICommunity,
- ICommunityNft::{ICommunityNftDispatcher, ICommunityNftDispatcherTrait}
+ ICustomNFT::{ICustomNFTDispatcher, ICustomNFTDispatcherTrait}
};
use karst::base::{
constants::errors::Errors::{
@@ -609,7 +609,7 @@ pub mod ChannelComponent {
profile: ContractAddress,
channel_nft_address: ContractAddress
) -> u256 {
- let token_id = ICommunityNftDispatcher { contract_address: channel_nft_address }
+ let token_id = ICustomNFTDispatcher { contract_address: channel_nft_address }
.mint_nft(profile);
token_id
}
@@ -622,7 +622,7 @@ pub mod ChannelComponent {
channel_nft_address: ContractAddress,
token_id: u256
) {
- ICommunityNftDispatcher { contract_address: channel_nft_address }
+ ICustomNFTDispatcher { contract_address: channel_nft_address }
.burn_nft(get_caller_address(), token_id);
}
}
diff --git a/src/channel/channelNFT.cairo b/src/channel/channelNFT.cairo
index 77e480b..6cf29ab 100644
--- a/src/channel/channelNFT.cairo
+++ b/src/channel/channelNFT.cairo
@@ -8,7 +8,7 @@ pub mod ChannelNFT {
use openzeppelin::introspection::src5::SRC5Component;
use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl};
- use karst::interfaces::ICommunityNft::ICommunityNft;
+ use karst::interfaces::ICustomNFT::ICustomNFT;
use karst::base::{
constants::errors::Errors::{ALREADY_MINTED, NOT_TOKEN_OWNER, TOKEN_DOES_NOT_EXIST},
@@ -66,7 +66,7 @@ pub mod ChannelNFT {
}
#[abi(embed_v0)]
- impl ChannelNFT of ICommunityNft {
+ impl ChannelNFT of ICustomNFT {
// *************************************************************************
// EXTERNAL
// *************************************************************************
diff --git a/src/collectnft.cairo b/src/collectnft.cairo
deleted file mode 100644
index a2daad5..0000000
--- a/src/collectnft.cairo
+++ /dev/null
@@ -1 +0,0 @@
-pub mod collectnft;
diff --git a/src/community/community.cairo b/src/community/community.cairo
index 8e1f05e..4bd0234 100644
--- a/src/community/community.cairo
+++ b/src/community/community.cairo
@@ -18,7 +18,7 @@ pub mod CommunityComponent {
use karst::jolt::jolt::JoltComponent;
use karst::interfaces::{
ICommunity::ICommunity, IJolt::IJolt, IERC721::{IERC721Dispatcher, IERC721DispatcherTrait},
- ICommunityNft::{ICommunityNftDispatcher, ICommunityNftDispatcherTrait}
+ ICustomNFT::{ICustomNFTDispatcher, ICustomNFTDispatcherTrait}
};
use karst::base::constants::types::{
CommunityDetails, GateKeepType, CommunityType, CommunityMember, CommunityGateKeepDetails,
@@ -913,7 +913,7 @@ pub mod CommunityComponent {
profile: ContractAddress,
community_nft_address: ContractAddress
) -> u256 {
- let token_id = ICommunityNftDispatcher { contract_address: community_nft_address }
+ let token_id = ICustomNFTDispatcher { contract_address: community_nft_address }
.mint_nft(profile);
token_id
}
@@ -927,7 +927,7 @@ pub mod CommunityComponent {
profile: ContractAddress,
token_id: u256
) {
- ICommunityNftDispatcher { contract_address: community_nft_address }
+ ICustomNFTDispatcher { contract_address: community_nft_address }
.burn_nft(profile, token_id);
}
}
diff --git a/src/community/communitynft.cairo b/src/community/communitynft.cairo
index b196eea..02e121f 100644
--- a/src/community/communitynft.cairo
+++ b/src/community/communitynft.cairo
@@ -8,7 +8,7 @@ pub mod CommunityNFT {
use openzeppelin::introspection::src5::SRC5Component;
use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl};
- use karst::interfaces::ICommunityNft::ICommunityNft;
+ use karst::interfaces::ICustomNFT::ICustomNFT;
use karst::base::{
constants::errors::Errors::{ALREADY_MINTED, NOT_TOKEN_OWNER, TOKEN_DOES_NOT_EXIST},
@@ -66,7 +66,7 @@ pub mod CommunityNFT {
}
#[abi(embed_v0)]
- impl CommunityNft of ICommunityNft {
+ impl CommunityNft of ICustomNFT {
// *************************************************************************
// EXTERNAL
// *************************************************************************
diff --git a/src/hub/hub.cairo b/src/hub/hub.cairo
index 2ca9e54..dc4e621 100644
--- a/src/hub/hub.cairo
+++ b/src/hub/hub.cairo
@@ -33,6 +33,10 @@ pub mod KarstHub {
};
use karst::profile::profile::ProfileComponent;
use karst::publication::publication::PublicationComponent;
+ use openzeppelin::access::ownable::OwnableComponent;
+ use karst::community::community::CommunityComponent;
+ use karst::channel::channel::ChannelComponent;
+ use karst::jolt::jolt::JoltComponent;
use karst::interfaces::IFollowNFT::{IFollowNFTDispatcher, IFollowNFTDispatcherTrait};
use karst::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
use karst::interfaces::IHandleRegistry::{
@@ -47,6 +51,10 @@ pub mod KarstHub {
// *************************************************************************
component!(path: ProfileComponent, storage: profile, event: ProfileEvent);
component!(path: PublicationComponent, storage: publication, event: PublicationEvent);
+ component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
+ component!(path: JoltComponent, storage: jolt, event: JoltEvent);
+ component!(path: ChannelComponent, storage: channel, event: ChannelEvent);
+ component!(path: CommunityComponent, storage: community, event: CommunityEvent);
#[abi(embed_v0)]
impl ProfileImpl = ProfileComponent::KarstProfile;
@@ -55,6 +63,18 @@ pub mod KarstHub {
impl ProfilePrivateImpl = ProfileComponent::Private;
+
+ #[abi(embed_v0)]
+ impl communityImpl = CommunityComponent::KarstCommunity;
+ impl communityPrivateImpl = CommunityComponent::Private;
+
+ #[abi(embed_v0)]
+ impl channelImpl = ChannelComponent::KarstChannel;
+ impl channelPrivateImpl = ChannelComponent::InternalImpl;
+
+ #[abi(embed_v0)]
+ impl joltImpl = JoltComponent::Jolt;
+ impl joltPrivateImpl = JoltComponent::Private;
// *************************************************************************
// STORAGE
// *************************************************************************
@@ -64,6 +84,14 @@ pub mod KarstHub {
profile: ProfileComponent::Storage,
#[substorage(v0)]
publication: PublicationComponent::Storage,
+ #[substorage(v0)]
+ jolt: JoltComponent::Storage,
+ #[substorage(v0)]
+ ownable: OwnableComponent::Storage,
+ #[substorage(v0)]
+ community: CommunityComponent::Storage,
+ #[substorage(v0)]
+ channel: ChannelComponent::Storage,
handle_contract_address: ContractAddress,
handle_registry_contract_address: ContractAddress
}
@@ -75,7 +103,15 @@ pub mod KarstHub {
#[derive(Drop, starknet::Event)]
enum Event {
ProfileEvent: ProfileComponent::Event,
- PublicationEvent: PublicationComponent::Event
+ PublicationEvent: PublicationComponent::Event,
+ #[flat]
+ JoltEvent: JoltComponent::Event,
+ #[flat]
+ OwnableEvent: OwnableComponent::Event,
+ #[flat]
+ CommunityEvent: CommunityComponent::Event,
+ #[flat]
+ ChannelEvent: ChannelComponent::Event,
}
// *************************************************************************
@@ -87,13 +123,19 @@ pub mod KarstHub {
karstnft_contract_address: ContractAddress,
handle_contract_address: ContractAddress,
handle_registry_contract_address: ContractAddress,
- follow_nft_classhash: felt252
+ follow_nft_classhash: felt252,
+ channel_nft_classhash: felt252,
+ community_nft_classhash: felt252,
+ owner: ContractAddress
) {
self
.profile
._initializer(karstnft_contract_address, get_contract_address(), follow_nft_classhash);
self.handle_contract_address.write(handle_contract_address);
self.handle_registry_contract_address.write(handle_registry_contract_address);
+ self.channel._initializer(channel_nft_classhash);
+ self.community._initializer(community_nft_classhash);
+ self.jolt._initializer(owner);
}
#[abi(embed_v0)]
@@ -190,9 +232,7 @@ pub mod KarstHub {
let dispatcher = IHandleRegistryDispatcher {
contract_address: self.handle_registry_contract_address.read()
};
-
- let handle_id = dispatcher.get_handle(profile_address);
- handle_id
+ dispatcher.get_handle(profile_address)
}
/// @notice returns the full handle of a user
diff --git a/src/interfaces.cairo b/src/interfaces.cairo
index f35a0c3..69de73f 100644
--- a/src/interfaces.cairo
+++ b/src/interfaces.cairo
@@ -10,7 +10,7 @@ pub mod IHandleRegistry;
pub mod IHub;
pub mod ICommunity;
pub mod ICollectNFT;
-pub mod ICommunityNft;
+pub mod ICustomNFT;
pub mod IJolt;
pub mod IUpgradeable;
pub mod IChannel;
diff --git a/src/interfaces/ICommunityNft.cairo b/src/interfaces/ICustomNFT.cairo
similarity index 96%
rename from src/interfaces/ICommunityNft.cairo
rename to src/interfaces/ICustomNFT.cairo
index 9aeb6c2..de66023 100644
--- a/src/interfaces/ICommunityNft.cairo
+++ b/src/interfaces/ICustomNFT.cairo
@@ -4,7 +4,7 @@ use starknet::ContractAddress;
// INTERFACE of ICommunity NFT
// *************************************************************************
#[starknet::interface]
-pub trait ICommunityNft {
+pub trait ICustomNFT {
// *************************************************************************
// EXTERNALS
// *************************************************************************
diff --git a/src/interfaces/IPublication.cairo b/src/interfaces/IPublication.cairo
index 8c94e18..e25ce54 100644
--- a/src/interfaces/IPublication.cairo
+++ b/src/interfaces/IPublication.cairo
@@ -14,16 +14,36 @@ pub trait IKarstPublications {
fn post(ref self: TState, post_params: PostParams) -> u256;
fn comment(ref self: TState, comment_params: CommentParams) -> u256;
fn repost(ref self: TState, repost_params: RepostParams) -> u256;
- fn upvote(ref self: TState, profile_address: ContractAddress, pub_id: u256);
- fn downvote(ref self: TState, profile_address: ContractAddress, pub_id: u256);
- fn tip(ref self: TState, profile_address: ContractAddress, pub_id: u256, amount: u256);
+ fn upvote(
+ ref self: TState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ channel_id: u256,
+ community_id: u256
+ );
+ fn downvote(
+ ref self: TState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ channel_id: u256,
+ community_id: u256
+ );
+ fn tip(
+ ref self: TState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ amount: u256,
+ channel_id: u256,
+ community_id: u256,
+ erc20_contract_address: ContractAddress,
+ );
fn collect(
ref self: TState,
- karst_hub: ContractAddress,
profile_address: ContractAddress,
pub_id: u256,
+ channel_id: u256,
+ community_id: u256,
collect_nft_impl_class_hash: felt252,
- salt: felt252
) -> u256;
// *************************************************************************
// GETTERS
diff --git a/src/lib.cairo b/src/lib.cairo
index 2213bf7..59c9e6b 100644
--- a/src/lib.cairo
+++ b/src/lib.cairo
@@ -9,6 +9,5 @@ pub mod namespaces;
pub mod presets;
pub mod hub;
pub mod jolt;
-pub mod collectnft;
pub mod community;
pub mod channel;
diff --git a/src/mocks/interfaces/IComposable.cairo b/src/mocks/interfaces/IComposable.cairo
index 1e9fc51..fc04d1c 100644
--- a/src/mocks/interfaces/IComposable.cairo
+++ b/src/mocks/interfaces/IComposable.cairo
@@ -37,17 +37,37 @@ pub trait IComposable {
fn initialize(ref self: TState, hub_address: ContractAddress);
fn post(ref self: TState, post_params: PostParams) -> u256;
fn comment(ref self: TState, comment_params: CommentParams) -> u256;
- fn repost(ref self: TState, mirror_params: RepostParams) -> u256;
- fn upvote(ref self: TState, profile_address: ContractAddress, pub_id: u256);
- fn downvote(ref self: TState, profile_address: ContractAddress, pub_id: u256);
- fn tip(ref self: TState, profile_address: ContractAddress, pub_id: u256, amount: u256);
+ fn repost(ref self: TState, repost_params: RepostParams) -> u256;
+ fn upvote(
+ ref self: TState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ channel_id: u256,
+ community_id: u256
+ );
+ fn downvote(
+ ref self: TState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ channel_id: u256,
+ community_id: u256
+ );
+ fn tip(
+ ref self: TState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ amount: u256,
+ channel_id: u256,
+ community_id: u256,
+ erc20_contract_address: ContractAddress,
+ );
fn collect(
ref self: TState,
- karst_hub: ContractAddress,
profile_address: ContractAddress,
pub_id: u256,
+ channel_id: u256,
+ community_id: u256,
collect_nft_impl_class_hash: felt252,
- salt: felt252
) -> u256;
// *************************************************************************
diff --git a/src/presets/publication.cairo b/src/presets/publication.cairo
index bc361c0..e527cd0 100644
--- a/src/presets/publication.cairo
+++ b/src/presets/publication.cairo
@@ -3,21 +3,53 @@ pub mod KarstPublication {
use starknet::ContractAddress;
use karst::publication::publication::PublicationComponent;
use karst::profile::profile::ProfileComponent;
+ use karst::jolt::jolt::JoltComponent;
+ use openzeppelin::access::ownable::OwnableComponent;
+ use karst::community::community::CommunityComponent;
+ use karst::channel::channel::ChannelComponent;
+
component!(path: PublicationComponent, storage: publication, event: PublicationEvent);
component!(path: ProfileComponent, storage: profile, event: ProfileEvent);
+ component!(path: JoltComponent, storage: jolt, event: JoltEvent);
+ component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
+ component!(path: ChannelComponent, storage: channel, event: ChannelEvent);
+ component!(path: CommunityComponent, storage: community, event: CommunityEvent);
+
+
#[abi(embed_v0)]
impl publicationImpl = PublicationComponent::KarstPublication;
+ impl publicationInternalImpl = PublicationComponent::InternalImpl;
#[abi(embed_v0)]
impl profileImpl = ProfileComponent::KarstProfile;
impl ProfilePrivateImpl = ProfileComponent::Private;
+ #[abi(embed_v0)]
+ impl joltImpl = JoltComponent::Jolt;
+ impl joltPrivateImpl = JoltComponent::Private;
+
+ #[abi(embed_v0)]
+ impl communityImpl = CommunityComponent::KarstCommunity;
+ impl communityPrivateImpl = CommunityComponent::Private;
+
+ #[abi(embed_v0)]
+ impl channelImpl = ChannelComponent::KarstChannel;
+ impl channelPrivateImpl = ChannelComponent::InternalImpl;
+
#[storage]
struct Storage {
#[substorage(v0)]
publication: PublicationComponent::Storage,
#[substorage(v0)]
- profile: ProfileComponent::Storage
+ profile: ProfileComponent::Storage,
+ #[substorage(v0)]
+ jolt: JoltComponent::Storage,
+ #[substorage(v0)]
+ ownable: OwnableComponent::Storage,
+ #[substorage(v0)]
+ community: CommunityComponent::Storage,
+ #[substorage(v0)]
+ channel: ChannelComponent::Storage,
}
#[event]
@@ -26,7 +58,15 @@ pub mod KarstPublication {
#[flat]
PublicationEvent: PublicationComponent::Event,
#[flat]
- ProfileEvent: ProfileComponent::Event
+ ProfileEvent: ProfileComponent::Event,
+ #[flat]
+ JoltEvent: JoltComponent::Event,
+ #[flat]
+ OwnableEvent: OwnableComponent::Event,
+ #[flat]
+ CommunityEvent: CommunityComponent::Event,
+ #[flat]
+ ChannelEvent: ChannelComponent::Event,
}
#[constructor]
@@ -34,8 +74,14 @@ pub mod KarstPublication {
ref self: ContractState,
karstnft_contract_address: ContractAddress,
hub_address: ContractAddress,
- follow_nft_classhash: felt252
+ follow_nft_classhash: felt252,
+ channel_nft_classhash: felt252,
+ community_nft_classhash: felt252,
+ owner: ContractAddress
) {
self.profile._initializer(karstnft_contract_address, hub_address, follow_nft_classhash);
+ self.channel._initializer(channel_nft_classhash);
+ self.community._initializer(community_nft_classhash);
+ self.jolt._initializer(owner);
}
}
diff --git a/src/publication.cairo b/src/publication.cairo
index 1bfb3be..72d6953 100644
--- a/src/publication.cairo
+++ b/src/publication.cairo
@@ -1 +1,2 @@
pub mod publication;
+pub mod collectnft;
diff --git a/src/collectnft/collectnft.cairo b/src/publication/collectnft.cairo
similarity index 100%
rename from src/collectnft/collectnft.cairo
rename to src/publication/collectnft.cairo
diff --git a/src/publication/publication.cairo b/src/publication/publication.cairo
index e8d3b59..cdf2682 100644
--- a/src/publication/publication.cairo
+++ b/src/publication/publication.cairo
@@ -8,19 +8,32 @@ pub mod PublicationComponent {
use core::num::traits::zero::Zero;
use core::option::OptionTrait;
use starknet::{
- ContractAddress, get_caller_address, get_block_timestamp, syscalls::{deploy_syscall},
- class_hash::ClassHash, SyscallResultTrait,
+ ContractAddress, get_caller_address, get_contract_address, get_block_timestamp,
+ syscalls::{deploy_syscall}, class_hash::ClassHash, SyscallResultTrait,
storage::{Map, StorageMapReadAccess, StorageMapWriteAccess}
};
use karst::interfaces::IPublication::IKarstPublications;
+ use karst::interfaces::IJolt::IJolt;
+ use karst::interfaces::ICommunity::ICommunity;
+ use karst::interfaces::IChannel::IChannel;
use karst::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatcherTrait};
use karst::base::{
- constants::errors::Errors::{NOT_PROFILE_OWNER, UNSUPPORTED_PUB_TYPE, ALREADY_REACTED},
- constants::types::{PostParams, Publication, PublicationType, CommentParams, RepostParams}
+ constants::errors::Errors::{
+ NOT_PROFILE_OWNER, UNSUPPORTED_PUB_TYPE, ALREADY_REACTED, NOT_COMMUNITY_MEMBER,
+ BANNED_MEMBER, NOT_CHANNEL_MEMBER, BANNED_FROM_CHANNEL
+ },
+ constants::types::{
+ PostParams, Publication, PublicationType, CommentParams, RepostParams, JoltParams,
+ JoltType
+ }
};
use karst::profile::profile::ProfileComponent;
use karst::profile::profile::ProfileComponent::PrivateTrait;
+ use karst::jolt::jolt::JoltComponent;
+ use karst::community::community::CommunityComponent;
+ use karst::channel::channel::ChannelComponent;
+ use openzeppelin::access::ownable::OwnableComponent;
// *************************************************************************
@@ -110,7 +123,11 @@ pub mod PublicationComponent {
TContractState,
+HasComponent,
+Drop,
- impl Profile: ProfileComponent::HasComponent
+ impl Profile: ProfileComponent::HasComponent,
+ impl Jolt: JoltComponent::HasComponent,
+ impl Ownable: OwnableComponent::HasComponent,
+ impl Community: CommunityComponent::HasComponent,
+ impl Channel: ChannelComponent::HasComponent,
> of IKarstPublications> {
// *************************************************************************
// PUBLISHING FUNCTIONS
@@ -118,18 +135,28 @@ pub mod PublicationComponent {
/// @notice performs post action
/// @param contentURI uri of the content to be posted
/// @param profile_address address of profile performing the post action
- fn post(ref self: ComponentState, post_params: PostParams) -> u256 {
+ fn post(ref self: ComponentState, mut post_params: PostParams) -> u256 {
+ // Initialize approval flag as false
+ let mut is_approved: bool = false;
+
+ // Clone the post parameters for future use (emission)
let ref_post_params = post_params.clone();
+
+ // Get the owner of the profile from the Profile component
let profile_owner: ContractAddress = get_dep_component!(@self, Profile)
.get_profile(post_params.profile_address)
.profile_owner;
+
+ // Ensure the caller is the owner of the profile
assert(profile_owner == get_caller_address(), NOT_PROFILE_OWNER);
+ // Get the Profile component and increment the publication count (new pub_id assigned)
let mut profile_component = get_dep_component_mut!(ref self, Profile);
let pub_id_assigned = profile_component
.increment_publication_count(post_params.profile_address);
- let new_post = Publication {
+ // Initialize the new post struct with default values
+ let mut new_post = Publication {
pointed_profile_address: 0.try_into().unwrap(),
pointed_pub_id: 0,
content_URI: post_params.content_URI,
@@ -140,10 +167,32 @@ pub mod PublicationComponent {
downvote: 0,
channel_id: 0,
collect_nft: 0.try_into().unwrap(),
- tipped_amount: 0
+ tipped_amount: 0,
+ community_id: 0,
+ approved: false
};
+ // Check if the post is for a community (non-zero community_id)
+ if post_params.community_id != 0 {
+ is_approved = self
+ ._check_community_approval(profile_owner, post_params.community_id);
+ // Update post struct to reflect community post
+ new_post.community_id = post_params.community_id;
+ new_post.channel_id = 0; // Set channel_id to 0 since it's a community post
+ new_post.approved = is_approved; // Set approval status based on checks
+ } else {
+ is_approved = self._check_channel_approval(profile_owner, post_params.channel_id);
+
+ // Update post struct to reflect channel post
+ new_post.community_id = 0; // Set community_id to 0 since it's a channel post
+ new_post.channel_id = post_params.channel_id;
+ new_post.approved = is_approved; // Set approval status based on checks
+ }
+
+ // Write the new post into the storage (identified by profile_address and pub_id)
self.publication.write((post_params.profile_address, pub_id_assigned), new_post);
+
+ // Emit a post event with the details of the post
self
.emit(
Post {
@@ -153,9 +202,12 @@ pub mod PublicationComponent {
block_timestamp: get_block_timestamp(),
}
);
+
+ // Return the assigned publication ID
pub_id_assigned
}
+
/// @notice performs comment action
/// @param profile_address address of profile performing the comment action
/// @param reference_pub_type publication type
@@ -167,6 +219,14 @@ pub mod PublicationComponent {
let profile_owner: ContractAddress = get_dep_component!(@self, Profile)
.get_profile(comment_params.profile_address)
.profile_owner;
+ self
+ ._validate_channel_membership_and_ban_status(
+ profile_owner, comment_params.channel_id
+ );
+ self
+ ._validate_community_membership_and_ban_status(
+ profile_owner, comment_params.community_id
+ );
assert(profile_owner == get_caller_address(), NOT_PROFILE_OWNER);
let ref_comment_params = comment_params.clone();
@@ -201,6 +261,14 @@ pub mod PublicationComponent {
let profile_owner: ContractAddress = get_dep_component!(@self, Profile)
.get_profile(repost_params.profile_address)
.profile_owner;
+ self
+ ._validate_channel_membership_and_ban_status(
+ profile_owner, repost_params.channel_id
+ );
+ self
+ ._validate_community_membership_and_ban_status(
+ profile_owner, repost_params.community_id
+ );
assert(profile_owner == get_caller_address(), NOT_PROFILE_OWNER);
let ref_repostParams = repost_params.clone();
@@ -233,13 +301,18 @@ pub mod PublicationComponent {
/// @notice upvote a post
/// @param profile_address address of profile performing the upvote action
/// @param pub_id id of the publication to upvote
- /// todo!(gate function)
fn upvote(
- ref self: ComponentState, profile_address: ContractAddress, pub_id: u256
+ ref self: ComponentState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ channel_id: u256,
+ community_id: u256
) {
let mut publication = self.get_publication(profile_address, pub_id);
let caller = get_caller_address();
let has_voted = self.vote_status.read((caller, pub_id));
+ self._validate_channel_membership_and_ban_status(caller, channel_id);
+ self._validate_community_membership_and_ban_status(caller, community_id);
let upvote_current_count = publication.upvote + 1;
assert(has_voted == false, ALREADY_REACTED);
let updated_publication = Publication { upvote: upvote_current_count, ..publication };
@@ -261,11 +334,17 @@ pub mod PublicationComponent {
/// todo!(gate function)
fn downvote(
- ref self: ComponentState, profile_address: ContractAddress, pub_id: u256
+ ref self: ComponentState,
+ profile_address: ContractAddress,
+ pub_id: u256,
+ channel_id: u256,
+ community_id: u256
) {
let mut publication = self.get_publication(profile_address, pub_id);
let caller = get_caller_address();
let has_voted = self.vote_status.read((caller, pub_id));
+ self._validate_channel_membership_and_ban_status(caller, channel_id);
+ self._validate_community_membership_and_ban_status(caller, community_id);
let downvote_current_count = publication.downvote + 1;
assert(has_voted == false, ALREADY_REACTED);
let updated_publication = Publication {
@@ -292,28 +371,44 @@ pub mod PublicationComponent {
ref self: ComponentState,
profile_address: ContractAddress,
pub_id: u256,
- amount: u256
+ amount: u256,
+ channel_id: u256,
+ community_id: u256,
+ erc20_contract_address: ContractAddress,
) {
+ let caller = get_caller_address();
let mut publication = self.get_publication(profile_address, pub_id);
+ self._validate_channel_membership_and_ban_status(caller, channel_id);
+ self._validate_community_membership_and_ban_status(caller, community_id);
let current_tip_amount = publication.tipped_amount;
- let updated_publication = Publication {
- tipped_amount: current_tip_amount + amount, ..publication
+ let jolt_param = JoltParams {
+ jolt_type: JoltType::Tip,
+ recipient: profile_address,
+ memo: "Tip User",
+ amount: current_tip_amount + amount,
+ expiration_stamp: 0,
+ subscription_details: (0, false, 0),
+ erc20_contract_address: erc20_contract_address
};
+ let mut jolt_comp = get_dep_component_mut!(ref self, Jolt);
+ jolt_comp.jolt(jolt_param);
+ let updated_publication = Publication { tipped_amount: amount, ..publication };
self.publication.write((profile_address, pub_id), updated_publication)
}
// @notice collect nft for a publication
fn collect(
ref self: ComponentState,
- karst_hub: ContractAddress,
profile_address: ContractAddress,
pub_id: u256,
+ channel_id: u256,
+ community_id: u256,
collect_nft_impl_class_hash: felt252,
- salt: felt252
) -> u256 {
+ let caller = get_caller_address();
+ self._validate_channel_membership_and_ban_status(caller, channel_id);
+ self._validate_community_membership_and_ban_status(caller, community_id);
let collect_nft_address = self
- ._get_or_deploy_collect_nft(
- karst_hub, profile_address, pub_id, collect_nft_impl_class_hash, salt
- );
+ ._get_or_deploy_collect_nft(profile_address, pub_id, collect_nft_impl_class_hash);
let token_id = self._mint_collect_nft(collect_nft_address);
self
@@ -398,11 +493,15 @@ pub mod PublicationComponent {
// PRIVATE FUNCTIONS
// *************************************************************************
#[generate_trait]
- impl InternalImpl<
+ pub impl InternalImpl<
TContractState,
+HasComponent,
+Drop,
- impl Profile: ProfileComponent::HasComponent
+ impl Profile: ProfileComponent::HasComponent,
+ impl Jolt: JoltComponent::HasComponent,
+ impl Ownable: OwnableComponent::HasComponent,
+ impl Community: CommunityComponent::HasComponent,
+ impl Channel: ChannelComponent::HasComponent,
> of InternalTrait {
/// @notice fill reference publication
/// @param profile_address the profile address creating the publication
@@ -457,7 +556,9 @@ pub mod PublicationComponent {
downvote: 0,
channel_id: pointed_pub.channel_id,
collect_nft: 0.try_into().unwrap(),
- tipped_amount: 0
+ tipped_amount: 0,
+ community_id: pointed_pub.community_id,
+ approved: pointed_pub.approved
};
self.publication.write((profile_address, pub_id_assigned), updated_reference);
@@ -592,11 +693,9 @@ pub mod PublicationComponent {
}
fn _get_or_deploy_collect_nft(
ref self: ComponentState,
- karst_hub: ContractAddress,
profile_address: ContractAddress,
pub_id: u256,
collect_nft_impl_class_hash: felt252,
- salt: felt252
) -> ContractAddress {
let mut publication = self.get_publication(profile_address, pub_id);
let collect_nft = publication.collect_nft;
@@ -604,7 +703,11 @@ pub mod PublicationComponent {
// Deploy a new Collect NFT contract
let deployed_collect_nft_address = self
._deploy_collect_nft(
- karst_hub, profile_address, pub_id, collect_nft_impl_class_hash, salt
+ get_contract_address(),
+ profile_address,
+ pub_id,
+ collect_nft_impl_class_hash,
+ get_block_timestamp().try_into().unwrap()
);
// Update the publication with the deployed Collect NFT address
@@ -627,6 +730,76 @@ pub mod PublicationComponent {
let token_id = ICollectNFTDispatcher { contract_address: collect_nft }.mint_nft(caller);
token_id
}
+
+ fn _check_community_approval(
+ self: @ComponentState,
+ profile_owner: ContractAddress,
+ community_id: u256
+ ) -> bool {
+ // Get community censorship and banned status
+ let community_comp = get_dep_component!(self, Community);
+
+ let banned_status = community_comp.get_ban_status(profile_owner, community_id);
+
+ let community_censorship_status = community_comp
+ .get_community_censorship_status(community_id);
+ // Check if the caller is a member of the community
+ let (is_community_member, _) = community_comp
+ .is_community_member(profile_owner, community_id);
+
+ // Ensure the caller is a valid member of the community and not banned
+ assert(is_community_member == true, NOT_COMMUNITY_MEMBER);
+ assert(banned_status == false, BANNED_MEMBER);
+
+ !community_censorship_status
+ }
+
+ fn _check_channel_approval(
+ self: @ComponentState, profile_owner: ContractAddress, channel_id: u256
+ ) -> bool {
+ let channel_comp = get_dep_component!(self, Channel);
+
+ let channel_censorship_status = channel_comp.get_channel_censorship_status(channel_id);
+ let channel_ban_status = channel_comp.get_channel_ban_status(profile_owner, channel_id);
+
+ // Check if the caller is a member of the channel
+ let (is_channel_member, _) = channel_comp.is_channel_member(profile_owner, channel_id);
+
+ // Ensure the user is a valid member and not banned
+ assert(is_channel_member == true, NOT_CHANNEL_MEMBER);
+ assert(channel_ban_status == false, BANNED_FROM_CHANNEL);
+
+ !channel_censorship_status
+ }
+
+
+ fn _validate_channel_membership_and_ban_status(
+ self: @ComponentState,
+ profile_address: ContractAddress,
+ channel_id: u256
+ ) {
+ let channel_comp = get_dep_component!(self, Channel);
+ let (is_channel_member, _) = channel_comp
+ .is_channel_member(profile_address, channel_id);
+ let channel_ban_status = channel_comp
+ .get_channel_ban_status(profile_address, channel_id);
+ assert(channel_ban_status == false, BANNED_FROM_CHANNEL);
+ assert(is_channel_member == true, NOT_CHANNEL_MEMBER);
+ }
+
+ fn _validate_community_membership_and_ban_status(
+ self: @ComponentState,
+ profile_address: ContractAddress,
+ community_id: u256
+ ) {
+ let community_comp = get_dep_component!(self, Community);
+ let (is_community_member, _) = community_comp
+ .is_community_member(profile_address, community_id);
+ let community_ban_status = community_comp.get_ban_status(profile_address, community_id);
+
+ assert(community_ban_status == false, BANNED_MEMBER);
+ assert(is_community_member == true, NOT_COMMUNITY_MEMBER);
+ }
}
}
diff --git a/tests/test_hub.cairo b/tests/test_hub.cairo
index 258e42a..c8f3a85 100644
--- a/tests/test_hub.cairo
+++ b/tests/test_hub.cairo
@@ -20,6 +20,7 @@ const ADDRESS2: felt252 = 53453;
const ADDRESS3: felt252 = 24252;
const ADDRESS4: felt252 = 24552;
const TEST_LOCAL_NAME: felt252 = 'user';
+const OWNER: felt252 = 2357;
// *************************************************************************
// SETUP
@@ -51,13 +52,21 @@ fn __setup__() -> (ContractAddress, ContractAddress, ContractAddress, ContractAd
// declare follownft
let follow_nft_classhash = declare("Follow").unwrap().contract_class();
+ let channel_nft_classhash = declare("ChannelNFT").unwrap().contract_class();
+ // declare community_nft
+
+ let community_nft_classhash = declare("CommunityNFT").unwrap().contract_class();
+
// deploy hub contract
let hub_class_hash = declare("KarstHub").unwrap().contract_class();
let mut calldata: Array = array![
nft_contract_address.into(),
handle_contract_address.into(),
handle_registry_contract_address.into(),
- (*follow_nft_classhash.class_hash).into()
+ (*follow_nft_classhash.class_hash).into(),
+ (*channel_nft_classhash.class_hash).into(),
+ (*community_nft_classhash.class_hash).into(),
+ OWNER
];
let (hub_contract_address, _) = hub_class_hash.deploy(@calldata).unwrap_syscall();
diff --git a/tests/test_publication.cairo b/tests/test_publication.cairo
index 7224b4e..8a1754c 100644
--- a/tests/test_publication.cairo
+++ b/tests/test_publication.cairo
@@ -6,10 +6,9 @@ use core::starknet::SyscallResultTrait;
use core::result::ResultTrait;
use core::traits::{TryInto, Into};
use starknet::{ContractAddress, get_block_timestamp};
-
use snforge_std::{
declare, start_cheat_caller_address, stop_cheat_caller_address, spy_events,
- EventSpyAssertionsTrait, ContractClassTrait, DeclareResultTrait, EventSpy
+ EventSpyAssertionsTrait, ContractClassTrait, DeclareResultTrait
};
use karst::publication::publication::PublicationComponent::{
Event as PublicationEvent, Post, CommentCreated, RepostCreated, Upvoted, Downvoted
@@ -17,6 +16,10 @@ use karst::publication::publication::PublicationComponent::{
use karst::mocks::interfaces::IComposable::{IComposableDispatcher, IComposableDispatcherTrait};
use karst::base::constants::types::{PostParams, RepostParams, CommentParams, PublicationType};
use karst::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatcherTrait};
+use karst::interfaces::ICommunity::{ICommunityDispatcher, ICommunityDispatcherTrait};
+use karst::interfaces::IChannel::{IChannelDispatcher, IChannelDispatcherTrait};
+use karst::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
+
const HUB_ADDRESS: felt252 = 'HUB';
const USER_ONE: felt252 = 'BOB';
@@ -25,22 +28,14 @@ const USER_THREE: felt252 = 'ROB';
const USER_FOUR: felt252 = 'DAN';
const USER_FIVE: felt252 = 'RANDY';
const USER_SIX: felt252 = 'JOE';
+const ADMIN: felt252 = 'ADMIN';
+
// *************************************************************************
// SETUP
// *************************************************************************
fn __setup__() -> (
- ContractAddress,
- ContractAddress,
- ContractAddress,
- felt252,
- felt252,
- ContractAddress,
- ContractAddress,
- ContractAddress,
- u256,
- EventSpy,
- felt252
+ ContractAddress, ContractAddress, ContractAddress, felt252, felt252, felt252, ContractAddress
) {
// deploy NFT
let nft_contract = declare("KarstNFT").unwrap().contract_class();
@@ -51,96 +46,45 @@ fn __setup__() -> (
// deploy registry
let registry_class_hash = declare("Registry").unwrap().contract_class();
let (registry_contract_address, _) = registry_class_hash.deploy(@array![]).unwrap_syscall();
-
// declare follownft
let follow_nft_classhash = declare("Follow").unwrap().contract_class();
-
- // deploy publication
+ // declare channel_nft
+ let channel_nft_classhash = declare("ChannelNFT").unwrap().contract_class();
+ // declare community_nft
+ let community_nft_classhash = declare("CommunityNFT").unwrap().contract_class();
+ // deploy publication preset
let publication_contract = declare("KarstPublication").unwrap().contract_class();
let mut publication_constructor_calldata = array![
- nft_contract_address.into(), HUB_ADDRESS, (*follow_nft_classhash.class_hash).into()
+ nft_contract_address.into(),
+ HUB_ADDRESS,
+ (*follow_nft_classhash.class_hash).into(),
+ (*channel_nft_classhash.class_hash).into(),
+ (*community_nft_classhash.class_hash).into(),
+ ADMIN
];
+
let (publication_contract_address, _) = publication_contract
.deploy(@publication_constructor_calldata)
.unwrap_syscall();
+ // deploy mock USDT
+ let usdt_contract = declare("USDT").unwrap().contract_class();
+ let (usdt_contract_address, _) = usdt_contract
+ .deploy(@array![1000000000000000000000, 0, USER_TWO])
+ .unwrap();
// declare account
let account_class_hash = declare("AccountV3").unwrap().contract_class();
//declare collectnft
let collect_nft_classhash = declare("CollectNFT").unwrap().contract_class();
-
- // create dispatcher
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
-
- // deploying karst Profile for USER 1
- start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- let user_one_profile_address = dispatcher
- .create_profile(
- nft_contract_address,
- (*registry_class_hash.class_hash).into(),
- (*account_class_hash.class_hash).into(),
- 2478
- );
- let content_URI: ByteArray = "ipfs://helloworld";
- let mut spy = spy_events();
- let user_one_first_post_pointed_pub_id = dispatcher
- .post(
- PostParams {
- content_URI: content_URI, profile_address: user_one_profile_address, channel_id: 0
- }
- );
- stop_cheat_caller_address(publication_contract_address);
-
- // deploying karst Profile for USER 2
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- let user_two_profile_address = dispatcher
- .create_profile(
- nft_contract_address,
- (*registry_class_hash.class_hash).into(),
- (*account_class_hash.class_hash).into(),
- 2479
- );
- let content_URI: ByteArray = "ipfs://helloworld";
- dispatcher
- .post(
- PostParams {
- content_URI: content_URI, profile_address: user_two_profile_address, channel_id: 0
- }
- );
- stop_cheat_caller_address(publication_contract_address);
-
- // deploying karst Profile for USER 3
- start_cheat_caller_address(publication_contract_address, USER_THREE.try_into().unwrap());
-
- let user_three_profile_address = dispatcher
- .create_profile(
- nft_contract_address,
- (*registry_class_hash.class_hash).into(),
- (*account_class_hash.class_hash).into(),
- 2480
- );
- let content_URI: ByteArray = "ipfs://helloworld";
- dispatcher
- .post(
- PostParams {
- content_URI: content_URI, profile_address: user_three_profile_address, channel_id: 0
- }
- );
- stop_cheat_caller_address(publication_contract_address);
-
return (
nft_contract_address,
registry_contract_address,
publication_contract_address,
(*registry_class_hash.class_hash).into(),
(*account_class_hash.class_hash).into(),
- user_one_profile_address,
- user_two_profile_address,
- user_three_profile_address,
- user_one_first_post_pointed_pub_id,
- spy,
- (*collect_nft_classhash.class_hash).into()
+ (*collect_nft_classhash.class_hash).into(),
+ usdt_contract_address
);
}
@@ -149,535 +93,976 @@ fn __setup__() -> (
// *************************************************************************
#[test]
-fn test_post() {
+fn test_post_community_post() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
-
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- let publication_type = dispatcher
- .get_publication_type(user_one_profile_address, user_one_first_post_pointed_pub_id);
-
- assert(publication_type == PublicationType::Post, 'invalid pub_type');
- assert(user_one_first_post_pointed_pub_id == 1_u256, 'invalid pub id');
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let _channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: 0,
+ community_id: community_id
+ }
+ );
+ assert(pub_assigned_id == 1, 'invalid_publication_id');
stop_cheat_caller_address(publication_contract_address);
}
#[test]
-fn test_upvote() {
+fn test_if_is_community_post() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- dispatcher.upvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
- stop_cheat_caller_address(publication_contract_address);
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let _channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: 0,
+ community_id: community_id
+ }
+ );
+ let post_community_id: u256 = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .community_id;
+ let post_channel_id: u256 = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .channel_id;
+ assert(community_id == post_community_id, 'invalid community_id');
+ assert(post_channel_id == 0, 'invalid channel_id ');
- let upvote_count = dispatcher
- .get_upvote_count(user_one_profile_address, user_one_first_post_pointed_pub_id);
- assert(upvote_count == 1, 'invalid upvote count');
+ stop_cheat_caller_address(publication_contract_address);
}
#[test]
-fn test_downvote() {
+fn test_community_censorship_post_status_tobe_true() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- start_cheat_caller_address(publication_contract_address, USER_FOUR.try_into().unwrap());
- dispatcher.downvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
- stop_cheat_caller_address(publication_contract_address);
- let downvote_count = dispatcher
- .get_downvote_count(user_one_profile_address, user_one_first_post_pointed_pub_id);
- assert(downvote_count == 1, 'invalid downvote count');
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let _channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: 0,
+ community_id: community_id
+ }
+ );
+ let approved_status: bool = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .approved;
+ assert(approved_status == true, 'invalid censorship status');
+
stop_cheat_caller_address(publication_contract_address);
}
-
#[test]
-fn test_upvote_event_emission() {
+fn test_community_censorship_post_status_tobe_false() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- spy,
- _
) =
__setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
- let mut spy = spy;
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- dispatcher.upvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
- let expected_event = PublicationEvent::Upvoted(
- Upvoted {
- publication_id: user_one_first_post_pointed_pub_id,
- transaction_executor: USER_ONE.try_into().unwrap(),
- block_timestamp: get_block_timestamp()
- }
- );
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ community_dispatcher.set_community_censorship_status(community_id, true);
+ // Check if community is created
+ let _channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: 0,
+ community_id: community_id
+ }
+ );
+ let approved_status: bool = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .approved;
+ assert(approved_status == false, 'invalid censorship status');
- spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
stop_cheat_caller_address(publication_contract_address);
}
+
#[test]
-fn test_downvote_event_emission() {
+fn test_channel_censorship_post_status_tobe_true() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- spy,
- _
) =
__setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
- let mut spy = spy;
- start_cheat_caller_address(publication_contract_address, USER_SIX.try_into().unwrap());
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- dispatcher.downvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
- let expected_event = PublicationEvent::Downvoted(
- Downvoted {
- publication_id: user_one_first_post_pointed_pub_id,
- transaction_executor: USER_SIX.try_into().unwrap(),
- block_timestamp: get_block_timestamp()
- }
- );
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: 0
+ }
+ );
+ let approved_status: bool = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .approved;
+ assert(approved_status == true, 'invalid censorship status');
- spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
stop_cheat_caller_address(publication_contract_address);
}
-
#[test]
-#[should_panic(expected: ('Karst: already react to post!',))]
-fn test_upvote_should_fail_if_user_already_upvoted() {
+fn test_channel_censorship_post_status_tobe_false() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+
+ channel_dispatcher.set_channel_censorship_status(channel_id, true);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: 0
+ }
+ );
+ let approved_status: bool = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .approved;
+ assert(approved_status == false, 'invalid censorship status');
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- dispatcher.upvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
- dispatcher.upvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
stop_cheat_caller_address(publication_contract_address);
}
#[test]
-#[should_panic(expected: ('Karst: already react to post!',))]
-fn test_downvote_should_fail_if_user_already_downvoted() {
+fn test_if_is_channel_post() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: 0
+ }
+ );
+ let post_community_id: u256 = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .community_id;
+ let post_channel_id: u256 = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
+ .channel_id;
+ assert(post_community_id == 0, 'invalid community_id');
+ assert(post_channel_id == channel_id, 'invalid channel_id ');
- start_cheat_caller_address(publication_contract_address, USER_FOUR.try_into().unwrap());
- dispatcher.downvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
- dispatcher.downvote(user_one_profile_address, user_one_first_post_pointed_pub_id);
stop_cheat_caller_address(publication_contract_address);
}
+// community_post
+#[should_panic(expected: ('Karst: Not a Community Member',))]
#[test]
-fn test_post_event_emission() {
+fn test_should_fail_if_user_is_not_a_community_member() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- spy,
- _
) =
__setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
- let mut spy = spy;
-
- let expected_event = PublicationEvent::Post(
- Post {
- post: PostParams {
- content_URI: "ipfs://helloworld",
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if channel is created
+ let _channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
profile_address: user_one_profile_address,
- channel_id: 0
- },
- publication_id: user_one_first_post_pointed_pub_id,
- transaction_executor: user_one_profile_address,
- block_timestamp: get_block_timestamp()
- }
- );
-
- spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
-}
-
-#[test]
-#[should_panic(expected: ('Karst: not profile owner!',))]
-fn test_posting_should_fail_if_not_profile_owner() {
- let (_, _, publication_contract_address, _, _, user_one_profile_address, _, _, _, _, _) =
- __setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ channel_id: 0,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- let content_URI = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/";
- dispatcher
+ let content_URI: ByteArray = "ipfs://helloworld";
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Attempt to post
+ let _pub_assigned_id = publication_dispatcher
.post(
PostParams {
- content_URI: content_URI, profile_address: user_one_profile_address, channel_id: 0
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: 0,
+ community_id: community_id
}
);
stop_cheat_caller_address(publication_contract_address);
}
+#[should_panic(expected: ('Karst: not channel member',))]
#[test]
-fn test_comment() {
+fn test_should_fail_if_user_is_not_a_channel_member() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- user_two_profile_address,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
-
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- let content_URI_1 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/";
- let content_URI_2 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/";
-
- // user comment on his own post
- let user_one_comment_assigned_pub_id_1 = dispatcher
- .comment(
- CommentParams {
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if channel is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
profile_address: user_one_profile_address,
- content_URI: content_URI_1,
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
- reference_pub_type: PublicationType::Comment,
+ channel_id: channel_id,
+ community_id: 0
}
);
stop_cheat_caller_address(publication_contract_address);
start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- // user two comment on user_one_post
- let user_two_comment_on_user_one_assigned_pub_id_2 = dispatcher
- .comment(
- CommentParams {
+ let content_URI: ByteArray = "ipfs://helloworld";
+ // Create profile
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Attempt to post
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
profile_address: user_two_profile_address,
- content_URI: content_URI_2,
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
- reference_pub_type: PublicationType::Comment,
+ channel_id: channel_id,
+ community_id: 0
}
);
stop_cheat_caller_address(publication_contract_address);
- let user_one_comment = dispatcher
- .get_publication(user_one_profile_address, user_one_comment_assigned_pub_id_1);
- let user_two_comment = dispatcher
- .get_publication(user_two_profile_address, user_two_comment_on_user_one_assigned_pub_id_2);
+ start_cheat_caller_address(publication_contract_address, USER_THREE.try_into().unwrap());
+ let content_URI: ByteArray = "ipfs://helloworld";
+ // Create profile
+ let user_three_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Attempt to post
+ community_dispatcher.join_community(community_id);
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_three_profile_address,
+ channel_id: channel_id,
+ community_id: 0
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
+}
- assert(
- user_one_comment.pointed_profile_address == user_one_profile_address,
- 'invalid pointed profile address'
- );
- assert(
- user_one_comment.pointed_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid pointed publication ID'
- );
- assert(
- user_one_comment.content_URI == "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/",
- 'invalid content URI'
- );
- assert(user_one_comment.pub_Type == PublicationType::Comment, 'invalid pub_type');
- assert(
- user_one_comment.root_profile_address == user_one_profile_address,
- 'invalid root profile address'
- );
- assert(
- user_one_comment.root_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid root publication ID'
- );
+#[test]
+fn test_post_channel_post() {
+ let (
+ nft_contract_address,
+ _,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ _,
+ _,
+ ) =
+ __setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
- assert(
- user_two_comment.pointed_profile_address == user_one_profile_address,
- 'invalid pointed profile address'
- );
- assert(
- user_two_comment.pointed_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid pointed publication ID'
- );
- assert(
- user_two_comment.content_URI == "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/",
- 'invalid content URI'
- );
- assert(user_two_comment.pub_Type == PublicationType::Comment, 'invalid pub_type');
- assert(
- user_two_comment.root_profile_address == user_one_profile_address,
- 'invalid root profile address'
- );
- assert(
- user_two_comment.root_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid root publication ID'
- );
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: 0
+ }
+ );
+ assert(pub_assigned_id == 1, 'invalid_publication_id');
+ stop_cheat_caller_address(publication_contract_address);
}
#[test]
-fn test_comment_event_emission() {
+fn test_upvote() {
let (
+ nft_contract_address,
+ _,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
+ ) =
+ __setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI2: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI2,
+ profile_address: user_two_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ publication_dispatcher
+ .upvote(
+ profile_address: user_two_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ let upvote_count = publication_dispatcher
+ .get_upvote_count(user_two_profile_address, pub_assigned_id);
+ assert(upvote_count == 1, 'invalid upvote count');
+ stop_cheat_caller_address(publication_contract_address);
+}
+
+#[test]
+fn test_downvote() {
+ let (
+ nft_contract_address,
+ _,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ _,
_,
+ ) =
+ __setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI2: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI2,
+ profile_address: user_two_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ publication_dispatcher
+ .downvote(
+ profile_address: user_two_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ let downvote_count = publication_dispatcher
+ .get_downvote_count(user_two_profile_address, pub_assigned_id);
+ assert(downvote_count == 1, 'invalid upvote count');
+ stop_cheat_caller_address(publication_contract_address);
+}
+#[test]
+fn test_upvote_event_emission() {
+ let (
+ nft_contract_address,
_,
- user_one_profile_address,
- user_two_profile_address,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
- user_one_first_post_pointed_pub_id,
- spy,
_
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- let mut spy = spy;
- let content_URI_1 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/";
+ let mut spy = spy_events();
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
- // user two comment on user_one_post
- let user_two_comment_on_user_one_assigned_pub_id_2 = dispatcher
- .comment(
- CommentParams {
- profile_address: user_two_profile_address,
- content_URI: content_URI_1,
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
- reference_pub_type: PublicationType::Comment,
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
}
);
stop_cheat_caller_address(publication_contract_address);
- let expected_event = PublicationEvent::CommentCreated(
- CommentCreated {
- commentParams: CommentParams {
- profile_address: user_two_profile_address,
- content_URI: "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/",
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
- reference_pub_type: PublicationType::Comment,
- },
- publication_id: user_two_comment_on_user_one_assigned_pub_id_2,
- transaction_executor: user_two_profile_address,
- block_timestamp: get_block_timestamp(),
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ publication_dispatcher
+ .upvote(
+ profile_address: user_one_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ let expected_event = PublicationEvent::Upvoted(
+ Upvoted {
+ publication_id: pub_assigned_id,
+ transaction_executor: USER_TWO.try_into().unwrap(),
+ block_timestamp: get_block_timestamp()
}
);
+ spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
+ stop_cheat_caller_address(publication_contract_address);
+}
+
+#[test]
+fn test_downvote_event_emission() {
+ let (
+ nft_contract_address,
+ _,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ _,
+ _
+ ) =
+ __setup__();
+ let mut spy = spy_events();
+
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ publication_dispatcher
+ .downvote(
+ profile_address: user_one_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ let expected_event = PublicationEvent::Downvoted(
+ Downvoted {
+ publication_id: pub_assigned_id,
+ transaction_executor: USER_TWO.try_into().unwrap(),
+ block_timestamp: get_block_timestamp()
+ }
+ );
spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
+ stop_cheat_caller_address(publication_contract_address);
}
#[test]
-fn test_nested_comments() {
+#[should_panic(expected: ('Karst: already react to post!',))]
+fn test_upvote_should_fail_if_user_already_upvoted() {
let (
+ nft_contract_address,
+ _,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ _,
_,
+ ) =
+ __setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI2: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI2,
+ profile_address: user_two_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ publication_dispatcher
+ .upvote(
+ profile_address: user_two_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ publication_dispatcher
+ .upvote(
+ profile_address: user_two_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ stop_cheat_caller_address(publication_contract_address);
+}
+
+#[test]
+#[should_panic(expected: ('Karst: already react to post!',))]
+fn test_downvote_should_fail_if_user_already_downvoted() {
+ let (
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ _,
_,
+ ) =
+ __setup__();
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI2: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI2,
+ profile_address: user_two_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ publication_dispatcher
+ .downvote(
+ profile_address: user_two_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ publication_dispatcher
+ .downvote(
+ profile_address: user_two_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ );
+ stop_cheat_caller_address(publication_contract_address);
+}
+
+#[test]
+fn test_post_event_emission() {
+ let (
+ nft_contract_address,
_,
- user_one_profile_address,
- user_two_profile_address,
- user_three_profile_address,
- user_one_first_post_pointed_pub_id,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let mut spy = spy_events();
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- let content_URI_1 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/";
- let content_URI_2 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/";
- let content_URI_3 = "ipfs://VmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewUhje/";
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
- // user 2 comments on post
- let user_two_comment_assigned_pub_id = dispatcher
- .comment(
- CommentParams {
- profile_address: user_two_profile_address,
- content_URI: content_URI_1,
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
- reference_pub_type: PublicationType::Comment,
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
}
);
+ let expected_event = PublicationEvent::Post(
+ Post {
+ post: PostParams {
+ content_URI: "ipfs://helloworld",
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ },
+ publication_id: pub_assigned_id,
+ transaction_executor: user_one_profile_address,
+ block_timestamp: get_block_timestamp()
+ }
+ );
+
+ spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
stop_cheat_caller_address(publication_contract_address);
+}
- // user three comments under user one's comment
- start_cheat_caller_address(publication_contract_address, USER_THREE.try_into().unwrap());
- let user_three_comment_assigned_pub_id = dispatcher
- .comment(
- CommentParams {
- profile_address: user_three_profile_address,
- content_URI: content_URI_2,
- pointed_profile_address: user_two_profile_address,
- pointed_pub_id: user_two_comment_assigned_pub_id,
- reference_pub_type: PublicationType::Comment,
+
+#[test]
+fn test_comment() {
+ let (
+ nft_contract_address,
+ _,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ _,
+ _,
+ ) =
+ __setup__();
+
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
}
);
stop_cheat_caller_address(publication_contract_address);
- // user one comments under user three's comment
- start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- let user_one_comment_assigned_pub_id = dispatcher
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ let content_URI_1 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/";
+
+ let user_one_comment_assigned_pub_id_1 = publication_dispatcher
.comment(
CommentParams {
- profile_address: user_one_profile_address,
- content_URI: content_URI_3,
- pointed_profile_address: user_three_profile_address,
- pointed_pub_id: user_three_comment_assigned_pub_id,
+ profile_address: user_two_profile_address,
+ content_URI: content_URI_1,
+ pointed_profile_address: user_one_profile_address,
+ pointed_pub_id: pub_assigned_id,
reference_pub_type: PublicationType::Comment,
+ channel_id: channel_id,
+ community_id: community_id
}
);
stop_cheat_caller_address(publication_contract_address);
- let user_two_comment = dispatcher
- .get_publication(user_two_profile_address, user_two_comment_assigned_pub_id);
- let user_three_comment = dispatcher
- .get_publication(user_three_profile_address, user_three_comment_assigned_pub_id);
- let user_one_comment = dispatcher
- .get_publication(user_one_profile_address, user_one_comment_assigned_pub_id);
-
- assert(
- user_two_comment.pointed_profile_address == user_one_profile_address,
- 'invalid pointed profile address'
- );
- assert(
- user_two_comment.pointed_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid pointed publication ID'
- );
- assert(
- user_two_comment.content_URI == "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/",
- 'invalid content URI'
- );
- assert(user_two_comment.pub_Type == PublicationType::Comment, 'invalid pub_type');
- assert(
- user_two_comment.root_profile_address == user_one_profile_address,
- 'invalid root profile address'
- );
- assert(
- user_two_comment.root_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid root publication ID'
- );
-
- assert(
- user_three_comment.pointed_profile_address == user_two_profile_address,
- 'invalid pointed profile address'
- );
- assert(
- user_three_comment.pointed_pub_id == user_two_comment_assigned_pub_id,
- 'invalid pointed publication ID'
- );
- assert(
- user_three_comment.content_URI == "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/",
- 'invalid content URI'
- );
- assert(user_three_comment.pub_Type == PublicationType::Comment, 'invalid pub_type');
- assert(
- user_three_comment.root_profile_address == user_one_profile_address,
- 'invalid root profile address'
- );
- assert(
- user_three_comment.root_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid root publication ID'
- );
+ let user_one_comment = publication_dispatcher
+ .get_publication(user_two_profile_address, user_one_comment_assigned_pub_id_1);
assert(
- user_one_comment.pointed_profile_address == user_three_profile_address,
+ user_one_comment.pointed_profile_address == user_one_profile_address,
'invalid pointed profile address'
);
+ assert(user_one_comment.pointed_pub_id == pub_assigned_id, 'invalid pointed publication ID');
assert(
- user_one_comment.pointed_pub_id == user_three_comment_assigned_pub_id,
- 'invalid pointed publication ID'
- );
- assert(
- user_one_comment.content_URI == "ipfs://VmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewUhje/",
+ user_one_comment.content_URI == "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/",
'invalid content URI'
);
assert(user_one_comment.pub_Type == PublicationType::Comment, 'invalid pub_type');
@@ -685,163 +1070,218 @@ fn test_nested_comments() {
user_one_comment.root_profile_address == user_one_profile_address,
'invalid root profile address'
);
- assert(
- user_one_comment.root_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid root publication ID'
- );
+ assert(user_one_comment.root_pub_id == pub_assigned_id, 'invalid root publication ID');
}
#[test]
-#[should_panic(expected: ('Karst: not profile owner!',))]
-fn test_commenting_should_fail_if_not_profile_owner() {
+fn test_comment_event_emission() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
- _,
- _,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
+ registry_class_hash,
+ account_class_hash,
_,
_
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let mut spy = spy_events();
+
+ let content_URI_1 = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/";
+
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- let content_URI = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/";
- dispatcher
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ let user_two_comment_on_user_one_assigned_pub_id = publication_dispatcher
.comment(
CommentParams {
- profile_address: user_one_profile_address,
- content_URI: content_URI,
+ profile_address: user_two_profile_address,
+ content_URI: content_URI_1,
pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
+ pointed_pub_id: pub_assigned_id,
reference_pub_type: PublicationType::Comment,
+ channel_id: channel_id,
+ community_id: community_id
}
);
stop_cheat_caller_address(publication_contract_address);
+
+ let expected_event = PublicationEvent::CommentCreated(
+ CommentCreated {
+ commentParams: CommentParams {
+ profile_address: user_two_profile_address,
+ content_URI: "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZysddewga/",
+ pointed_profile_address: user_one_profile_address,
+ pointed_pub_id: pub_assigned_id,
+ reference_pub_type: PublicationType::Comment,
+ channel_id: channel_id,
+ community_id: community_id
+ },
+ publication_id: user_two_comment_on_user_one_assigned_pub_id,
+ transaction_executor: user_two_profile_address,
+ block_timestamp: get_block_timestamp(),
+ }
+ );
+
+ spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
}
+
#[test]
-#[should_panic(expected: ('Karst: unsupported pub type!',))]
-fn test_as_reference_pub_params_should_fail_on_wrong_pub_type() {
+fn test_repost() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- let content_URI = "ipfs://QmSkDCsS32eLpcymxtn1cEn7Rc5hfefLBgfvZyjaryrga/";
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
- // user comments on his own post
- dispatcher
- .comment(
- CommentParams {
- profile_address: user_one_profile_address,
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
content_URI: content_URI,
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
- reference_pub_type: PublicationType::Repost,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
}
);
-
stop_cheat_caller_address(publication_contract_address);
-}
-
-#[test]
-fn test_repost() {
- let (
- _,
- _,
- publication_contract_address,
- _,
- _,
- user_one_profile_address,
- user_two_profile_address,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
- ) =
- __setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
let repost_params = RepostParams {
profile_address: user_two_profile_address,
pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
+ pointed_pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id
};
-
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- let pub_assigned_id = dispatcher.repost(repost_params);
+ let pub_assigned_id = publication_dispatcher.repost(repost_params);
stop_cheat_caller_address(publication_contract_address);
// get the repost publication
- let user_repost = dispatcher.get_publication(user_two_profile_address, pub_assigned_id);
+ let user_repost = publication_dispatcher
+ .get_publication(user_two_profile_address, pub_assigned_id);
assert(
user_repost.pointed_profile_address == user_one_profile_address,
'invalid pointed profile address'
);
- assert(
- user_repost.pointed_pub_id == user_one_first_post_pointed_pub_id,
- 'invalid pointed publication ID'
- );
+ assert(user_repost.pointed_pub_id == pub_assigned_id, 'invalid pointed publication ID');
assert(user_repost.content_URI == "ipfs://helloworld", 'invalid content URI');
assert(user_repost.pub_Type == PublicationType::Repost, 'invalid pub_type');
assert(
user_repost.root_profile_address == user_one_profile_address, 'invalid root profile address'
);
- assert(
- user_repost.root_pub_id == user_one_first_post_pointed_pub_id, 'invalid root publication ID'
- );
+ assert(user_repost.root_pub_id == pub_assigned_id, 'invalid root publication ID');
}
#[test]
fn test_repost_event_emission() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
- _,
- user_one_profile_address,
- user_two_profile_address,
- _,
- user_one_first_post_pointed_pub_id,
- spy,
_
) =
__setup__();
+ let mut spy = spy_events();
+
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let post_pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
let mut spy = spy;
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
let repost_params = RepostParams {
profile_address: user_two_profile_address,
pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
+ pointed_pub_id: post_pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id
};
-
- start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- let pub_assigned_id = dispatcher.repost(repost_params);
+ let pub_assigned_id = publication_dispatcher.repost(repost_params);
stop_cheat_caller_address(publication_contract_address);
// get the repost publication
- let user_repost = dispatcher.get_publication(user_two_profile_address, pub_assigned_id);
+ let user_repost = publication_dispatcher
+ .get_publication(user_two_profile_address, pub_assigned_id);
let expected_event = PublicationEvent::RepostCreated(
RepostCreated {
@@ -849,6 +1289,8 @@ fn test_repost_event_emission() {
profile_address: user_two_profile_address,
pointed_profile_address: user_repost.pointed_profile_address,
pointed_pub_id: user_repost.pointed_pub_id,
+ channel_id: channel_id,
+ community_id: community_id
},
publication_id: pub_assigned_id,
transaction_executor: user_two_profile_address,
@@ -859,158 +1301,380 @@ fn test_repost_event_emission() {
spy.assert_emitted(@array![(publication_contract_address, expected_event)]);
}
+
#[test]
-#[should_panic(expected: ('Karst: not profile owner!',))]
-fn test_reposting_should_fail_if_not_profile_owner() {
+fn test_get_publication_content_uri() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- user_two_profile_address,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- let repost_params = RepostParams {
- profile_address: user_two_profile_address,
- pointed_profile_address: user_one_profile_address,
- pointed_pub_id: user_one_first_post_pointed_pub_id,
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
};
-
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
- dispatcher.repost(repost_params);
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ let content_uri = publication_dispatcher
+ .get_publication_content_uri(user_one_profile_address, pub_assigned_id);
+ assert(content_uri == "ipfs://helloworld", 'invalid uri');
stop_cheat_caller_address(publication_contract_address);
}
#[test]
-fn test_get_publication_content_uri() {
+fn test_get_publication_type() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
- let content_uri = dispatcher
- .get_publication_content_uri(user_one_profile_address, user_one_first_post_pointed_pub_id);
- assert(content_uri == "ipfs://helloworld", 'invalid uri');
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ let pub_type = publication_dispatcher
+ .get_publication_type(user_one_profile_address, pub_assigned_id);
+ assert(pub_type == PublicationType::Post, 'invalid pub type');
+ stop_cheat_caller_address(publication_contract_address);
}
#[test]
-fn test_get_publication_type() {
+#[should_panic(expected: ('Karst: Profile is banned!',))]
+fn test_should_fail_if_banned_profile_from_posting() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
_,
- user_one_profile_address,
+ ) =
+ __setup__();
+
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ let content_URI2: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ stop_cheat_caller_address(publication_contract_address);
+
+ //set ban
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let mut profiles = ArrayTrait::new();
+ profiles.append(USER_TWO.try_into().unwrap());
+ let mut ban_statuses = ArrayTrait::new();
+ ban_statuses.append(true);
+ community_dispatcher.set_ban_status(community_id, profiles, ban_statuses);
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI2,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
+}
+
+#[test]
+#[should_panic(expected: ('Karst: Not a Community Member',))]
+fn test_should_fail_if_not_community_member_while_posting() {
+ let (
+ nft_contract_address,
_,
+ publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
- user_one_first_post_pointed_pub_id,
_,
- _
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+ let content_URI2: ByteArray = "ipfs://helloworld!";
- let pub_type = dispatcher
- .get_publication_type(user_one_profile_address, user_one_first_post_pointed_pub_id);
- assert(pub_type == PublicationType::Post, 'invalid pub type');
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ let community_id = community_dispatcher.create_community();
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 24998);
+ let _pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI2,
+ profile_address: user_two_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
}
#[test]
fn test_tip() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
_,
- _,
- user_one_profile_address,
- _,
- _,
- user_one_first_post_pointed_pub_id,
- _,
- _
+ erc20_contract_address
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let erc20_dispatcher = IERC20Dispatcher { contract_address: erc20_contract_address };
+ let content_URI: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
+ // USER_TWO joins community
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let _user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ stop_cheat_caller_address(publication_contract_address);
+
+ start_cheat_caller_address(erc20_contract_address, USER_TWO.try_into().unwrap());
+ // approve contract to spend amount
+ erc20_dispatcher.approve(publication_contract_address, 2000000000000000000);
+ stop_cheat_caller_address(erc20_contract_address);
+
start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
- dispatcher.tip(user_one_profile_address, user_one_first_post_pointed_pub_id, 100);
- let tipped_amount = dispatcher
- .get_tipped_amount(user_one_profile_address, user_one_first_post_pointed_pub_id);
- assert(tipped_amount == 100, 'invalid amount');
+ publication_dispatcher
+ .tip(
+ profile_address: user_one_profile_address,
+ pub_id: pub_assigned_id,
+ amount: 2000000000000000000,
+ channel_id: channel_id,
+ community_id: community_id,
+ erc20_contract_address: erc20_contract_address
+ );
+ stop_cheat_caller_address(publication_contract_address);
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ let tip_amount = IComposableDispatcher { contract_address: publication_contract_address }
+ .get_tipped_amount(user_one_profile_address, pub_assigned_id);
+ let jolt_balance = IERC20Dispatcher { contract_address: erc20_contract_address }
+ .balance_of(user_one_profile_address);
+ assert(tip_amount == 2000000000000000000, 'invalid tip_amount');
+ assert(jolt_balance == 2000000000000000000, 'invalid amount');
stop_cheat_caller_address(publication_contract_address);
}
#[test]
fn test_collect() {
let (
- _,
+ nft_contract_address,
_,
publication_contract_address,
+ registry_class_hash,
+ account_class_hash,
+ collect_nft_classhash,
_,
- _,
- user_one_profile_address,
- user_two_profile_address,
- user_three_profile_address,
- user_one_first_post_pointed_pub_id,
- _,
- collect_nft_classhash
) =
__setup__();
- let dispatcher = IComposableDispatcher { contract_address: publication_contract_address };
- start_cheat_caller_address(publication_contract_address, user_two_profile_address);
- // Case 1: First collection, expecting new deployment
- let token_id = dispatcher
+
+ let publication_dispatcher = IComposableDispatcher {
+ contract_address: publication_contract_address
+ };
+ let channel_dispatcher = IChannelDispatcher { contract_address: publication_contract_address };
+ let community_dispatcher = ICommunityDispatcher {
+ contract_address: publication_contract_address
+ };
+ let content_URI: ByteArray = "ipfs://helloworld";
+
+ start_cheat_caller_address(publication_contract_address, USER_ONE.try_into().unwrap());
+ // Create profile
+ let user_one_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ // Check if community is created
+ let community_id = community_dispatcher.create_community();
+ // Check if community is created
+ let channel_id = channel_dispatcher.create_channel(community_id);
+ // Attempt to post
+ let pub_assigned_id = publication_dispatcher
+ .post(
+ PostParams {
+ content_URI: content_URI,
+ profile_address: user_one_profile_address,
+ channel_id: channel_id,
+ community_id: community_id
+ }
+ );
+ stop_cheat_caller_address(publication_contract_address);
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ let _user_two_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ stop_cheat_caller_address(publication_contract_address);
+
+ start_cheat_caller_address(publication_contract_address, USER_THREE.try_into().unwrap());
+ let _user_three_profile_address = publication_dispatcher
+ .create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2478);
+ community_dispatcher.join_community(community_id);
+ channel_dispatcher.join_channel(channel_id);
+ stop_cheat_caller_address(publication_contract_address);
+
+ start_cheat_caller_address(publication_contract_address, USER_TWO.try_into().unwrap());
+ // // Case 1: First collection, expecting new deployment
+ let token_id = publication_dispatcher
.collect(
- HUB_ADDRESS.try_into().unwrap(),
- user_one_profile_address,
- user_one_first_post_pointed_pub_id,
- collect_nft_classhash,
- 23465
- );
- let collect_nft1 = dispatcher
- .get_publication(user_one_profile_address, user_one_first_post_pointed_pub_id)
+ profile_address: user_one_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ collect_nft_impl_class_hash: collect_nft_classhash,
+ );
+ let collect_nft1 = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
.collect_nft;
let collect_dispatcher = ICollectNFTDispatcher { contract_address: collect_nft1 };
- let user2_token_id = collect_dispatcher.get_user_token_id(user_two_profile_address);
+ let user2_token_id = collect_dispatcher.get_user_token_id(USER_TWO.try_into().unwrap());
assert(token_id == user2_token_id, 'invalid token_id');
stop_cheat_caller_address(publication_contract_address);
- start_cheat_caller_address(publication_contract_address, user_three_profile_address);
- // Case 2: collect the same publication, expecting reuse of the existing contract
- let token_id2 = dispatcher
+ start_cheat_caller_address(publication_contract_address, USER_THREE.try_into().unwrap());
+ // // Case 2: collect the same publication, expecting reuse of the existing contract
+ let token_id2 = publication_dispatcher
.collect(
- HUB_ADDRESS.try_into().unwrap(),
- user_one_profile_address,
- user_one_first_post_pointed_pub_id,
- collect_nft_classhash,
- 234657
- );
- let collect_nft2 = dispatcher
- .get_publication(user_one_profile_address, user_one_first_post_pointed_pub_id)
+ profile_address: user_one_profile_address,
+ pub_id: pub_assigned_id,
+ channel_id: channel_id,
+ community_id: community_id,
+ collect_nft_impl_class_hash: collect_nft_classhash,
+ );
+ let collect_nft2 = publication_dispatcher
+ .get_publication(user_one_profile_address, pub_assigned_id)
.collect_nft;
let collect_dispatcher = ICollectNFTDispatcher { contract_address: collect_nft2 };
- let user3_token_id = collect_dispatcher.get_user_token_id(user_three_profile_address);
+ let user3_token_id = collect_dispatcher.get_user_token_id(USER_THREE.try_into().unwrap());
assert(collect_nft1 == collect_nft2, 'invalid_ address');
assert(token_id2 == user3_token_id, 'invalid token_id');
stop_cheat_caller_address(publication_contract_address);
}
+
From 33318255f95c754da58e3719c964a8caf35542ff Mon Sep 17 00:00:00 2001
From: Adegbite Ademola Kelvin
Date: Thu, 24 Oct 2024 15:06:03 +0100
Subject: [PATCH 2/2] chore: rename projects files and add publication review
---
.all-contributorsrc | 2 +-
CODE_OF_CONDUCT.md | 4 +-
CONTRIBUTING.md | 12 +--
README.md | 16 ++--
Scarb.lock | 2 +-
Scarb.toml | 6 +-
scripts/package.json | 2 +-
scripts/readme.md | 4 +-
scripts/src/abi/handle.json | 2 +-
scripts/src/abi/handleRegistry.json | 2 +-
scripts/src/abi/hub.json | 2 +-
scripts/src/abi/karstnft.json | 2 +-
scripts/src/abi/profile.json | 2 +-
scripts/src/abi/publication.json | 2 +-
scripts/src/contracts/handle.ts | 4 +-
scripts/src/contracts/hub.ts | 4 +-
scripts/src/contracts/profile.ts | 4 +-
scripts/src/helpers/constants.ts | 4 +-
src/base/constants/errors.cairo | 82 ++++++++---------
src/base/constants/types.cairo | 2 +-
src/base/token_uris/follow_token_uri.cairo | 6 +-
src/base/token_uris/handle_token_uri.cairo | 6 +-
src/base/token_uris/profile_token_uri.cairo | 4 +-
src/base/token_uris/traits/background.cairo | 2 +-
src/base/token_uris/traits/beard.cairo | 2 +-
src/base/token_uris/traits/cloth.cairo | 2 +-
src/base/token_uris/traits/color.cairo | 2 +-
src/base/token_uris/traits/eyeacessory.cairo | 4 +-
src/base/token_uris/traits/eyebrows.cairo | 4 +-
src/base/token_uris/traits/eyecolor.cairo | 4 +-
src/base/token_uris/traits/follow.cairo | 6 +-
src/base/token_uris/traits/glass.cairo | 2 +-
src/base/token_uris/traits/handle.cairo | 6 +-
src/base/token_uris/traits/head.cairo | 2 +-
src/base/token_uris/traits/profile.cairo | 10 +--
src/base/utils/base64_extended.cairo | 2 +-
src/base/utils/hubrestricted.cairo | 2 +-
src/channel/channel.cairo | 10 +--
src/channel/channelNFT.cairo | 8 +-
src/coloniznft.cairo | 1 +
.../coloniznft.cairo} | 18 ++--
src/community/community.cairo | 10 +--
src/community/communitynft.cairo | 8 +-
src/follownft/follownft.cairo | 20 ++---
src/hub/hub.cairo | 38 ++++----
src/interfaces.cairo | 2 +-
src/interfaces/IChannel.cairo | 2 +-
.../{IKarstNFT.cairo => IColonizNFT.cairo} | 6 +-
src/interfaces/ICommunity.cairo | 2 +-
src/interfaces/IFollowNFT.cairo | 2 +-
src/interfaces/IHub.cairo | 4 +-
src/interfaces/IJolt.cairo | 2 +-
src/interfaces/IProfile.cairo | 6 +-
src/interfaces/IPublication.cairo | 24 ++---
src/jolt/jolt.cairo | 4 +-
src/karstnft.cairo | 1 -
src/lib.cairo | 2 +-
src/mocks/interfaces/IChannelComposable.cairo | 6 +-
src/mocks/interfaces/IComposable.cairo | 24 ++---
src/mocks/interfaces/IJoltUpgrade.cairo | 2 +-
src/namespaces/handle_registry.cairo | 8 +-
src/namespaces/handles.cairo | 12 +--
src/presets/channel.cairo | 12 +--
src/presets/community.cairo | 8 +-
src/presets/jolt.cairo | 2 +-
src/presets/profile.cairo | 10 +--
src/presets/publication.cairo | 24 ++---
src/profile/profile.cairo | 40 +++++----
src/publication/collectnft.cairo | 20 ++---
src/publication/publication.cairo | 53 +++++------
tests/test_channel.cairo | 38 ++++----
...t_karstnft.cairo => test_coloniznft.cairo} | 32 +++----
tests/test_community.cairo | 48 +++++-----
tests/test_follownft.cairo | 24 ++---
tests/test_handle.cairo | 35 ++++----
tests/test_handle_registry.cairo | 18 ++--
tests/test_hub.cairo | 16 ++--
tests/test_jolt.cairo | 32 +++----
tests/test_profile.cairo | 26 +++---
tests/test_profile_token_uri.cairo | 2 +-
tests/test_publication.cairo | 88 +++++--------------
81 files changed, 453 insertions(+), 523 deletions(-)
create mode 100644 src/coloniznft.cairo
rename src/{karstnft/karstnft.cairo => coloniznft/coloniznft.cairo} (92%)
rename src/interfaces/{IKarstNFT.cairo => IColonizNFT.cairo} (88%)
delete mode 100644 src/karstnft.cairo
rename tests/{test_karstnft.cairo => test_coloniznft.cairo} (71%)
diff --git a/.all-contributorsrc b/.all-contributorsrc
index 35ada0f..fe049b1 100644
--- a/.all-contributorsrc
+++ b/.all-contributorsrc
@@ -1,5 +1,5 @@
{
- "projectName": "karst-core",
+ "projectName": "coloniz-core",
"projectOwner": "horuslabsio",
"files": [
"README.md"
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md
index 4d5bada..59f5739 100644
--- a/CODE_OF_CONDUCT.md
+++ b/CODE_OF_CONDUCT.md
@@ -1,8 +1,8 @@
-# KARST Code of Conduct
+# coloniz Code of Conduct
## Preamble
-The KARST Community was created to foster an open, innovative and inclusive community around open source development.
+The coloniz Community was created to foster an open, innovative and inclusive community around open source development.
To clarify expected behaviour in our community we have adopted the Contributor Covenant. This code of conduct
has been adopted by many other open source communities and we feel it expresses our values well.
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index bf1ce36..033ad1c 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,18 +1,18 @@
-# Contributing to KARST
+# Contributing to coloniz
-The KARST team maintains guidelines for contributing to the KARST project repository.
+The coloniz team maintains guidelines for contributing to the coloniz project repository.
### Code of Conduct
-Have you read the [code of conduct](https://github.com/horuslabsio/karst-core/blob/master/CODE_OF_CONDUCT.md)?
+Have you read the [code of conduct](https://github.com/horuslabsio/coloniz-core/blob/master/CODE_OF_CONDUCT.md)?
## Bugs and Feature Request
-Before you make your changes, check to see if an [issue](https://github.com/horuslabsio/karst-coreissues) exists already for the change you want to make.
+Before you make your changes, check to see if an [issue](https://github.com/horuslabsio/coloniz-coreissues) exists already for the change you want to make.
### Don't see your issue? Open one
-If you spot something new, open an issue using a [template](https://github.com/horuslabsio/karst-core/issues/new/choose). We'll use the issue to have a conversation about the problem you want to fix.
+If you spot something new, open an issue using a [template](https://github.com/horuslabsio/coloniz-core/issues/new/choose). We'll use the issue to have a conversation about the problem you want to fix.
### Open a Pull Request
@@ -34,7 +34,7 @@ Please do:
- **DO** give priority to the current style of the project or file you're changing even if it diverges from the general guidelines.
- **DO** include tests when adding new features. When fixing bugs, start with adding a test that highlights how the current behavior is broken.
-- **DO** especially follow our rules in the [Contributing](https://github.com/horuslabsio/karst-core/master/CODE_OF_CONDUCT.md#contributing) section of our code of conduct.
+- **DO** especially follow our rules in the [Contributing](https://github.com/horuslabsio/coloniz-core/master/CODE_OF_CONDUCT.md#contributing) section of our code of conduct.
Please do not:
diff --git a/README.md b/README.md
index bebe419..f918f91 100644
--- a/README.md
+++ b/README.md
@@ -10,9 +10,9 @@
-Karst is a permissionless and composable social graph built on Starknet, empowering creators to own every part of their social experience.
+coloniz 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.
+With coloniz, 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:
@@ -22,8 +22,8 @@ You will need to have Scarb and Starknet Foundry installed on your system. Refer
To use this repository, first clone it:
```
-git clone git@github.com:horuslabsio/karst-core.git
-cd karst-core
+git clone git@github.com:horuslabsio/coloniz-core.git
+cd coloniz-core
```
### Building contracts
@@ -48,22 +48,22 @@ For more information on writing and running tests, refer to the [Starknet-Foundr
## Contributing
-BEFORE you start work on a feature or fix, please read and follow our [contribution guide](https://github.com/horuslabsio/karst-core/blob/master/CONTRIBUTING.md) to help avoid any wasted or duplicate effort.
+BEFORE you start work on a feature or fix, please read and follow our [contribution guide](https://github.com/horuslabsio/coloniz-core/blob/master/CONTRIBUTING.md) to help avoid any wasted or duplicate effort.
## Security
-If you believe you have found a security vulnerability in our code, please report it to us as described in our [security policy](https://github.com/horuslabsio/karst-core/blob/master/SECURITY.md).
+If you believe you have found a security vulnerability in our code, please report it to us as described in our [security policy](https://github.com/horuslabsio/coloniz-core/blob/master/SECURITY.md).
## License
-KARST is an open-source software licensed under the [MIT](https://github.com/horuslabsio/karst-core/blob/master/LICENSE.md).
+coloniz is an open-source software licensed under the [MIT](https://github.com/horuslabsio/coloniz-core/blob/master/LICENSE.md).
## Architecture
Check out the contract architecture below, and join our [working group](https://t.me/+DFfuHjLkeXlkNTg0).
-
+
## Contributors
diff --git a/Scarb.lock b/Scarb.lock
index 3cc7b9f..7bc96ec 100644
--- a/Scarb.lock
+++ b/Scarb.lock
@@ -54,7 +54,7 @@ dependencies = [
]
[[package]]
-name = "karst"
+name = "coloniz"
version = "0.1.0"
dependencies = [
"alexandria_bytes",
diff --git a/Scarb.toml b/Scarb.toml
index 9cd0427..8a041ae 100644
--- a/Scarb.toml
+++ b/Scarb.toml
@@ -1,11 +1,11 @@
[package]
-name = "karst"
+name = "coloniz"
version = "0.1.0"
edition = "2024_07"
authors = ["Horus Labs "]
description = "Decentralized Social Graph on Starknet"
-repository = "https://github.com/horuslabsio/karst-core"
-keywords = ["Karst", "SocialFi", "tokenbound", "cairo", "contracts", "starknet"]
+repository = "https://github.com/horuslabsio/coloniz-core"
+keywords = ["coloniz", "SocialFi", "tokenbound", "cairo", "contracts", "starknet"]
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html
diff --git a/scripts/package.json b/scripts/package.json
index 636ddb0..1769fb7 100644
--- a/scripts/package.json
+++ b/scripts/package.json
@@ -1,5 +1,5 @@
{
- "name": "karst_scripts",
+ "name": "coloniz_scripts",
"version": "1.0.0",
"type": "module",
"main": "index.ts",
diff --git a/scripts/readme.md b/scripts/readme.md
index df3a51f..b75fd3f 100644
--- a/scripts/readme.md
+++ b/scripts/readme.md
@@ -1,6 +1,6 @@
-# Karst Deployment Script
+# coloniz Deployment Script
-This script facilitates the deployment of contracts within the Karst project. Follow the steps below to set up and run the deployment script for your desired contract.
+This script facilitates the deployment of contracts within the coloniz project. Follow the steps below to set up and run the deployment script for your desired contract.
## Prerequisites
diff --git a/scripts/src/abi/handle.json b/scripts/src/abi/handle.json
index 67a89f3..6cb7ba5 100644
--- a/scripts/src/abi/handle.json
+++ b/scripts/src/abi/handle.json
@@ -1 +1 @@
-[{"type":"impl","name":"HandlesImpl","interface_name":"karst::interfaces::IHandle::IHandle"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"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":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"type":"interface","name":"karst::interfaces::IHandle::IHandle","items":[{"type":"function","name":"mint_handle","inputs":[{"name":"address","type":"core::starknet::contract_address::ContractAddress"},{"name":"local_name","type":"core::felt252"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"burn_handle","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_namespace","inputs":[],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"get_local_name","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"get_handle","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"exists","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"},{"type":"function","name":"total_supply","inputs":[],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_token_id","inputs":[{"name":"local_name","type":"core::felt252"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"name","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"symbol","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"token_uri","inputs":[{"name":"token_id","type":"core::integer::u256"},{"name":"local_name","type":"core::felt252"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"}]},{"type":"impl","name":"SRC5Impl","interface_name":"openzeppelin_introspection::interface::ISRC5"},{"type":"interface","name":"openzeppelin_introspection::interface::ISRC5","items":[{"type":"function","name":"supports_interface","inputs":[{"name":"interface_id","type":"core::felt252"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721Impl","interface_name":"openzeppelin_token::erc721::interface::IERC721"},{"type":"struct","name":"core::array::Span::","members":[{"name":"snapshot","type":"@core::array::Array::"}]},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721","items":[{"type":"function","name":"balance_of","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"owner_of","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safe_transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"approve","inputs":[{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"set_approval_for_all","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_approved","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"is_approved_for_all","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721CamelOnlyImpl","interface_name":"openzeppelin_token::erc721::interface::IERC721CamelOnly"},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721CamelOnly","items":[{"type":"function","name":"balanceOf","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"ownerOf","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safeTransferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"setApprovalForAll","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"getApproved","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"isApprovedForAll","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"OwnableImpl","interface_name":"openzeppelin_access::ownable::interface::IOwnable"},{"type":"interface","name":"openzeppelin_access::ownable::interface::IOwnable","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":"constructor","name":"constructor","inputs":[{"name":"admin","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"struct","members":[{"name":"from","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"to","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::bool","kind":"data"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"enum","variants":[{"name":"Transfer","type":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"nested"},{"name":"Approval","type":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"nested"},{"name":"ApprovalForAll","type":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"nested"}]},{"type":"event","name":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"enum","variants":[]},{"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":"karst::namespaces::handles::Handles::HandleMinted","kind":"struct","members":[{"name":"local_name","type":"core::felt252","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"},{"name":"to","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"karst::namespaces::handles::Handles::HandleBurnt","kind":"struct","members":[{"name":"local_name","type":"core::felt252","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"},{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"karst::namespaces::handles::Handles::Event","kind":"enum","variants":[{"name":"ERC721Event","type":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"flat"},{"name":"SRC5Event","type":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"flat"},{"name":"OwnableEvent","type":"openzeppelin_access::ownable::ownable::OwnableComponent::Event","kind":"flat"},{"name":"HandleMinted","type":"karst::namespaces::handles::Handles::HandleMinted","kind":"nested"},{"name":"HandleBurnt","type":"karst::namespaces::handles::Handles::HandleBurnt","kind":"nested"}]}]
\ No newline at end of file
+[{"type":"impl","name":"HandlesImpl","interface_name":"coloniz::interfaces::IHandle::IHandle"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"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":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"type":"interface","name":"coloniz::interfaces::IHandle::IHandle","items":[{"type":"function","name":"mint_handle","inputs":[{"name":"address","type":"core::starknet::contract_address::ContractAddress"},{"name":"local_name","type":"core::felt252"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"burn_handle","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_namespace","inputs":[],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"get_local_name","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::felt252"}],"state_mutability":"view"},{"type":"function","name":"get_handle","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"exists","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"},{"type":"function","name":"total_supply","inputs":[],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_token_id","inputs":[{"name":"local_name","type":"core::felt252"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"name","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"symbol","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"token_uri","inputs":[{"name":"token_id","type":"core::integer::u256"},{"name":"local_name","type":"core::felt252"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"}]},{"type":"impl","name":"SRC5Impl","interface_name":"openzeppelin_introspection::interface::ISRC5"},{"type":"interface","name":"openzeppelin_introspection::interface::ISRC5","items":[{"type":"function","name":"supports_interface","inputs":[{"name":"interface_id","type":"core::felt252"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721Impl","interface_name":"openzeppelin_token::erc721::interface::IERC721"},{"type":"struct","name":"core::array::Span::","members":[{"name":"snapshot","type":"@core::array::Array::"}]},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721","items":[{"type":"function","name":"balance_of","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"owner_of","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safe_transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"approve","inputs":[{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"set_approval_for_all","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_approved","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"is_approved_for_all","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721CamelOnlyImpl","interface_name":"openzeppelin_token::erc721::interface::IERC721CamelOnly"},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721CamelOnly","items":[{"type":"function","name":"balanceOf","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"ownerOf","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safeTransferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"setApprovalForAll","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"getApproved","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"isApprovedForAll","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"OwnableImpl","interface_name":"openzeppelin_access::ownable::interface::IOwnable"},{"type":"interface","name":"openzeppelin_access::ownable::interface::IOwnable","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":"constructor","name":"constructor","inputs":[{"name":"admin","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"struct","members":[{"name":"from","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"to","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::bool","kind":"data"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"enum","variants":[{"name":"Transfer","type":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"nested"},{"name":"Approval","type":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"nested"},{"name":"ApprovalForAll","type":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"nested"}]},{"type":"event","name":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"enum","variants":[]},{"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::namespaces::handles::Handles::HandleMinted","kind":"struct","members":[{"name":"local_name","type":"core::felt252","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"},{"name":"to","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::namespaces::handles::Handles::HandleBurnt","kind":"struct","members":[{"name":"local_name","type":"core::felt252","kind":"data"},{"name":"token_id","type":"core::integer::u256","kind":"data"},{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"block_timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::namespaces::handles::Handles::Event","kind":"enum","variants":[{"name":"ERC721Event","type":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"flat"},{"name":"SRC5Event","type":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"flat"},{"name":"OwnableEvent","type":"openzeppelin_access::ownable::ownable::OwnableComponent::Event","kind":"flat"},{"name":"HandleMinted","type":"coloniz::namespaces::handles::Handles::HandleMinted","kind":"nested"},{"name":"HandleBurnt","type":"coloniz::namespaces::handles::Handles::HandleBurnt","kind":"nested"}]}]
\ No newline at end of file
diff --git a/scripts/src/abi/handleRegistry.json b/scripts/src/abi/handleRegistry.json
index ed9c5ba..2a00f23 100644
--- a/scripts/src/abi/handleRegistry.json
+++ b/scripts/src/abi/handleRegistry.json
@@ -1 +1 @@
-[{"type":"impl","name":"HandleRegistryImpl","interface_name":"karst::interfaces::IHandleRegistry::IHandleRegistry"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"interface","name":"karst::interfaces::IHandleRegistry::IHandleRegistry","items":[{"type":"function","name":"link","inputs":[{"name":"handle_id","type":"core::integer::u256"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"unlink","inputs":[{"name":"handle_id","type":"core::integer::u256"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"resolve","inputs":[{"name":"handle_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"get_handle","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"}]},{"type":"constructor","name":"constructor","inputs":[{"name":"handle_address","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"event","name":"karst::namespaces::handle_registry::HandleRegistry::HandleLinked","kind":"struct","members":[{"name":"handle_id","type":"core::integer::u256","kind":"data"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"caller","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"karst::namespaces::handle_registry::HandleRegistry::HandleUnlinked","kind":"struct","members":[{"name":"handle_id","type":"core::integer::u256","kind":"data"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"caller","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"karst::namespaces::handle_registry::HandleRegistry::Event","kind":"enum","variants":[{"name":"Linked","type":"karst::namespaces::handle_registry::HandleRegistry::HandleLinked","kind":"nested"},{"name":"Unlinked","type":"karst::namespaces::handle_registry::HandleRegistry::HandleUnlinked","kind":"nested"}]}]
\ No newline at end of file
+[{"type":"impl","name":"HandleRegistryImpl","interface_name":"coloniz::interfaces::IHandleRegistry::IHandleRegistry"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"interface","name":"coloniz::interfaces::IHandleRegistry::IHandleRegistry","items":[{"type":"function","name":"link","inputs":[{"name":"handle_id","type":"core::integer::u256"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"unlink","inputs":[{"name":"handle_id","type":"core::integer::u256"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"resolve","inputs":[{"name":"handle_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"get_handle","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"}]},{"type":"constructor","name":"constructor","inputs":[{"name":"handle_address","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"event","name":"coloniz::namespaces::handle_registry::HandleRegistry::HandleLinked","kind":"struct","members":[{"name":"handle_id","type":"core::integer::u256","kind":"data"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"caller","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::namespaces::handle_registry::HandleRegistry::HandleUnlinked","kind":"struct","members":[{"name":"handle_id","type":"core::integer::u256","kind":"data"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"caller","type":"core::starknet::contract_address::ContractAddress","kind":"data"},{"name":"timestamp","type":"core::integer::u64","kind":"data"}]},{"type":"event","name":"coloniz::namespaces::handle_registry::HandleRegistry::Event","kind":"enum","variants":[{"name":"Linked","type":"coloniz::namespaces::handle_registry::HandleRegistry::HandleLinked","kind":"nested"},{"name":"Unlinked","type":"coloniz::namespaces::handle_registry::HandleRegistry::HandleUnlinked","kind":"nested"}]}]
\ No newline at end of file
diff --git a/scripts/src/abi/hub.json b/scripts/src/abi/hub.json
index 7663cb0..ce04270 100644
--- a/scripts/src/abi/hub.json
+++ b/scripts/src/abi/hub.json
@@ -1 +1 @@
-[{"type":"impl","name":"KarstHubImpl","interface_name":"karst::hub::hub::IKarstHub"},{"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":"karst::hub::hub::IKarstHub","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":"karst::interfaces::IProfile::IProfile"},{"type":"struct","name":"karst::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":"karst::interfaces::IProfile::IProfile","items":[{"type":"function","name":"initializer","inputs":[{"name":"karst_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":"karstnft_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":"karst::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":"karstnft_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":"karst::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":"karst::profile::profile::ProfileComponent::Event","kind":"enum","variants":[{"name":"CreatedProfile","type":"karst::profile::profile::ProfileComponent::CreatedProfile","kind":"nested"}]},{"type":"struct","name":"karst::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":"karst::publication::publication::PublicationComponent::Post","kind":"struct","members":[{"name":"post","type":"karst::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":"karst::base::constants::types::PublicationType","variants":[{"name":"Nonexistent","type":"()"},{"name":"Post","type":"()"},{"name":"Comment","type":"()"},{"name":"Repost","type":"()"}]},{"type":"struct","name":"karst::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":"karst::base::constants::types::PublicationType"}]},{"type":"event","name":"karst::publication::publication::PublicationComponent::CommentCreated","kind":"struct","members":[{"name":"commentParams","type":"karst::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":"karst::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":"karst::publication::publication::PublicationComponent::RepostCreated","kind":"struct","members":[{"name":"repostParams","type":"karst::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":"karst::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":"karst::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":"karst::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":"karst::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":"karst::publication::publication::PublicationComponent::Event","kind":"enum","variants":[{"name":"Post","type":"karst::publication::publication::PublicationComponent::Post","kind":"nested"},{"name":"CommentCreated","type":"karst::publication::publication::PublicationComponent::CommentCreated","kind":"nested"},{"name":"RepostCreated","type":"karst::publication::publication::PublicationComponent::RepostCreated","kind":"nested"},{"name":"Upvoted","type":"karst::publication::publication::PublicationComponent::Upvoted","kind":"nested"},{"name":"Downvoted","type":"karst::publication::publication::PublicationComponent::Downvoted","kind":"nested"},{"name":"CollectedNFT","type":"karst::publication::publication::PublicationComponent::CollectedNFT","kind":"nested"},{"name":"DeployedCollectNFT","type":"karst::publication::publication::PublicationComponent::DeployedCollectNFT","kind":"nested"}]},{"type":"event","name":"karst::hub::hub::KarstHub::Event","kind":"enum","variants":[{"name":"ProfileEvent","type":"karst::profile::profile::ProfileComponent::Event","kind":"nested"},{"name":"PublicationEvent","type":"karst::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":"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
diff --git a/scripts/src/abi/karstnft.json b/scripts/src/abi/karstnft.json
index dbe63bc..00f00b8 100644
--- a/scripts/src/abi/karstnft.json
+++ b/scripts/src/abi/karstnft.json
@@ -1 +1 @@
-[{"type":"impl","name":"KarstImpl","interface_name":"karst::interfaces::IKarstNFT::IKarstNFT"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"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":"karst::interfaces::IKarstNFT::IKarstNFT","items":[{"type":"function","name":"mint_karstnft","inputs":[{"name":"address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_last_minted_id","inputs":[],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_user_token_id","inputs":[{"name":"user","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_token_mint_timestamp","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u64"}],"state_mutability":"view"},{"type":"function","name":"name","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"symbol","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"token_uri","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"}]},{"type":"impl","name":"SRC5Impl","interface_name":"openzeppelin_introspection::interface::ISRC5"},{"type":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"type":"interface","name":"openzeppelin_introspection::interface::ISRC5","items":[{"type":"function","name":"supports_interface","inputs":[{"name":"interface_id","type":"core::felt252"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721Impl","interface_name":"openzeppelin_token::erc721::interface::IERC721"},{"type":"struct","name":"core::array::Span::","members":[{"name":"snapshot","type":"@core::array::Array::"}]},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721","items":[{"type":"function","name":"balance_of","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"owner_of","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safe_transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"approve","inputs":[{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"set_approval_for_all","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_approved","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"is_approved_for_all","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721CamelOnlyImpl","interface_name":"openzeppelin_token::erc721::interface::IERC721CamelOnly"},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721CamelOnly","items":[{"type":"function","name":"balanceOf","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"ownerOf","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safeTransferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"setApprovalForAll","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"getApproved","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"isApprovedForAll","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"OwnableImpl","interface_name":"openzeppelin_access::ownable::interface::IOwnable"},{"type":"interface","name":"openzeppelin_access::ownable::interface::IOwnable","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":"constructor","name":"constructor","inputs":[{"name":"admin","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"struct","members":[{"name":"from","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"to","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::bool","kind":"data"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"enum","variants":[{"name":"Transfer","type":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"nested"},{"name":"Approval","type":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"nested"},{"name":"ApprovalForAll","type":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"nested"}]},{"type":"event","name":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"enum","variants":[]},{"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":"karst::karstnft::karstnft::KarstNFT::Event","kind":"enum","variants":[{"name":"ERC721Event","type":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"flat"},{"name":"SRC5Event","type":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"flat"},{"name":"OwnableEvent","type":"openzeppelin_access::ownable::ownable::OwnableComponent::Event","kind":"flat"}]}]
\ No newline at end of file
+[{"type":"impl","name":"colonizImpl","interface_name":"coloniz::interfaces::IcolonizNFT::IcolonizNFT"},{"type":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"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::interfaces::IcolonizNFT::IcolonizNFT","items":[{"type":"function","name":"mint_coloniznft","inputs":[{"name":"address","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_last_minted_id","inputs":[],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_user_token_id","inputs":[{"name":"user","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_token_mint_timestamp","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u64"}],"state_mutability":"view"},{"type":"function","name":"name","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"symbol","inputs":[],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"token_uri","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"}]},{"type":"impl","name":"SRC5Impl","interface_name":"openzeppelin_introspection::interface::ISRC5"},{"type":"enum","name":"core::bool","variants":[{"name":"False","type":"()"},{"name":"True","type":"()"}]},{"type":"interface","name":"openzeppelin_introspection::interface::ISRC5","items":[{"type":"function","name":"supports_interface","inputs":[{"name":"interface_id","type":"core::felt252"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721Impl","interface_name":"openzeppelin_token::erc721::interface::IERC721"},{"type":"struct","name":"core::array::Span::","members":[{"name":"snapshot","type":"@core::array::Array::"}]},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721","items":[{"type":"function","name":"balance_of","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"owner_of","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safe_transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transfer_from","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"approve","inputs":[{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"token_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"set_approval_for_all","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"get_approved","inputs":[{"name":"token_id","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"is_approved_for_all","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"ERC721CamelOnlyImpl","interface_name":"openzeppelin_token::erc721::interface::IERC721CamelOnly"},{"type":"interface","name":"openzeppelin_token::erc721::interface::IERC721CamelOnly","items":[{"type":"function","name":"balanceOf","inputs":[{"name":"account","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"ownerOf","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"safeTransferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"},{"name":"data","type":"core::array::Span::"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"transferFrom","inputs":[{"name":"from","type":"core::starknet::contract_address::ContractAddress"},{"name":"to","type":"core::starknet::contract_address::ContractAddress"},{"name":"tokenId","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"setApprovalForAll","inputs":[{"name":"operator","type":"core::starknet::contract_address::ContractAddress"},{"name":"approved","type":"core::bool"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"getApproved","inputs":[{"name":"tokenId","type":"core::integer::u256"}],"outputs":[{"type":"core::starknet::contract_address::ContractAddress"}],"state_mutability":"view"},{"type":"function","name":"isApprovedForAll","inputs":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress"}],"outputs":[{"type":"core::bool"}],"state_mutability":"view"}]},{"type":"impl","name":"OwnableImpl","interface_name":"openzeppelin_access::ownable::interface::IOwnable"},{"type":"interface","name":"openzeppelin_access::ownable::interface::IOwnable","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":"constructor","name":"constructor","inputs":[{"name":"admin","type":"core::starknet::contract_address::ContractAddress"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"struct","members":[{"name":"from","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"to","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"token_id","type":"core::integer::u256","kind":"key"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"struct","members":[{"name":"owner","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"operator","type":"core::starknet::contract_address::ContractAddress","kind":"key"},{"name":"approved","type":"core::bool","kind":"data"}]},{"type":"event","name":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"enum","variants":[{"name":"Transfer","type":"openzeppelin_token::erc721::erc721::ERC721Component::Transfer","kind":"nested"},{"name":"Approval","type":"openzeppelin_token::erc721::erc721::ERC721Component::Approval","kind":"nested"},{"name":"ApprovalForAll","type":"openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll","kind":"nested"}]},{"type":"event","name":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"enum","variants":[]},{"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::coloniznft::coloniznft::colonizNFT::Event","kind":"enum","variants":[{"name":"ERC721Event","type":"openzeppelin_token::erc721::erc721::ERC721Component::Event","kind":"flat"},{"name":"SRC5Event","type":"openzeppelin_introspection::src5::SRC5Component::Event","kind":"flat"},{"name":"OwnableEvent","type":"openzeppelin_access::ownable::ownable::OwnableComponent::Event","kind":"flat"}]}]
\ No newline at end of file
diff --git a/scripts/src/abi/profile.json b/scripts/src/abi/profile.json
index 4a3b406..a27ed89 100644
--- a/scripts/src/abi/profile.json
+++ b/scripts/src/abi/profile.json
@@ -1 +1 @@
-[{"type":"impl","name":"profileImpl","interface_name":"karst::interfaces::IProfile::IProfile"},{"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":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"struct","name":"karst::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":"karst::interfaces::IProfile::IProfile","items":[{"type":"function","name":"initializer","inputs":[{"name":"karst_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":"karstnft_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":"karst::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":"karstnft_contract_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"hub_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"follow_nft_classhash","type":"core::felt252"}]},{"type":"event","name":"karst::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":"karst::profile::profile::ProfileComponent::Event","kind":"enum","variants":[{"name":"CreatedProfile","type":"karst::profile::profile::ProfileComponent::CreatedProfile","kind":"nested"}]},{"type":"event","name":"karst::presets::profile::KarstProfile::Event","kind":"enum","variants":[{"name":"ProfileEvent","type":"karst::profile::profile::ProfileComponent::Event","kind":"flat"}]}]
\ No newline at end of file
+[{"type":"impl","name":"profileImpl","interface_name":"coloniz::interfaces::IProfile::IProfile"},{"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":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"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":"hub_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":"event","name":"coloniz::presets::profile::colonizProfile::Event","kind":"enum","variants":[{"name":"ProfileEvent","type":"coloniz::profile::profile::ProfileComponent::Event","kind":"flat"}]}]
\ No newline at end of file
diff --git a/scripts/src/abi/publication.json b/scripts/src/abi/publication.json
index 61850a2..774df98 100644
--- a/scripts/src/abi/publication.json
+++ b/scripts/src/abi/publication.json
@@ -1 +1 @@
-[{"type":"impl","name":"publicationImpl","interface_name":"karst::interfaces::IPublication::IKarstPublications"},{"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":"struct","name":"karst::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":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"type":"enum","name":"karst::base::constants::types::PublicationType","variants":[{"name":"Nonexistent","type":"()"},{"name":"Post","type":"()"},{"name":"Comment","type":"()"},{"name":"Repost","type":"()"}]},{"type":"struct","name":"karst::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":"karst::base::constants::types::PublicationType"}]},{"type":"struct","name":"karst::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":"struct","name":"karst::base::constants::types::Publication","members":[{"name":"pointed_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pointed_pub_id","type":"core::integer::u256"},{"name":"content_URI","type":"core::byte_array::ByteArray"},{"name":"pub_Type","type":"karst::base::constants::types::PublicationType"},{"name":"root_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"root_pub_id","type":"core::integer::u256"},{"name":"upvote","type":"core::integer::u256"},{"name":"downvote","type":"core::integer::u256"},{"name":"channel_id","type":"core::felt252"},{"name":"collect_nft","type":"core::starknet::contract_address::ContractAddress"},{"name":"tipped_amount","type":"core::integer::u256"}]},{"type":"interface","name":"karst::interfaces::IPublication::IKarstPublications","items":[{"type":"function","name":"post","inputs":[{"name":"post_params","type":"karst::base::constants::types::PostParams"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"comment","inputs":[{"name":"comment_params","type":"karst::base::constants::types::CommentParams"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"repost","inputs":[{"name":"repost_params","type":"karst::base::constants::types::RepostParams"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"upvote","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"downvote","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"tip","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"},{"name":"amount","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"collect","inputs":[{"name":"karst_hub","type":"core::starknet::contract_address::ContractAddress"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"},{"name":"collect_nft_impl_class_hash","type":"core::felt252"},{"name":"salt","type":"core::felt252"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"get_publication","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id_assigned","type":"core::integer::u256"}],"outputs":[{"type":"karst::base::constants::types::Publication"}],"state_mutability":"view"},{"type":"function","name":"get_publication_type","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id_assigned","type":"core::integer::u256"}],"outputs":[{"type":"karst::base::constants::types::PublicationType"}],"state_mutability":"view"},{"type":"function","name":"get_publication_content_uri","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"get_upvote_count","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_downvote_count","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_tipped_amount","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"}]},{"type":"impl","name":"profileImpl","interface_name":"karst::interfaces::IProfile::IProfile"},{"type":"struct","name":"karst::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":"karst::interfaces::IProfile::IProfile","items":[{"type":"function","name":"initializer","inputs":[{"name":"karst_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":"karstnft_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":"karst::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":"event","name":"karst::publication::publication::PublicationComponent::Post","kind":"struct","members":[{"name":"post","type":"karst::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":"event","name":"karst::publication::publication::PublicationComponent::CommentCreated","kind":"struct","members":[{"name":"commentParams","type":"karst::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":"event","name":"karst::publication::publication::PublicationComponent::RepostCreated","kind":"struct","members":[{"name":"repostParams","type":"karst::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":"karst::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":"karst::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":"karst::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":"karst::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":"karst::publication::publication::PublicationComponent::Event","kind":"enum","variants":[{"name":"Post","type":"karst::publication::publication::PublicationComponent::Post","kind":"nested"},{"name":"CommentCreated","type":"karst::publication::publication::PublicationComponent::CommentCreated","kind":"nested"},{"name":"RepostCreated","type":"karst::publication::publication::PublicationComponent::RepostCreated","kind":"nested"},{"name":"Upvoted","type":"karst::publication::publication::PublicationComponent::Upvoted","kind":"nested"},{"name":"Downvoted","type":"karst::publication::publication::PublicationComponent::Downvoted","kind":"nested"},{"name":"CollectedNFT","type":"karst::publication::publication::PublicationComponent::CollectedNFT","kind":"nested"},{"name":"DeployedCollectNFT","type":"karst::publication::publication::PublicationComponent::DeployedCollectNFT","kind":"nested"}]},{"type":"event","name":"karst::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":"karst::profile::profile::ProfileComponent::Event","kind":"enum","variants":[{"name":"CreatedProfile","type":"karst::profile::profile::ProfileComponent::CreatedProfile","kind":"nested"}]},{"type":"event","name":"karst::presets::publication::KarstPublication::Event","kind":"enum","variants":[{"name":"PublicationEvent","type":"karst::publication::publication::PublicationComponent::Event","kind":"flat"},{"name":"ProfileEvent","type":"karst::profile::profile::ProfileComponent::Event","kind":"flat"}]}]
\ No newline at end of file
+[{"type":"impl","name":"publicationImpl","interface_name":"coloniz::interfaces::IPublication::IcolonizPublications"},{"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":"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":"struct","name":"core::integer::u256","members":[{"name":"low","type":"core::integer::u128"},{"name":"high","type":"core::integer::u128"}]},{"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":"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":"struct","name":"coloniz::base::constants::types::Publication","members":[{"name":"pointed_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pointed_pub_id","type":"core::integer::u256"},{"name":"content_URI","type":"core::byte_array::ByteArray"},{"name":"pub_Type","type":"coloniz::base::constants::types::PublicationType"},{"name":"root_profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"root_pub_id","type":"core::integer::u256"},{"name":"upvote","type":"core::integer::u256"},{"name":"downvote","type":"core::integer::u256"},{"name":"channel_id","type":"core::felt252"},{"name":"collect_nft","type":"core::starknet::contract_address::ContractAddress"},{"name":"tipped_amount","type":"core::integer::u256"}]},{"type":"interface","name":"coloniz::interfaces::IPublication::IcolonizPublications","items":[{"type":"function","name":"post","inputs":[{"name":"post_params","type":"coloniz::base::constants::types::PostParams"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"comment","inputs":[{"name":"comment_params","type":"coloniz::base::constants::types::CommentParams"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"repost","inputs":[{"name":"repost_params","type":"coloniz::base::constants::types::RepostParams"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"upvote","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"downvote","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"tip","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"},{"name":"amount","type":"core::integer::u256"}],"outputs":[],"state_mutability":"external"},{"type":"function","name":"collect","inputs":[{"name":"coloniz_hub","type":"core::starknet::contract_address::ContractAddress"},{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"},{"name":"collect_nft_impl_class_hash","type":"core::felt252"},{"name":"salt","type":"core::felt252"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"external"},{"type":"function","name":"get_publication","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id_assigned","type":"core::integer::u256"}],"outputs":[{"type":"coloniz::base::constants::types::Publication"}],"state_mutability":"view"},{"type":"function","name":"get_publication_type","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id_assigned","type":"core::integer::u256"}],"outputs":[{"type":"coloniz::base::constants::types::PublicationType"}],"state_mutability":"view"},{"type":"function","name":"get_publication_content_uri","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::byte_array::ByteArray"}],"state_mutability":"view"},{"type":"function","name":"get_upvote_count","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_downvote_count","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u256"}],"state_mutability":"view"},{"type":"function","name":"get_tipped_amount","inputs":[{"name":"profile_address","type":"core::starknet::contract_address::ContractAddress"},{"name":"pub_id","type":"core::integer::u256"}],"outputs":[{"type":"core::integer::u256"}],"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":"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":"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":"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::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::presets::publication::colonizPublication::Event","kind":"enum","variants":[{"name":"PublicationEvent","type":"coloniz::publication::publication::PublicationComponent::Event","kind":"flat"},{"name":"ProfileEvent","type":"coloniz::profile::profile::ProfileComponent::Event","kind":"flat"}]}]
\ No newline at end of file
diff --git a/scripts/src/contracts/handle.ts b/scripts/src/contracts/handle.ts
index 41ed43f..9c2e950 100644
--- a/scripts/src/contracts/handle.ts
+++ b/scripts/src/contracts/handle.ts
@@ -1,3 +1,3 @@
-// script for karst Handles contract goes in here
+// script for coloniz Handles contract goes in here
-console.log('Karst Handle')
\ No newline at end of file
+console.log('coloniz Handle')
\ No newline at end of file
diff --git a/scripts/src/contracts/hub.ts b/scripts/src/contracts/hub.ts
index 901f8b9..9edf2c3 100644
--- a/scripts/src/contracts/hub.ts
+++ b/scripts/src/contracts/hub.ts
@@ -1,11 +1,11 @@
import tokenbound from "../index";
-import {KARST_HUB_CONTRACT_ADDRESS, PROFILE_ADDRESS_ONE, PROFILE_ADDRESS_TWO} from "../helpers/constants"
+import {coloniz_HUB_CONTRACT_ADDRESS, PROFILE_ADDRESS_ONE, PROFILE_ADDRESS_TWO} from "../helpers/constants"
import { Call } from "starknet-tokenbound-sdk";
const execute_unfollow = async() =>{
let call:Call = {
- to:KARST_HUB_CONTRACT_ADDRESS,
+ to:coloniz_HUB_CONTRACT_ADDRESS,
selector:"0x70cb483ff70f4401877815e8a7bada80205df630fe0d8157b4e458f4e5114e",
calldata:[1, PROFILE_ADDRESS_ONE]
}
diff --git a/scripts/src/contracts/profile.ts b/scripts/src/contracts/profile.ts
index 73a2d92..457c876 100644
--- a/scripts/src/contracts/profile.ts
+++ b/scripts/src/contracts/profile.ts
@@ -1,3 +1,3 @@
-// script for karst profile contract goes in here
+// script for coloniz profile contract goes in here
-console.log('Karst Profile')
\ No newline at end of file
+console.log('coloniz Profile')
\ No newline at end of file
diff --git a/scripts/src/helpers/constants.ts b/scripts/src/helpers/constants.ts
index 60c5f22..5b7a6fa 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 KARST_NFT_CONTRACT_ADDRESS:string = "0x4dca9ec1ed78ce5cddbbcec63d3620514ae66bc73a3942d48a011bad452ffe"
-export const KARST_HUB_CONTRACT_ADDRESS:string ="0x7e3c4c5275b93d985699b86486848b0bee8d75b88fbaf36fea339eeb74b8aa8"
+export const coloniz_NFT_CONTRACT_ADDRESS:string = "0x4dca9ec1ed78ce5cddbbcec63d3620514ae66bc73a3942d48a011bad452ffe"
+export const coloniz_HUB_CONTRACT_ADDRESS:string ="0x7e3c4c5275b93d985699b86486848b0bee8d75b88fbaf36fea339eeb74b8aa8"
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/src/base/constants/errors.cairo b/src/base/constants/errors.cairo
index 70d4419..191f3eb 100644
--- a/src/base/constants/errors.cairo
+++ b/src/base/constants/errors.cairo
@@ -2,45 +2,45 @@
// ERRORS
// *************************************************************************
pub mod Errors {
- pub const UNAUTHORIZED: felt252 = 'Karst: user unauthorized!';
- pub const NOT_PROFILE_OWNER: felt252 = 'Karst: not profile owner!';
- pub const ALREADY_MINTED: felt252 = 'Karst: user already minted!';
- pub const INITIALIZED: felt252 = 'Karst: already initialized!';
- pub const HUB_RESTRICTED: felt252 = 'Karst: caller is not Hub!';
- pub const FOLLOWING: felt252 = 'Karst: user already following!';
- pub const NOT_FOLLOWING: felt252 = 'Karst: user not following!';
- pub const BLOCKED_STATUS: felt252 = 'Karst: user is blocked!';
- pub const INVALID_POINTED_PUBLICATION: felt252 = 'Karst: invalid pointed pub!';
- pub const INVALID_OWNER: felt252 = 'Karst: caller is not owner!';
- pub const INVALID_PROFILE: felt252 = 'Karst: profile is not owner!';
- pub const HANDLE_ALREADY_LINKED: felt252 = 'Karst: handle already linked!';
- pub const HANDLE_DOES_NOT_EXIST: felt252 = 'Karst: handle does not exist!';
- pub const INVALID_LOCAL_NAME: felt252 = 'Karst: invalid local name!';
- pub const UNSUPPORTED_PUB_TYPE: felt252 = 'Karst: unsupported pub type!';
- pub const INVALID_PROFILE_ADDRESS: felt252 = 'Karst: invalid profile address!';
- pub const SELF_FOLLOWING: felt252 = 'Karst: self follow is forbidden';
- pub const ALREADY_REACTED: felt252 = 'Karst: already react to post!';
- pub const ALREADY_MEMBER: felt252 = 'Karst: already a Member';
- pub const COMMUNITY_DOES_NOT_EXIST: felt252 = 'Karst: Community does not exist';
- pub const NOT_COMMUNITY_OWNER: felt252 = 'Karst: Not Community owner';
- pub const ONLY_PREMIUM_COMMUNITIES: felt252 = 'Karst: only premium communities';
- pub const NOT_COMMUNITY_MEMBER: felt252 = 'Karst: Not a Community Member';
- pub const NOT_COMMUNITY_MOD: felt252 = 'Karst: Not a community mod';
- pub const BANNED_MEMBER: felt252 = 'Karst: Profile is banned!';
- pub const NOT_TOKEN_OWNER: felt252 = 'Karst: Not a Token Owner';
- pub const TOKEN_DOES_NOT_EXIST: felt252 = 'Karst: Token does not exist';
- pub const SELF_TIPPING: felt252 = 'Karst: self-tip forbidden!';
- pub const SELF_TRANSFER: felt252 = 'Karst: self-transfer forbidden!';
- pub const SELF_REQUEST: felt252 = 'Karst: self-request forbidden!';
- pub const INVALID_EXPIRATION_STAMP: felt252 = 'Karst: invalid expiration stamp';
- pub const INSUFFICIENT_ALLOWANCE: felt252 = 'Karst: insufficient allowance!';
- 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 = 'Karst: not channel owner';
- pub const NOT_CHANNEL_MODERATOR: felt252 = 'Karst: not channel moderator';
- pub const NOT_CHANNEL_MEMBER: felt252 = 'Karst: not channel member';
- pub const BANNED_FROM_CHANNEL: felt252 = 'Karst: banned from channel';
- pub const CHANNEL_HAS_NO_MEMBER: felt252 = 'Karst: channel has no members';
- pub const INVALID_LENGTH: felt252 = 'Karst: array mismatch';
+ pub const UNAUTHORIZED: felt252 = 'coloniz: user unauthorized!';
+ pub const NOT_PROFILE_OWNER: felt252 = 'coloniz: not profile owner!';
+ pub const ALREADY_MINTED: felt252 = 'coloniz: user already minted!';
+ pub const INITIALIZED: felt252 = 'coloniz: already initialized!';
+ pub const HUB_RESTRICTED: felt252 = 'coloniz: caller is not Hub!';
+ pub const FOLLOWING: felt252 = 'coloniz: already following!';
+ pub const NOT_FOLLOWING: felt252 = 'coloniz: user not following!';
+ pub const BLOCKED_STATUS: felt252 = 'coloniz: user is blocked!';
+ pub const INVALID_POINTED_PUBLICATION: felt252 = 'coloniz: invalid pointed pub!';
+ pub const INVALID_OWNER: felt252 = 'coloniz: caller is not owner!';
+ pub const INVALID_PROFILE: felt252 = 'coloniz: profile is not owner!';
+ pub const HANDLE_ALREADY_LINKED: felt252 = 'coloniz: handle already linked!';
+ pub const HANDLE_DOES_NOT_EXIST: felt252 = 'coloniz: handle does not exist!';
+ pub const INVALID_LOCAL_NAME: felt252 = 'coloniz: invalid local name!';
+ pub const UNSUPPORTED_PUB_TYPE: felt252 = 'coloniz: unsupported pub type!';
+ pub const INVALID_PROFILE_ADDRESS: felt252 = 'coloniz: invalid profile_addr!';
+ pub const SELF_FOLLOWING: felt252 = 'coloniz: self_follow forbidden';
+ pub const ALREADY_REACTED: felt252 = 'coloniz: already react to post!';
+ pub const ALREADY_MEMBER: felt252 = 'coloniz: already a Member';
+ pub const COMMUNITY_DOES_NOT_EXIST: felt252 = 'coloniz: Comm does not exist';
+ pub const NOT_COMMUNITY_OWNER: felt252 = 'coloniz: Not Community owner';
+ pub const ONLY_PREMIUM_COMMUNITIES: felt252 = 'coloniz: only premium communiti';
+ pub const NOT_COMMUNITY_MEMBER: felt252 = 'coloniz: Not Community Member';
+ pub const NOT_COMMUNITY_MOD: felt252 = 'coloniz: Not a community mod';
+ pub const BANNED_MEMBER: felt252 = 'coloniz: Profile is banned!';
+ pub const NOT_TOKEN_OWNER: felt252 = 'coloniz: Not a Token Owner';
+ pub const TOKEN_DOES_NOT_EXIST: felt252 = 'coloniz: Token does not exist';
+ pub const SELF_TIPPING: felt252 = 'coloniz: self-tip forbidden!';
+ pub const SELF_TRANSFER: felt252 = 'coloniz: self-transfer forbiden';
+ pub const SELF_REQUEST: felt252 = 'coloniz: self-request forbiden';
+ pub const INVALID_EXPIRATION_STAMP: felt252 = 'coloniz: invld expiration stamp';
+ pub const INSUFFICIENT_ALLOWANCE: felt252 = 'coloniz: not enough allowance!';
+ pub const AUTO_RENEW_DURATION_ENDED: felt252 = 'coloniz: auto renew ended!';
+ pub const INVALID_JOLT: felt252 = 'coloniz: invalid jolt!';
+ pub const INVALID_JOLT_RECIPIENT: felt252 = 'coloniz: not request recipient!';
+ pub const NOT_CHANNEL_OWNER: felt252 = 'coloniz: not channel owner';
+ pub const NOT_CHANNEL_MODERATOR: felt252 = 'coloniz: not channel moderator';
+ pub const NOT_CHANNEL_MEMBER: felt252 = 'coloniz: not channel member';
+ pub const BANNED_FROM_CHANNEL: felt252 = 'coloniz: banned from channel';
+ pub const CHANNEL_HAS_NO_MEMBER: felt252 = 'coloniz: channel has no members';
+ pub const INVALID_LENGTH: felt252 = 'coloniz: array mismatch';
}
diff --git a/src/base/constants/types.cairo b/src/base/constants/types.cairo
index e086fc4..048adb9 100644
--- a/src/base/constants/types.cairo
+++ b/src/base/constants/types.cairo
@@ -4,7 +4,7 @@ use starknet::ContractAddress;
// PROFILE
// *************************************************************************
// * @notice A struct containing profile data.
-// * profile_address The profile ID of a karst profile
+// * profile_address The profile ID of a coloniz 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
diff --git a/src/base/token_uris/follow_token_uri.cairo b/src/base/token_uris/follow_token_uri.cairo
index e682216..f93ea44 100644
--- a/src/base/token_uris/follow_token_uri.cairo
+++ b/src/base/token_uris/follow_token_uri.cairo
@@ -3,9 +3,9 @@
pub mod FollowTokenUri {
use starknet::ContractAddress;
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
- use karst::base::utils::base64_extended::{convert_into_byteArray, get_base64_encode};
- use karst::base::token_uris::traits::follow::follow::get_svg_follow;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::base64_extended::{convert_into_byteArray, get_base64_encode};
+ use coloniz::base::token_uris::traits::follow::follow::get_svg_follow;
pub fn get_token_uri(
follow_token_id: u256, followed_profile_address: ContractAddress, follow_timestamp: u64
diff --git a/src/base/token_uris/handle_token_uri.cairo b/src/base/token_uris/handle_token_uri.cairo
index c47abf2..035ea9c 100644
--- a/src/base/token_uris/handle_token_uri.cairo
+++ b/src/base/token_uris/handle_token_uri.cairo
@@ -3,9 +3,9 @@
pub mod HandleTokenUri {
use core::array::ArrayTrait;
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
- use karst::base::utils::base64_extended::{convert_into_byteArray, get_base64_encode};
- use karst::base::token_uris::traits::handle::handle::get_svg_handle;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::base64_extended::{convert_into_byteArray, get_base64_encode};
+ use coloniz::base::token_uris::traits::handle::handle::get_svg_handle;
pub fn get_token_uri(token_id: u256, local_name: felt252, namespace: felt252) -> ByteArray {
let baseuri = 'data:image/svg+xml;base64,';
diff --git a/src/base/token_uris/profile_token_uri.cairo b/src/base/token_uris/profile_token_uri.cairo
index bb8f932..1413b7a 100644
--- a/src/base/token_uris/profile_token_uri.cairo
+++ b/src/base/token_uris/profile_token_uri.cairo
@@ -3,8 +3,8 @@
pub mod ProfileTokenUri {
use core::array::ArrayTrait;
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
- use karst::base::utils::base64_extended::{get_base64_encode, convert_into_byteArray};
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::base64_extended::{get_base64_encode, convert_into_byteArray};
fn get_svg(token_id: u256, mint_timestamp: u64) -> Array {
let mut svg = ArrayTrait::::new();
diff --git a/src/base/token_uris/traits/background.cairo b/src/base/token_uris/traits/background.cairo
index cb78dfd..cd8c18f 100644
--- a/src/base/token_uris/traits/background.cairo
+++ b/src/base/token_uris/traits/background.cairo
@@ -1,7 +1,7 @@
// let make the face of the profile svg
pub mod background {
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum BackgroundVariants {
diff --git a/src/base/token_uris/traits/beard.cairo b/src/base/token_uris/traits/beard.cairo
index 1e18f0e..fab4c3a 100644
--- a/src/base/token_uris/traits/beard.cairo
+++ b/src/base/token_uris/traits/beard.cairo
@@ -1,7 +1,7 @@
// let make the face of the profile svg
pub mod beard {
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum BeardVariants {
diff --git a/src/base/token_uris/traits/cloth.cairo b/src/base/token_uris/traits/cloth.cairo
index b3ba2e7..7a7a690 100644
--- a/src/base/token_uris/traits/cloth.cairo
+++ b/src/base/token_uris/traits/cloth.cairo
@@ -1,7 +1,7 @@
// let make the face of the profile svg
pub mod cloth {
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum ClothVariants {
diff --git a/src/base/token_uris/traits/color.cairo b/src/base/token_uris/traits/color.cairo
index 9dfc5b2..bad10cc 100644
--- a/src/base/token_uris/traits/color.cairo
+++ b/src/base/token_uris/traits/color.cairo
@@ -1,6 +1,6 @@
// SPDX-License-Identifier: MIT
-pub mod karstColors {
+pub mod colonizColors {
pub const baseGreen: felt252 = '#A0D170';
pub const basePink: felt252 = '#FFD2DD';
pub const basePurple: felt252 = '#EAD7FF';
diff --git a/src/base/token_uris/traits/eyeacessory.cairo b/src/base/token_uris/traits/eyeacessory.cairo
index 722f7ba..e696c19 100644
--- a/src/base/token_uris/traits/eyeacessory.cairo
+++ b/src/base/token_uris/traits/eyeacessory.cairo
@@ -2,8 +2,8 @@
pub mod eyeacessory {
use core::traits::TryInto;
- use karst::base::token_uris::traits::color::karstColors;
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::token_uris::traits::color::colonizColors;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum EyeAcessoryVariants {
diff --git a/src/base/token_uris/traits/eyebrows.cairo b/src/base/token_uris/traits/eyebrows.cairo
index d545846..4eaff0b 100644
--- a/src/base/token_uris/traits/eyebrows.cairo
+++ b/src/base/token_uris/traits/eyebrows.cairo
@@ -2,8 +2,8 @@
mod eyebrows {
use core::traits::TryInto;
- use karst::base::token_uris::traits::color::karstColors;
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::token_uris::traits::color::colonizColors;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum EyebrowsVariants {
diff --git a/src/base/token_uris/traits/eyecolor.cairo b/src/base/token_uris/traits/eyecolor.cairo
index 8492657..20ab215 100644
--- a/src/base/token_uris/traits/eyecolor.cairo
+++ b/src/base/token_uris/traits/eyecolor.cairo
@@ -2,8 +2,8 @@
mod eyecolor {
use core::traits::TryInto;
- use karst::base::token_uris::traits::color::karstColors;
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::token_uris::traits::color::colonizColors;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum EyeColorVariants {
diff --git a/src/base/token_uris/traits/follow.cairo b/src/base/token_uris/traits/follow.cairo
index 1f57f74..124d5e8 100644
--- a/src/base/token_uris/traits/follow.cairo
+++ b/src/base/token_uris/traits/follow.cairo
@@ -1,7 +1,7 @@
pub mod follow {
use core::array::ArrayTrait;
- use karst::base::utils::base64_extended::convert_into_byteArray;
- use karst::base::token_uris::traits::color::karstColors;
+ use coloniz::base::utils::base64_extended::convert_into_byteArray;
+ use coloniz::base::token_uris::traits::color::colonizColors;
pub fn get_svg_follow(follow_token_id: u256) -> ByteArray {
let mut svg = ArrayTrait::::new();
@@ -18,6 +18,6 @@ pub mod follow {
fn get_random_color(local_name: u256) -> felt252 {
// TODO select the random color
- karstColors::basePink
+ colonizColors::basePink
}
}
diff --git a/src/base/token_uris/traits/glass.cairo b/src/base/token_uris/traits/glass.cairo
index 64b361a..3b057d5 100644
--- a/src/base/token_uris/traits/glass.cairo
+++ b/src/base/token_uris/traits/glass.cairo
@@ -1,7 +1,7 @@
// let make the face of the profile svg
pub mod glass {
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum GlassVariants {
diff --git a/src/base/token_uris/traits/handle.cairo b/src/base/token_uris/traits/handle.cairo
index e8359b9..d72b1d0 100644
--- a/src/base/token_uris/traits/handle.cairo
+++ b/src/base/token_uris/traits/handle.cairo
@@ -1,7 +1,7 @@
pub mod handle {
use core::array::ArrayTrait;
- use karst::base::utils::base64_extended::convert_into_byteArray;
- use karst::base::token_uris::traits::color::karstColors;
+ use coloniz::base::utils::base64_extended::convert_into_byteArray;
+ use coloniz::base::token_uris::traits::color::colonizColors;
pub fn get_svg_handle(token_id: u256, local_name: felt252, namespace: felt252) -> ByteArray {
let mut svg = ArrayTrait::::new();
@@ -18,6 +18,6 @@ pub mod handle {
fn get_random_color(local_name: felt252) -> felt252 {
// TODO select the random color
- karstColors::basePink
+ colonizColors::basePink
}
}
diff --git a/src/base/token_uris/traits/head.cairo b/src/base/token_uris/traits/head.cairo
index ea56731..8b2bbfa 100644
--- a/src/base/token_uris/traits/head.cairo
+++ b/src/base/token_uris/traits/head.cairo
@@ -1,7 +1,7 @@
// let make the face of the profile svg
pub mod head {
- use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+ use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
#[derive(Drop)]
enum FaceVariants {
diff --git a/src/base/token_uris/traits/profile.cairo b/src/base/token_uris/traits/profile.cairo
index 8f0c286..0ddce31 100644
--- a/src/base/token_uris/traits/profile.cairo
+++ b/src/base/token_uris/traits/profile.cairo
@@ -1,9 +1,9 @@
pub mod ProfileSvg {
- use karst::base::token_uris::traits::head::head::faceSvgStart;
- use karst::base::token_uris::traits::glass::glass::glassSvgStart;
- use karst::base::token_uris::traits::beard::beard::beardSvgStart;
- use karst::base::token_uris::traits::cloth::cloth::clothSvgStart;
- use karst::base::token_uris::traits::background::background::backgroundSvgStart;
+ use coloniz::base::token_uris::traits::head::head::faceSvgStart;
+ use coloniz::base::token_uris::traits::glass::glass::glassSvgStart;
+ use coloniz::base::token_uris::traits::beard::beard::beardSvgStart;
+ use coloniz::base::token_uris::traits::cloth::cloth::clothSvgStart;
+ use coloniz::base::token_uris::traits::background::background::backgroundSvgStart;
pub fn gen_profile_svg() -> ByteArray {
let mut profilesvg: ByteArray =
diff --git a/src/base/utils/base64_extended.cairo b/src/base/utils/base64_extended.cairo
index f6b4fae..c7e8be6 100644
--- a/src/base/utils/base64_extended.cairo
+++ b/src/base/utils/base64_extended.cairo
@@ -1,5 +1,5 @@
use core::array::ArrayTrait;
-use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
+use coloniz::base::utils::byte_array_extra::FeltTryIntoByteArray;
use alexandria_encoding::base64::{Base64UrlEncoder};
pub fn get_base64_encode(res: ByteArray) -> ByteArray {
diff --git a/src/base/utils/hubrestricted.cairo b/src/base/utils/hubrestricted.cairo
index 3f01eb9..342b0f5 100644
--- a/src/base/utils/hubrestricted.cairo
+++ b/src/base/utils/hubrestricted.cairo
@@ -3,7 +3,7 @@
// *************************************************************************
pub mod HubRestricted {
use starknet::{ContractAddress, get_caller_address};
- use karst::base::constants::errors::Errors;
+ use coloniz::base::constants::errors::Errors;
pub fn hub_only(hub: ContractAddress) {
let caller = get_caller_address();
diff --git a/src/channel/channel.cairo b/src/channel/channel.cairo
index fa2b4d4..b3dddf0 100644
--- a/src/channel/channel.cairo
+++ b/src/channel/channel.cairo
@@ -14,13 +14,13 @@ pub mod ChannelComponent {
};
use openzeppelin::access::ownable::OwnableComponent;
- use karst::jolt::jolt::JoltComponent;
- use karst::community::community::CommunityComponent;
- use karst::interfaces::{
+ use coloniz::jolt::jolt::JoltComponent;
+ use coloniz::community::community::CommunityComponent;
+ use coloniz::interfaces::{
IChannel::IChannel, ICommunity::ICommunity,
ICustomNFT::{ICustomNFTDispatcher, ICustomNFTDispatcherTrait}
};
- use karst::base::{
+ use coloniz::base::{
constants::errors::Errors::{
NOT_CHANNEL_OWNER, ALREADY_MEMBER, NOT_CHANNEL_MEMBER, NOT_COMMUNITY_MEMBER,
BANNED_FROM_CHANNEL, CHANNEL_HAS_NO_MEMBER, UNAUTHORIZED, INVALID_LENGTH,
@@ -118,7 +118,7 @@ pub mod ChannelComponent {
// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
- #[embeddable_as(KarstChannel)]
+ #[embeddable_as(colonizChannel)]
impl ChannelImpl<
TContractState,
+HasComponent,
diff --git a/src/channel/channelNFT.cairo b/src/channel/channelNFT.cairo
index 6cf29ab..37381d2 100644
--- a/src/channel/channelNFT.cairo
+++ b/src/channel/channelNFT.cairo
@@ -8,9 +8,9 @@ pub mod ChannelNFT {
use openzeppelin::introspection::src5::SRC5Component;
use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl};
- use karst::interfaces::ICustomNFT::ICustomNFT;
+ use coloniz::interfaces::ICustomNFT::ICustomNFT;
- use karst::base::{
+ use coloniz::base::{
constants::errors::Errors::{ALREADY_MINTED, NOT_TOKEN_OWNER, TOKEN_DOES_NOT_EXIST},
utils::base64_extended::convert_into_byteArray,
token_uris::channel_token_uri::ChannelTokenUri::get_token_uri,
@@ -114,7 +114,7 @@ pub mod ChannelNFT {
fn name(self: @ContractState) -> ByteArray {
let mut collection_name = ArrayTrait::::new();
let channel_id_felt252: felt252 = self.channel_id.read().try_into().unwrap();
- collection_name.append('Karst Channel | #');
+ collection_name.append('coloniz Channel | #');
collection_name.append(channel_id_felt252);
let collection_name_byte = convert_into_byteArray(ref collection_name);
collection_name_byte
@@ -122,7 +122,7 @@ pub mod ChannelNFT {
/// @notice returns the collection symbol
fn symbol(self: @ContractState) -> ByteArray {
- return "KARST:CHANNEL";
+ return "coloniz:CHANNEL";
}
/// @notice returns the token_uri for a particular token_id
diff --git a/src/coloniznft.cairo b/src/coloniznft.cairo
new file mode 100644
index 0000000..a19b7e8
--- /dev/null
+++ b/src/coloniznft.cairo
@@ -0,0 +1 @@
+pub mod coloniznft;
diff --git a/src/karstnft/karstnft.cairo b/src/coloniznft/coloniznft.cairo
similarity index 92%
rename from src/karstnft/karstnft.cairo
rename to src/coloniznft/coloniznft.cairo
index 16ba774..cd2ff01 100644
--- a/src/karstnft/karstnft.cairo
+++ b/src/coloniznft/coloniznft.cairo
@@ -1,5 +1,5 @@
#[starknet::contract]
-pub mod KarstNFT {
+pub mod ColonizNFT {
// *************************************************************************
// IMPORTS
// *************************************************************************
@@ -11,8 +11,8 @@ pub mod KarstNFT {
}
};
use core::num::traits::zero::Zero;
- use karst::interfaces::IKarstNFT;
- use karst::base::{
+ use coloniz::interfaces::IColonizNFT;
+ use coloniz::base::{
constants::errors::Errors::ALREADY_MINTED,
token_uris::profile_token_uri::ProfileTokenUri::get_token_uri,
};
@@ -79,17 +79,17 @@ pub mod KarstNFT {
#[constructor]
fn constructor(ref self: ContractState, admin: ContractAddress,) {
self.admin.write(admin);
- self.erc721.initializer("Karst", "KST", "");
+ self.erc721.initializer("coloniz", "KST", "");
}
#[abi(embed_v0)]
- impl KarstImpl of IKarstNFT::IKarstNFT {
+ impl colonizImpl of IColonizNFT::IColonizNFT {
// *************************************************************************
// EXTERNAL
// *************************************************************************
- /// @notice mints the karst NFT
- /// @param address address of user trying to mint the karst NFT
- fn mint_karstnft(ref self: ContractState, address: ContractAddress) {
+ /// @notice mints the coloniz NFT
+ /// @param address address of user trying to mint the coloniz NFT
+ fn mint_coloniznft(ref self: ContractState, address: ContractAddress) {
let balance = self.erc721.balance_of(address);
assert(balance.is_zero(), ALREADY_MINTED);
@@ -125,7 +125,7 @@ pub mod KarstNFT {
// *************************************************************************
/// @notice returns the collection name
fn name(self: @ContractState) -> ByteArray {
- return "Karst";
+ return "coloniz";
}
/// @notice returns the collection symbol
diff --git a/src/community/community.cairo b/src/community/community.cairo
index 4bd0234..131f86b 100644
--- a/src/community/community.cairo
+++ b/src/community/community.cairo
@@ -15,16 +15,16 @@ pub mod CommunityComponent {
};
use openzeppelin::access::ownable::OwnableComponent;
- use karst::jolt::jolt::JoltComponent;
- use karst::interfaces::{
+ use coloniz::jolt::jolt::JoltComponent;
+ use coloniz::interfaces::{
ICommunity::ICommunity, IJolt::IJolt, IERC721::{IERC721Dispatcher, IERC721DispatcherTrait},
ICustomNFT::{ICustomNFTDispatcher, ICustomNFTDispatcherTrait}
};
- use karst::base::constants::types::{
+ use coloniz::base::constants::types::{
CommunityDetails, GateKeepType, CommunityType, CommunityMember, CommunityGateKeepDetails,
JoltParams, JoltType
};
- use karst::base::constants::errors::Errors::{
+ use coloniz::base::constants::errors::Errors::{
ALREADY_MEMBER, NOT_COMMUNITY_OWNER, NOT_COMMUNITY_MEMBER, NOT_COMMUNITY_MOD, BANNED_MEMBER,
UNAUTHORIZED, ONLY_PREMIUM_COMMUNITIES, INVALID_LENGTH
};
@@ -148,7 +148,7 @@ pub mod CommunityComponent {
// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
- #[embeddable_as(KarstCommunity)]
+ #[embeddable_as(colonizCommunity)]
impl CommunityImpl<
TContractState,
+HasComponent,
diff --git a/src/community/communitynft.cairo b/src/community/communitynft.cairo
index 02e121f..0784069 100644
--- a/src/community/communitynft.cairo
+++ b/src/community/communitynft.cairo
@@ -8,9 +8,9 @@ pub mod CommunityNFT {
use openzeppelin::introspection::src5::SRC5Component;
use openzeppelin::token::erc721::{ERC721Component, ERC721HooksEmptyImpl};
- use karst::interfaces::ICustomNFT::ICustomNFT;
+ use coloniz::interfaces::ICustomNFT::ICustomNFT;
- use karst::base::{
+ use coloniz::base::{
constants::errors::Errors::{ALREADY_MINTED, NOT_TOKEN_OWNER, TOKEN_DOES_NOT_EXIST},
utils::base64_extended::convert_into_byteArray,
token_uris::community_token_uri::CommunityTokenUri::get_token_uri,
@@ -114,7 +114,7 @@ pub mod CommunityNFT {
fn name(self: @ContractState) -> ByteArray {
let mut collection_name = ArrayTrait::::new();
let community_id_felt252: felt252 = self.community_id.read().try_into().unwrap();
- collection_name.append('Karst Community | #');
+ collection_name.append('coloniz Community | #');
collection_name.append(community_id_felt252);
let collection_name_byte = convert_into_byteArray(ref collection_name);
collection_name_byte
@@ -122,7 +122,7 @@ pub mod CommunityNFT {
/// @notice returns the collection symbol
fn symbol(self: @ContractState) -> ByteArray {
- return "KARST:COMMUNITY";
+ return "coloniz:COMMUNITY";
}
/// @notice returns the token_uri for a particular token_id
diff --git a/src/follownft/follownft.cairo b/src/follownft/follownft.cairo
index 51e8ff8..068050b 100644
--- a/src/follownft/follownft.cairo
+++ b/src/follownft/follownft.cairo
@@ -11,8 +11,8 @@ pub mod Follow {
}
};
use core::num::traits::zero::Zero;
- use karst::interfaces::{IFollowNFT::IFollowNFT};
- use karst::base::{
+ use coloniz::interfaces::{IFollowNFT::IFollowNFT};
+ use coloniz::base::{
constants::{errors::Errors, types::FollowData},
utils::hubrestricted::HubRestricted::hub_only, token_uris::follow_token_uri::FollowTokenUri,
};
@@ -57,7 +57,7 @@ pub mod Follow {
follower_count: u256,
follow_id_by_follower_profile_address: Map,
follow_data_by_follow_id: Map,
- karst_hub: ContractAddress,
+ coloniz_hub: ContractAddress,
}
// *************************************************************************
@@ -121,8 +121,8 @@ pub mod Follow {
admin: ContractAddress
) {
self.admin.write(admin);
- self.erc721.initializer("KARST:FOLLOWER", "KFL", "");
- self.karst_hub.write(hub);
+ self.erc721.initializer("coloniz:FOLLOWER", "KFL", "");
+ self.coloniz_hub.write(hub);
self.followed_profile_address.write(profile_address);
}
@@ -134,7 +134,7 @@ pub mod Follow {
/// @notice performs the follow action
/// @param follower_profile_address address of the user trying to perform the follow action
fn follow(ref self: ContractState, follower_profile_address: ContractAddress) -> u256 {
- hub_only(self.karst_hub.read());
+ hub_only(self.coloniz_hub.read());
let follow_id = self
.follow_id_by_follower_profile_address
.read(follower_profile_address);
@@ -146,7 +146,7 @@ pub mod Follow {
/// @param unfollower_profile_address address of the user trying to perform the unfollow
/// action
fn unfollow(ref self: ContractState, unfollower_profile_address: ContractAddress) {
- hub_only(self.karst_hub.read());
+ hub_only(self.coloniz_hub.read());
let follow_id = self
.follow_id_by_follower_profile_address
.read(unfollower_profile_address);
@@ -159,7 +159,7 @@ pub mod Follow {
fn process_block(
ref self: ContractState, follower_profile_address: ContractAddress
) -> bool {
- hub_only(self.karst_hub.read());
+ hub_only(self.coloniz_hub.read());
let follow_id = self
.follow_id_by_follower_profile_address
.read(follower_profile_address);
@@ -193,7 +193,7 @@ pub mod Follow {
fn process_unblock(
ref self: ContractState, follower_profile_address: ContractAddress
) -> bool {
- hub_only(self.karst_hub.read());
+ hub_only(self.coloniz_hub.read());
let follow_id = self
.follow_id_by_follower_profile_address
.read(follower_profile_address);
@@ -277,7 +277,7 @@ pub mod Follow {
// *************************************************************************
/// @notice returns the collection name
fn name(self: @ContractState) -> ByteArray {
- return "KARST:FOLLOWER";
+ return "coloniz:FOLLOWER";
}
/// @notice returns the collection symbol
diff --git a/src/hub/hub.cairo b/src/hub/hub.cairo
index dc4e621..26f20b4 100644
--- a/src/hub/hub.cairo
+++ b/src/hub/hub.cairo
@@ -1,7 +1,7 @@
use starknet::ContractAddress;
#[starknet::interface]
-trait IKarstHub {
+trait IcolonizHub {
fn follow(
ref self: TState,
follower_profile_address: ContractAddress,
@@ -25,24 +25,24 @@ trait IKarstHub {
}
#[starknet::contract]
-pub mod KarstHub {
+pub mod ColonizHub {
use core::array::SpanTrait;
use starknet::{
ContractAddress, get_caller_address, get_contract_address,
storage::{StoragePointerWriteAccess, StoragePointerReadAccess}
};
- use karst::profile::profile::ProfileComponent;
- use karst::publication::publication::PublicationComponent;
+ use coloniz::profile::profile::ProfileComponent;
+ use coloniz::publication::publication::PublicationComponent;
use openzeppelin::access::ownable::OwnableComponent;
- use karst::community::community::CommunityComponent;
- use karst::channel::channel::ChannelComponent;
- use karst::jolt::jolt::JoltComponent;
- use karst::interfaces::IFollowNFT::{IFollowNFTDispatcher, IFollowNFTDispatcherTrait};
- use karst::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
- use karst::interfaces::IHandleRegistry::{
+ use coloniz::community::community::CommunityComponent;
+ use coloniz::channel::channel::ChannelComponent;
+ use coloniz::jolt::jolt::JoltComponent;
+ use coloniz::interfaces::IFollowNFT::{IFollowNFTDispatcher, IFollowNFTDispatcherTrait};
+ use coloniz::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
+ use coloniz::interfaces::IHandleRegistry::{
IHandleRegistryDispatcher, IHandleRegistryDispatcherTrait
};
- use karst::base::constants::errors::Errors::{
+ use coloniz::base::constants::errors::Errors::{
BLOCKED_STATUS, INVALID_PROFILE_ADDRESS, SELF_FOLLOWING
};
@@ -57,19 +57,19 @@ pub mod KarstHub {
component!(path: CommunityComponent, storage: community, event: CommunityEvent);
#[abi(embed_v0)]
- impl ProfileImpl = ProfileComponent::KarstProfile;
+ impl ProfileImpl = ProfileComponent::colonizProfile;
#[abi(embed_v0)]
- impl PublicationImpl = PublicationComponent::KarstPublication;
+ impl PublicationImpl = PublicationComponent::colonizPublication;
impl ProfilePrivateImpl = ProfileComponent::Private;
#[abi(embed_v0)]
- impl communityImpl = CommunityComponent::KarstCommunity;
+ impl communityImpl = CommunityComponent::colonizCommunity;
impl communityPrivateImpl = CommunityComponent::Private;
#[abi(embed_v0)]
- impl channelImpl = ChannelComponent::KarstChannel;
+ impl channelImpl = ChannelComponent::colonizChannel;
impl channelPrivateImpl = ChannelComponent::InternalImpl;
#[abi(embed_v0)]
@@ -120,7 +120,7 @@ pub mod KarstHub {
#[constructor]
fn constructor(
ref self: ContractState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
handle_contract_address: ContractAddress,
handle_registry_contract_address: ContractAddress,
follow_nft_classhash: felt252,
@@ -130,7 +130,9 @@ pub mod KarstHub {
) {
self
.profile
- ._initializer(karstnft_contract_address, get_contract_address(), follow_nft_classhash);
+ ._initializer(
+ coloniznft_contract_address, get_contract_address(), follow_nft_classhash
+ );
self.handle_contract_address.write(handle_contract_address);
self.handle_registry_contract_address.write(handle_registry_contract_address);
self.channel._initializer(channel_nft_classhash);
@@ -139,7 +141,7 @@ pub mod KarstHub {
}
#[abi(embed_v0)]
- impl KarstHubImpl of super::IKarstHub {
+ impl colonizHubImpl of super::IcolonizHub {
// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
diff --git a/src/interfaces.cairo b/src/interfaces.cairo
index 69de73f..2528461 100644
--- a/src/interfaces.cairo
+++ b/src/interfaces.cairo
@@ -1,4 +1,4 @@
-pub mod IKarstNFT;
+pub mod IColonizNFT;
pub mod IERC721;
pub mod IERC20;
pub mod IRegistry;
diff --git a/src/interfaces/IChannel.cairo b/src/interfaces/IChannel.cairo
index 5388386..817bbf7 100644
--- a/src/interfaces/IChannel.cairo
+++ b/src/interfaces/IChannel.cairo
@@ -1,5 +1,5 @@
use starknet::ContractAddress;
-use karst::base::constants::types::{ChannelDetails, ChannelMember};
+use coloniz::base::constants::types::{ChannelDetails, ChannelMember};
#[starknet::interface]
pub trait IChannel {
diff --git a/src/interfaces/IKarstNFT.cairo b/src/interfaces/IColonizNFT.cairo
similarity index 88%
rename from src/interfaces/IKarstNFT.cairo
rename to src/interfaces/IColonizNFT.cairo
index 36769b4..7fb3c88 100644
--- a/src/interfaces/IKarstNFT.cairo
+++ b/src/interfaces/IColonizNFT.cairo
@@ -1,13 +1,13 @@
use starknet::ContractAddress;
// *************************************************************************
-// INTERFACE of KARST NFT
+// INTERFACE of coloniz NFT
// *************************************************************************
#[starknet::interface]
-pub trait IKarstNFT {
+pub trait IColonizNFT {
// *************************************************************************
// EXTERNALS
// *************************************************************************
- fn mint_karstnft(ref self: TState, address: ContractAddress);
+ fn mint_coloniznft(ref self: TState, address: ContractAddress);
// *************************************************************************
// GETTERS
// *************************************************************************
diff --git a/src/interfaces/ICommunity.cairo b/src/interfaces/ICommunity.cairo
index 166c4bb..ef12058 100644
--- a/src/interfaces/ICommunity.cairo
+++ b/src/interfaces/ICommunity.cairo
@@ -1,5 +1,5 @@
use starknet::{ContractAddress};
-use karst::base::constants::types::{
+use coloniz::base::constants::types::{
GateKeepType, CommunityGateKeepDetails, CommunityType, CommunityDetails, CommunityMember
};
diff --git a/src/interfaces/IFollowNFT.cairo b/src/interfaces/IFollowNFT.cairo
index cf9aef1..83d98fc 100644
--- a/src/interfaces/IFollowNFT.cairo
+++ b/src/interfaces/IFollowNFT.cairo
@@ -1,5 +1,5 @@
use starknet::ContractAddress;
-use karst::base::constants::types::FollowData;
+use coloniz::base::constants::types::FollowData;
// *************************************************************************
// INTERFACE of FollowNFT
diff --git a/src/interfaces/IHub.cairo b/src/interfaces/IHub.cairo
index 79164e5..c71d49a 100644
--- a/src/interfaces/IHub.cairo
+++ b/src/interfaces/IHub.cairo
@@ -1,5 +1,5 @@
use starknet::ContractAddress;
-use karst::base::constants::types::{
+use coloniz::base::constants::types::{
Profile, PostParams, RepostParams, CommentParams, PublicationType, Publication
};
@@ -13,7 +13,7 @@ pub trait IHub {
// *************************************************************************
fn create_profile(
ref self: TState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
registry_hash: felt252,
implementation_hash: felt252,
salt: felt252
diff --git a/src/interfaces/IJolt.cairo b/src/interfaces/IJolt.cairo
index f381e91..e275a9c 100644
--- a/src/interfaces/IJolt.cairo
+++ b/src/interfaces/IJolt.cairo
@@ -1,5 +1,5 @@
use starknet::ContractAddress;
-use karst::base::constants::types::{JoltParams, JoltData, SubscriptionData};
+use coloniz::base::constants::types::{JoltParams, JoltData, SubscriptionData};
#[starknet::interface]
pub trait IJolt {
diff --git a/src/interfaces/IProfile.cairo b/src/interfaces/IProfile.cairo
index 6f7f554..ef96f01 100644
--- a/src/interfaces/IProfile.cairo
+++ b/src/interfaces/IProfile.cairo
@@ -1,7 +1,7 @@
use starknet::ContractAddress;
-use karst::base::constants::types::Profile;
+use coloniz::base::constants::types::Profile;
// *************************************************************************
-// INTERFACE of KARST PROFILE
+// INTERFACE of coloniz PROFILE
// *************************************************************************
#[starknet::interface]
pub trait IProfile {
@@ -10,7 +10,7 @@ pub trait IProfile {
// *************************************************************************
fn create_profile(
ref self: TState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
registry_hash: felt252,
implementation_hash: felt252,
salt: felt252
diff --git a/src/interfaces/IPublication.cairo b/src/interfaces/IPublication.cairo
index e25ce54..148704c 100644
--- a/src/interfaces/IPublication.cairo
+++ b/src/interfaces/IPublication.cairo
@@ -1,40 +1,26 @@
// *************************************************************************
-// INTERFACE of KARST PUBLICATIONS
+// INTERFACE of coloniz PUBLICATIONS
// *************************************************************************
use starknet::ContractAddress;
-use karst::base::constants::types::{
+use coloniz::base::constants::types::{
PostParams, RepostParams, CommentParams, PublicationType, Publication
};
#[starknet::interface]
-pub trait IKarstPublications {
+pub trait IColonizPublications {
// *************************************************************************
// EXTERNALS
// *************************************************************************
fn post(ref self: TState, post_params: PostParams) -> u256;
fn comment(ref self: TState, comment_params: CommentParams) -> u256;
fn repost(ref self: TState, repost_params: RepostParams) -> u256;
- fn upvote(
- ref self: TState,
- profile_address: ContractAddress,
- pub_id: u256,
- channel_id: u256,
- community_id: u256
- );
- fn downvote(
- ref self: TState,
- profile_address: ContractAddress,
- pub_id: u256,
- channel_id: u256,
- community_id: u256
- );
+ fn upvote(ref self: TState, profile_address: ContractAddress, pub_id: u256,);
+ fn downvote(ref self: TState, profile_address: ContractAddress, pub_id: u256,);
fn tip(
ref self: TState,
profile_address: ContractAddress,
pub_id: u256,
amount: u256,
- channel_id: u256,
- community_id: u256,
erc20_contract_address: ContractAddress,
);
fn collect(
diff --git a/src/jolt/jolt.cairo b/src/jolt/jolt.cairo
index d74849b..b78f643 100644
--- a/src/jolt/jolt.cairo
+++ b/src/jolt/jolt.cairo
@@ -13,11 +13,11 @@ pub mod JoltComponent {
StorageMapWriteAccess
}
};
- use karst::base::{
+ use coloniz::base::{
constants::errors::Errors,
constants::types::{JoltData, JoltParams, JoltType, JoltStatus, SubscriptionData}
};
- use karst::interfaces::{IJolt::IJolt, IERC20::{IERC20Dispatcher, IERC20DispatcherTrait}};
+ use coloniz::interfaces::{IJolt::IJolt, IERC20::{IERC20Dispatcher, IERC20DispatcherTrait}};
use openzeppelin::access::ownable::OwnableComponent;
use openzeppelin::access::ownable::OwnableComponent::{OwnableMixinImpl, InternalImpl};
diff --git a/src/karstnft.cairo b/src/karstnft.cairo
deleted file mode 100644
index 346df99..0000000
--- a/src/karstnft.cairo
+++ /dev/null
@@ -1 +0,0 @@
-pub mod karstnft;
diff --git a/src/lib.cairo b/src/lib.cairo
index 59c9e6b..5f1b7b6 100644
--- a/src/lib.cairo
+++ b/src/lib.cairo
@@ -1,4 +1,4 @@
-pub mod karstnft;
+pub mod coloniznft;
pub mod interfaces;
pub mod profile;
pub mod base;
diff --git a/src/mocks/interfaces/IChannelComposable.cairo b/src/mocks/interfaces/IChannelComposable.cairo
index a83a19d..6f65a52 100644
--- a/src/mocks/interfaces/IChannelComposable.cairo
+++ b/src/mocks/interfaces/IChannelComposable.cairo
@@ -1,10 +1,10 @@
use starknet::ContractAddress;
-use karst::base::constants::types::{ChannelDetails, ChannelMember};
-use karst::base::constants::types::{
+use coloniz::base::constants::types::{ChannelDetails, ChannelMember};
+use coloniz::base::constants::types::{
GateKeepType, CommunityGateKeepDetails, CommunityType, CommunityDetails, CommunityMember
};
// *************************************************************************
-// INTERFACE of KARST CHANNEL
+// INTERFACE of coloniz CHANNEL
// *************************************************************************
#[starknet::interface]
pub trait IChannelComposable {
diff --git a/src/mocks/interfaces/IComposable.cairo b/src/mocks/interfaces/IComposable.cairo
index fc04d1c..5b31a98 100644
--- a/src/mocks/interfaces/IComposable.cairo
+++ b/src/mocks/interfaces/IComposable.cairo
@@ -1,9 +1,9 @@
use starknet::ContractAddress;
-use karst::base::constants::types::{
+use coloniz::base::constants::types::{
Profile, PublicationType, Publication, RepostParams, PostParams, CommentParams
};
// *************************************************************************
-// INTERFACE of KARST PROFILE
+// INTERFACE of coloniz PROFILE
// *************************************************************************
#[starknet::interface]
pub trait IComposable {
@@ -12,7 +12,7 @@ pub trait IComposable {
// *************************************************************************
fn create_profile(
ref self: TState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
registry_hash: felt252,
implementation_hash: felt252,
salt: felt252
@@ -38,27 +38,13 @@ pub trait IComposable {
fn post(ref self: TState, post_params: PostParams) -> u256;
fn comment(ref self: TState, comment_params: CommentParams) -> u256;
fn repost(ref self: TState, repost_params: RepostParams) -> u256;
- fn upvote(
- ref self: TState,
- profile_address: ContractAddress,
- pub_id: u256,
- channel_id: u256,
- community_id: u256
- );
- fn downvote(
- ref self: TState,
- profile_address: ContractAddress,
- pub_id: u256,
- channel_id: u256,
- community_id: u256
- );
+ fn upvote(ref self: TState, profile_address: ContractAddress, pub_id: u256,);
+ fn downvote(ref self: TState, profile_address: ContractAddress, pub_id: u256,);
fn tip(
ref self: TState,
profile_address: ContractAddress,
pub_id: u256,
amount: u256,
- channel_id: u256,
- community_id: u256,
erc20_contract_address: ContractAddress,
);
fn collect(
diff --git a/src/mocks/interfaces/IJoltUpgrade.cairo b/src/mocks/interfaces/IJoltUpgrade.cairo
index 85087a5..23ceaa8 100644
--- a/src/mocks/interfaces/IJoltUpgrade.cairo
+++ b/src/mocks/interfaces/IJoltUpgrade.cairo
@@ -1,4 +1,4 @@
-use karst::base::constants::types::{JoltParams};
+use coloniz::base::constants::types::{JoltParams};
#[starknet::interface]
pub trait IJoltUpgrade {
diff --git a/src/namespaces/handle_registry.cairo b/src/namespaces/handle_registry.cairo
index 9695256..d35fd90 100644
--- a/src/namespaces/handle_registry.cairo
+++ b/src/namespaces/handle_registry.cairo
@@ -11,10 +11,10 @@ pub mod HandleRegistry {
StorageMapWriteAccess
}
};
- use karst::interfaces::IHandleRegistry::IHandleRegistry;
- use karst::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
- use karst::base::{constants::errors::Errors};
- use karst::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
+ use coloniz::interfaces::IHandleRegistry::IHandleRegistry;
+ use coloniz::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
+ use coloniz::base::{constants::errors::Errors};
+ use coloniz::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
// *************************************************************************
// STORAGE
diff --git a/src/namespaces/handles.cairo b/src/namespaces/handles.cairo
index adc8c76..13e779e 100644
--- a/src/namespaces/handles.cairo
+++ b/src/namespaces/handles.cairo
@@ -18,11 +18,11 @@ pub mod Handles {
access::ownable::OwnableComponent, token::erc721::{ERC721Component, ERC721HooksEmptyImpl},
introspection::{src5::SRC5Component}
};
- use karst::base::{
+ use coloniz::base::{
constants::errors::Errors, utils::byte_array_extra::FeltTryIntoByteArray,
token_uris::handle_token_uri::HandleTokenUri,
};
- use karst::interfaces::{IHandle::IHandle};
+ use coloniz::interfaces::{IHandle::IHandle};
component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
component!(path: SRC5Component, storage: src5, event: SRC5Event);
@@ -109,7 +109,7 @@ pub mod Handles {
#[constructor]
fn constructor(ref self: ContractState, admin: ContractAddress) {
self.admin.write(admin);
- self.erc721.initializer("Karst Handles", "KARST", "");
+ self.erc721.initializer("coloniz Handles", "coloniz", "");
}
// *************************************************************************
@@ -152,7 +152,7 @@ pub mod Handles {
// *************************************************************************
// GETTERS
// *************************************************************************
- /// @notice returns Karst namespace
+ /// @notice returns coloniz namespace
fn get_namespace(self: @ContractState) -> felt252 {
return NAMESPACE;
}
@@ -201,12 +201,12 @@ pub mod Handles {
// *************************************************************************
/// @notice returns the collection name
fn name(self: @ContractState) -> ByteArray {
- return "Karst Handles";
+ return "coloniz Handles";
}
/// @notice returns the collection symbol
fn symbol(self: @ContractState) -> ByteArray {
- return "KARST";
+ return "coloniz";
}
/// @notice returns the token URI of a particular handle
diff --git a/src/presets/channel.cairo b/src/presets/channel.cairo
index 0d3d29a..2f9786a 100644
--- a/src/presets/channel.cairo
+++ b/src/presets/channel.cairo
@@ -1,8 +1,8 @@
#[starknet::contract]
-pub mod KarstChannel {
- use karst::channel::channel::ChannelComponent;
- use karst::community::community::CommunityComponent;
- use karst::jolt::jolt::JoltComponent;
+pub mod ColonizChannel {
+ use coloniz::channel::channel::ChannelComponent;
+ use coloniz::community::community::CommunityComponent;
+ use coloniz::jolt::jolt::JoltComponent;
use openzeppelin::access::ownable::OwnableComponent;
component!(path: ChannelComponent, storage: channel, event: ChannelEvent);
@@ -11,11 +11,11 @@ pub mod KarstChannel {
component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
#[abi(embed_v0)]
- impl channelImpl = ChannelComponent::KarstChannel;
+ impl channelImpl = ChannelComponent::colonizChannel;
impl channelPrivateImpl = ChannelComponent::InternalImpl;
#[abi(embed_v0)]
- impl communityImpl = CommunityComponent::KarstCommunity;
+ impl communityImpl = CommunityComponent::colonizCommunity;
impl communityPrivateImpl = CommunityComponent::Private;
#[storage]
diff --git a/src/presets/community.cairo b/src/presets/community.cairo
index 7f051b4..38bfc58 100644
--- a/src/presets/community.cairo
+++ b/src/presets/community.cairo
@@ -1,8 +1,8 @@
#[starknet::contract]
-pub mod KarstCommunity {
+pub mod ColonizCommunity {
use starknet::ContractAddress;
- use karst::community::community::CommunityComponent;
- use karst::jolt::jolt::JoltComponent;
+ use coloniz::community::community::CommunityComponent;
+ use coloniz::jolt::jolt::JoltComponent;
use openzeppelin::access::ownable::OwnableComponent;
component!(path: CommunityComponent, storage: community, event: CommunityEvent);
@@ -10,7 +10,7 @@ pub mod KarstCommunity {
component!(path: OwnableComponent, storage: ownable, event: OwnableEvent);
#[abi(embed_v0)]
- impl communityImpl = CommunityComponent::KarstCommunity;
+ impl communityImpl = CommunityComponent::colonizCommunity;
impl communityPrivateImpl = CommunityComponent::Private;
#[abi(embed_v0)]
impl joltImpl = JoltComponent::Jolt;
diff --git a/src/presets/jolt.cairo b/src/presets/jolt.cairo
index 7a4f2d4..8608861 100644
--- a/src/presets/jolt.cairo
+++ b/src/presets/jolt.cairo
@@ -1,7 +1,7 @@
#[starknet::contract]
pub mod Jolt {
use starknet::ContractAddress;
- use karst::jolt::jolt::JoltComponent;
+ use coloniz::jolt::jolt::JoltComponent;
use openzeppelin::access::ownable::OwnableComponent;
component!(path: JoltComponent, storage: jolt, event: JoltEvent);
diff --git a/src/presets/profile.cairo b/src/presets/profile.cairo
index f616bca..9da3a13 100644
--- a/src/presets/profile.cairo
+++ b/src/presets/profile.cairo
@@ -1,12 +1,12 @@
#[starknet::contract]
-pub mod KarstProfile {
+pub mod ColonizProfile {
use starknet::ContractAddress;
- use karst::profile::profile::ProfileComponent;
+ use coloniz::profile::profile::ProfileComponent;
component!(path: ProfileComponent, storage: profile, event: ProfileEvent);
#[abi(embed_v0)]
- impl profileImpl = ProfileComponent::KarstProfile;
+ impl profileImpl = ProfileComponent::colonizProfile;
impl ProfilePrivateImpl = ProfileComponent::Private;
#[storage]
@@ -25,10 +25,10 @@ pub mod KarstProfile {
#[constructor]
fn constructor(
ref self: ContractState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
hub_address: ContractAddress,
follow_nft_classhash: felt252
) {
- self.profile._initializer(karstnft_contract_address, hub_address, follow_nft_classhash);
+ self.profile._initializer(coloniznft_contract_address, hub_address, follow_nft_classhash);
}
}
diff --git a/src/presets/publication.cairo b/src/presets/publication.cairo
index e527cd0..7aaf365 100644
--- a/src/presets/publication.cairo
+++ b/src/presets/publication.cairo
@@ -1,12 +1,12 @@
#[starknet::contract]
-pub mod KarstPublication {
+pub mod ColonizPublication {
use starknet::ContractAddress;
- use karst::publication::publication::PublicationComponent;
- use karst::profile::profile::ProfileComponent;
- use karst::jolt::jolt::JoltComponent;
+ use coloniz::publication::publication::PublicationComponent;
+ use coloniz::profile::profile::ProfileComponent;
+ use coloniz::jolt::jolt::JoltComponent;
use openzeppelin::access::ownable::OwnableComponent;
- use karst::community::community::CommunityComponent;
- use karst::channel::channel::ChannelComponent;
+ use coloniz::community::community::CommunityComponent;
+ use coloniz::channel::channel::ChannelComponent;
component!(path: PublicationComponent, storage: publication, event: PublicationEvent);
@@ -18,10 +18,10 @@ pub mod KarstPublication {
#[abi(embed_v0)]
- impl publicationImpl = PublicationComponent::KarstPublication;
+ impl publicationImpl = PublicationComponent::colonizPublication;
impl publicationInternalImpl = PublicationComponent::InternalImpl;
#[abi(embed_v0)]
- impl profileImpl = ProfileComponent::KarstProfile;
+ impl profileImpl = ProfileComponent::colonizProfile;
impl ProfilePrivateImpl = ProfileComponent::Private;
#[abi(embed_v0)]
@@ -29,11 +29,11 @@ pub mod KarstPublication {
impl joltPrivateImpl = JoltComponent::Private;
#[abi(embed_v0)]
- impl communityImpl = CommunityComponent::KarstCommunity;
+ impl communityImpl = CommunityComponent::colonizCommunity;
impl communityPrivateImpl = CommunityComponent::Private;
#[abi(embed_v0)]
- impl channelImpl = ChannelComponent::KarstChannel;
+ impl channelImpl = ChannelComponent::colonizChannel;
impl channelPrivateImpl = ChannelComponent::InternalImpl;
#[storage]
@@ -72,14 +72,14 @@ pub mod KarstPublication {
#[constructor]
fn constructor(
ref self: ContractState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
hub_address: ContractAddress,
follow_nft_classhash: felt252,
channel_nft_classhash: felt252,
community_nft_classhash: felt252,
owner: ContractAddress
) {
- self.profile._initializer(karstnft_contract_address, hub_address, follow_nft_classhash);
+ self.profile._initializer(coloniznft_contract_address, hub_address, follow_nft_classhash);
self.channel._initializer(channel_nft_classhash);
self.community._initializer(community_nft_classhash);
self.jolt._initializer(owner);
diff --git a/src/profile/profile.cairo b/src/profile/profile.cairo
index bd84298..720bbf9 100644
--- a/src/profile/profile.cairo
+++ b/src/profile/profile.cairo
@@ -12,11 +12,11 @@ pub mod ProfileComponent {
StorageMapWriteAccess
}
};
- use karst::interfaces::IKarstNFT::{IKarstNFTDispatcher, IKarstNFTDispatcherTrait};
- use karst::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryLibraryDispatcher};
- use karst::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
- use karst::interfaces::IProfile::IProfile;
- use karst::base::{constants::types::Profile, constants::errors::Errors::NOT_PROFILE_OWNER};
+ use coloniz::interfaces::IColonizNFT::{IColonizNFTDispatcher, IColonizNFTDispatcherTrait};
+ use coloniz::interfaces::IRegistry::{IRegistryDispatcherTrait, IRegistryLibraryDispatcher};
+ use coloniz::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
+ use coloniz::interfaces::IProfile::IProfile;
+ use coloniz::base::{constants::types::Profile, constants::errors::Errors::NOT_PROFILE_OWNER};
// *************************************************************************
// STORAGE
@@ -24,7 +24,7 @@ pub mod ProfileComponent {
#[storage]
pub struct Storage {
profile: Map,
- karst_nft_address: ContractAddress,
+ coloniz_nft_address: ContractAddress,
hub_address: ContractAddress,
follow_nft_classhash: ClassHash
}
@@ -51,31 +51,33 @@ pub mod ProfileComponent {
// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
- #[embeddable_as(KarstProfile)]
+ #[embeddable_as(colonizProfile)]
impl ProfileImpl<
TContractState, +HasComponent
> of IProfile> {
- /// @notice creates karst profile
- /// @param karstnft_contract_address address of karstnft
+ /// @notice creates coloniz profile
+ /// @param coloniznft_contract_address address of coloniznft
/// @param registry_hash class_hash of registry contract
/// @param implementation_hash the class hash of the reference account
/// @param salt random salt for deployment
fn create_profile(
ref self: ComponentState,
- karstnft_contract_address: ContractAddress,
+ coloniznft_contract_address: ContractAddress,
registry_hash: felt252,
implementation_hash: felt252,
salt: felt252
) -> ContractAddress {
- // mint karst nft
+ // mint coloniz nft
let recipient = get_caller_address();
- let owns_karstnft = IERC721Dispatcher { contract_address: karstnft_contract_address }
+ let owns_coloniznft = IERC721Dispatcher {
+ contract_address: coloniznft_contract_address
+ }
.balance_of(recipient);
- if owns_karstnft == 0 {
- IKarstNFTDispatcher { contract_address: karstnft_contract_address }
- .mint_karstnft(recipient);
+ if owns_coloniznft == 0 {
+ IColonizNFTDispatcher { contract_address: coloniznft_contract_address }
+ .mint_coloniznft(recipient);
}
- let token_id = IKarstNFTDispatcher { contract_address: karstnft_contract_address }
+ let token_id = IColonizNFTDispatcher { contract_address: coloniznft_contract_address }
.get_user_token_id(recipient);
let tx_info = get_tx_info().unbox();
let chain_id = tx_info.chain_id;
@@ -84,7 +86,7 @@ pub mod ProfileComponent {
class_hash: registry_hash.try_into().unwrap()
}
.create_account(
- implementation_hash, karstnft_contract_address, token_id, salt, chain_id
+ implementation_hash, coloniznft_contract_address, token_id, salt, chain_id
);
// deploy follow nft contract
@@ -176,11 +178,11 @@ pub mod ProfileComponent {
/// @notice initialize profile component
fn _initializer(
ref self: ComponentState,
- karst_nft_address: ContractAddress,
+ coloniz_nft_address: ContractAddress,
hub_address: ContractAddress,
follow_nft_classhash: felt252
) {
- self.karst_nft_address.write(karst_nft_address);
+ self.coloniz_nft_address.write(coloniz_nft_address);
self.hub_address.write(hub_address);
self.follow_nft_classhash.write(follow_nft_classhash.try_into().unwrap());
}
diff --git a/src/publication/collectnft.cairo b/src/publication/collectnft.cairo
index 8b54d7a..62bd502 100644
--- a/src/publication/collectnft.cairo
+++ b/src/publication/collectnft.cairo
@@ -9,9 +9,9 @@ pub mod CollectNFT {
use core::traits::TryInto;
use starknet::{ContractAddress, get_block_timestamp};
use core::num::traits::zero::Zero;
- use karst::interfaces::ICollectNFT::ICollectNFT;
- use karst::interfaces::IHub::{IHubDispatcher, IHubDispatcherTrait};
- use karst::base::{
+ use coloniz::interfaces::ICollectNFT::ICollectNFT;
+ use coloniz::interfaces::IHub::{IHubDispatcher, IHubDispatcherTrait};
+ use coloniz::base::{
constants::errors::Errors::{ALREADY_MINTED, TOKEN_DOES_NOT_EXIST},
utils::base64_extended::convert_into_byteArray
};
@@ -60,7 +60,7 @@ pub mod CollectNFT {
src5: SRC5Component::Storage,
#[substorage(v0)]
ownable: OwnableComponent::Storage,
- karst_hub: ContractAddress,
+ coloniz_hub: ContractAddress,
last_minted_id: u256,
mint_timestamp: Map,
user_token_id: Map,
@@ -88,11 +88,11 @@ pub mod CollectNFT {
#[constructor]
fn constructor(
ref self: ContractState,
- karst_hub: ContractAddress,
+ coloniz_hub: ContractAddress,
profile_address: ContractAddress,
pub_id: u256,
) {
- self.karst_hub.write(karst_hub);
+ self.coloniz_hub.write(coloniz_hub);
self.profile_address.write(profile_address);
self.pub_id.write(pub_id);
}
@@ -149,7 +149,7 @@ pub mod CollectNFT {
let mut collection_name = ArrayTrait::::new();
let profile_address_felt252: felt252 = self.profile_address.read().into();
let pub_id_felt252: felt252 = self.pub_id.read().try_into().unwrap();
- collection_name.append('Karst Collect | Profile #');
+ collection_name.append('coloniz Collect | Profile #');
collection_name.append(profile_address_felt252);
collection_name.append('- Publication #');
collection_name.append(pub_id_felt252);
@@ -159,7 +159,7 @@ pub mod CollectNFT {
/// @notice returns the collection symbol
fn symbol(self: @ContractState) -> ByteArray {
- return "KARST:COLLECT";
+ return "coloniz:COLLECT";
}
/// @notice returns the token_uri for a particular token_id
@@ -167,8 +167,8 @@ pub mod CollectNFT {
assert(self.erc721.exists(token_id), TOKEN_DOES_NOT_EXIST);
let profile_address = self.profile_address.read();
let pub_id = self.pub_id.read();
- let karst_hub = self.karst_hub.read();
- let token_uri = IHubDispatcher { contract_address: karst_hub }
+ let coloniz_hub = self.coloniz_hub.read();
+ let token_uri = IHubDispatcher { contract_address: coloniz_hub }
.get_publication_content_uri(profile_address, pub_id);
token_uri
}
diff --git a/src/publication/publication.cairo b/src/publication/publication.cairo
index cdf2682..6d46867 100644
--- a/src/publication/publication.cairo
+++ b/src/publication/publication.cairo
@@ -4,7 +4,7 @@ pub mod PublicationComponent {
// IMPORTS
// *************************************************************************
use core::traits::TryInto;
- use karst::interfaces::IProfile::IProfile;
+ use coloniz::interfaces::IProfile::IProfile;
use core::num::traits::zero::Zero;
use core::option::OptionTrait;
use starknet::{
@@ -12,12 +12,12 @@ pub mod PublicationComponent {
syscalls::{deploy_syscall}, class_hash::ClassHash, SyscallResultTrait,
storage::{Map, StorageMapReadAccess, StorageMapWriteAccess}
};
- use karst::interfaces::IPublication::IKarstPublications;
- use karst::interfaces::IJolt::IJolt;
- use karst::interfaces::ICommunity::ICommunity;
- use karst::interfaces::IChannel::IChannel;
- use karst::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatcherTrait};
- use karst::base::{
+ use coloniz::interfaces::IPublication::IColonizPublications;
+ use coloniz::interfaces::IJolt::IJolt;
+ use coloniz::interfaces::ICommunity::ICommunity;
+ use coloniz::interfaces::IChannel::IChannel;
+ use coloniz::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatcherTrait};
+ use coloniz::base::{
constants::errors::Errors::{
NOT_PROFILE_OWNER, UNSUPPORTED_PUB_TYPE, ALREADY_REACTED, NOT_COMMUNITY_MEMBER,
BANNED_MEMBER, NOT_CHANNEL_MEMBER, BANNED_FROM_CHANNEL
@@ -28,11 +28,11 @@ pub mod PublicationComponent {
}
};
- use karst::profile::profile::ProfileComponent;
- use karst::profile::profile::ProfileComponent::PrivateTrait;
- use karst::jolt::jolt::JoltComponent;
- use karst::community::community::CommunityComponent;
- use karst::channel::channel::ChannelComponent;
+ use coloniz::profile::profile::ProfileComponent;
+ use coloniz::profile::profile::ProfileComponent::PrivateTrait;
+ use coloniz::jolt::jolt::JoltComponent;
+ use coloniz::community::community::CommunityComponent;
+ use coloniz::channel::channel::ChannelComponent;
use openzeppelin::access::ownable::OwnableComponent;
@@ -118,7 +118,7 @@ pub mod PublicationComponent {
// *************************************************************************
// EXTERNAL FUNCTIONS
// *************************************************************************
- #[embeddable_as(KarstPublication)]
+ #[embeddable_as(colonizPublication)]
impl PublicationsImpl<
TContractState,
+HasComponent,
@@ -128,7 +128,7 @@ pub mod PublicationComponent {
impl Ownable: OwnableComponent::HasComponent,
impl Community: CommunityComponent::HasComponent,
impl Channel: ChannelComponent::HasComponent,
- > of IKarstPublications> {
+ > of IColonizPublications> {
// *************************************************************************
// PUBLISHING FUNCTIONS
// *************************************************************************
@@ -305,14 +305,12 @@ pub mod PublicationComponent {
ref self: ComponentState,
profile_address: ContractAddress,
pub_id: u256,
- channel_id: u256,
- community_id: u256
) {
let mut publication = self.get_publication(profile_address, pub_id);
let caller = get_caller_address();
let has_voted = self.vote_status.read((caller, pub_id));
- self._validate_channel_membership_and_ban_status(caller, channel_id);
- self._validate_community_membership_and_ban_status(caller, community_id);
+ self._validate_channel_membership_and_ban_status(caller, publication.channel_id);
+ self._validate_community_membership_and_ban_status(caller, publication.community_id);
let upvote_current_count = publication.upvote + 1;
assert(has_voted == false, ALREADY_REACTED);
let updated_publication = Publication { upvote: upvote_current_count, ..publication };
@@ -337,14 +335,12 @@ pub mod PublicationComponent {
ref self: ComponentState,
profile_address: ContractAddress,
pub_id: u256,
- channel_id: u256,
- community_id: u256
) {
let mut publication = self.get_publication(profile_address, pub_id);
let caller = get_caller_address();
let has_voted = self.vote_status.read((caller, pub_id));
- self._validate_channel_membership_and_ban_status(caller, channel_id);
- self._validate_community_membership_and_ban_status(caller, community_id);
+ self._validate_channel_membership_and_ban_status(caller, publication.channel_id);
+ self._validate_community_membership_and_ban_status(caller, publication.community_id);
let downvote_current_count = publication.downvote + 1;
assert(has_voted == false, ALREADY_REACTED);
let updated_publication = Publication {
@@ -372,20 +368,17 @@ pub mod PublicationComponent {
profile_address: ContractAddress,
pub_id: u256,
amount: u256,
- channel_id: u256,
- community_id: u256,
erc20_contract_address: ContractAddress,
) {
let caller = get_caller_address();
let mut publication = self.get_publication(profile_address, pub_id);
- self._validate_channel_membership_and_ban_status(caller, channel_id);
- self._validate_community_membership_and_ban_status(caller, community_id);
- let current_tip_amount = publication.tipped_amount;
+ self._validate_channel_membership_and_ban_status(caller, publication.channel_id);
+ self._validate_community_membership_and_ban_status(caller, publication.community_id);
let jolt_param = JoltParams {
jolt_type: JoltType::Tip,
recipient: profile_address,
memo: "Tip User",
- amount: current_tip_amount + amount,
+ amount: amount,
expiration_stamp: 0,
subscription_details: (0, false, 0),
erc20_contract_address: erc20_contract_address
@@ -667,14 +660,14 @@ pub mod PublicationComponent {
fn _deploy_collect_nft(
ref self: ComponentState,
- karst_hub: ContractAddress,
+ coloniz_hub: ContractAddress,
profile_address: ContractAddress,
pub_id: u256,
collect_nft_impl_class_hash: felt252,
salt: felt252
) -> ContractAddress {
let mut constructor_calldata: Array = array![
- karst_hub.into(), profile_address.into(), pub_id.low.into(), pub_id.high.into()
+ coloniz_hub.into(), profile_address.into(), pub_id.low.into(), pub_id.high.into()
];
let class_hash: ClassHash = collect_nft_impl_class_hash.try_into().unwrap();
let result = deploy_syscall(class_hash, salt, constructor_calldata.span(), true);
diff --git a/tests/test_channel.cairo b/tests/test_channel.cairo
index aacbdf9..9b4092a 100644
--- a/tests/test_channel.cairo
+++ b/tests/test_channel.cairo
@@ -11,9 +11,9 @@ use snforge_std::{
EventSpyAssertionsTrait, ContractClassTrait, DeclareResultTrait
};
use core::starknet::{ContractAddress, contract_address_const, get_block_timestamp};
-use karst::channel::channel::ChannelComponent;
-use karst::base::constants::types::{ChannelDetails};
-use karst::mocks::interfaces::IChannelComposable::{
+use coloniz::channel::channel::ChannelComponent;
+use coloniz::base::constants::types::{ChannelDetails};
+use coloniz::mocks::interfaces::IChannelComposable::{
IChannelComposableDispatcher, IChannelComposableDispatcherTrait
};
@@ -29,7 +29,7 @@ fn __setup__() -> ContractAddress {
let community_nft_class_hash = declare("CommunityNFT").unwrap().contract_class().class_hash;
let channel_nft_class_hash = declare("ChannelNFT").unwrap().contract_class().class_hash;
- let channel_contract = declare("KarstChannel").unwrap().contract_class();
+ let channel_contract = declare("ColonizChannel").unwrap().contract_class();
let mut channel_constructor_calldata = array![
(*(channel_nft_class_hash)).into(), (*(community_nft_class_hash)).into()
];
@@ -120,7 +120,7 @@ fn test_create_channel_by_community_member() {
}
#[test]
-#[should_panic(expected: ('Karst: Not a Community Member',))]
+#[should_panic(expected: ('coloniz: Not Community Member',))]
fn test_should_panic_if_channel_creator_is_not_community_member() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -242,7 +242,7 @@ fn test_channel_nft_is_burnt_on_leaving_channel() {
}
#[test]
-#[should_panic(expected: ('Karst: already a Member',))]
+#[should_panic(expected: ('coloniz: already a Member',))]
fn test_should_panic_if_a_user_joins_one_channel_twice() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -264,7 +264,7 @@ fn test_should_panic_if_a_user_joins_one_channel_twice() {
stop_cheat_caller_address(channel_contract_address);
}
#[test]
-#[should_panic(expected: ('Karst: banned from channel',))]
+#[should_panic(expected: ('coloniz: banned from channel',))]
fn test_should_panic_if_banned_members_join_a_channel() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -292,7 +292,7 @@ fn test_should_panic_if_banned_members_join_a_channel() {
}
#[test]
-#[should_panic(expected: ('Karst: banned from channel',))]
+#[should_panic(expected: ('coloniz: banned from channel',))]
fn test_should_panic_if_banned_user_tries_to_leave_channel_and_then_rejoin() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -439,7 +439,7 @@ fn test_leave_channel() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel member',))]
+#[should_panic(expected: ('coloniz: not channel member',))]
fn test_should_panic_if_profile_leaving_is_not_a_member() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -454,7 +454,7 @@ fn test_should_panic_if_profile_leaving_is_not_a_member() {
}
#[test]
-#[should_panic(expected: ('Karst: channel has no members',))]
+#[should_panic(expected: ('coloniz: channel has no members',))]
fn test_channel_have_members_before_leaving() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -559,7 +559,7 @@ fn test_set_channel_metadata_with_moderator() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_set_metadata_should_panic_if_caller_is_not_owner_or_moderator() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -623,7 +623,7 @@ fn test_add_channel_mods() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel owner',))]
+#[should_panic(expected: ('coloniz: not channel owner',))]
fn test_only_owner_can_add_channel_mod() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -663,7 +663,7 @@ fn test_only_owner_can_add_channel_mod() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel member',))]
+#[should_panic(expected: ('coloniz: not channel member',))]
fn test_should_panic_if_mod_is_not_member() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -762,7 +762,7 @@ fn test_remove_channel_mods() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel owner',))]
+#[should_panic(expected: ('coloniz: not channel owner',))]
fn test_only_owner_can_remove_channel_mod() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -798,7 +798,7 @@ fn test_only_owner_can_remove_channel_mod() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel moderator',))]
+#[should_panic(expected: ('coloniz: not channel moderator',))]
fn test_should_panic_if_profile_to_be_removed_is_not_mod() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -912,7 +912,7 @@ fn test_set_channel_censorship_status() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel owner',))]
+#[should_panic(expected: ('coloniz: not channel owner',))]
fn test_set_channel_censorship_status_not_owner() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -1059,7 +1059,7 @@ fn test_set_ban_status_emit_event() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_should_panic_if_caller_to_set_ban_status_is_not_owner_or_mod() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -1097,7 +1097,7 @@ fn test_should_panic_if_caller_to_set_ban_status_is_not_owner_or_mod() {
}
#[test]
-#[should_panic(expected: ('Karst: not channel member',))]
+#[should_panic(expected: ('coloniz: not channel member',))]
fn test_can_only_set_ban_status_for_members() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
@@ -1127,7 +1127,7 @@ fn test_can_only_set_ban_status_for_members() {
}
#[test]
-#[should_panic(expected: ('Karst: array mismatch',))]
+#[should_panic(expected: ('coloniz: array mismatch',))]
fn test_should_not_set_ban_status_for_invalid_array_length() {
let channel_contract_address = __setup__();
let dispatcher = IChannelComposableDispatcher { contract_address: channel_contract_address };
diff --git a/tests/test_karstnft.cairo b/tests/test_coloniznft.cairo
similarity index 71%
rename from tests/test_karstnft.cairo
rename to tests/test_coloniznft.cairo
index ed517f8..851b9f5 100644
--- a/tests/test_karstnft.cairo
+++ b/tests/test_coloniznft.cairo
@@ -10,13 +10,13 @@ use snforge_std::{
use openzeppelin::{token::erc721::interface::{ERC721ABIDispatcher, ERC721ABIDispatcherTrait}};
-use karst::interfaces::IKarstNFT::{IKarstNFTDispatcher, IKarstNFTDispatcherTrait};
+use coloniz::interfaces::IColonizNFT::{IColonizNFTDispatcher, IColonizNFTDispatcherTrait};
const ADMIN: felt252 = 'ADMIN';
const USER_ONE: felt252 = 'BOB';
fn __setup__() -> ContractAddress {
- let nft_contract = declare("KarstNFT").unwrap().contract_class();
+ let nft_contract = declare("ColonizNFT").unwrap().contract_class();
let mut calldata: Array = array![ADMIN];
let (nft_contract_address, _) = nft_contract.deploy(@calldata).unwrap_syscall();
(nft_contract_address)
@@ -29,7 +29,7 @@ fn test_metadata() {
start_cheat_caller_address(nft_contract_address, ADMIN.try_into().unwrap());
let nft_name = dispatcher.name();
let nft_symbol = dispatcher.symbol();
- assert(nft_name == "Karst", 'invalid name');
+ assert(nft_name == "coloniz", 'invalid name');
assert(nft_symbol == "KST", 'invalid symbol');
stop_cheat_caller_address(nft_contract_address);
}
@@ -37,7 +37,7 @@ fn test_metadata() {
#[test]
fn test_last_minted_id_on_init_is_zero() {
let nft_contract_address = __setup__();
- let dispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let dispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
start_cheat_caller_address(nft_contract_address, ADMIN.try_into().unwrap());
let last_minted_id = dispatcher.get_last_minted_id();
assert(last_minted_id.is_zero(), 'last minted id not zero');
@@ -45,34 +45,34 @@ fn test_last_minted_id_on_init_is_zero() {
}
#[test]
-fn test_mint_karst_nft() {
+fn test_mint_coloniz_nft() {
let nft_contract_address = __setup__();
- let dispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let dispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
let erc721_dispatcher = ERC721ABIDispatcher { contract_address: nft_contract_address };
start_cheat_caller_address(nft_contract_address, ADMIN.try_into().unwrap());
- dispatcher.mint_karstnft(USER_ONE.try_into().unwrap());
+ dispatcher.mint_coloniznft(USER_ONE.try_into().unwrap());
let balance = erc721_dispatcher.balance_of(USER_ONE.try_into().unwrap());
assert(balance == 1, 'nft not minted');
stop_cheat_caller_address(nft_contract_address);
}
#[test]
-#[should_panic(expected: ('Karst: user already minted!',))]
-fn test_mint_karst_nft_twice_for_the_same_user() {
+#[should_panic(expected: ('coloniz: user already minted!',))]
+fn test_mint_coloniz_nft_twice_for_the_same_user() {
let nft_contract_address = __setup__();
- let dispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let dispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
start_cheat_caller_address(nft_contract_address, ADMIN.try_into().unwrap());
- dispatcher.mint_karstnft(USER_ONE.try_into().unwrap());
- dispatcher.mint_karstnft(USER_ONE.try_into().unwrap());
+ dispatcher.mint_coloniznft(USER_ONE.try_into().unwrap());
+ dispatcher.mint_coloniznft(USER_ONE.try_into().unwrap());
stop_cheat_caller_address(nft_contract_address);
}
#[test]
fn test_get_last_minted_id_after_minting() {
let nft_contract_address = __setup__();
- let dispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let dispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
start_cheat_caller_address(nft_contract_address, ADMIN.try_into().unwrap());
- dispatcher.mint_karstnft(USER_ONE.try_into().unwrap());
+ dispatcher.mint_coloniznft(USER_ONE.try_into().unwrap());
let last_minted_id = dispatcher.get_last_minted_id();
assert(last_minted_id == 1, 'invalid last minted id');
stop_cheat_caller_address(nft_contract_address);
@@ -81,9 +81,9 @@ fn test_get_last_minted_id_after_minting() {
#[test]
fn test_get_user_token_id_after_minting() {
let nft_contract_address = __setup__();
- let dispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let dispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
start_cheat_caller_address(nft_contract_address, ADMIN.try_into().unwrap());
- dispatcher.mint_karstnft(USER_ONE.try_into().unwrap());
+ dispatcher.mint_coloniznft(USER_ONE.try_into().unwrap());
let user_token_id = dispatcher.get_user_token_id(USER_ONE.try_into().unwrap());
assert(user_token_id == 1, 'invalid user token id');
stop_cheat_caller_address(nft_contract_address);
diff --git a/tests/test_community.cairo b/tests/test_community.cairo
index 875c402..60146c6 100644
--- a/tests/test_community.cairo
+++ b/tests/test_community.cairo
@@ -11,12 +11,12 @@ use snforge_std::{
EventSpyAssertionsTrait, ContractClassTrait, DeclareResultTrait
};
-use karst::community::community::CommunityComponent;
-use karst::base::constants::types::{GateKeepType, CommunityType};
-use karst::interfaces::ICommunity::{ICommunityDispatcher, ICommunityDispatcherTrait};
-use karst::interfaces::IJolt::{IJoltDispatcher, IJoltDispatcherTrait};
-use karst::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
-use karst::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
+use coloniz::community::community::CommunityComponent;
+use coloniz::base::constants::types::{GateKeepType, CommunityType};
+use coloniz::interfaces::ICommunity::{ICommunityDispatcher, ICommunityDispatcherTrait};
+use coloniz::interfaces::IJolt::{IJoltDispatcher, IJoltDispatcherTrait};
+use coloniz::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
+use coloniz::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
const HUB_ADDRESS: felt252 = 'HUB';
const ADMIN: felt252 = 'ADMIN';
@@ -36,7 +36,7 @@ fn __setup__() -> (ContractAddress, ContractAddress) {
let community_nft_class_hash = declare("CommunityNFT").unwrap().contract_class();
// deploy community preset contract
- let community_contract = declare("KarstCommunity").unwrap().contract_class();
+ let community_contract = declare("ColonizCommunity").unwrap().contract_class();
let mut community_constructor_calldata: Array = array![
(*community_nft_class_hash.class_hash).into(), ADMIN
];
@@ -156,7 +156,7 @@ fn test_join_community() {
}
#[test]
-#[should_panic(expected: ('Karst: already a Member',))]
+#[should_panic(expected: ('coloniz: already a Member',))]
fn test_should_panic_if_a_user_joins_one_community_twice() {
let (community_contract_address, _) = __setup__();
@@ -255,7 +255,7 @@ fn test_leave_community() {
}
#[test]
-#[should_panic(expected: ('Karst: Not a Community Member',))]
+#[should_panic(expected: ('coloniz: Not Community Member',))]
fn test_should_panic_if_profile_leaving_is_not_a_member() {
let (community_contract_address, _) = __setup__();
@@ -334,7 +334,7 @@ fn test_set_community_metadata_uri() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_should_panic_if_unauthorize_profile_set_community_metadata_uri() {
let (community_contract_address, _) = __setup__();
@@ -430,7 +430,7 @@ fn test_add_community_mod_emits_event() {
}
#[test]
-#[should_panic(expected: ('Karst: Not Community owner',))]
+#[should_panic(expected: ('coloniz: Not Community owner',))]
fn test_should_panic_if_caller_adding_mod_is_not_owner() {
let (community_contract_address, _) = __setup__();
@@ -448,7 +448,7 @@ fn test_should_panic_if_caller_adding_mod_is_not_owner() {
}
#[test]
-#[should_panic(expected: ('Karst: Not a Community Member',))]
+#[should_panic(expected: ('coloniz: Not Community Member',))]
fn test_should_panic_if_mod_is_not_member() {
let (community_contract_address, _) = __setup__();
@@ -579,7 +579,7 @@ fn test_remove_community_mod_emit_event() {
}
#[test]
-#[should_panic(expected: ('Karst: Not a community mod',))]
+#[should_panic(expected: ('coloniz: Not a community mod',))]
fn test_should_panic_if_mod_to_be_removed_is_not_a_mod() {
let (community_contract_address, _) = __setup__();
@@ -618,7 +618,7 @@ fn test_should_panic_if_mod_to_be_removed_is_not_a_mod() {
}
#[test]
-#[should_panic(expected: ('Karst: Not Community owner',))]
+#[should_panic(expected: ('coloniz: Not Community owner',))]
fn test_should_panic_if_caller_removing_mod_is_not_owner() {
let (community_contract_address, _) = __setup__();
@@ -677,7 +677,7 @@ fn test_set_censorship_status() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_only_owner_can_set_censorship_status() {
let (community_contract_address, _) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
@@ -820,7 +820,7 @@ fn test_set_ban_status_emit_event() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_should_panic_if_caller_to_set_ban_status_is_not_owner_or_mod() {
let (community_contract_address, _) = __setup__();
@@ -858,7 +858,7 @@ fn test_should_panic_if_caller_to_set_ban_status_is_not_owner_or_mod() {
}
#[test]
-#[should_panic(expected: ('Karst: Not a Community Member',))]
+#[should_panic(expected: ('coloniz: Not Community Member',))]
fn test_can_only_set_ban_status_for_members() {
let (community_contract_address, _) = __setup__();
@@ -891,7 +891,7 @@ fn test_can_only_set_ban_status_for_members() {
#[test]
-#[should_panic(expected: ('Karst: array mismatch',))]
+#[should_panic(expected: ('coloniz: array mismatch',))]
fn test_should_set_ban_status_for_invalid_array_length() {
let (community_contract_address, _) = __setup__();
@@ -952,7 +952,7 @@ fn test_community_upgrade() {
}
#[test]
-#[should_panic(expected: ('Karst: Not Community owner',))]
+#[should_panic(expected: ('coloniz: Not Community owner',))]
fn test_should_panic_if_caller_upgrading_is_not_owner() {
let (community_contract_address, _) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
@@ -1125,7 +1125,7 @@ fn test_nft_gatekeeping() {
}
#[test]
-#[should_panic(expected: ('Karst: only premium communities',))]
+#[should_panic(expected: ('coloniz: only premium communiti',))]
fn test_only_premium_communities_can_be_paid_gated() {
let (community_contract_address, _) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
@@ -1144,7 +1144,7 @@ fn test_only_premium_communities_can_be_paid_gated() {
}
#[test]
-#[should_panic(expected: ('Karst: only premium communities',))]
+#[should_panic(expected: ('coloniz: only premium communiti',))]
fn test_only_premium_communities_can_be_nft_gated() {
let (community_contract_address, _) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
@@ -1163,7 +1163,7 @@ fn test_only_premium_communities_can_be_nft_gated() {
}
#[test]
-#[should_panic(expected: ('Karst: Not Community owner',))]
+#[should_panic(expected: ('coloniz: Not Community owner',))]
fn test_should_panic_if_caller_to_gatekeep_is_not_owner() {
let (community_contract_address, _) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
@@ -1230,7 +1230,7 @@ fn test_community_gatekeep_emits_event() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_permissioned_gating_is_enforced_on_joining() {
let (community_contract_address, _) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
@@ -1261,7 +1261,7 @@ fn test_permissioned_gating_is_enforced_on_joining() {
}
#[test]
-#[should_panic(expected: ('Karst: user unauthorized!',))]
+#[should_panic(expected: ('coloniz: user unauthorized!',))]
fn test_nft_gating_is_enforced_on_joining() {
let (community_contract_address, usdt_contract_address) = __setup__();
let communityDispatcher = ICommunityDispatcher { contract_address: community_contract_address };
diff --git a/tests/test_follownft.cairo b/tests/test_follownft.cairo
index 98c5ad0..d33f39a 100644
--- a/tests/test_follownft.cairo
+++ b/tests/test_follownft.cairo
@@ -12,13 +12,13 @@ use snforge_std::{
stop_cheat_block_timestamp
};
-use karst::interfaces::IFollowNFT::{IFollowNFTDispatcher, IFollowNFTDispatcherTrait};
-use karst::follownft::follownft::Follow::{Event as FollowEvent, Followed};
-use karst::follownft::follownft::Follow::{Event as UnfollowEvent, Unfollowed};
-use karst::follownft::follownft::Follow::{Event as FollowerBlockedEvent, FollowerBlocked};
-use karst::follownft::follownft::Follow::{Event as FollowerUnblockedEvent, FollowerUnblocked};
-use karst::base::constants::types::FollowData;
-use karst::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
+use coloniz::interfaces::IFollowNFT::{IFollowNFTDispatcher, IFollowNFTDispatcherTrait};
+use coloniz::follownft::follownft::Follow::{Event as FollowEvent, Followed};
+use coloniz::follownft::follownft::Follow::{Event as UnfollowEvent, Unfollowed};
+use coloniz::follownft::follownft::Follow::{Event as FollowerBlockedEvent, FollowerBlocked};
+use coloniz::follownft::follownft::Follow::{Event as FollowerUnblockedEvent, FollowerUnblocked};
+use coloniz::base::constants::types::FollowData;
+use coloniz::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
const HUB_ADDRESS: felt252 = 24205;
const ADMIN: felt252 = 13245;
@@ -49,7 +49,7 @@ fn test_follower_count_on_init_is_zero() {
}
#[test]
-#[should_panic(expected: ('Karst: caller is not Hub!',))]
+#[should_panic(expected: ('coloniz: caller is not Hub!',))]
fn test_cannot_call_follow_if_not_hub() {
let follow_nft_contract_address = __setup__();
let dispatcher = IFollowNFTDispatcher { contract_address: follow_nft_contract_address };
@@ -59,7 +59,7 @@ fn test_cannot_call_follow_if_not_hub() {
}
#[test]
-#[should_panic(expected: ('Karst: caller is not Hub!',))]
+#[should_panic(expected: ('coloniz: caller is not Hub!',))]
fn test_cannot_call_unfollow_if_not_hub() {
let follow_nft_contract_address = __setup__();
let dispatcher = IFollowNFTDispatcher { contract_address: follow_nft_contract_address };
@@ -69,7 +69,7 @@ fn test_cannot_call_unfollow_if_not_hub() {
}
#[test]
-#[should_panic(expected: ('Karst: user already following!',))]
+#[should_panic(expected: ('coloniz: already following!',))]
fn test_cannot_follow_if_already_following() {
let follow_nft_contract_address = __setup__();
let dispatcher = IFollowNFTDispatcher { contract_address: follow_nft_contract_address };
@@ -168,7 +168,7 @@ fn test_unfollow() {
}
#[test]
-#[should_panic(expected: ('Karst: user not following!',))]
+#[should_panic(expected: ('coloniz: user not following!',))]
fn test_cannot_unfollow_if_not_following() {
let follow_nft_contract_address = __setup__();
let dispatcher = IFollowNFTDispatcher { contract_address: follow_nft_contract_address };
@@ -209,7 +209,7 @@ fn test_metadata() {
let dispatcher = IFollowNFTDispatcher { contract_address: follow_nft_contract_address };
let nft_name = dispatcher.name();
let nft_symbol = dispatcher.symbol();
- assert(nft_name == "KARST:FOLLOWER", 'invalid name');
+ assert(nft_name == "coloniz:FOLLOWER", 'invalid name');
assert(nft_symbol == "KFL", 'invalid symbol');
stop_cheat_caller_address(follow_nft_contract_address);
}
diff --git a/tests/test_handle.cairo b/tests/test_handle.cairo
index dfaacf0..07846f7 100644
--- a/tests/test_handle.cairo
+++ b/tests/test_handle.cairo
@@ -9,23 +9,23 @@ use snforge_std::{
EventSpyAssertionsTrait, DeclareResultTrait
};
-use karst::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
-use karst::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
-use karst::namespaces::handles::Handles;
+use coloniz::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
+use coloniz::interfaces::IERC721::{IERC721Dispatcher, IERC721DispatcherTrait};
+use coloniz::namespaces::handles::Handles;
const ADMIN_ADDRESS: felt252 = 'ADMIN';
const USER_ONE: felt252 = 'BOB';
const USER_TWO: felt252 = 'JOHN';
-const TEST_LOCAL_NAME: felt252 = 'karst';
-const TEST_LOCAL_NAME_TWO: felt252 = 'karst_two';
-const TEST_LOCAL_NAME_THREE: felt252 = 'karstdoe_';
-const TEST_LOCAL_NAME_FOUR: felt252 = 'karstdoe2';
-const TEST_BAD_LOCAL_NAME_1: felt252 = '_karst';
-const TEST_BAD_LOCAL_NAME_2: felt252 = 'Karst';
-const TEST_BAD_LOCAL_NAME_3: felt252 = 'karst-';
+const TEST_LOCAL_NAME: felt252 = 'coloniz';
+const TEST_LOCAL_NAME_TWO: felt252 = 'coloniz_two';
+const TEST_LOCAL_NAME_THREE: felt252 = 'colonizdoe_';
+const TEST_LOCAL_NAME_FOUR: felt252 = 'colonizdoe2';
+const TEST_BAD_LOCAL_NAME_1: felt252 = '_coloniz';
+const TEST_BAD_LOCAL_NAME_2: felt252 = 'Coloniz';
+const TEST_BAD_LOCAL_NAME_3: felt252 = 'coloniz-';
const TEST_TOKEN_ID: u256 =
- 2821396919044486126129003092173544296283884532301009869065707438220168412703;
+ 3382571571946029498300446473584208976610422898231982587356291365654797409289;
fn __setup__() -> ContractAddress {
// deploy handles contract
@@ -67,7 +67,7 @@ fn test_mint_handle_two() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid local name!',))]
+#[should_panic(expected: ('coloniz: invalid local name!',))]
fn test_mint_handle_with_bad_local_name_1() {
let handles_contract_address = __setup__();
let handles_dispatcher = IHandleDispatcher { contract_address: handles_contract_address };
@@ -75,9 +75,8 @@ fn test_mint_handle_with_bad_local_name_1() {
start_cheat_caller_address(handles_contract_address, USER_ONE.try_into().unwrap());
handles_dispatcher.mint_handle(USER_ONE.try_into().unwrap(), TEST_BAD_LOCAL_NAME_1);
}
-
#[test]
-#[should_panic(expected: ('Karst: invalid local name!',))]
+#[should_panic(expected: ('coloniz: invalid local name!',))]
fn test_mint_handle_with_bad_local_name_2() {
let handles_contract_address = __setup__();
let handles_dispatcher = IHandleDispatcher { contract_address: handles_contract_address };
@@ -87,7 +86,7 @@ fn test_mint_handle_with_bad_local_name_2() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid local name!',))]
+#[should_panic(expected: ('coloniz: invalid local name!',))]
fn test_mint_handle_with_bad_local_name_3() {
let handles_contract_address = __setup__();
let handles_dispatcher = IHandleDispatcher { contract_address: handles_contract_address };
@@ -158,7 +157,7 @@ fn test_burn() {
}
#[test]
-#[should_panic(expected: ('Karst: caller is not owner!',))]
+#[should_panic(expected: ('coloniz: caller is not owner!',))]
fn test_cannot_burn_if_not_owner_of() {
let contract_address = __setup__();
let dispatcher = IHandleDispatcher { contract_address };
@@ -185,13 +184,13 @@ fn test_get_handle() {
let handle: ByteArray = handles_dispatcher.get_handle(token_id);
- assert(handle == "karst.kst", 'Invalid handle');
+ assert(handle == "coloniz.kst", 'Invalid handle');
stop_cheat_caller_address(handles_contract_address);
}
#[test]
-#[should_panic(expected: ('Karst: handle does not exist!',))]
+#[should_panic(expected: ('coloniz: handle does not exist!',))]
fn test_get_handle_should_panic() {
let handles_contract_address = __setup__();
diff --git a/tests/test_handle_registry.cairo b/tests/test_handle_registry.cairo
index c86c920..fc1c3fe 100644
--- a/tests/test_handle_registry.cairo
+++ b/tests/test_handle_registry.cairo
@@ -9,11 +9,13 @@ use snforge_std::{
};
-use karst::interfaces::IHandleRegistry::{IHandleRegistryDispatcher, IHandleRegistryDispatcherTrait};
-use karst::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
+use coloniz::interfaces::IHandleRegistry::{
+ IHandleRegistryDispatcher, IHandleRegistryDispatcherTrait
+};
+use coloniz::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
-use karst::namespaces::handle_registry::HandleRegistry::{Event as LinkedEvent, HandleLinked};
-use karst::namespaces::handle_registry::HandleRegistry::{Event as UnlinkedEvent, HandleUnlinked};
+use coloniz::namespaces::handle_registry::HandleRegistry::{Event as LinkedEvent, HandleLinked};
+use coloniz::namespaces::handle_registry::HandleRegistry::{Event as UnlinkedEvent, HandleUnlinked};
const ADMIN_ADDRESS: felt252 = 'ADMIN';
const USER_ONE: felt252 = 'BOB';
@@ -46,7 +48,7 @@ fn __setup__() -> (ContractAddress, ContractAddress) {
// *************************************************************************
#[test]
-#[should_panic(expected: ('Karst: handle does not exist!',))]
+#[should_panic(expected: ('coloniz: handle does not exist!',))]
fn test_cannot_resolve_if_handle_does_not_exist() {
let (handle_registry_contract_address, _) = __setup__();
let dispatcher = IHandleRegistryDispatcher {
@@ -98,7 +100,7 @@ fn test_link() {
}
#[test]
-#[should_panic(expected: ('Karst: profile is not owner!',))]
+#[should_panic(expected: ('coloniz: profile is not owner!',))]
fn test_linking_fails_if_profile_address_is_not_owner() {
let (handle_registry_address, handle_contract_address) = __setup__();
let registryDispatcher = IHandleRegistryDispatcher {
@@ -114,7 +116,7 @@ fn test_linking_fails_if_profile_address_is_not_owner() {
}
#[test]
-#[should_panic(expected: ('Karst: handle already linked!',))]
+#[should_panic(expected: ('coloniz: handle already linked!',))]
fn test_does_not_link_twice_for_same_handle() {
let (handle_registry_address, handle_contract_address) = __setup__();
let registryDispatcher = IHandleRegistryDispatcher {
@@ -157,7 +159,7 @@ fn test_unlink() {
}
#[test]
-#[should_panic(expected: ('Karst: caller is not owner!',))]
+#[should_panic(expected: ('coloniz: caller is not owner!',))]
fn test_unlink_fails_if_caller_is_not_owner() {
let (handle_registry_address, handle_contract_address) = __setup__();
let registryDispatcher = IHandleRegistryDispatcher {
diff --git a/tests/test_hub.cairo b/tests/test_hub.cairo
index c8f3a85..74a2bee 100644
--- a/tests/test_hub.cairo
+++ b/tests/test_hub.cairo
@@ -10,9 +10,11 @@ use snforge_std::{
declare, DeclareResultTrait, ContractClassTrait, start_cheat_caller_address,
stop_cheat_caller_address
};
-use karst::interfaces::IHub::{IHubDispatcher, IHubDispatcherTrait};
-use karst::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
-use karst::interfaces::IHandleRegistry::{IHandleRegistryDispatcher, IHandleRegistryDispatcherTrait};
+use coloniz::interfaces::IHub::{IHubDispatcher, IHubDispatcherTrait};
+use coloniz::interfaces::IHandle::{IHandleDispatcher, IHandleDispatcherTrait};
+use coloniz::interfaces::IHandleRegistry::{
+ IHandleRegistryDispatcher, IHandleRegistryDispatcherTrait
+};
const ADMIN: felt252 = 13245;
const ADDRESS1: felt252 = 1234;
@@ -27,7 +29,7 @@ const OWNER: felt252 = 2357;
// *************************************************************************
fn __setup__() -> (ContractAddress, ContractAddress, ContractAddress, ContractAddress, u256) {
// deploy NFT
- let nft_class_hash = declare("KarstNFT").unwrap().contract_class();
+ let nft_class_hash = declare("ColonizNFT").unwrap().contract_class();
let mut calldata: Array = array![ADMIN];
let (nft_contract_address, _) = nft_class_hash.deploy(@calldata).unwrap_syscall();
@@ -58,7 +60,7 @@ fn __setup__() -> (ContractAddress, ContractAddress, ContractAddress, ContractAd
let community_nft_classhash = declare("CommunityNFT").unwrap().contract_class();
// deploy hub contract
- let hub_class_hash = declare("KarstHub").unwrap().contract_class();
+ let hub_class_hash = declare("ColonizHub").unwrap().contract_class();
let mut calldata: Array = array![
nft_contract_address.into(),
handle_contract_address.into(),
@@ -151,7 +153,7 @@ fn test_hub_following() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid profile address!',))]
+#[should_panic(expected: ('coloniz: invalid profile_addr!',))]
fn test_hub_following_fails_if_any_profile_is_invalid() {
let (hub_contract_address, user_one_profile_address, _, user_three_profile_address, _) =
__setup__();
@@ -165,7 +167,7 @@ fn test_hub_following_fails_if_any_profile_is_invalid() {
}
#[test]
-#[should_panic(expected: ('Karst: self follow is forbidden',))]
+#[should_panic(expected: ('coloniz: self_follow forbidden',))]
fn test_hub_following_fails_if_profile_is_self_following() {
let (hub_contract_address, user_one_profile_address, _, _, _) = __setup__();
diff --git a/tests/test_jolt.cairo b/tests/test_jolt.cairo
index e1a77c9..8b7ae21 100644
--- a/tests/test_jolt.cairo
+++ b/tests/test_jolt.cairo
@@ -8,15 +8,15 @@ use snforge_std::{
stop_cheat_caller_address, start_cheat_nonce, stop_cheat_nonce, start_cheat_block_timestamp,
stop_cheat_block_timestamp, spy_events, EventSpyAssertionsTrait
};
-use karst::interfaces::IJolt::{IJoltDispatcher, IJoltDispatcherTrait};
-use karst::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
+use coloniz::interfaces::IJolt::{IJoltDispatcher, IJoltDispatcherTrait};
+use coloniz::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
-use karst::jolt::jolt::JoltComponent::{
+use coloniz::jolt::jolt::JoltComponent::{
{Event as JoltEvent, Jolted}, {Event as JoltRequestEvent, JoltRequested},
{Event as JoltRequestFulfillEvent, JoltRequestFullfilled},
};
-use karst::base::constants::types::{JoltParams, JoltType, JoltStatus};
+use coloniz::base::constants::types::{JoltParams, JoltType, JoltStatus};
const ADMIN: felt252 = 5382942;
const ADDRESS1: felt252 = 254290;
@@ -153,7 +153,7 @@ fn test_jolting_with_same_params_have_different_jolt_ids() {
}
#[test]
-#[should_panic(expected: ('Karst: self-tip forbidden!',))]
+#[should_panic(expected: ('coloniz: self-tip forbidden!',))]
fn test_tipper_cant_self_tip() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -182,7 +182,7 @@ fn test_tipper_cant_self_tip() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid profile address!',))]
+#[should_panic(expected: ('coloniz: invalid profile_addr!',))]
fn test_tipper_cant_tip_a_zero_address() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -318,7 +318,7 @@ fn test_jolt_transfer() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid profile address!',))]
+#[should_panic(expected: ('coloniz: invalid profile_addr!',))]
fn test_sender_cant_transfer_to_a_zero_address() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -347,7 +347,7 @@ fn test_sender_cant_transfer_to_a_zero_address() {
}
#[test]
-#[should_panic(expected: ('Karst: self-transfer forbidden!',))]
+#[should_panic(expected: ('coloniz: self-transfer forbiden',))]
fn test_sender_cant_self_transfer() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -473,7 +473,7 @@ fn test_jolt_request() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid profile address!',))]
+#[should_panic(expected: ('coloniz: invalid profile_addr!',))]
fn test_requester_cant_request_to_a_zero_address() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -498,7 +498,7 @@ fn test_requester_cant_request_to_a_zero_address() {
}
#[test]
-#[should_panic(expected: ('Karst: self-request forbidden!',))]
+#[should_panic(expected: ('coloniz: self-request forbiden',))]
fn test_requester_cant_self_request() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -563,7 +563,7 @@ fn test_jolt_event_is_emitted_on_request() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid expiration stamp',))]
+#[should_panic(expected: ('coloniz: invld expiration stamp',))]
fn test_request_expiration_time_must_be_greater_than_current_time() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -589,7 +589,7 @@ fn test_request_expiration_time_must_be_greater_than_current_time() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid jolt!',))]
+#[should_panic(expected: ('coloniz: invalid jolt!',))]
fn test_cant_fulfill_request_if_jolt_type_is_not_a_request() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -630,7 +630,7 @@ fn test_cant_fulfill_request_if_jolt_type_is_not_a_request() {
}
#[test]
-#[should_panic(expected: ('Karst: invalid jolt!',))]
+#[should_panic(expected: ('coloniz: invalid jolt!',))]
fn test_cant_fulfill_request_if_jolt_status_is_not_pending() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -672,7 +672,7 @@ fn test_cant_fulfill_request_if_jolt_status_is_not_pending() {
}
#[test]
-#[should_panic(expected: ('Karst: not request recipient!',))]
+#[should_panic(expected: ('coloniz: not request recipient!',))]
fn test_cant_fulfill_request_if_sender_is_not_initial_recipient() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -942,7 +942,7 @@ fn test_jolt_subscription() {
}
#[test]
-#[should_panic(expected: ('Karst: insufficient allowance!',))]
+#[should_panic(expected: ('coloniz: not enough allowance!',))]
fn test_jolt_subscription_fails_if_insufficient_allowance() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
@@ -1094,7 +1094,7 @@ fn test_auto_renewal() {
}
#[test]
-#[should_panic(expected: ('Karst: auto renew ended!',))]
+#[should_panic(expected: ('coloniz: auto renew ended!',))]
fn test_auto_renewal_fails_once_iteration_count_is_zero() {
let (jolt_contract_address, erc20_contract_address) = __setup__();
let dispatcher = IJoltDispatcher { contract_address: jolt_contract_address };
diff --git a/tests/test_profile.cairo b/tests/test_profile.cairo
index 3ddcf10..735248e 100644
--- a/tests/test_profile.cairo
+++ b/tests/test_profile.cairo
@@ -10,9 +10,9 @@ use snforge_std::{
EventSpyAssertionsTrait, ContractClassTrait, DeclareResultTrait
};
-use karst::interfaces::IKarstNFT::{IKarstNFTDispatcher, IKarstNFTDispatcherTrait};
-use karst::profile::profile::ProfileComponent::{Event as ProfileEvent, CreatedProfile};
-use karst::interfaces::IProfile::{IProfileDispatcher, IProfileDispatcherTrait};
+use coloniz::interfaces::IColonizNFT::{IColonizNFTDispatcher, IColonizNFTDispatcherTrait};
+use coloniz::profile::profile::ProfileComponent::{Event as ProfileEvent, CreatedProfile};
+use coloniz::interfaces::IProfile::{IProfileDispatcher, IProfileDispatcherTrait};
const HUB_ADDRESS: felt252 = 'HUB';
const USER: felt252 = 'USER1';
@@ -23,7 +23,7 @@ const USER: felt252 = 'USER1';
fn __setup__() -> (ContractAddress, ContractAddress, felt252, felt252, ContractAddress) {
// deploy NFT
- let nft_contract = declare("KarstNFT").unwrap().contract_class();
+ let nft_contract = declare("ColonizNFT").unwrap().contract_class();
let mut calldata: Array = array![USER];
let (nft_contract_address, _) = nft_contract.deploy(@calldata).unwrap_syscall();
@@ -38,12 +38,12 @@ fn __setup__() -> (ContractAddress, ContractAddress, felt252, felt252, ContractA
let follow_nft_classhash = declare("Follow").unwrap().contract_class();
// deploy profile
- let profile_contract = declare("KarstProfile").unwrap().contract_class();
- let mut karst_profile_constructor_calldata = array![
+ let profile_contract = declare("ColonizProfile").unwrap().contract_class();
+ let mut coloniz_profile_constructor_calldata = array![
nft_contract_address.into(), HUB_ADDRESS, (*follow_nft_classhash.class_hash).into()
];
let (profile_contract_address, _) = profile_contract
- .deploy(@karst_profile_constructor_calldata)
+ .deploy(@coloniz_profile_constructor_calldata)
.unwrap();
return (
@@ -64,7 +64,7 @@ fn test_profile_creation() {
nft_contract_address, _, registry_class_hash, account_class_hash, profile_contract_address
) =
__setup__();
- let karstNFTDispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let colonizNFTDispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
let profileDispatcher = IProfileDispatcher { contract_address: profile_contract_address };
//user 1 create profile
@@ -73,9 +73,9 @@ fn test_profile_creation() {
let profile_address = profileDispatcher
.create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2456);
- // test a new karst nft is minted
- let last_minted_id = karstNFTDispatcher.get_last_minted_id();
- let token_id = karstNFTDispatcher.get_user_token_id(USER.try_into().unwrap());
+ // test a new coloniz nft is minted
+ let last_minted_id = colonizNFTDispatcher.get_last_minted_id();
+ let token_id = colonizNFTDispatcher.get_user_token_id(USER.try_into().unwrap());
assert(last_minted_id == 1.try_into().unwrap(), 'invalid ID');
assert(token_id == 1.try_into().unwrap(), 'invalid ID');
@@ -128,7 +128,7 @@ fn test_profile_creation_event() {
nft_contract_address, _, registry_class_hash, account_class_hash, profile_contract_address
) =
__setup__();
- let karstNFTDispatcher = IKarstNFTDispatcher { contract_address: nft_contract_address };
+ let colonizNFTDispatcher = IColonizNFTDispatcher { contract_address: nft_contract_address };
let profileDispatcher = IProfileDispatcher { contract_address: profile_contract_address };
let mut spy = spy_events();
@@ -139,7 +139,7 @@ fn test_profile_creation_event() {
let profile_address = profileDispatcher
.create_profile(nft_contract_address, registry_class_hash, account_class_hash, 2456);
- let token_id = karstNFTDispatcher.get_user_token_id(USER.try_into().unwrap());
+ let token_id = colonizNFTDispatcher.get_user_token_id(USER.try_into().unwrap());
let expected_event = ProfileEvent::CreatedProfile(
CreatedProfile {
diff --git a/tests/test_profile_token_uri.cairo b/tests/test_profile_token_uri.cairo
index d747b3b..a8767f1 100644
--- a/tests/test_profile_token_uri.cairo
+++ b/tests/test_profile_token_uri.cairo
@@ -1,4 +1,4 @@
-use karst::base::token_uris::profile_token_uri::ProfileTokenUri::get_token_uri;
+use coloniz::base::token_uris::profile_token_uri::ProfileTokenUri::get_token_uri;
#[test]
fn test_profile_token_uri() {
diff --git a/tests/test_publication.cairo b/tests/test_publication.cairo
index 8a1754c..1d67170 100644
--- a/tests/test_publication.cairo
+++ b/tests/test_publication.cairo
@@ -10,15 +10,15 @@ use snforge_std::{
declare, start_cheat_caller_address, stop_cheat_caller_address, spy_events,
EventSpyAssertionsTrait, ContractClassTrait, DeclareResultTrait
};
-use karst::publication::publication::PublicationComponent::{
+use coloniz::publication::publication::PublicationComponent::{
Event as PublicationEvent, Post, CommentCreated, RepostCreated, Upvoted, Downvoted
};
-use karst::mocks::interfaces::IComposable::{IComposableDispatcher, IComposableDispatcherTrait};
-use karst::base::constants::types::{PostParams, RepostParams, CommentParams, PublicationType};
-use karst::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatcherTrait};
-use karst::interfaces::ICommunity::{ICommunityDispatcher, ICommunityDispatcherTrait};
-use karst::interfaces::IChannel::{IChannelDispatcher, IChannelDispatcherTrait};
-use karst::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
+use coloniz::mocks::interfaces::IComposable::{IComposableDispatcher, IComposableDispatcherTrait};
+use coloniz::base::constants::types::{PostParams, RepostParams, CommentParams, PublicationType};
+use coloniz::interfaces::ICollectNFT::{ICollectNFTDispatcher, ICollectNFTDispatcherTrait};
+use coloniz::interfaces::ICommunity::{ICommunityDispatcher, ICommunityDispatcherTrait};
+use coloniz::interfaces::IChannel::{IChannelDispatcher, IChannelDispatcherTrait};
+use coloniz::interfaces::IERC20::{IERC20Dispatcher, IERC20DispatcherTrait};
const HUB_ADDRESS: felt252 = 'HUB';
@@ -38,7 +38,7 @@ fn __setup__() -> (
ContractAddress, ContractAddress, ContractAddress, felt252, felt252, felt252, ContractAddress
) {
// deploy NFT
- let nft_contract = declare("KarstNFT").unwrap().contract_class();
+ let nft_contract = declare("ColonizNFT").unwrap().contract_class();
let mut calldata: Array = array![USER_ONE];
let (nft_contract_address, _) = nft_contract.deploy(@calldata).unwrap_syscall();
@@ -53,7 +53,7 @@ fn __setup__() -> (
// declare community_nft
let community_nft_classhash = declare("CommunityNFT").unwrap().contract_class();
// deploy publication preset
- let publication_contract = declare("KarstPublication").unwrap().contract_class();
+ let publication_contract = declare("ColonizPublication").unwrap().contract_class();
let mut publication_constructor_calldata = array![
nft_contract_address.into(),
HUB_ADDRESS,
@@ -429,7 +429,7 @@ fn test_if_is_channel_post() {
}
// community_post
-#[should_panic(expected: ('Karst: Not a Community Member',))]
+#[should_panic(expected: ('coloniz: Not Community Member',))]
#[test]
fn test_should_fail_if_user_is_not_a_community_member() {
let (
@@ -489,7 +489,7 @@ fn test_should_fail_if_user_is_not_a_community_member() {
stop_cheat_caller_address(publication_contract_address);
}
-#[should_panic(expected: ('Karst: not channel member',))]
+#[should_panic(expected: ('coloniz: not channel member',))]
#[test]
fn test_should_fail_if_user_is_not_a_channel_member() {
let (
@@ -649,12 +649,7 @@ fn test_upvote() {
}
);
publication_dispatcher
- .upvote(
- profile_address: user_two_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .upvote(profile_address: user_two_profile_address, pub_id: pub_assigned_id,);
let upvote_count = publication_dispatcher
.get_upvote_count(user_two_profile_address, pub_assigned_id);
assert(upvote_count == 1, 'invalid upvote count');
@@ -697,12 +692,7 @@ fn test_downvote() {
}
);
publication_dispatcher
- .downvote(
- profile_address: user_two_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .downvote(profile_address: user_two_profile_address, pub_id: pub_assigned_id,);
let downvote_count = publication_dispatcher
.get_downvote_count(user_two_profile_address, pub_assigned_id);
assert(downvote_count == 1, 'invalid upvote count');
@@ -753,12 +743,7 @@ fn test_upvote_event_emission() {
community_dispatcher.join_community(community_id);
channel_dispatcher.join_channel(channel_id);
publication_dispatcher
- .upvote(
- profile_address: user_one_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .upvote(profile_address: user_one_profile_address, pub_id: pub_assigned_id,);
let expected_event = PublicationEvent::Upvoted(
Upvoted {
publication_id: pub_assigned_id,
@@ -814,12 +799,7 @@ fn test_downvote_event_emission() {
community_dispatcher.join_community(community_id);
channel_dispatcher.join_channel(channel_id);
publication_dispatcher
- .downvote(
- profile_address: user_one_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .downvote(profile_address: user_one_profile_address, pub_id: pub_assigned_id,);
let expected_event = PublicationEvent::Downvoted(
Downvoted {
publication_id: pub_assigned_id,
@@ -832,7 +812,7 @@ fn test_downvote_event_emission() {
}
#[test]
-#[should_panic(expected: ('Karst: already react to post!',))]
+#[should_panic(expected: ('coloniz: already react to post!',))]
fn test_upvote_should_fail_if_user_already_upvoted() {
let (
nft_contract_address,
@@ -868,24 +848,14 @@ fn test_upvote_should_fail_if_user_already_upvoted() {
}
);
publication_dispatcher
- .upvote(
- profile_address: user_two_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .upvote(profile_address: user_two_profile_address, pub_id: pub_assigned_id,);
publication_dispatcher
- .upvote(
- profile_address: user_two_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .upvote(profile_address: user_two_profile_address, pub_id: pub_assigned_id,);
stop_cheat_caller_address(publication_contract_address);
}
#[test]
-#[should_panic(expected: ('Karst: already react to post!',))]
+#[should_panic(expected: ('coloniz: already react to post!',))]
fn test_downvote_should_fail_if_user_already_downvoted() {
let (
nft_contract_address,
@@ -921,19 +891,9 @@ fn test_downvote_should_fail_if_user_already_downvoted() {
}
);
publication_dispatcher
- .downvote(
- profile_address: user_two_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .downvote(profile_address: user_two_profile_address, pub_id: pub_assigned_id,);
publication_dispatcher
- .downvote(
- profile_address: user_two_profile_address,
- pub_id: pub_assigned_id,
- channel_id: channel_id,
- community_id: community_id,
- );
+ .downvote(profile_address: user_two_profile_address, pub_id: pub_assigned_id,);
stop_cheat_caller_address(publication_contract_address);
}
@@ -1385,7 +1345,7 @@ fn test_get_publication_type() {
}
#[test]
-#[should_panic(expected: ('Karst: Profile is banned!',))]
+#[should_panic(expected: ('coloniz: Profile is banned!',))]
fn test_should_fail_if_banned_profile_from_posting() {
let (
nft_contract_address,
@@ -1455,7 +1415,7 @@ fn test_should_fail_if_banned_profile_from_posting() {
}
#[test]
-#[should_panic(expected: ('Karst: Not a Community Member',))]
+#[should_panic(expected: ('coloniz: Not Community Member',))]
fn test_should_fail_if_not_community_member_while_posting() {
let (
nft_contract_address,
@@ -1567,8 +1527,6 @@ fn test_tip() {
profile_address: user_one_profile_address,
pub_id: pub_assigned_id,
amount: 2000000000000000000,
- channel_id: channel_id,
- community_id: community_id,
erc20_contract_address: erc20_contract_address
);
stop_cheat_caller_address(publication_contract_address);