Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
target
.snfoundry_cache/
.vscode/
.vscode/
.deployment.md/
14 changes: 12 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ declare:
sncast \
declare \
--fee-token eth \
--url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- \
--name ${name} \
--contract-name ${name}

deploy:
Expand All @@ -23,5 +25,13 @@ upgrade:

set_env:
export STARKNET_ACCOUNT=
export STARKNET_KEYSTORE=
export STARKNET_RPC=
export STARKNET_KEYSTORE= ../../keystore/keystore.json
export STARKNET_RPC= https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8-


sncast \
account create \
--url 'https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- \'
--name weaver_deploy


6 changes: 6 additions & 0 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,9 @@ test = "snforge test"
[profile.dev.cairo]
unstable-add-statements-code-locations-debug-info = true
unstable-add-statements-functions-debug-info = true


[profile.default]
account = "weaver_deploy"
accounts-file = ".starknet_accounts/accounts.json"
network = "sepolia"
32 changes: 32 additions & 0 deletions deployment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
sncast account create --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --name weaver_deploy

sncast account deploy --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --name weaver_deploy --fee-token eth

sncast --account deploy_weaver declare --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --contract-name protocolNFT --fee-token eth

sncast --account deploy_weaver declare --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --contract-name protocols --fee-token eth

sncast --account deploy_weaver declare --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --contract-name WeaverNFT --fee-token eth

sncast --account deploy_weaver declare --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --contract-name Weaver --fee-token eth


sncast --account deploy_weaver deploy --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --class-hash 0x00a48e557dce8fa7f837e547e2370cf4cb1ad4c6639b1ffc901c1ad1654460c1 --fee-token eth --constructor-calldata 0x05d1529a7e55E8f0E6591465E2c34bFF10d5e40F74f510cF8EA229a880096C3a

sncast --account deploy_weaver deploy --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --class-hash 0x0689773dfcdaeff1fb3e94e7b3c00af755af354f5a4340bbbda35d7e4bb5c071 --fee-token eth --constructor-calldata 0x05d1529a7e55E8f0E6591465E2c34bFF10d5e40F74f510cF8EA229a880096C3a

sncast --account deploy_weaver deploy --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --class-hash 0x054e3fc7fa075587839d33e723acb1c42e32e9f8fedd41e3244ce80fa8ad24e3 --fee-token eth --constructor-calldata 0x01f3801de0af4481bdc1bd20960ea7850d53375e5830f1c2ecaecbfc5987c814

sncast --account deploy_weaver deploy --url https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8- --class-hash 0x01f3801de0af4481bdc1bd20960ea7850d53375e5830f1c2ecaecbfc5987c814 --fee-token eth --constructor-calldata 0x00 0x01 0x05d1529a7e55E8f0E6591465E2c34bFF10d5e40F74f510cF8EA229a880096C3a












8 changes: 5 additions & 3 deletions snfoundry.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Visit https://foundry-rs.github.io/starknet-foundry/appendix/snfoundry-toml.html

# and https://foundry-rs.github.io/starknet-foundry/projects/configuration.html for more information

# [sncast.default] # Define a profile name
# url = "https://free-rpc.nethermind.io/sepolia-juno/v0_7" # Url of the RPC provider
# url = "https://starknet-sepolia.g.alchemy.com/starknet/version/rpc/v0_7/CGmQDezuhKApBVtytny0Hh7MvAHwTh8-" # Url of the RPC provider

# accounts-file = "../account-file" # Path to the file with the account data
# account = "mainuser" # Account from `accounts_file` or default account file that will be used for the transactions
# account = "Weavers_contract" # Account from `accounts_file` or default account file that will be used for the transactions
# keystore = "~/keystore" # Path to the keystore file
# wait-params = { timeout = 300, retry-interval = 10 } # Wait for submitted transaction parameters
# block-explorer = "StarkScan" # Block explorer service used to display links to transaction details
# show-explorer-links = true # Print links pointing to pages with transaction details in the chosen block explorer
# network = "sepolia"
17 changes: 17 additions & 0 deletions src/contract.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

