Skip to content

Commit 43e8849

Browse files
Bump cairo to 0.14.0 (#369)
Co-authored-by: Eric Lau <[email protected]>
1 parent 5ddbf45 commit 43e8849

22 files changed

+172
-160
lines changed

packages/core-cairo/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## 0.14.0 (2024-06-20)
4+
5+
- **Breaking changes**:
6+
- Use OpenZeppelin Contracts for Cairo v0.14.0. ([#369](https://github.com/OpenZeppelin/contracts-wizard/pull/369))
7+
- Fix compile error with ERC1155 Burnable.
8+
39
## 0.13.0 (2024-05-22)
410

511
- **Breaking changes**:

packages/core-cairo/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openzeppelin/wizard-cairo",
3-
"version": "0.13.0",
3+
"version": "0.14.0",
44
"description": "A boilerplate generator to get started with OpenZeppelin Contracts for Cairo",
55
"license": "MIT",
66
"repository": "github:OpenZeppelin/contracts-wizard",

packages/core-cairo/src/add-pausable.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ const functions = defineFunctions({
4444
getSelfArg(),
4545
],
4646
code: [
47-
'self.pausable._pause()'
47+
'self.pausable.pause()'
4848
]
4949
},
5050
unpause: {
5151
args: [
5252
getSelfArg(),
5353
],
5454
code: [
55-
'self.pausable._unpause()'
55+
'self.pausable.unpause()'
5656
]
5757
},
5858
});

packages/core-cairo/src/contract.test.ts.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
99
> Snapshot 1
1010
1111
`// SPDX-License-Identifier: MIT␊
12-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
12+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
1313
1414
#[starknet::contract]␊
1515
mod Foo {␊
@@ -24,7 +24,7 @@ Generated by [AVA](https://avajs.dev).
2424
> Snapshot 1
2525
2626
`// SPDX-License-Identifier: MIT␊
27-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
27+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
2828
2929
#[starknet::contract]␊
3030
mod Foo {␊
@@ -44,7 +44,7 @@ Generated by [AVA](https://avajs.dev).
4444
> Snapshot 1
4545
4646
`// SPDX-License-Identifier: MIT␊
47-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
47+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
4848
4949
#[starknet::contract]␊
5050
mod Foo {␊
@@ -64,7 +64,7 @@ Generated by [AVA](https://avajs.dev).
6464
> Snapshot 1
6565
6666
`// SPDX-License-Identifier: MIT␊
67-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
67+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
6868
6969
#[starknet::contract]␊
7070
mod Foo {␊
@@ -89,7 +89,7 @@ Generated by [AVA](https://avajs.dev).
8989
> Snapshot 1
9090
9191
`// SPDX-License-Identifier: MIT␊
92-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
92+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
9393
9494
#[starknet::contract]␊
9595
mod Foo {␊
@@ -114,7 +114,7 @@ Generated by [AVA](https://avajs.dev).
114114
> Snapshot 1
115115
116116
`// SPDX-License-Identifier: MIT␊
117-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
117+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
118118
119119
#[starknet::contract]␊
120120
mod Foo {␊
@@ -152,7 +152,7 @@ Generated by [AVA](https://avajs.dev).
152152
> Snapshot 1
153153
154154
`// SPDX-License-Identifier: MIT␊
155-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
155+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
156156
157157
#[starknet::contract]␊
158158
mod Foo {␊
0 Bytes
Binary file not shown.

packages/core-cairo/src/contract.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export class ContractBuilder implements Contract {
131131
const key = component.name;
132132
const present = this.componentsMap.has(key);
133133
if (!present) {
134-
const initializer = initializable ? { params } : undefined;
134+
const initializer = initializable ? { params } : undefined;
135135
const cp: Component = { initializer, ...component, impls: [ ...component.impls ] }; // spread impls to deep copy from original component
136136
this.componentsMap.set(key, cp);
137137
}

packages/core-cairo/src/custom.test.ts.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Generated by [AVA](https://avajs.dev).
99
> Snapshot 1
1010
1111
`// SPDX-License-Identifier: MIT␊
12-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
12+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
1313
1414
#[starknet::contract]␊
1515
mod MyContract {␊
@@ -24,7 +24,7 @@ Generated by [AVA](https://avajs.dev).
2424
> Snapshot 1
2525
2626
`// SPDX-License-Identifier: MIT␊
27-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
27+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
2828
2929
#[starknet::contract]␊
3030
mod MyContract {␊
@@ -69,7 +69,7 @@ Generated by [AVA](https://avajs.dev).
6969
impl UpgradeableImpl of IUpgradeable<ContractState> {␊
7070
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {␊
7171
self.ownable.assert_only_owner();␊
72-
self.upgradeable._upgrade(new_class_hash);␊
72+
self.upgradeable.upgrade(new_class_hash);␊
7373
}␊
7474
}␊
7575
}␊
@@ -80,7 +80,7 @@ Generated by [AVA](https://avajs.dev).
8080
> Snapshot 1
8181
8282
`// SPDX-License-Identifier: MIT␊
83-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
83+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
8484
8585
#[starknet::contract]␊
8686
mod MyContract {␊
@@ -134,7 +134,7 @@ Generated by [AVA](https://avajs.dev).
134134
impl UpgradeableImpl of IUpgradeable<ContractState> {␊
135135
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {␊
136136
self.ownable.assert_only_owner();␊
137-
self.upgradeable._upgrade(new_class_hash);␊
137+
self.upgradeable.upgrade(new_class_hash);␊
138138
}␊
139139
}␊
140140
@@ -144,13 +144,13 @@ Generated by [AVA](https://avajs.dev).
144144
#[external(v0)]␊
145145
fn pause(ref self: ContractState) {␊
146146
self.ownable.assert_only_owner();␊
147-
self.pausable._pause();␊
147+
self.pausable.pause();␊
148148
}␊
149149
150150
#[external(v0)]␊
151151
fn unpause(ref self: ContractState) {␊
152152
self.ownable.assert_only_owner();␊
153-
self.pausable._unpause();␊
153+
self.pausable.unpause();␊
154154
}␊
155155
}␊
156156
}␊
@@ -161,7 +161,7 @@ Generated by [AVA](https://avajs.dev).
161161
> Snapshot 1
162162
163163
`// SPDX-License-Identifier: MIT␊
164-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
164+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
165165
166166
#[starknet::contract]␊
167167
mod MyContract {␊
@@ -206,7 +206,7 @@ Generated by [AVA](https://avajs.dev).
206206
impl UpgradeableImpl of IUpgradeable<ContractState> {␊
207207
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {␊
208208
self.ownable.assert_only_owner();␊
209-
self.upgradeable._upgrade(new_class_hash);␊
209+
self.upgradeable.upgrade(new_class_hash);␊
210210
}␊
211211
}␊
212212
}␊
@@ -217,7 +217,7 @@ Generated by [AVA](https://avajs.dev).
217217
> Snapshot 1
218218
219219
`// SPDX-License-Identifier: MIT␊
220-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
220+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
221221
222222
#[starknet::contract]␊
223223
mod MyContract {␊
@@ -232,7 +232,7 @@ Generated by [AVA](https://avajs.dev).
232232
> Snapshot 1
233233
234234
`// SPDX-License-Identifier: MIT␊
235-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
235+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
236236
237237
#[starknet::contract]␊
238238
mod MyContract {␊
@@ -277,7 +277,7 @@ Generated by [AVA](https://avajs.dev).
277277
impl UpgradeableImpl of IUpgradeable<ContractState> {␊
278278
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {␊
279279
self.ownable.assert_only_owner();␊
280-
self.upgradeable._upgrade(new_class_hash);␊
280+
self.upgradeable.upgrade(new_class_hash);␊
281281
}␊
282282
}␊
283283
}␊
@@ -288,7 +288,7 @@ Generated by [AVA](https://avajs.dev).
288288
> Snapshot 1
289289
290290
`// SPDX-License-Identifier: MIT␊
291-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
291+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
292292
293293
const UPGRADER_ROLE: felt252 = selector!("UPGRADER_ROLE");␊
294294
@@ -350,7 +350,7 @@ Generated by [AVA](https://avajs.dev).
350350
impl UpgradeableImpl of IUpgradeable<ContractState> {␊
351351
fn upgrade(ref self: ContractState, new_class_hash: ClassHash) {␊
352352
self.accesscontrol.assert_only_role(UPGRADER_ROLE);␊
353-
self.upgradeable._upgrade(new_class_hash);␊
353+
self.upgradeable.upgrade(new_class_hash);␊
354354
}␊
355355
}␊
356356
}␊
@@ -361,7 +361,7 @@ Generated by [AVA](https://avajs.dev).
361361
> Snapshot 1
362362
363363
`// SPDX-License-Identifier: MIT␊
364-
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
364+
// Compatible with OpenZeppelin Contracts for Cairo ^0.14.0␊
365365
366366
#[starknet::contract]␊
367367
mod MyContract {␊
@@ -408,13 +408,13 @@ Generated by [AVA](https://avajs.dev).
408408
#[external(v0)]␊
409409
fn pause(ref self: ContractState) {␊
410410
self.ownable.assert_only_owner();␊
411-
self.pausable._pause();␊
411+
self.pausable.pause();␊
412412
}␊
413413
414414
#[external(v0)]␊
415415
fn unpause(ref self: ContractState) {␊
416416
self.ownable.assert_only_owner();␊
417-
self.pausable._unpause();␊
417+
self.pausable.unpause();␊
418418
}␊
419419
}␊
420420
}␊
1 Byte
Binary file not shown.

0 commit comments

Comments
 (0)