Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump to Cairo 2.7.1 (edition 2024_07) + snfoundry 0.27.0 #296

Closed
wants to merge 1 commit into from
Closed
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
12 changes: 10 additions & 2 deletions onchain/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ dependencies = [
"snforge_std",
]

[[package]]
name = "snforge_scarb_plugin"
version = "0.1.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.28.0#4dfe39d96690ed6b3d56971512700de3f58288ea"

[[package]]
name = "snforge_std"
version = "0.25.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.25.0#5b366e24821e530fea97f11b211d220e8493fbea"
version = "0.28.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.28.0#4dfe39d96690ed6b3d56971512700de3f58288ea"
dependencies = [
"snforge_scarb_plugin",
]
7 changes: 4 additions & 3 deletions onchain/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
[package]
name = "joyboy"
version = "0.1.0"
edition = "2023_11"
edition = "2024_07"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.6.3"
starknet = "2.7.1"
assert_macros = "0.1.0"

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

#[lib]

Expand Down
5 changes: 2 additions & 3 deletions onchain/src/bip340.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@
use core::byte_array::ByteArrayTrait;
use core::option::OptionTrait;
use core::result::ResultTrait;
// TODO: uncomment once Cairo 2.7 is available
// use core::sha256::compute_sha256_byte_array;
use core::sha256::compute_sha256_byte_array;
use core::starknet::SyscallResultTrait;
use core::to_byte_array::{AppendFormattedToByteArray, FormatAsByteArray};
use core::traits::Into;

use joyboy::utils::{shl, shr, compute_sha256_byte_array};
use joyboy::utils::{shl, shr};
use starknet::{secp256k1::{Secp256k1Point}, secp256_trait::{Secp256Trait, Secp256PointTrait}};

const TWO_POW_32: u128 = 0x100000000;
Expand Down
8 changes: 6 additions & 2 deletions onchain/src/erc20.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,19 @@ pub mod ERC20 {
use starknet::ContractAddress;
use starknet::contract_address_const;
use starknet::get_caller_address;
use starknet::storage::{
StorageMapReadAccess, StorageMapWriteAccess, StoragePointerReadAccess,
StoragePointerWriteAccess
};

#[storage]
struct Storage {
name: felt252,
symbol: felt252,
decimals: u8,
total_supply: u256,
balances: LegacyMap::<ContractAddress, u256>,
allowances: LegacyMap::<(ContractAddress, ContractAddress), u256>,
balances: starknet::storage::Map::<ContractAddress, u256>,
allowances: starknet::storage::Map::<(ContractAddress, ContractAddress), u256>,
}

#[event]
Expand Down
1 change: 0 additions & 1 deletion onchain/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
pub mod bip340;
pub mod erc20;
pub mod sha256;
pub mod social;
pub mod utils;
262 changes: 0 additions & 262 deletions onchain/src/sha256.cairo

This file was deleted.

1 change: 1 addition & 0 deletions onchain/src/social.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ pub mod deposit;
pub mod profile;
pub mod request;
pub mod transfer;
pub mod utils;
Loading
Loading