// class hash
protocolNFT classhash: 0x01f3801de0af4481bdc1bd20960ea7850d53375e5830f1c2ecaecbfc5987c814
protocols classhash: 0x054e3fc7fa075587839d33e723acb1c42e32e9f8fedd41e3244ce80fa8ad24e3
weaver NFT classhash: 0x0689773dfcdaeff1fb3e94e7b3c00af755af354f5a4340bbbda35d7e4bb5c071
weaverContract classhash: 0x00a48e557dce8fa7f837e547e2370cf4cb1ad4c6639b1ffc901c1ad1654460c1


// address
weaverContract addressb: 0x000a6ab43cb891ee68a350dbfd2a972bab0379701c6fc115802284dad4d22dea
WeaverNFT address : 0x041def29d2d5c719c89788959db261c708303c6fe9ef2cdcddd3af6678c6bf07
protocols address: 0x02d916e6f8d8e2dc8d3c9a8a6f25f5f72b280ed25fdaf18e09116800c608e26e
protocolNFT address: 0x051685ff5506f403a05385f0ae10ab637336da849925bc5ebf6cd0a04055de12




1 change: 0 additions & 1 deletion src/mods.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub mod interfaces {
}

pub mod weaver_contract {
pub mod weaver_component;
pub mod weaver;
}

Expand Down
1 change: 1 addition & 0 deletions src/mods/errors.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ pub mod Errors {
pub const TASK_ALREADY_EXIST: felt252 = 'TASK_ALREADY_EXIST';
pub const TASK_NOT_YET_COMPLETED: felt252 = 'TASK_NOT_YET_COMPLETED';
pub const INVALID_PROTOCOL_ID: felt252 = 'INVALID_PROTOCOL_ID';
pub const NOT_IN_PROTOCOL_CAMPAIGN: felt252 = 'NOT_IN_PROTOCOL_CAMPAIGN';
}
9 changes: 0 additions & 9 deletions src/mods/events.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,3 @@ pub struct UserRegistered {
pub block_timestamp: u64,
}


#[derive(Copy, Drop, Debug, PartialEq, starknet::Event)]
pub struct TaskMinted {
#[key]
pub task_id: u256,
#[key]
pub user: ContractAddress,
}

13 changes: 8 additions & 5 deletions src/mods/interfaces/IWeaver.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,15 @@ use starknet::class_hash::ClassHash;
// INTERFACE of WEAVER
// *************************************************************************

use crate::mods::types::{ProtocolInfo, TaskInfo, User};
use crate::mods::types::{User};

#[starknet::interface]
pub trait IWeaver<TState> {
fn register_User(ref self: TState, Details: ByteArray);
pub trait IWeaver<TContractState> {
fn register_User(ref self: TContractState, Details: ByteArray);

fn get_register_user(self: @TState, address: ContractAddress) -> User;
fn get_owner(self: @TState) -> ContractAddress;
fn get_register_user(self: @TContractState, address: ContractAddress) -> User;
fn get_owner(self: @TContractState) -> ContractAddress;
fn set_erc721(ref self: TContractState, address: ContractAddress);
fn get_user_id(self: @TContractState) -> u256;
fn get_erc721(self: @TContractState) -> ContractAddress;
}
9 changes: 7 additions & 2 deletions src/mods/interfaces/Iprotocol.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub trait IProtocol<TState> {
fn join_protocol_campaign(ref self: TState, campaign_user: ContractAddress, protocol_id: u256);
fn set_protocol_matadata_uri(ref self: TState, protocol_id: u256, matadata_uri: ByteArray);
fn protocol_register(ref self: TState, protocol_Details: ByteArray);
fn verfify_protocol(ref self: TState, protocol_address: ContractAddress);


// *************************************************************************
Expand All @@ -33,10 +32,16 @@ pub trait IProtocol<TState> {
fn get_protocol_matadata_uri(self: @TState, protocol_id: u256) -> ByteArray;
fn get_protocol_campaign_users(self: @TState, protocol_id: u256) -> u256;

fn get_campaign_members(self: @TState, protocol_id: u256) -> CampaignMembers;

fn get_registered_protocol(self: @TState, protocol_owner: ContractAddress) -> ProtocolInfo;


fn get_protocol_nft_class_hash(self: @TState) -> ClassHash;
fn get_all_protocol_details(self: @TState) -> Array<ProtocolDetails>;

fn get_all_campaign_for_members(self: @TState, user: ContractAddress) -> Array<CampaignMembers>;

fn get_campaign_for_member(
self: @TState, protocol_id: u256, user: ContractAddress
) -> CampaignMembers;
}
Loading
Loading