Skip to content

Commit

Permalink
chore: upgrade contracts to v2.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Sep 30, 2024
1 parent d1399ca commit beb4e8b
Show file tree
Hide file tree
Showing 39 changed files with 287 additions and 293 deletions.
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
scarb 2.6.3
starknet-foundry 0.22.0
scarb 2.8.3
starknet-foundry 0.31.0
113 changes: 109 additions & 4 deletions Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,118 @@ dependencies = [

[[package]]
name = "openzeppelin"
version = "0.11.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.11.0#a83f36b23f1af6e160288962be4a2701c3ecbcda"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_finance",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_merkle_tree",
"openzeppelin_presets",
"openzeppelin_security",
"openzeppelin_token",
"openzeppelin_upgrades",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_access"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_account"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_finance"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_access",
"openzeppelin_token",
]

[[package]]
name = "openzeppelin_governance"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_access",
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_introspection"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"

[[package]]
name = "openzeppelin_merkle_tree"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"

[[package]]
name = "openzeppelin_presets"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_finance",
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_upgrades",
]

[[package]]
name = "openzeppelin_security"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"

[[package]]
name = "openzeppelin_token"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_account",
"openzeppelin_governance",
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_upgrades"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"

[[package]]
name = "openzeppelin_utils"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"

[[package]]
name = "snforge_scarb_plugin"
version = "0.31.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67"

[[package]]
name = "snforge_std"
version = "0.22.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.22.0#9b215944c6c5871c738381b4ded61bbf06e7ba35"
version = "0.31.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67"
dependencies = [
"snforge_scarb_plugin",
]

[[package]]
name = "token_bound_accounts"
Expand Down
8 changes: 4 additions & 4 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "karst"
version = "0.1.0"
edition = "2023_10"
edition = "2024_07"
authors = ["Horus Labs <[email protected]>"]
description = "Decentralized Social Graph on Starknet"
repository = "https://github.com/horuslabsio/karst-core"
Expand All @@ -10,13 +10,13 @@ keywords = ["Karst", "SocialFi", "tokenbound", "cairo", "contracts", "starknet"]
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.6.3"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.11.0" }
starknet = "2.8.2"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.17.0" }
token_bound_accounts= { git = "https://github.com/Starknet-Africa-Edu/TBA", tag = "v0.3.0" }
alexandria_bytes = { git = "https://github.com/keep-starknet-strange/alexandria.git" }

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.22.0" }
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.31.0" }

[sncast.default]
url= "https://starknet-sepolia.public.blastapi.io"
Expand Down
4 changes: 2 additions & 2 deletions src/base/constants.cairo
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mod errors;
mod types;
pub mod errors;
pub mod types;
91 changes: 46 additions & 45 deletions src/base/constants/types.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
use core::option::OptionTrait;
// *************************************************************************
// TYPES
// *************************************************************************
Expand All @@ -14,10 +13,10 @@ use starknet::ContractAddress;
// */
#[derive(Drop, Serde, starknet::Store)]
pub struct FollowData {
followed_profile_address: ContractAddress,
follower_profile_address: ContractAddress,
follow_timestamp: u64,
block_status: bool,
pub followed_profile_address: ContractAddress,
pub follower_profile_address: ContractAddress,
pub follow_timestamp: u64,
pub block_status: bool,
}

