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.2.0 #15

Merged
merged 3 commits into from
Sep 27, 2023
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
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scarb 0.6.0
scarb 0.7.0
4 changes: 2 additions & 2 deletions Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name = "governance"
version = "0.1.0"
description = "Contracts for governance of Starknet-native protocols"
homepage = "https://ekubo.org"
cairo-version = "2.1.0"
cairo-version = "2.2.0"

[dependencies]
starknet = "=2.1.0"
starknet = "=2.2.0"

[[target.starknet-contract]]
allowed-libfuncs-list.name = "audited"
7 changes: 3 additions & 4 deletions src/airdrop.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mod Airdrop {
ITransferrableERC20DispatcherTrait
};
use array::{ArrayTrait, SpanTrait};
use hash::{pedersen};
use traits::{Into, TryInto};
use starknet::ContractAddressIntoFelt252;

Expand All @@ -42,9 +41,9 @@ mod Airdrop {
Option::Some(proof_element) => {
compute_pedersen_root(
if felt252_lt(@current, proof_element) {
pedersen(current, *proof_element)
pedersen::pedersen(current, *proof_element)
} else {
pedersen(*proof_element, current)
pedersen::pedersen(*proof_element, current)
},
proof
)
Expand All @@ -58,7 +57,7 @@ mod Airdrop {
#[generate_trait]
impl ClaimToLeaf of ClaimToLeafTrait {
fn to_leaf(self: @Claim) -> felt252 {
pedersen((*self.claimee).into(), (*self.amount).into())
pedersen::pedersen((*self.claimee).into(), (*self.amount).into())
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/call_trait.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ impl CallTraitImpl of CallTrait {
loop {
match data_span.pop_front() {
Option::Some(word) => {
data_hash = pedersen(data_hash, *word);
data_hash = pedersen::pedersen(data_hash, *word);
},
Option::None(_) => {
break;
}
};
};

pedersen(pedersen((*self.to).into(), *self.selector), data_hash)
pedersen::pedersen(pedersen::pedersen((*self.to).into(), *self.selector), data_hash)
}

fn execute(self: @Call) -> Span<felt252> {
Expand Down
4 changes: 2 additions & 2 deletions src/tests/airdrop_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,9 @@ fn test_claim_two_claims() {
let leaf_b = claim_b.to_leaf();

let root = if felt252_lt(@leaf_a, @leaf_b) {
pedersen(leaf_a, leaf_b)
pedersen::pedersen(leaf_a, leaf_b)
} else {
pedersen(leaf_b, leaf_a)
pedersen::pedersen(leaf_b, leaf_a)
};

let airdrop = deploy(token.contract_address, root);
Expand Down
2 changes: 1 addition & 1 deletion src/tests/call_trait_test.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ fn test_execute_invalid_entry_point() {

#[test]
#[available_gas(300000000)]
#[should_panic(expected: ('Input too short for arguments', 'ENTRYPOINT_FAILED'))]
#[should_panic(expected: ('Failed to deserialize param #1', 'ENTRYPOINT_FAILED'))]
fn test_execute_invalid_call_data_too_short() {
let (token, _) = deploy_token('TIMELOCK', 'TL', 1);

Expand Down
2 changes: 1 addition & 1 deletion src/timelock.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ mod Timelock {
loop {
match calls.pop_front() {
Option::Some(call) => {
state = pedersen(state, call.hash());
state = pedersen::pedersen(state, call.hash());
},
Option::None(_) => {
break state;
Expand Down