Skip to content

Commit 3d76c5e

Browse files
Rename argent to ready (#3504)
<!-- Reference any GitHub issues resolved by this PR --> Closes #3501 ## Introduced changes Rename argent to ready, due to their rebranding. Add `ready` option and deprecates existing `argent`. Fore sncast accounts json, we use `ready`, but still accept `argent` for backward compatibility. When saving account to starkli format, `ready` is mapped to `argent` (because starkli doesn't support `ready` yet). ## Checklist <!-- Make sure all of these are complete --> - [x] Linked relevant issue - [x] Updated relevant documentation - [x] Added relevant tests - [x] Performed self-review of the code - [x] Added changes to `CHANGELOG.md`
1 parent 52ff01d commit 3d76c5e

File tree

35 files changed

+391
-66
lines changed

35 files changed

+391
-66
lines changed

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313

1414
- Passing a cheatcode span of 0 was incorrectly treated as `CheatSpan::Indefinite`. This is now resolved by making `CheatSpan::TargetCalls` accept `NonZero<usize>` instead of just `usize` in `snforge_std`.
1515

16+
### Cast
17+
18+
#### Added
19+
20+
- `ready` option for `--type` flag in `account create` and `account import` commands (Argent wallet has rebranded as Ready)
21+
22+
#### Deprecated
23+
24+
- `argent` option for `--type` flag in `account create` and `account import` commands. Use `ready` instead
25+
1626
## [0.46.0] - 2025-07-09
1727

1828
### Forge

crates/cheatnet/src/runtime_extensions/call_to_blockifier_runtime_extension/execution/entry_point.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ pub fn execute_call_entry_point(
135135
.set_class_hash_for_current_call(class_hash);
136136
// endregion
137137

138-
// Hack to prevent version 0 attack on argent accounts.
138+
// Hack to prevent version 0 attack on ready (formerly argent) accounts.
139139
if context.tx_context.tx_info.version() == TransactionVersion(Felt::from(0_u8))
140140
&& class_hash
141141
== TryFromHexStr::try_from_hex_str(FAULTY_CLASS_HASH)

crates/sncast/src/helpers/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub const UDC_ADDRESS: Felt =
1919
felt!("0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf");
2020
pub const OZ_CLASS_HASH: Felt =
2121
felt!("0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564"); // v1.0.0
22-
pub const ARGENT_CLASS_HASH: Felt =
22+
pub const READY_CLASS_HASH: Felt =
2323
felt!("0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f"); // v0.4.0
2424

2525
pub const BRAAVOS_CLASS_HASH: Felt =

crates/sncast/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ pub enum AccountType {
5656
#[serde(rename = "open_zeppelin")]
5757
OpenZeppelin,
5858
Argent,
59+
Ready,
5960
Braavos,
6061
}
6162

@@ -66,6 +67,7 @@ impl FromStr for AccountType {
6667
match s {
6768
"open_zeppelin" | "open-zeppelin" | "oz" => Ok(AccountType::OpenZeppelin),
6869
"argent" => Ok(AccountType::Argent),
70+
"ready" => Ok(AccountType::Ready),
6971
"braavos" => Ok(AccountType::Braavos),
7072
account_type => Err(anyhow!("Invalid account type = {account_type}")),
7173
}
@@ -385,7 +387,7 @@ pub fn get_account_data_from_keystore(
385387
.and_then(|account_type| account_type.parse().ok());
386388

387389
let public_key = match account_type.context("Failed to get type key")? {
388-
AccountType::Argent => parse_to_felt("/variant/owner"),
390+
AccountType::Argent | AccountType::Ready => parse_to_felt("/variant/owner"),
389391
AccountType::OpenZeppelin => parse_to_felt("/variant/public_key"),
390392
AccountType::Braavos => get_braavos_account_public_key(&account_info)?,
391393
}

crates/sncast/src/starknet_commands/account/create.rs

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ use camino::Utf8PathBuf;
77
use clap::Args;
88
use console::style;
99
use conversions::IntoConv;
10+
use foundry_ui::UI;
11+
use foundry_ui::components::warning::WarningMessage;
1012
use serde_json::json;
1113
use sncast::helpers::braavos::{BraavosAccountFactory, check_braavos_account_compatibility};
1214
use sncast::helpers::constants::{
13-
ARGENT_CLASS_HASH, BRAAVOS_BASE_ACCOUNT_CLASS_HASH, BRAAVOS_CLASS_HASH,
14-
CREATE_KEYSTORE_PASSWORD_ENV_VAR, OZ_CLASS_HASH,
15+
BRAAVOS_BASE_ACCOUNT_CLASS_HASH, BRAAVOS_CLASS_HASH, CREATE_KEYSTORE_PASSWORD_ENV_VAR,
16+
OZ_CLASS_HASH, READY_CLASS_HASH,
1517
};
1618
use sncast::helpers::rpc::RpcArgs;
1719
use sncast::response::account::create::AccountCreateResponse;
@@ -63,7 +65,16 @@ pub async fn create(
6365
provider: &JsonRpcClient<HttpTransport>,
6466
chain_id: Felt,
6567
create: &Create,
68+
ui: &UI,
6669
) -> Result<AccountCreateResponse> {
70+
// TODO(#3556): Remove this warning once we drop Argent account type
71+
if create.account_type == AccountType::Argent {
72+
ui.println(&WarningMessage::new(
73+
"Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account create` is deprecated, please use `ready` instead.",
74+
));
75+
ui.print_blank_line();
76+
}
77+
6778
// Braavos accounts before v1.2.0 are not compatible with starknet >= 0.13.4
6879
// For more, read https://community.starknet.io/t/starknet-devtools-for-0-13-5/115495#p-2359168-braavos-compatibility-issues-3
6980
if let Some(class_hash) = create.class_hash {
@@ -73,7 +84,7 @@ pub async fn create(
7384
let salt = extract_or_generate_salt(create.salt);
7485
let class_hash = create.class_hash.unwrap_or(match create.account_type {
7586
AccountType::OpenZeppelin => OZ_CLASS_HASH,
76-
AccountType::Argent => ARGENT_CLASS_HASH,
87+
AccountType::Argent | AccountType::Ready => READY_CLASS_HASH,
7788
AccountType::Braavos => BRAAVOS_CLASS_HASH,
7889
});
7990
check_class_hash_exists(provider, class_hash).await?;
@@ -171,7 +182,7 @@ async fn generate_account(
171182
OpenZeppelinAccountFactory::new(class_hash, chain_id, signer, provider).await?;
172183
get_address_and_deployment_fee(factory, salt).await?
173184
}
174-
AccountType::Argent => {
185+
AccountType::Argent | AccountType::Ready => {
175186
let factory =
176187
ArgentAccountFactory::new(class_hash, chain_id, None, signer, provider).await?;
177188

@@ -268,11 +279,12 @@ fn create_to_keystore(
268279
}
269280
})
270281
}
271-
AccountType::Argent => {
282+
AccountType::Argent | AccountType::Ready => {
272283
json!({
273284
"version": 1,
274285
"variant": {
275-
"type": AccountType::Argent,
286+
// TODO(#3556): Remove hardcoded "argent" and use format! with `AccountType::Ready`
287+
"type": "argent",
276288
"version": 1,
277289
"owner": format!("{:#x}", private_key.verifying_key().scalar()),
278290
"guardian": "0x0",

crates/sncast/src/starknet_commands/account/deploy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ async fn get_deployment_result(
208208
ui: &UI,
209209
) -> Result<InvokeResponse> {
210210
match account_type {
211-
AccountType::Argent => {
211+
AccountType::Argent | AccountType::Ready => {
212212
let factory = ArgentAccountFactory::new(
213213
class_hash,
214214
chain_id,
@@ -392,7 +392,7 @@ pub(crate) fn compute_account_address(
392392
chain_id: Felt,
393393
) -> Felt {
394394
match account_type {
395-
AccountType::Argent => get_contract_address(
395+
AccountType::Argent | AccountType::Ready => get_contract_address(
396396
salt,
397397
class_hash,
398398
&[private_key.verifying_key().scalar(), Felt::ZERO],

crates/sncast/src/starknet_commands/account/import.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ use anyhow::{Context, Result, bail, ensure};
88
use camino::Utf8PathBuf;
99
use clap::Args;
1010
use conversions::string::{TryFromDecStr, TryFromHexStr};
11+
use foundry_ui::UI;
12+
use foundry_ui::components::warning::WarningMessage;
1113
use sncast::check_if_legacy_contract;
1214
use sncast::helpers::account::generate_account_name;
1315
use sncast::helpers::braavos::check_braavos_account_compatibility;
@@ -68,7 +70,16 @@ pub async fn import(
6870
accounts_file: &Utf8PathBuf,
6971
provider: &JsonRpcClient<HttpTransport>,
7072
import: &Import,
73+
ui: &UI,
7174
) -> Result<AccountImportResponse> {
75+
// TODO(#3556): Remove this warning once we drop Argent account type
76+
if import.account_type == AccountType::Argent {
77+
ui.println(&WarningMessage::new(
78+
"Argent has rebranded as Ready. The `argent` option for the `--type` flag in `account import` is deprecated, please use `ready` instead.",
79+
));
80+
ui.print_blank_line();
81+
}
82+
7283
// Braavos accounts before v1.2.0 are not compatible with Starknet >= 0.13.4
7384
// For more, read https://community.starknet.io/t/starknet-devtools-for-0-13-5/115495#p-2359168-braavos-compatibility-issues-3
7485
if let Some(class_hash) = import.class_hash {

crates/sncast/src/starknet_commands/account/list.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,13 @@ impl Message for AccountDataRepresentationMessage {
114114
let _ = writeln!(result, " legacy: {legacy}");
115115
}
116116
if let Some(ref account_type) = self.account_type {
117-
let _ = writeln!(result, " type: {account_type}");
117+
// TODO(#3556): Remove this adjustment when the `argent` account type is removed
118+
let displayed_type = if account_type == &AccountType::Argent {
119+
&AccountType::Ready
120+
} else {
121+
account_type
122+
};
123+
let _ = writeln!(result, " type: {displayed_type:?}");
118124
}
119125

120126
result.trim_end().to_string()

crates/sncast/src/starknet_commands/account/mod.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,16 @@ pub fn prepare_account_json(
5757
class_hash: Option<Felt>,
5858
salt: Option<Felt>,
5959
) -> serde_json::Value {
60+
// TODO(#3556): Once `Argent` variant is deleted, use `account_type` directly
61+
let saved_account_type = match account_type {
62+
AccountType::Argent => AccountType::Ready,
63+
_ => account_type,
64+
};
6065
let mut account_json = json!({
6166
"private_key": format!("{:#x}", private_key.secret_scalar()),
6267
"public_key": format!("{:#x}", private_key.verifying_key().scalar()),
6368
"address": format!("{address:#x}"),
64-
"type": format!("{account_type}").to_lowercase().replace("openzeppelin", "open_zeppelin"),
69+
"type": format!("{saved_account_type}").to_lowercase().replace("openzeppelin", "open_zeppelin"),
6570
"deployed": deployed,
6671
"legacy": legacy,
6772
});
@@ -209,6 +214,7 @@ pub async fn account(
209214
&config.accounts_file,
210215
&provider,
211216
&import,
217+
ui,
212218
)
213219
.await;
214220

@@ -248,6 +254,7 @@ pub async fn account(
248254
&provider,
249255
chain_id,
250256
&create,
257+
ui,
251258
)
252259
.await;
253260

crates/sncast/tests/data/accounts/accounts.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,13 +112,14 @@
112112
"salt": "0xe35eea9d1b0fa729",
113113
"legacy": true
114114
},
115-
"argent": {
115+
"ready": {
116116
"address": "0x0321dd5ed1ff8ca08792d5c7c66d9daad1f0249c4defbe045b28ab0fec1beaed",
117117
"class_hash": "0x36078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f",
118118
"legacy": false,
119119
"private_key": "0x00bb17245c662eb6ada1ae85c0a6afc77b0df2aa92ee9046e577f4427cdf6d3a",
120120
"public_key": "0x04d2c00e488819b43a09d720694fe97aa44054803f411bdc93d6b22d548f69a2",
121-
"salt": "0x50d1de0aa965925d611a0d52142f22f6fd0a664838b213da4621f8d70230b40"
121+
"salt": "0x50d1de0aa965925d611a0d52142f22f6fd0a664838b213da4621f8d70230b40",
122+
"type": "ready"
122123
},
123124
"braavos": {
124125
"address": "0x2235bf96ef3f88915e3537f9a692977f5caf10b728dd95b0a3ccca2282fbb9b",

0 commit comments

Comments
 (0)