Skip to content

Commit

Permalink
chore: make follow and community nfts non-upgradeable
Browse files Browse the repository at this point in the history
  • Loading branch information
Darlington02 committed Feb 2, 2025
1 parent 17a985e commit 5c15abb
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 24 deletions.
11 changes: 1 addition & 10 deletions src/community/communitynft.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pub mod CommunityNFT {
// *************************************************************************
// IMPORTS
// *************************************************************************
use starknet::{ContractAddress, ClassHash, get_block_timestamp};
use starknet::{ContractAddress, get_block_timestamp};
use core::num::traits::zero::Zero;
use openzeppelin_introspection::src5::SRC5Component;
use openzeppelin_token::erc721::{ERC721Component, ERC721HooksEmptyImpl};
Expand Down Expand Up @@ -117,15 +117,6 @@ pub mod CommunityNFT {
self.user_token_id.write(user_address, 0);
}

/// @notice upgrades the nft contract
/// @param new_class_hash classhash to upgrade to
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {
self.ownable.assert_only_owner();

// Replace the class hash upgrading the contract
self.upgradeable.upgrade(new_class_hash);
}

// *************************************************************************
// GETTERS
// *************************************************************************
Expand Down
11 changes: 1 addition & 10 deletions src/follownft/follownft.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod Follow {
// IMPORT
// *************************************************************************
use starknet::{
ContractAddress, ClassHash, get_block_timestamp,
ContractAddress, get_block_timestamp,
storage::{
StoragePointerWriteAccess, StoragePointerReadAccess, Map, StorageMapReadAccess,
StorageMapWriteAccess
Expand Down Expand Up @@ -244,15 +244,6 @@ pub mod Follow {
return true;
}

/// @notice upgrades the nft contract
/// @param new_class_hash classhash to upgrade to
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {
self.ownable.assert_only_owner();

// Replace the class hash upgrading the contract
self.upgradeable.upgrade(new_class_hash);
}

// *************************************************************************
// GETTERS
// *************************************************************************
Expand Down
3 changes: 1 addition & 2 deletions src/interfaces/ICustomNFT.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use starknet::{ContractAddress, ClassHash};
use starknet::ContractAddress;

// *************************************************************************
// INTERFACE of ICommunity NFT
Expand All @@ -11,7 +11,6 @@ pub trait ICustomNFT<TState> {

fn mint_nft(ref self: TState, user_address: ContractAddress) -> u256;
fn burn_nft(ref self: TState, user_address: ContractAddress, token_id: u256);
fn upgrade(ref self: TState, new_class_hash: ClassHash);

// *************************************************************************
// GETTERS
Expand Down
3 changes: 1 addition & 2 deletions src/interfaces/IFollowNFT.cairo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use starknet::{ContractAddress, ClassHash};
use starknet::ContractAddress;
use coloniz::base::constants::types::FollowData;

// *************************************************************************
Expand All @@ -13,7 +13,6 @@ pub trait IFollowNFT<TState> {
fn unfollow(ref self: TState, unfollower_profile_address: ContractAddress);
fn process_block(ref self: TState, follower_profile_address: ContractAddress) -> bool;
fn process_unblock(ref self: TState, follower_profile_address: ContractAddress) -> bool;
fn upgrade(ref self: TState, new_class_hash: ClassHash);
// *************************************************************************
// GETTERS
// *************************************************************************
Expand Down

0 comments on commit 5c15abb

Please sign in to comment.