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

katana: update default predeployed accounts #2524

Merged
merged 18 commits into from
Oct 14, 2024
Merged
Show file tree
Hide file tree
Changes from 11 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 bin/sozo/src/commands/options/account/controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ mod tests {
.build_test_config("spawn-and-move", Profile::DEV);

let world_addr = felt!("0x74c73d35df54ddc53bcf34aab5e0dbb09c447e99e01f4d69535441253c9571a");
let user_addr = felt!("0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03");
let user_addr = felt!("0x5a37d83d451063858217e9c510d6f45d6bd37ff8664a7c0466329316f7a2891");

let policies =
collect_policies(WorldAddressOrName::Address(world_addr), user_addr, &config).unwrap();
Expand Down
2 changes: 1 addition & 1 deletion bin/sozo/tests/test_data/policies.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"method": "set_facts_registry"
},
{
"target": "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03",
"target": "0x5a37d83d451063858217e9c510d6f45d6bd37ff8664a7c0466329316f7a2891",
"method": "__declare_transaction__"
},
{
Expand Down
2 changes: 1 addition & 1 deletion crates/benches/contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ initializer_class_hash = "0xbeef"
[tool.dojo.env]
# rpc_url = "http://localhost:5050/"
# Default account for katana with seed = 0
account_address = "0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03"
account_address = "0x5a37d83d451063858217e9c510d6f45d6bd37ff8664a7c0466329316f7a2891"
private_key = "0x1800000000300000180000000000030000000000003006001800006600"

[tool.dojo.world.namespace]
Expand Down
2 changes: 1 addition & 1 deletion crates/dojo-world/src/metadata_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ async fn get_full_dojo_metadata_from_workspace() {
assert!(
env.account_address
.unwrap()
.eq("0x6162896d1d7ab204c7ccac6dd5f8e9e7c25ecd5ae4fcb4ad32e57786bb46e03")
.eq("0x5a37d83d451063858217e9c510d6f45d6bd37ff8664a7c0466329316f7a2891")
);

assert!(env.private_key.is_some());
Expand Down
2 changes: 1 addition & 1 deletion crates/katana/contracts/.tool-versions
Original file line number Diff line number Diff line change
@@ -1 +1 @@
scarb 2.8.3
scarb 2.7.0
14 changes: 14 additions & 0 deletions crates/katana/contracts/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
CONTRACT_CLASS_SUFFIX := .contract_class.json
# Directory where the compiled classes will be stored
BUILD_DIR := ./build

## ---- Default Pre-deployed Account

ORIGINAL_CLASS_NAME := katana_account_Account$(CONTRACT_CLASS_SUFFIX)
CLASS_NAME := default_account.json

$(BUILD_DIR): ./account/src/*
scarb build -p katana_account
mv target/dev/$(ORIGINAL_CLASS_NAME) $(BUILD_DIR)/$(CLASS_NAME)

## ----
57 changes: 20 additions & 37 deletions crates/katana/contracts/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ version = "0.1.0"

[[package]]
name = "openzeppelin"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_finance",
"openzeppelin_governance",
"openzeppelin_introspection",
"openzeppelin_merkle_tree",
"openzeppelin_presets",
"openzeppelin_security",
"openzeppelin_token",
Expand All @@ -32,72 +30,57 @@ dependencies = [

[[package]]
name = "openzeppelin_access"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_account"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
dependencies = [
"openzeppelin_introspection",
"openzeppelin_utils",
]

[[package]]
name = "openzeppelin_finance"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
dependencies = [
"openzeppelin_access",
"openzeppelin_token",
]

[[package]]
name = "openzeppelin_governance"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
dependencies = [
"openzeppelin_access",
"openzeppelin_introspection",
]

[[package]]
name = "openzeppelin_introspection"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"

[[package]]
name = "openzeppelin_merkle_tree"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"

[[package]]
name = "openzeppelin_presets"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
dependencies = [
"openzeppelin_access",
"openzeppelin_account",
"openzeppelin_finance",
"openzeppelin_introspection",
"openzeppelin_token",
"openzeppelin_upgrades",
]

[[package]]
name = "openzeppelin_security"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"

[[package]]
name = "openzeppelin_token"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
dependencies = [
"openzeppelin_account",
"openzeppelin_governance",
Expand All @@ -106,10 +89,10 @@ dependencies = [

[[package]]
name = "openzeppelin_upgrades"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"

[[package]]
name = "openzeppelin_utils"
version = "0.17.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.17.0#bf5d02c25c989ccc24f3ab42ec649617d3f21289"
version = "0.15.1"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.15.1#2f8a93d762858714095a1d391afffa9e21df6983"
7 changes: 3 additions & 4 deletions crates/katana/contracts/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ edition = "2023_11"
# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[workspace.dependencies]
starknet = "2.8.2"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.17.0" }
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.31.0" }
assert_macros = "2.8.2"
starknet = "2.7.0"
kariy marked this conversation as resolved.
Show resolved Hide resolved
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.15.1" }
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.26.0" }
1 change: 1 addition & 0 deletions crates/katana/contracts/account/Scarb.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ openzeppelin.workspace = true

[[target.starknet-contract]]
sierra = true
casm = true
10 changes: 5 additions & 5 deletions crates/katana/contracts/account/src/lib.cairo
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts for Cairo v0.17.0 (presets/account.cairo)
// OpenZeppelin Contracts for Cairo v0.15.1 (presets/account.cairo)

/// # Account Preset
///
Expand Down Expand Up @@ -27,13 +27,13 @@ pub mod Account {
impl UpgradeableInternalImpl = UpgradeableComponent::InternalImpl<ContractState>;

#[storage]
pub struct Storage {
struct Storage {
kariy marked this conversation as resolved.
Show resolved Hide resolved
#[substorage(v0)]
pub account: AccountComponent::Storage,
account: AccountComponent::Storage,
#[substorage(v0)]
pub src5: SRC5Component::Storage,
src5: SRC5Component::Storage,
#[substorage(v0)]
pub upgradeable: UpgradeableComponent::Storage
upgradeable: UpgradeableComponent::Storage
kariy marked this conversation as resolved.
Show resolved Hide resolved
}

#[event]
Expand Down
1 change: 1 addition & 0 deletions crates/katana/contracts/build/default_account.json

Large diffs are not rendered by default.

Loading
Loading