// * @notice A struct containing profile data.
Expand All @@ -28,11 +27,11 @@ pub struct FollowData {
// * @param follow_nft profile follow nft token contract
#[derive(Drop, Serde, starknet::Store)]
pub struct Profile {
profile_address: ContractAddress,
profile_owner: ContractAddress,
pub_count: u256,
metadata_URI: ByteArray,
follow_nft: ContractAddress
pub profile_address: ContractAddress,
pub profile_owner: ContractAddress,
pub pub_count: u256,
pub metadata_URI: ByteArray,
pub follow_nft: ContractAddress
}

// /**
Expand All @@ -51,14 +50,14 @@ pub struct Profile {
// */
#[derive(Debug, Drop, Serde, starknet::Store)]
pub struct Publication {
pointed_profile_address: ContractAddress,
pointed_pub_id: u256,
content_URI: ByteArray,
pub_Type: PublicationType,
root_profile_address: ContractAddress,
root_pub_id: u256,
upvote: u256,
downvote: u256,
pub pointed_profile_address: ContractAddress,
pub pointed_pub_id: u256,
pub content_URI: ByteArray,
pub pub_Type: PublicationType,
pub root_profile_address: ContractAddress,
pub root_pub_id: u256,
pub upvote: u256,
pub downvote: u256,
}

// /**
Expand All @@ -70,7 +69,7 @@ pub struct Publication {
// * @param Mirror A mirror, having a pointer to another publication, but no URI.
// */
#[derive(Debug, Drop, Serde, starknet::Store, Clone, PartialEq)]
enum PublicationType {
pub enum PublicationType {
Nonexistent,
Post,
Comment,
Expand All @@ -85,8 +84,8 @@ enum PublicationType {
// */
#[derive(Drop, Serde, starknet::Store, Clone)]
pub struct PostParams {
content_URI: ByteArray,
profile_address: ContractAddress,
pub content_URI: ByteArray,
pub profile_address: ContractAddress,
}

// /**
Expand All @@ -98,21 +97,21 @@ pub struct PostParams {
// * @param pointed_pub_id ID of the pointed publication
// */
#[derive(Drop, Serde, starknet::Store, Clone)]
struct CommentParams {
profile_address: ContractAddress,
content_URI: ByteArray,
pointed_profile_address: ContractAddress,
pointed_pub_id: u256,
reference_pub_type: PublicationType,
pub struct CommentParams {
pub profile_address: ContractAddress,
pub content_URI: ByteArray,
pub pointed_profile_address: ContractAddress,
pub pointed_pub_id: u256,
pub reference_pub_type: PublicationType,
}


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

// /**
Expand All @@ -125,9 +124,9 @@ pub struct ReferencePubParams {
// */
#[derive(Drop, Serde, starknet::Store, Clone)]
pub struct RepostParams {
profile_address: ContractAddress,
pointed_profile_address: ContractAddress,
pointed_pub_id: u256,
pub profile_address: ContractAddress,
pub pointed_profile_address: ContractAddress,
pub pointed_pub_id: u256,
}

// /**
Expand All @@ -140,21 +139,23 @@ pub struct RepostParams {
// */
#[derive(Drop, Serde, starknet::Store, Clone)]
pub struct QuoteParams {
profile_address: ContractAddress,
content_URI: ByteArray,
pointed_profile_address: ContractAddress,
pointed_pub_id: u256,
reference_pub_type: PublicationType
pub profile_address: ContractAddress,
pub content_URI: ByteArray,
pub pointed_profile_address: ContractAddress,
pub pointed_pub_id: u256,
pub reference_pub_type: PublicationType
}

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

#[derive(Debug, Drop, Serde, starknet::Store, Clone)]
pub struct Downvote {
publication_id: u256,
transaction_executor: ContractAddress,
block_timestamp: u64,
pub publication_id: u256,
pub transaction_executor: ContractAddress,
pub block_timestamp: u64,
}
8 changes: 4 additions & 4 deletions src/base/token_uris.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
mod follow_token_uri;
mod handle_token_uri;
mod profile_token_uri;
mod traits;
pub mod follow_token_uri;
pub mod handle_token_uri;
pub mod profile_token_uri;
pub mod traits;
1 change: 0 additions & 1 deletion src/base/token_uris/follow_token_uri.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pub mod FollowTokenUri {
use starknet::ContractAddress;
use alexandria_bytes::{Bytes, BytesTrait};
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;
Expand Down
1 change: 0 additions & 1 deletion src/base/token_uris/handle_token_uri.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

pub mod HandleTokenUri {
use core::array::ArrayTrait;
use alexandria_bytes::{Bytes, BytesTrait};
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;
Expand Down
2 changes: 0 additions & 2 deletions src/base/token_uris/profile_token_uri.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@

pub mod ProfileTokenUri {
use core::array::ArrayTrait;
use alexandria_bytes::{Bytes, BytesTrait};
use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;
use karst::base::utils::base64_extended::{get_base64_encode, convert_into_byteArray};
use karst::base::token_uris::traits::profile::ProfileSvg::gen_profile_svg;

fn get_svg(token_id: u256, mint_timestamp: u64) -> Array<felt252> {
let mut svg = ArrayTrait::<felt252>::new();
Expand Down
18 changes: 9 additions & 9 deletions src/base/token_uris/traits.cairo
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
mod head;
mod glass;
mod color;
mod beard;
mod background;
mod cloth;
mod profile;
mod handle;
mod follow;
pub mod head;
pub mod glass;
pub mod color;
pub mod beard;
pub mod background;
pub mod cloth;
pub mod profile;
pub mod handle;
pub mod follow;
4 changes: 1 addition & 3 deletions src/base/token_uris/traits/background.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// let make the face of the profile svg

mod background {
use core::traits::TryInto;
use karst::base::token_uris::traits::color::karstColors;
pub mod background {
use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;

#[derive(Drop)]
Expand Down
4 changes: 1 addition & 3 deletions src/base/token_uris/traits/beard.cairo
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// let make the face of the profile svg

mod beard {
use core::traits::TryInto;
use karst::base::token_uris::traits::color::karstColors;
pub mod beard {
use karst::base::utils::byte_array_extra::FeltTryIntoByteArray;

#[derive(Drop)]
Expand Down
Loading

0 comments on commit beb4e8b

Please sign in to comment.