Skip to content

Commit

Permalink
fix: 2024_07 edition
Browse files Browse the repository at this point in the history
  • Loading branch information
julio4 committed Sep 13, 2024
1 parent 93227de commit 196bfe1
Show file tree
Hide file tree
Showing 31 changed files with 39 additions and 36 deletions.
2 changes: 1 addition & 1 deletion listings/applications/components/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "components"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[lib]

Expand Down
2 changes: 1 addition & 1 deletion listings/applications/components_dependencies/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "components_dependencies"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/applications/constant_product_amm/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "constant_product_amm"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/applications/erc20/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "erc20"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[lib]

Expand Down
2 changes: 1 addition & 1 deletion listings/applications/nft_dutch_auction/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "nft_dutch_auction"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
erc20 = { path = "../erc20" }
Expand Down
7 changes: 5 additions & 2 deletions listings/applications/nft_dutch_auction/src/erc721.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,10 @@ mod ERC721 {
// library imports
////////////////////////////////
use starknet::{ContractAddress, get_caller_address};
use starknet::storage::{Map, StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess, StoragePointerWriteAccess};
use starknet::storage::{
Map, StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess,
StoragePointerWriteAccess
};
use core::num::traits::Zero;

////////////////////////////////
Expand Down Expand Up @@ -163,7 +166,7 @@ mod ERC721 {
}

////////////////////////////////
// set_approval_for_all function approves an operator to spend all tokens
// set_approval_for_all function approves an operator to spend all tokens
////////////////////////////////
fn set_approval_for_all(
ref self: ContractState, operator: ContractAddress, approved: bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ mod tests {
assert_eq!(buyer_bal_after_buy, buyer_bal_before_buy - nft_price);
assert_eq!(erc721_dispatcher.owner_of(nft_id_1), buyer);

// Forward block timestamp in order for a reduced nft price
// Forward block timestamp in order for a reduced nft price
let forward_blocktime_by = 4000; // milliseconds
cheat_block_timestamp(nft_auction_address, forward_blocktime_by, CheatSpan::TargetCalls(1));

Expand Down Expand Up @@ -277,7 +277,7 @@ mod tests {
erc20_dispatcher.approve(nft_auction_address, nft_price);
nft_auction_dispatcher.buy(nft_id_1);

// Forward block timestamp in order for a reduced nft price
// Forward block timestamp in order for a reduced nft price
let forward_blocktime_by = 4000; // 4 seconds (in milliseconds)
cheat_block_timestamp(nft_auction_address, forward_blocktime_by, CheatSpan::TargetCalls(1));

Expand Down Expand Up @@ -322,7 +322,7 @@ mod tests {
nft_auction_dispatcher.buy(nft_id_1);

// Forward block timestamp to a time after duration has ended
// During deployment, duration was set to 60 seconds
// During deployment, duration was set to 60 seconds
let forward_blocktime_by = 61000; // 61 seconds (in milliseconds)
cheat_block_timestamp(nft_auction_address, forward_blocktime_by, CheatSpan::TargetCalls(1));

Expand Down
2 changes: 1 addition & 1 deletion listings/applications/simple_vault/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "simple_vault"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/applications/staking/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "staking"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/applications/upgradeable_contract/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "upgradeable_contract"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/bytearray/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "bytearray"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/cairo_cheatsheet/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "cairo_cheatsheet"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "calling_other_contracts"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/constructor/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "constructor"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/counter/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "counter"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/custom_type_serde/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "custom_type_serde"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/errors/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "errors"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/events/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "events"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/factory/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "factory"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/interfaces_traits/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "interfaces_traits"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/mappings/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "mappings"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/storage/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "storage"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod test {
Contract::TEST_CLASS_HASH.try_into().unwrap(), 0, array![].span(), false
)
.unwrap_syscall();
// Not much to test
// Not much to test
}
}

2 changes: 1 addition & 1 deletion listings/getting-started/storing_custom_types/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "storing_custom_types"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/testing_how_to/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "testing_how_to"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/variables/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "variables"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions listings/getting-started/variables/src/global_variables.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub mod GlobalExample {
fn foo(ref self: ContractState) {
// Call the get_caller_address function to get the sender address
let _caller = get_caller_address();
// ...
// ...
}
}
}
Expand All @@ -34,6 +34,6 @@ mod test {
GlobalExample::TEST_CLASS_HASH.try_into().unwrap(), 0, array![].span(), false
)
.unwrap_syscall();
// Not much to test
// Not much to test
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub mod LocalVariablesExample {
let sum = value + increment;
sum
}
// We can't access the variable `sum` here, as it's out of scope.
// We can't access the variable `sum` here, as it's out of scope.
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ pub mod StorageVariablesExample {
#[cfg(test)]
mod test {
use super::{
StorageVariablesExample,
IStorageVariableExampleDispatcher, IStorageVariableExampleDispatcherTrait
StorageVariablesExample, IStorageVariableExampleDispatcher,
IStorageVariableExampleDispatcherTrait
};
use starknet::{SyscallResultTrait, syscalls::deploy_syscall};
use starknet::testing::set_contract_address;
Expand Down
2 changes: 1 addition & 1 deletion listings/getting-started/visibility/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "visibility"
version.workspace = true
edition = '2024_07'
edition = "2024_07"

[dependencies]
starknet.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion src/starknet-by-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ The current version this book uses:

```
cairo 2.6.3
edition = '2024_07'
edition = "2024_07"
{{#include ../.tool-versions}}
```

0 comments on commit 196bfe1

Please sign in to comment.