diff --git a/.gitignore b/.gitignore index 1e50415..54d3fe5 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,5 @@ tmp.* /target accounts -keys \ No newline at end of file +keys +Scarb.lock diff --git a/README.md b/README.md index 663830d..472ec06 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ scarb test && scarb build Declare contract ``` -starkli declare --account accounts/account.json --rpc --network goerli-1 ./target/dev/LootSurvivorBeasts_Beasts.sierra.json +starkli declare --account accounts/account.json --rpc --network goerli-1 ./target/dev/beasts_Beasts.sierra.json ``` Helpful Cairo string conversion @@ -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 @@ -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 diff --git a/Scarb.toml b/Scarb.toml index d6893a7..0322620 100644 --- a/Scarb.toml +++ b/Scarb.toml @@ -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" \ No newline at end of file diff --git a/src/beast.cairo b/src/beast.cairo index e854c51..d28cdee 100644 --- a/src/beast.cairo +++ b/src/beast.cairo @@ -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'; @@ -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, @@ -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)] diff --git a/src/beasts.cairo b/src/beasts.cairo index a8e17a5..eee3f7d 100644 --- a/src/beasts.cairo +++ b/src/beasts.cairo @@ -25,12 +25,14 @@ mod Beasts { use starknet::storage_access::StorePacking; use starknet::contract_address_const; - use openzeppelin::utils::constants::{IERC721_ID, IERC721_METADATA_ID, ISRC5_ID}; + use openzeppelin_token::erc721::interface::{IERC721_ID, IERC721_METADATA_ID}; + use openzeppelin_introspection::interface::{ISRC5_ID}; - use LootSurvivorBeasts::long_string::{LongString}; - use LootSurvivorBeasts::interfaces::{IBeasts}; - use LootSurvivorBeasts::pack::{mask, pow, PackableBeast}; - use LootSurvivorBeasts::beast::{get_hash, get_content}; + use beasts::long_string::{LongString}; + use beasts::interfaces::{IBeasts}; + use beasts::pack::{mask, pow, PackableBeast}; + use beasts::beast::{get_hash, get_content}; + use core::starknet::storage::Map; // https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md const IERC721_ID_EIP: felt252 = 0x80ac58cd; @@ -42,14 +44,14 @@ mod Beasts { _minter: ContractAddress, _name: felt252, _symbol: felt252, - _owners: LegacyMap, - _balances: LegacyMap, - _tokenApprovals: LegacyMap, - _operatorApprovals: LegacyMap<(ContractAddress, ContractAddress), bool>, + _owners: Map, + _balances: Map, + _tokenApprovals: Map, + _operatorApprovals: Map<(ContractAddress, ContractAddress), bool>, _tokenIndex: u256, - _supportedInterfaces: LegacyMap, - _minted: LegacyMap::, - _beast: LegacyMap, + _supportedInterfaces: Map, + _minted: Map::, + _beast: Map, _genesis_mint: bool, _airdrop_issued: bool, } @@ -225,7 +227,7 @@ mod Beasts { } } - #[external(v0)] + #[abi(embed_v0)] impl BeastsImpl of IBeasts { fn owner(self: @ContractState) -> ContractAddress { self._owner.read() @@ -273,7 +275,7 @@ mod Beasts { let caller = get_caller_address(); assert( - owner == caller || BeastsImpl::isApprovedForAll(@self, owner, caller), + owner == caller || Self::isApprovedForAll(@self, owner, caller), 'ERC721: unauthorized caller' ); self._approve(to, tokenID); @@ -423,924 +425,1188 @@ mod Beasts { airdrops .append( Airdrop { - address: contract_address_const::<0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201>(), + address: contract_address_const::< + 0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201 + >(), beast: PackableBeast { id: 23, prefix: 68, suffix: 17, level: 23, health: 33 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201>(), + address: contract_address_const::< + 0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201 + >(), beast: PackableBeast { id: 74, prefix: 38, suffix: 11, level: 19, health: 159 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0154c4a6e48b66bd77e8c7786e2de6a037af7104cfbec10f9fb2e5cedc0e56b1>(), + address: contract_address_const::< + 0x0154c4a6e48b66bd77e8c7786e2de6a037af7104cfbec10f9fb2e5cedc0e56b1 + >(), beast: PackableBeast { id: 20, prefix: 32, suffix: 8, level: 20, health: 30 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 61, prefix: 4, suffix: 10, level: 28, health: 236 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 68, prefix: 44, suffix: 11, level: 21, health: 183 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 36, prefix: 33, suffix: 18, level: 28, health: 496 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 75, prefix: 63, suffix: 3, level: 25, health: 115 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 73, prefix: 10, suffix: 16, level: 40, health: 158 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 30, prefix: 57, suffix: 6, level: 32, health: 430 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 72, prefix: 27, suffix: 9, level: 47, health: 497 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 32, prefix: 50, suffix: 8, level: 28, health: 511 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca>(), + address: contract_address_const::< + 0x071538f6445e0c6179b786230a3e7b5ddee40b72673a9b5a395da20f4657bdca + >(), beast: PackableBeast { id: 36, prefix: 45, suffix: 12, level: 26, health: 206 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 21, prefix: 6, suffix: 12, level: 20, health: 16 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 24, prefix: 60, suffix: 15, level: 19, health: 109 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 66, prefix: 3, suffix: 9, level: 19, health: 211 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0261069892eca8e8d4d45b31a36eed8b188aaa9c3b4afc43e799f6a8ee3ff158>(), + address: contract_address_const::< + 0x0261069892eca8e8d4d45b31a36eed8b188aaa9c3b4afc43e799f6a8ee3ff158 + >(), beast: PackableBeast { id: 67, prefix: 37, suffix: 7, level: 19, health: 62 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03474353878b236171e4c08e52465d9f2cf6c3babf726cc292ff1566e68612c3>(), + address: contract_address_const::< + 0x03474353878b236171e4c08e52465d9f2cf6c3babf726cc292ff1566e68612c3 + >(), beast: PackableBeast { id: 58, prefix: 43, suffix: 13, level: 19, health: 113 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03474353878b236171e4c08e52465d9f2cf6c3babf726cc292ff1566e68612c3>(), + address: contract_address_const::< + 0x03474353878b236171e4c08e52465d9f2cf6c3babf726cc292ff1566e68612c3 + >(), beast: PackableBeast { id: 23, prefix: 41, suffix: 17, level: 31, health: 153 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 26, prefix: 8, suffix: 11, level: 25, health: 21 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 28, prefix: 13, suffix: 1, level: 19, health: 233 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 45, prefix: 6, suffix: 15, level: 29, health: 295 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x069cca516f5f6fd67e007bc73808e908755b3fd9a87e4856a05d8c6536688674>(), + address: contract_address_const::< + 0x069cca516f5f6fd67e007bc73808e908755b3fd9a87e4856a05d8c6536688674 + >(), beast: PackableBeast { id: 61, prefix: 13, suffix: 7, level: 19, health: 71 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 63, prefix: 9, suffix: 6, level: 22, health: 88 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0378b9c3cb6be32d087d1af8a91c1484226ac8b009f502e12b06ffd46d94f014>(), + address: contract_address_const::< + 0x0378b9c3cb6be32d087d1af8a91c1484226ac8b009f502e12b06ffd46d94f014 + >(), beast: PackableBeast { id: 70, prefix: 7, suffix: 13, level: 21, health: 20 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0716e39b21fe7062421cb0056e1e3323ded9e9154915c0e89f1c9dff206ba459>(), + address: contract_address_const::< + 0x0716e39b21fe7062421cb0056e1e3323ded9e9154915c0e89f1c9dff206ba459 + >(), beast: PackableBeast { id: 13, prefix: 25, suffix: 13, level: 27, health: 173 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 64, prefix: 13, suffix: 16, level: 22, health: 44 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 50, prefix: 56, suffix: 11, level: 25, health: 165 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 43, prefix: 13, suffix: 10, level: 28, health: 128 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 64, prefix: 10, suffix: 1, level: 19, health: 209 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 23, prefix: 47, suffix: 2, level: 38, health: 348 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 71, prefix: 59, suffix: 11, level: 21, health: 111 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 75, prefix: 66, suffix: 6, level: 52, health: 340 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 48, prefix: 3, suffix: 18, level: 28, health: 118 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 61, prefix: 37, suffix: 7, level: 21, health: 371 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c>(), + address: contract_address_const::< + 0x05c387425d73abc847ca158f6a5da1eaa34f2c024d195de70a4c522fe8eb4b5c + >(), beast: PackableBeast { id: 57, prefix: 57, suffix: 18, level: 32, health: 511 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06f490c0ec49fe17148af6f83ebebd9d31e5a06dc46bdbe5c5e0657c23a4ff4f>(), + address: contract_address_const::< + 0x06f490c0ec49fe17148af6f83ebebd9d31e5a06dc46bdbe5c5e0657c23a4ff4f + >(), beast: PackableBeast { id: 23, prefix: 20, suffix: 8, level: 24, health: 153 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06f490c0ec49fe17148af6f83ebebd9d31e5a06dc46bdbe5c5e0657c23a4ff4f>(), + address: contract_address_const::< + 0x06f490c0ec49fe17148af6f83ebebd9d31e5a06dc46bdbe5c5e0657c23a4ff4f + >(), beast: PackableBeast { id: 26, prefix: 20, suffix: 14, level: 24, health: 51 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0154c4a6e48b66bd77e8c7786e2de6a037af7104cfbec10f9fb2e5cedc0e56b1>(), + address: contract_address_const::< + 0x0154c4a6e48b66bd77e8c7786e2de6a037af7104cfbec10f9fb2e5cedc0e56b1 + >(), beast: PackableBeast { id: 69, prefix: 15, suffix: 3, level: 27, health: 79 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 42, prefix: 15, suffix: 6, level: 22, health: 172 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 69, prefix: 54, suffix: 12, level: 30, health: 274 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 20, prefix: 59, suffix: 5, level: 19, health: 105 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 73, prefix: 55, suffix: 4, level: 28, health: 398 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 57, prefix: 66, suffix: 3, level: 25, health: 157 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x074f91d284351a8603933b648684b6a990126d7c78a1b867353a57a3bc2097da>(), + address: contract_address_const::< + 0x074f91d284351a8603933b648684b6a990126d7c78a1b867353a57a3bc2097da + >(), beast: PackableBeast { id: 63, prefix: 9, suffix: 15, level: 23, health: 313 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x074f91d284351a8603933b648684b6a990126d7c78a1b867353a57a3bc2097da>(), + address: contract_address_const::< + 0x074f91d284351a8603933b648684b6a990126d7c78a1b867353a57a3bc2097da + >(), beast: PackableBeast { id: 67, prefix: 4, suffix: 1, level: 23, health: 347 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 38, prefix: 44, suffix: 11, level: 23, health: 93 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 33, prefix: 18, suffix: 3, level: 25, health: 133 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 12, prefix: 66, suffix: 9, level: 27, health: 172 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 72, prefix: 6, suffix: 18, level: 36, health: 172 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 48, prefix: 45, suffix: 18, level: 28, health: 133 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 19, prefix: 22, suffix: 10, level: 44, health: 194 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 18, prefix: 27, suffix: 12, level: 46, health: 283 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6649>(), + address: contract_address_const::< + 0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6649 + >(), beast: PackableBeast { id: 40, prefix: 40, suffix: 13, level: 25, health: 50 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6649>(), + address: contract_address_const::< + 0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6649 + >(), beast: PackableBeast { id: 46, prefix: 28, suffix: 4, level: 30, health: 56 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 64, prefix: 28, suffix: 1, level: 19, health: 29 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 38, prefix: 14, suffix: 14, level: 28, health: 138 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 60, prefix: 21, suffix: 9, level: 27, health: 85 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 12, prefix: 12, suffix: 9, level: 33, health: 157 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 56, prefix: 2, suffix: 17, level: 31, health: 381 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 17, prefix: 8, suffix: 5, level: 45, health: 177 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 57, prefix: 15, suffix: 9, level: 37, health: 127 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 40, prefix: 25, suffix: 1, level: 35, health: 245 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 45, prefix: 66, suffix: 18, level: 30, health: 220 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 20, prefix: 29, suffix: 5, level: 31, health: 225 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 37, prefix: 13, suffix: 1, level: 31, health: 317 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 12, prefix: 12, suffix: 15, level: 41, health: 287 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 48, prefix: 39, suffix: 3, level: 25, health: 443 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356>(), + address: contract_address_const::< + 0x02cd97240db3f679de98a729ae91eb996cab9fd92a9a578df11a72f49be1c356 + >(), beast: PackableBeast { id: 64, prefix: 37, suffix: 4, level: 46, health: 511 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6650>(), + address: contract_address_const::< + 0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6650 + >(), beast: PackableBeast { id: 23, prefix: 26, suffix: 17, level: 23, health: 153 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6649>(), + address: contract_address_const::< + 0x04461b5e6a40da71a2ea718e8e2cbde18109f5d55ec3ffc29f44086d8a7a6649 + >(), beast: PackableBeast { id: 59, prefix: 5, suffix: 5, level: 23, health: 159 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 39, prefix: 69, suffix: 6, level: 24, health: 124 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 71, prefix: 68, suffix: 2, level: 22, health: 96 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 44, prefix: 65, suffix: 14, level: 24, health: 294 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 10, prefix: 22, suffix: 1, level: 21, health: 185 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 11, prefix: 32, suffix: 5, level: 21, health: 201 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 5, prefix: 50, suffix: 14, level: 24, health: 15 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 62, prefix: 2, suffix: 11, level: 21, health: 42 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 47, prefix: 8, suffix: 8, level: 32, health: 42 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 32, prefix: 26, suffix: 8, level: 22, health: 117 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01f447b1d086c66533b481311813a68cde116aacf39fb9611636f18c79502241>(), + address: contract_address_const::< + 0x01f447b1d086c66533b481311813a68cde116aacf39fb9611636f18c79502241 + >(), beast: PackableBeast { id: 21, prefix: 27, suffix: 9, level: 19, health: 16 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01f447b1d086c66533b481311813a68cde116aacf39fb9611636f18c79502241>(), + address: contract_address_const::< + 0x01f447b1d086c66533b481311813a68cde116aacf39fb9611636f18c79502241 + >(), beast: PackableBeast { id: 63, prefix: 15, suffix: 18, level: 28, health: 238 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01f447b1d086c66533b481311813a68cde116aacf39fb9611636f18c79502241>(), + address: contract_address_const::< + 0x01f447b1d086c66533b481311813a68cde116aacf39fb9611636f18c79502241 + >(), beast: PackableBeast { id: 72, prefix: 33, suffix: 15, level: 31, health: 187 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 74, prefix: 35, suffix: 11, level: 19, health: 159 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 73, prefix: 16, suffix: 13, level: 19, health: 128 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd>(), + address: contract_address_const::< + 0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd + >(), beast: PackableBeast { id: 72, prefix: 60, suffix: 3, level: 21, health: 67 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd>(), + address: contract_address_const::< + 0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd + >(), beast: PackableBeast { id: 44, prefix: 35, suffix: 17, level: 19, health: 99 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd>(), + address: contract_address_const::< + 0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd + >(), beast: PackableBeast { id: 24, prefix: 60, suffix: 18, level: 24, health: 109 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd>(), + address: contract_address_const::< + 0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd + >(), beast: PackableBeast { id: 11, prefix: 53, suffix: 8, level: 26, health: 171 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd>(), + address: contract_address_const::< + 0x03573910f5b33ca8249412ef469a5cc35dd6629ebe034d2b3098bc3c5ba9dcbd + >(), beast: PackableBeast { id: 74, prefix: 5, suffix: 17, level: 29, health: 39 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 19, prefix: 40, suffix: 1, level: 23, health: 89 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 9, prefix: 51, suffix: 6, level: 22, health: 49 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 71, prefix: 23, suffix: 14, level: 48, health: 411 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 66, prefix: 60, suffix: 18, level: 28, health: 406 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319>(), + address: contract_address_const::< + 0x01046e44faf09e4e69ba96180a545882e196c34ffcfc3598c4ab15a3a442d319 + >(), beast: PackableBeast { id: 15, prefix: 18, suffix: 15, level: 43, health: 445 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 21, prefix: 33, suffix: 9, level: 27, health: 241 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 71, prefix: 20, suffix: 2, level: 44, health: 366 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd>(), + address: contract_address_const::< + 0x05f17eb829583374661a8ae382333b34a046345dfbe26fa51bdf4a30ff6548bd + >(), beast: PackableBeast { id: 65, prefix: 35, suffix: 5, level: 25, health: 511 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 68, prefix: 5, suffix: 5, level: 23, health: 78 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 48, prefix: 36, suffix: 3, level: 21, health: 133 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 65, prefix: 41, suffix: 17, level: 27, health: 75 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 21, prefix: 57, suffix: 6, level: 52, health: 331 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 28, prefix: 64, suffix: 13, level: 25, health: 323 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 25, prefix: 31, suffix: 7, level: 19, health: 185 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 47, prefix: 26, suffix: 5, level: 25, health: 147 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 12, prefix: 69, suffix: 15, level: 37, health: 187 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 29, prefix: 68, suffix: 8, level: 22, health: 354 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 33, prefix: 3, suffix: 6, level: 36, health: 103 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 67, prefix: 61, suffix: 13, level: 29, health: 167 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb>(), + address: contract_address_const::< + 0x04e8fa25c1c786bb014311ed21cd5c5e0aa0b44a276fa6c6775f26febaaed2fb + >(), beast: PackableBeast { id: 50, prefix: 47, suffix: 14, level: 48, health: 390 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x021cfa1ab62008896f10b50d972ed0f53c12eae2cf636b03f47f0962dfdffe6c>(), + address: contract_address_const::< + 0x021cfa1ab62008896f10b50d972ed0f53c12eae2cf636b03f47f0962dfdffe6c + >(), beast: PackableBeast { id: 45, prefix: 51, suffix: 12, level: 24, health: 130 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x021cfa1ab62008896f10b50d972ed0f53c12eae2cf636b03f47f0962dfdffe6c>(), + address: contract_address_const::< + 0x021cfa1ab62008896f10b50d972ed0f53c12eae2cf636b03f47f0962dfdffe6c + >(), beast: PackableBeast { id: 22, prefix: 64, suffix: 16, level: 24, health: 47 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0444f4350539b01ace59d37a3eb58710c737f3d3640e7f2e43721c5dd8fec9e6>(), + address: contract_address_const::< + 0x0444f4350539b01ace59d37a3eb58710c737f3d3640e7f2e43721c5dd8fec9e6 + >(), beast: PackableBeast { id: 5, prefix: 17, suffix: 8, level: 20, health: 90 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0378b9c3cb6be32d087d1af8a91c1484226ac8b009f502e12b06ffd46d94f014>(), + address: contract_address_const::< + 0x0378b9c3cb6be32d087d1af8a91c1484226ac8b009f502e12b06ffd46d94f014 + >(), beast: PackableBeast { id: 9, prefix: 66, suffix: 9, level: 21, health: 109 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 75, prefix: 33, suffix: 12, level: 22, health: 130 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 64, prefix: 64, suffix: 1, level: 19, health: 74 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2>(), + address: contract_address_const::< + 0x06984560836d038e6e42226351eb70e627afc7879df11aa3cfc383d41f6701a2 + >(), beast: PackableBeast { id: 47, prefix: 5, suffix: 8, level: 22, health: 192 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x044081ea31b076fd7daf9f66e5405a64bf3f6384d9ffea6c6b8c45e5524c60f3>(), + address: contract_address_const::< + 0x044081ea31b076fd7daf9f66e5405a64bf3f6384d9ffea6c6b8c45e5524c60f3 + >(), beast: PackableBeast { id: 21, prefix: 48, suffix: 6, level: 20, health: 151 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c>(), + address: contract_address_const::< + 0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c + >(), beast: PackableBeast { id: 18, prefix: 27, suffix: 3, level: 21, health: 193 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c>(), + address: contract_address_const::< + 0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c + >(), beast: PackableBeast { id: 69, prefix: 63, suffix: 9, level: 19, health: 109 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c>(), + address: contract_address_const::< + 0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c + >(), beast: PackableBeast { id: 37, prefix: 52, suffix: 16, level: 22, health: 362 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c>(), + address: contract_address_const::< + 0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c + >(), beast: PackableBeast { id: 17, prefix: 65, suffix: 5, level: 27, health: 417 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c>(), + address: contract_address_const::< + 0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c + >(), beast: PackableBeast { id: 70, prefix: 4, suffix: 1, level: 39, health: 511 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201>(), + address: contract_address_const::< + 0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201 + >(), beast: PackableBeast { id: 65, prefix: 26, suffix: 2, level: 24, health: 90 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201>(), + address: contract_address_const::< + 0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201 + >(), beast: PackableBeast { id: 70, prefix: 19, suffix: 13, level: 25, health: 230 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 40, prefix: 61, suffix: 4, level: 22, health: 140 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 14, prefix: 29, suffix: 5, level: 29, health: 24 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x021cfa1ab62008896f10b50d972ed0f53c12eae2cf636b03f47f0962dfdffe6c>(), + address: contract_address_const::< + 0x021cfa1ab62008896f10b50d972ed0f53c12eae2cf636b03f47f0962dfdffe6c + >(), beast: PackableBeast { id: 68, prefix: 35, suffix: 14, level: 20, health: 63 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201>(), + address: contract_address_const::< + 0x05b0a0def8c8eea7c4b1002502386c067d218d95a8346b0842f7b8cd53447201 + >(), beast: PackableBeast { id: 45, prefix: 66, suffix: 12, level: 20, health: 130 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c>(), + address: contract_address_const::< + 0x0620b2e12fb8d195ce384512d65fbbddbdea26c4610a49f7630282ea7e55077c + >(), beast: PackableBeast { id: 75, prefix: 33, suffix: 9, level: 21, health: 115 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 49, prefix: 52, suffix: 1, level: 19, health: 59 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 45, prefix: 33, suffix: 6, level: 22, health: 70 } } ); airdrops .append( Airdrop { - address: contract_address_const::<0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460>(), + address: contract_address_const::< + 0x066f04f184ddbc8e10d53540b724a336bda64222d916f277030ec9d99cf99460 + >(), beast: PackableBeast { id: 38, prefix: 2, suffix: 11, level: 23, health: 213 } } ); diff --git a/src/interfaces.cairo b/src/interfaces.cairo index d9838e7..3810844 100644 --- a/src/interfaces.cairo +++ b/src/interfaces.cairo @@ -1,5 +1,5 @@ use starknet::ContractAddress; -use LootSurvivorBeasts::pack::PackableBeast; +use beasts::pack::PackableBeast; // contract interface #[starknet::interface] diff --git a/src/long_string.cairo b/src/long_string.cairo index dfe49ac..fa08eb5 100644 --- a/src/long_string.cairo +++ b/src/long_string.cairo @@ -147,13 +147,13 @@ impl LongStringStorageAccess of starknet::Store { fn read_at_offset( address_domain: u32, base: StorageBaseAddress, offset: u8 ) -> SyscallResult { - LongStringStorageAccess::read_at_offset(address_domain, base, offset) + Self::read_at_offset(address_domain, base, offset) } fn write_at_offset( address_domain: u32, base: StorageBaseAddress, offset: u8, value: LongString ) -> SyscallResult<()> { - LongStringStorageAccess::write_at_offset(address_domain, base, offset, value) + Self::write_at_offset(address_domain, base, offset, value) } fn size() -> u8 { diff --git a/src/pack.cairo b/src/pack.cairo index c76af18..8778a45 100644 --- a/src/pack.cairo +++ b/src/pack.cairo @@ -22,11 +22,21 @@ impl PackPackable of StorePacking { } fn unpack(value: felt252) -> PackableBeast { let packed = value.into(); - let (packed, id) = integer::U256DivRem::div_rem(packed, pow::TWO_POW_7.try_into().expect('0 bits')); - let (packed, prefix) = integer::U256DivRem::div_rem(packed, pow::TWO_POW_7.try_into().expect('0 bits')); - let (packed, suffix) = integer::U256DivRem::div_rem(packed, pow::TWO_POW_5.try_into().expect('0 bits')); - let (packed, level) = integer::U256DivRem::div_rem(packed, pow::TWO_POW_16.try_into().expect('0 bits')); - let (packed, health) = integer::U256DivRem::div_rem(packed, pow::TWO_POW_16.try_into().expect('0 bits')); + let (packed, id) = integer::U256DivRem::div_rem( + packed, pow::TWO_POW_7.try_into().expect('0 bits') + ); + let (packed, prefix) = integer::U256DivRem::div_rem( + packed, pow::TWO_POW_7.try_into().expect('0 bits') + ); + let (packed, suffix) = integer::U256DivRem::div_rem( + packed, pow::TWO_POW_5.try_into().expect('0 bits') + ); + let (packed, level) = integer::U256DivRem::div_rem( + packed, pow::TWO_POW_16.try_into().expect('0 bits') + ); + let (_, health) = integer::U256DivRem::div_rem( + packed, pow::TWO_POW_16.try_into().expect('0 bits') + ); PackableBeast { id: id.try_into().expect('unpack id'), prefix: prefix.try_into().expect('unpack prefix'), @@ -37,54 +47,6 @@ impl PackPackable of StorePacking { } } - -#[test] -#[available_gas(180960)] -fn test_pack_and_unpack_gas() { - let beast = PackableBeast { id: 1, prefix: 2, suffix: 3, level: 4, health: 5}; - let packed = PackPackable::pack(beast); - let unpacked = PackPackable::unpack(packed); -} - -#[test] -#[available_gas(1000000000)] -fn test_pack_and_unpack_basic() { - let beast = PackableBeast { id: 1, prefix: 2, suffix: 3, level: 4, health: 5}; - let packed = PackPackable::pack(beast); - let unpacked = PackPackable::unpack(packed); - - assert(beast.id == unpacked.id, 'id'); - assert(beast.prefix == unpacked.prefix, 'prefix'); - assert(beast.suffix == unpacked.suffix, 'suffix'); - assert(beast.level == unpacked.level, 'level'); -} - -#[test] -#[available_gas(1000000000)] -fn test_pack_and_unpack_zero() { - let beast = PackableBeast { id: 0, prefix: 0, suffix: 0, level: 0, health: 0}; - let packed = PackPackable::pack(beast); - let unpacked = PackPackable::unpack(packed); - - assert(beast.id == unpacked.id, 'id'); - assert(beast.prefix == unpacked.prefix, 'prefix'); - assert(beast.suffix == unpacked.suffix, 'suffix'); - assert(beast.level == unpacked.level, 'level'); -} - -#[test] -#[available_gas(1000000000)] -fn test_pack_and_unpack_max() { - let beast = PackableBeast { id: 127, prefix: 127, suffix: 31, level: 65535, health: 65535}; - let packed = PackPackable::pack(beast); - let unpacked = PackPackable::unpack(packed); - - assert(beast.id == unpacked.id, 'id'); - assert(beast.prefix == unpacked.prefix, 'prefix'); - assert(beast.suffix == unpacked.suffix, 'suffix'); - assert(beast.level == unpacked.level, 'level'); -} - mod mask { const MASK_1: u256 = 0x1; const MASK_2: u256 = 0x3; @@ -499,3 +461,53 @@ mod pow { const TWO_POW_256: u256 = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF; // 2^256 } + +#[cfg(test)] +mod tests { + #[test] + #[available_gas(180960)] + fn test_pack_and_unpack_gas() { + let beast = PackableBeast { id: 1, prefix: 2, suffix: 3, level: 4, health: 5 }; + let packed = PackPackable::pack(beast); + let unpacked = PackPackable::unpack(packed); + } + + #[test] + #[available_gas(1000000000)] + fn test_pack_and_unpack_basic() { + let beast = PackableBeast { id: 1, prefix: 2, suffix: 3, level: 4, health: 5 }; + let packed = PackPackable::pack(beast); + let unpacked = PackPackable::unpack(packed); + + assert(beast.id == unpacked.id, 'id'); + assert(beast.prefix == unpacked.prefix, 'prefix'); + assert(beast.suffix == unpacked.suffix, 'suffix'); + assert(beast.level == unpacked.level, 'level'); + } + + #[test] + #[available_gas(1000000000)] + fn test_pack_and_unpack_zero() { + let beast = PackableBeast { id: 0, prefix: 0, suffix: 0, level: 0, health: 0 }; + let packed = PackPackable::pack(beast); + let unpacked = PackPackable::unpack(packed); + + assert(beast.id == unpacked.id, 'id'); + assert(beast.prefix == unpacked.prefix, 'prefix'); + assert(beast.suffix == unpacked.suffix, 'suffix'); + assert(beast.level == unpacked.level, 'level'); + } + + #[test] + #[available_gas(1000000000)] + fn test_pack_and_unpack_max() { + let beast = PackableBeast { id: 127, prefix: 127, suffix: 31, level: 65535, health: 65535 }; + let packed = PackPackable::pack(beast); + let unpacked = PackPackable::unpack(packed); + + assert(beast.id == unpacked.id, 'id'); + assert(beast.prefix == unpacked.prefix, 'prefix'); + assert(beast.suffix == unpacked.suffix, 'suffix'); + assert(beast.level == unpacked.level, 'level'); + } +} diff --git a/src/tests/deploy.cairo b/src/tests/deploy.cairo index 729e6b1..7c313c5 100644 --- a/src/tests/deploy.cairo +++ b/src/tests/deploy.cairo @@ -7,12 +7,14 @@ mod tests { use traits::{TryInto, Into}; use option::OptionTrait; use result::ResultTrait; - use LootSurvivorBeasts::beasts::{LongString, Beasts}; - use LootSurvivorBeasts::interfaces::{IBeastsDispatcher, IBeastsDispatcherTrait}; + use beasts::beasts::{LongString, Beasts}; + use beasts::interfaces::{IBeastsDispatcher, IBeastsDispatcherTrait}; use starknet::testing::{set_caller_address, set_contract_address}; fn OWNER() -> ContractAddress { - contract_address_const::<0x168893664220f03a74a9bce84228b009df46040c08bb308783dcf130790335f>() + contract_address_const::< + 0x168893664220f03a74a9bce84228b009df46040c08bb308783dcf130790335f + >() } fn deploy() -> IBeastsDispatcher {