Skip to content

Commit dbd2f4d

Browse files
authored
Update OZ class_hash (#3235)
<!-- Reference any GitHub issues resolved by this PR --> Closes #3236 Updated OZ account class_hash to the latest declared. This change allows charging fee using sierra gas. - https://docs.openzeppelin.com/contracts-cairo/1.0.0/presets ## Introduced changes <!-- A brief description of the changes --> - ## 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 c7e1fcb commit dbd2f4d

File tree

6 files changed

+29
-25
lines changed

6 files changed

+29
-25
lines changed

CHANGELOG.md

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

1919
- "invalid syscall selector" error appearing when using arithmetic circuits
2020

21+
### Cast
22+
23+
#### Updated
24+
25+
- OpenZeppelin account updated to v1.0.0 [preset](https://docs.openzeppelin.com/contracts-cairo/1.0.0/api/account#AccountUpgradeable)
26+
2127
## [0.43.0] - 2025-05-09
2228

2329
### Forge

crates/sncast/src/helpers/constants.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ inputs = []
1818
pub const UDC_ADDRESS: Felt =
1919
felt!("0x041a78e741e5af2fec34b695679bc6891742439f7afb8484ecd7766661ad02bf");
2020
pub const OZ_CLASS_HASH: Felt =
21-
felt!("0x00e2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6");
21+
felt!("0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564"); // v1.0.0
2222
pub const ARGENT_CLASS_HASH: Felt =
2323
felt!("0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f"); // v0.4.0
2424

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,13 @@
131131
"type": "braavos"
132132
},
133133
"oz": {
134-
"address": "0x1eae312dad53cf9d1c435891648cc48b14c901bec0e1bc87c332fcdca1a762f",
135-
"class_hash": "0xe2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6",
134+
"address": "0x1173129651d1853fe9a15f8e8ef29e4806c5a9469b0a6b9622ee90f392bc26d",
135+
"class_hash": "0x5b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564",
136136
"deployed": false,
137137
"legacy": false,
138-
"private_key": "0x6a3fff2b1333a4ed3dd6f9afc957c4ec9ac73af69590a6312ffeddb6caf0f20",
139-
"public_key": "0x6aa82f4db6c740c27751885f47f2b73eed6c70d12d059965a563a04678c8405",
140-
"salt": "0xc3990d6bbb890e77",
138+
"private_key": "0x4a31141908e08ec6d82d324303d97405ad2196def8a13ea320e2117166809d2",
139+
"public_key": "0x36a64f9d432cce317c3e50bc467d48f2797463babe8f29c83c2e6125ddd1947",
140+
"salt": "0x25e7144fce03d200",
141141
"type": "open_zeppelin"
142142
}
143143
}

crates/sncast/tests/helpers/fixtures.rs

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -243,22 +243,20 @@ pub async fn invoke_contract(
243243

244244
pub async fn mint_token(recipient: &str, amount: u128) {
245245
let client = reqwest::Client::new();
246-
for unit in ["FRI", "WEI"] {
247-
let json = json!(
248-
{
249-
"address": recipient,
250-
"amount": amount,
251-
"unit": unit,
252-
}
253-
);
254-
client
255-
.post("http://127.0.0.1:5055/mint")
256-
.header("Content-Type", "application/json")
257-
.body(json.to_string())
258-
.send()
259-
.await
260-
.expect("Error occurred while minting tokens");
261-
}
246+
let json = json!(
247+
{
248+
"address": recipient,
249+
"amount": amount,
250+
"unit": "FRI",
251+
}
252+
);
253+
client
254+
.post("http://127.0.0.1:5055/mint")
255+
.header("Content-Type", "application/json")
256+
.body(json.to_string())
257+
.send()
258+
.await
259+
.expect("Error occurred while minting tokens");
262260
}
263261

264262
#[must_use]

docs/src/appendix/sncast/account/create.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ Versions of the account contracts:
3838

3939
| Account Contract | Version | Class Hash |
4040
|------------------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
41-
| `oz` | v0.14.0 | [0x00e2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6](https://starkscan.co/class/0x00e2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6) |
41+
| `oz` | v1.0.0 | [0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564](https://starkscan.co/class/0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564) |
4242
| `argent` | v0.4.0 | [0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f](https://starkscan.co/class/0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f) |
4343
<!-- TODO(#3118): Uncomment once braavos integration is restored -->
4444
<!-- | `braavos` | v1.0.0 | [0x00816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253](https://starkscan.co/class/0x00816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253) | -->

docs/src/starknet/account.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ $ sncast account delete \
169169
#### Custom Account Contract
170170
171171
By default, `sncast` creates/deploys an account
172-
using [OpenZeppelin's account contract class hash](https://starkscan.co/class/0x00e2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6).
172+
using [OpenZeppelin's account contract class hash](https://starkscan.co/class/0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564).
173173
It is possible to create an account using custom openzeppelin, argent or braavos contract declared to starknet. This can
174174
be achieved
175175
with `--class-hash` flag:
@@ -179,7 +179,7 @@ $ sncast \
179179
account create \
180180
--name new_account_2 \
181181
--network sepolia \
182-
--class-hash 0x00e2eb8f5672af4e6a4e8a8f1b44989685e668489b0a25437733756c5a34a1d6
182+
--class-hash 0x05b4b537eaa2399e3aa99c4e2e0208ebd6c71bc1467938cd52c798c601e43564
183183
--type oz
184184
```
185185

0 commit comments

Comments
 (0)