Skip to content

Commit

Permalink
make crowdfunding contracts standalone chapters
Browse files Browse the repository at this point in the history
  • Loading branch information
Nenad committed Jun 12, 2024
1 parent 931250e commit 0bce989
Show file tree
Hide file tree
Showing 16 changed files with 32 additions and 32 deletions.
40 changes: 20 additions & 20 deletions Scarb.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# Code generated by scarb DO NOT EDIT.
version = 1

[[package]]
name = "advanced_factory"
version = "0.1.0"
dependencies = [
"alexandria_storage",
"components",
"crowdfunding",
"snforge_std",
]

[[package]]
name = "alexandria_storage"
version = "0.3.0"
source = "git+https://github.com/keep-starknet-strange/alexandria.git#3041887b95cf10f9d3cd8d75326c754b331f9573"
source = "git+https://github.com/keep-starknet-strange/alexandria.git?rev=800f5ad#800f5ad217847b5ded63c0302a444161766ee9d6"

[[package]]
name = "bytearray"
Expand All @@ -18,25 +28,6 @@ version = "0.1.0"
name = "calling_other_contracts"
version = "0.1.0"

[[package]]
name = "campaign"
version = "0.1.0"
dependencies = [
"components",
"openzeppelin",
"snforge_std",
]

[[package]]
name = "campaign_factory"
version = "0.1.0"
dependencies = [
"alexandria_storage",
"campaign",
"components",
"snforge_std",
]

[[package]]
name = "components"
version = "0.1.0"
Expand All @@ -63,6 +54,15 @@ version = "0.1.0"
name = "counter"
version = "0.1.0"

[[package]]
name = "crowdfunding"
version = "0.1.0"
dependencies = [
"components",
"openzeppelin",
"snforge_std",
]

[[package]]
name = "custom_type_serde"
version = "0.1.0"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "crowdfunding_factory"
name = "advanced_factory"
version.workspace = true
edition = "2023_11"

Expand All @@ -8,11 +8,11 @@ starknet.workspace = true
components.workspace = true
alexandria_storage.workspace = true
snforge_std.workspace = true
crowdfunding_campaign = { path = "../crowdfunding_campaign" }
crowdfunding = { path = "../crowdfunding" }

[scripts]
test.workspace = true

[[target.starknet-contract]]
casm = true
build-external-contracts = ["crowdfunding_campaign::campaign::Campaign"]
build-external-contracts = ["crowdfunding::campaign::Campaign"]
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ pub mod CampaignFactory {
get_caller_address, get_contract_address
};
use alexandria_storage::list::{List, ListTrait};
use crowdfunding_campaign::campaign::{ICampaignDispatcher, ICampaignDispatcherTrait};
use crowdfunding::campaign::{ICampaignDispatcher, ICampaignDispatcherTrait};
use components::ownable::ownable_component;

component!(path: ownable_component, storage: ownable, event: OwnableEvent);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use core::traits::TryInto;
use core::clone::Clone;
use core::result::ResultTrait;
use crowdfunding_factory::contract::{
use advanced_factory::contract::{
CampaignFactory, ICampaignFactoryDispatcher, ICampaignFactoryDispatcherTrait
};
use starknet::{
Expand All @@ -13,8 +13,8 @@ use snforge_std::{
};

// Define a target contract to deploy
use crowdfunding_campaign::campaign::{Campaign, ICampaignDispatcher, ICampaignDispatcherTrait};
use crowdfunding_campaign::campaign::Status;
use crowdfunding::campaign::{Campaign, ICampaignDispatcher, ICampaignDispatcherTrait};
use crowdfunding::campaign::Status;
use components::ownable::{IOwnableDispatcher, IOwnableDispatcherTrait};


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "crowdfunding_campaign"
name = "crowdfunding"
version.workspace = true
edition = "2023_11"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ use snforge_std::{
stop_cheat_caller_address, spy_events, SpyOn, EventSpy, EventAssertions, get_class_hash
};

use crowdfunding_campaign::campaign::{Campaign, ICampaignDispatcher, ICampaignDispatcherTrait};
use crowdfunding_campaign::campaign::Status;
use crowdfunding::campaign::{Campaign, ICampaignDispatcher, ICampaignDispatcherTrait};
use crowdfunding::campaign::Status;
use components::ownable::{IOwnableDispatcher, IOwnableDispatcherTrait};

/// Deploy a campaign contract with the provided data
Expand Down
2 changes: 1 addition & 1 deletion src/applications/advanced_factory.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This is the CampaignFactory contract that creates new Campaign contract instances.

```rust
{{#include ../../../listings/applications/crowdfunding_factory/src/contract.cairo:contract}}
{{#include ../../../listings/applications/advanced_factory/src/contract.cairo:contract}}
```
2 changes: 1 addition & 1 deletion src/applications/crowdfunding.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
This is the Crowdfunding Campaign contract.

```rust
{{#include ../../../listings/applications/crowdfunding_campaign/src/contract.cairo:contract}}
{{#include ../../../listings/applications/crowdfunding/src/contract.cairo:contract}}
```

0 comments on commit 0bce989

Please sign in to comment.