Skip to content

Commit

Permalink
bump to Cairo 2.7.1 (edition 2024_07) + snfoundry 0.27.0
Browse files Browse the repository at this point in the history
  • Loading branch information
remybar committed Aug 16, 2024
1 parent 4d74725 commit ec623f0
Show file tree
Hide file tree
Showing 12 changed files with 65 additions and 374 deletions.
4 changes: 2 additions & 2 deletions onchain/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ dependencies = [

[[package]]
name = "snforge_std"
version = "0.25.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.25.0#5b366e24821e530fea97f11b211d220e8493fbea"
version = "0.27.0"
source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de"
6 changes: 3 additions & 3 deletions onchain/Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[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.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.27.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.

Loading

0 comments on commit ec623f0

Please sign in to comment.