Skip to content

Commit

Permalink
upgrade from Cairo 2.1.1 to 2.7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
loothero committed Sep 7, 2024
1 parent abd0550 commit 971bd46
Show file tree
Hide file tree
Showing 9 changed files with 498 additions and 222 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ tmp.*
/target

accounts
keys
keys
Scarb.lock
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ scarb test && scarb build

Declare contract
```
starkli declare --account accounts/account.json --rpc <RPC_URL> --network goerli-1 ./target/dev/LootSurvivorBeasts_Beasts.sierra.json
starkli declare --account accounts/account.json --rpc <RPC_URL> --network goerli-1 ./target/dev/beasts_Beasts.sierra.json
```

Helpful Cairo string conversion
Expand Down Expand Up @@ -94,7 +94,7 @@ export STARKNET_NETWORK=alpha-mainnet

Declare contract
```
starknet declare --contract target/dev/LootSurvivorBeasts_Beasts.sierra.json --account pusscode
starknet declare --contract target/dev/beasts_Beasts.sierra.json --account pusscode
```

If compiling error happens, try building with a recent version manually in the home dir
Expand All @@ -109,7 +109,7 @@ cargo build --all --release
Declare again if failed earlier
```
cd /workspaces/leetloot
starknet declare --contract target/dev/LootSurvivorBeasts_Beasts.sierra.json --account pusscode
starknet declare --contract target/dev/beasts_Beasts.sierra.json --account pusscode
```

Deploy contract
Expand Down
15 changes: 5 additions & 10 deletions Scarb.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,10 @@
[package]
name = "LootSurvivorBeasts"
name = "beasts"
version = "0.1.0"

[dependencies]
starknet = "2.1.1"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts", rev = "v0.7.0" }

starknet = "2.7.1"
openzeppelin_token = { git = "https://github.com/OpenZeppelin/cairo-contracts", rev = "v0.15.1" }
openzeppelin_introspection = { git = "https://github.com/OpenZeppelin/cairo-contracts", rev = "v0.15.1" }
[scripts]
test = "scarb cairo-test"

[[target.starknet-contract]]
sierra = true
allowed-libfuncs-list.name = "experimental"
allowed-libfuncs = true
test = "scarb cairo-test"
6 changes: 3 additions & 3 deletions src/beast.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use array::{ArrayTrait};
use core::traits::{Into};

use super::long_string::LongString;
use LootSurvivorBeasts::pack::{PackableBeast};
use beasts::pack::{PackableBeast};

// Tiers
const TIER_1: felt252 = '1';
Expand Down Expand Up @@ -3514,7 +3514,7 @@ fn u16_to_felt_string(number: u16) -> felt252 {
#[cfg(test)]
mod tests {
use core::array::ArrayTrait;
use LootSurvivorBeasts::beast::{
use beasts::beast::{
get_hash, get_type, get_tier, get_svg, get_name, get_prefix, get_suffix, u16_to_felt_string,
get_content, TYPE_MAGICAL, TYPE_HUNTER, TYPE_BRUTE, WARLOCK, JUGGERNAUT, PEGASUS, GOBLIN,
BEAR, FENRIR, WENDIGO, GHOUL, PIXIE, AMMIT, BERSERKER, RAKSHASA, TITAN, GOLEM, MANTICORE,
Expand All @@ -3525,7 +3525,7 @@ mod tests {
WOLF, SPIDER, RAT, COLOSSUS, BALROG, LEVIATHAN, TARRASQUE, NEPHILIM, BEHEMOTH, ONI, JOTUNN,
ETTIN, CYCLOPS, ENT, TROLL, BIGFOOT, OGRE, ORC, SKELETON
};
use LootSurvivorBeasts::pack::{PackableBeast};
use beasts::pack::{PackableBeast};

#[test]
#[available_gas(2265600000000)]
Expand Down
Loading

0 comments on commit 971bd46

Please sign in to comment.