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

added updates based on cairo version 2.6.3 #214

Merged
merged 1 commit into from
Sep 23, 2024
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: 0 additions & 3 deletions exercises/arrays/arrays1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@

// I AM NOT DONE

use array::ArrayTrait;
use option::OptionTrait;

fn create_array() -> Array<felt252> {
let a = ArrayTrait::new(); // something to change here...
a.append(1);
Expand Down
3 changes: 0 additions & 3 deletions exercises/arrays/arrays2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@

// I AM NOT DONE

use array::ArrayTrait;
use option::OptionTrait;

// Don't modify this function
fn create_array() -> Array<felt252> {
let mut a = ArrayTrait::new();
Expand Down
3 changes: 0 additions & 3 deletions exercises/arrays/arrays3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

// I AM NOT DONE

use array::ArrayTrait;
use option::OptionTrait;

fn create_array() -> Array<felt252> {
let a = ArrayTrait::new(); // something to change here...
a.append(0);
Expand Down
3 changes: 1 addition & 2 deletions exercises/enums/enums2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
// I AM NOT DONE

use debug::PrintTrait;
use array::ArrayTrait;
use traits::Into;


#[derive(Copy, Drop)]
enum Message { // TODO: define the different variants used below
Expand Down
2 changes: 0 additions & 2 deletions exercises/enums/enums3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

// I AM NOT DONE

use debug::PrintTrait;

#[derive(Drop, Copy)]
enum Message { // TODO: implement the message variant types based on their usage below
}
Expand Down
4 changes: 0 additions & 4 deletions exercises/move_semantics/move_semantics1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@

// I AM NOT DONE

use array::ArrayTrait;
use array::ArrayTCloneImpl;
use array::SpanTrait;
use debug::PrintTrait;
use clone::Clone;

fn main() {
let arr0 = ArrayTrait::new();
Expand Down
1 change: 0 additions & 1 deletion exercises/move_semantics/move_semantics2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Make me compile without changing line 16 or moving line 13!
// Execute `starklings hint move_semantics2` or use the `hint` watch subcommand for a hint.

use array::ArrayTrait;
use debug::PrintTrait;

// I AM NOT DONE
Expand Down
4 changes: 0 additions & 4 deletions exercises/move_semantics/move_semantics3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

// I AM NOT DONE

use array::ArrayTrait;
use array::ArrayTCloneImpl;
use array::SpanTrait;
use clone::Clone;
use debug::PrintTrait;

fn main() {
Expand Down
5 changes: 1 addition & 4 deletions exercises/move_semantics/move_semantics4.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,7 @@
// Execute `starklings hint move_semantics4` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use array::ArrayTrait;
use array::ArrayTCloneImpl;
use array::SpanTrait;
use clone::Clone;

use debug::PrintTrait;

fn main() {
Expand Down
2 changes: 1 addition & 1 deletion exercises/move_semantics/move_semantics5.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Execute `starklings hint move_semantics5` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use array::ArrayTrait;

#[test]
fn main() {
let mut a = ArrayTrait::new();
Expand Down
3 changes: 1 addition & 2 deletions exercises/move_semantics/move_semantics6.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// You can't change anything except adding or removing references.

// I AM NOT DONE
use debug::PrintTrait;

#[derive(Drop)]
struct Number {
Expand All @@ -27,5 +26,5 @@ fn get_value(number: Number) -> u32 {
fn set_value(number: Number) {
let value = 2222222;
number = Number { value };
number.value.print();
println!("Number is: {}", number.value);
}
2 changes: 0 additions & 2 deletions exercises/options/options1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

// I AM NOT DONE

use option::OptionTrait;

// This function returns how much icecream there is left in the fridge.
// If it's before 10PM, there's 5 pieces left. At 10PM, someone eats them
// all, so there'll be no more left :(
Expand Down
2 changes: 0 additions & 2 deletions exercises/options/options2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@

// I AM NOT DONE

use option::OptionTrait;

#[test]
fn test_options() {
let target = 'starklings';
Expand Down
3 changes: 0 additions & 3 deletions exercises/options/options3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@

// I AM NOT DONE

use option::OptionTrait;
use array::ArrayTrait;

#[derive(Drop)]
struct Student {
name: felt252,
Expand Down
4 changes: 0 additions & 4 deletions exercises/primitive_types/primitive_types4.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@

// I AM NOT DONE

use traits::Into;
use traits::TryInto;
use option::OptionTrait;

fn sum_u8s(x: u8, y: u8) -> u8 {
x + y
}
Expand Down
8 changes: 0 additions & 8 deletions exercises/starknet/basics/starknet1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,10 @@ mod JoesContract {

#[cfg(test)]
mod test {
use array::ArrayTrait;
use array::SpanTrait;
use super::JoesContract;
use starknet::syscalls::deploy_syscall;
use traits::TryInto;
use option::OptionTrait;
use starknet::class_hash::Felt252TryIntoClassHash;
use core::result::ResultTrait;
use super::IJoesContractDispatcher;
use super::IJoesContractDispatcherTrait;
use starknet::ContractAddress;
use debug::PrintTrait;

#[test]
#[available_gas(2000000000)]
Expand Down
9 changes: 0 additions & 9 deletions exercises/starknet/basics/starknet2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -38,19 +38,10 @@ trait IJillsContract<TContractState> {

#[cfg(test)]
mod test {
use starknet::ContractAddress;
use array::ArrayTrait;
use array::SpanTrait;
use debug::PrintTrait;
use traits::TryInto;
use starknet::syscalls::deploy_syscall;
use option::OptionTrait;
use starknet::class_hash::Felt252TryIntoClassHash;
use core::result::ResultTrait;
use super::IJillsContractDispatcher;
use super::IJillsContractDispatcherTrait;

use starknet::Felt252TryIntoContractAddress;
use super::JillsContract;
#[test]
#[available_gas(2000000000)]
Expand Down
8 changes: 0 additions & 8 deletions exercises/starknet/basics/starknet3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,7 @@ mod ProgressTracker {
#[cfg(test)]
mod test {
use starknet::ContractAddress;
use array::ArrayTrait;
use array::SpanTrait;
use debug::PrintTrait;
use traits::TryInto;
use starknet::syscalls::deploy_syscall;
use core::result::ResultTrait;

use starknet::Felt252TryIntoContractAddress;
use option::OptionTrait;
use super::IProgressTrackerDispatcher;
use super::IProgressTrackerDispatcherTrait;
use super::ProgressTracker;
Expand Down
8 changes: 0 additions & 8 deletions exercises/starknet/basics/starknet4.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,7 @@ mod LizInventory {
#[cfg(test)]
mod test {
use starknet::ContractAddress;
use array::ArrayTrait;
use array::SpanTrait;
use debug::PrintTrait;
use traits::TryInto;
use starknet::syscalls::deploy_syscall;
use core::result::ResultTrait;

use starknet::Felt252TryIntoContractAddress;
use option::OptionTrait;
use super::LizInventory;
use super::ILizInventoryDispatcher;
use super::ILizInventoryDispatcherTrait;
Expand Down
20 changes: 0 additions & 20 deletions exercises/starknet/interoperability/starknet5.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@

// I AM NOT DONE

use core::traits::Into;
use core::result::ResultTrait;
use starknet::syscalls::deploy_syscall;
use array::ArrayTrait;
use traits::TryInto;
use option::OptionTrait;
use starknet::class_hash::Felt252TryIntoClassHash;

#[starknet::interface]
trait IContractA<TContractState> {
fn set_value(ref self: TContractState, value: u128) -> bool;
Expand All @@ -21,13 +13,9 @@ trait IContractA<TContractState> {

#[starknet::contract]
mod ContractA {
use traits::Into;
use starknet::info::get_contract_address;
use starknet::ContractAddress;
use super::IContractBDispatcher;
use super::IContractBDispatcherTrait;
use result::ResultTrait;
use debug::PrintTrait;

#[storage]
struct Storage {
Expand Down Expand Up @@ -88,15 +76,7 @@ mod ContractB {

#[cfg(test)]
mod test {
use option::OptionTrait;
use starknet::syscalls::deploy_syscall;
use traits::Into;
use traits::TryInto;
use starknet::class_hash::Felt252TryIntoClassHash;
use array::ArrayTrait;
use result::ResultTrait;
use starknet::ContractAddress;

use super::ContractA;
use super::IContractADispatcher;
use super::IContractADispatcherTrait;
Expand Down
1 change: 0 additions & 1 deletion exercises/structs/structs3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

// I AM NOT DONE

use array::ArrayTrait;
#[derive(Copy, Drop)]
struct Package {
sender_country: felt252,
Expand Down
2 changes: 0 additions & 2 deletions exercises/variables/variables1.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

// I AM NOT DONE

use debug::PrintTrait;

fn main() {
x = 5 ;
println!(" x is {}", x)
Expand Down
1 change: 0 additions & 1 deletion exercises/variables/variables2.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Execute `starklings hint variables2` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use debug::PrintTrait;

fn main() {
let x;
Expand Down
1 change: 0 additions & 1 deletion exercises/variables/variables3.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Execute `starklings hint variables3` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use debug::PrintTrait;

fn main() {
let x: felt252;
Expand Down
1 change: 0 additions & 1 deletion exercises/variables/variables4.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Execute `starklings hint variables4` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use debug::PrintTrait;

fn main() {
let x = 3;
Expand Down
1 change: 0 additions & 1 deletion exercises/variables/variables5.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Execute `starklings hint variables5` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use debug::PrintTrait;

fn main() {
let number = 1_u8; // don't change this line
Expand Down
1 change: 0 additions & 1 deletion exercises/variables/variables6.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Execute `starklings hint variables6` or use the `hint` watch subcommand for a hint.

// I AM NOT DONE
use debug::PrintTrait;

const NUMBER = 3;
const SMALL_NUMBER = 3_u8;
Expand Down
Loading