Skip to content

Commit 6e24cfa

Browse files
committed
fix(sozo): enable autodetect for blake2s on mainnet
1 parent 71f5d15 commit 6e24cfa

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

bin/sozo/src/commands/declare.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ impl DeclareArgs {
5050

5151
let account = get_account_from_env(account, &starknet).await?;
5252

53+
// As of 10th of December 2025, Mainnet network is now using the blake2s class hash.
54+
// But Katana doesn't yet. So we still need to autodetect it.
5355
let use_blake2s = if let Some(rpc_url) = starknet.rpc_url {
54-
if rpc_url.to_string().contains("sepolia") || rpc_url.to_string().contains("testnet") {
56+
if rpc_url.to_string().contains("sepolia")
57+
|| rpc_url.to_string().contains("testnet")
58+
|| rpc_url.to_string().contains("mainnet")
59+
{
5560
true
5661
} else {
5762
starknet.use_blake2s_casm_class_hash

crates/dojo/world/src/local/artifact_to_local.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,15 @@ impl WorldLocal {
5050
"Loading world from directory."
5151
);
5252

53-
// Currently, we have no way to know the network chain-id from here.
54-
// We try to read the rpc_url of the config to infer the chain-id.
53+
// As of 10th of December 2025, Mainnet network is now using the blake2s class hash.
54+
// But Katana doesn't yet. So we still need to autodetect it.
5555
let autodetect_blake2s_class_hash = profile_config
5656
.env
5757
.as_ref()
5858
.map(|env| {
5959
env.rpc_url.as_ref().unwrap().contains("sepolia")
6060
|| env.rpc_url.as_ref().unwrap().contains("testnet")
61+
|| env.rpc_url.as_ref().unwrap().contains("mainnet")
6162
})
6263
.unwrap_or(false);
6364

0 commit comments

Comments
 (0)