Skip to content

Commit 2cd5bad

Browse files
authored
Support Contracts for Cairo v0.13.0, use hooks with ERC721/1155 and Pausable (#359)
1 parent 0077248 commit 2cd5bad

17 files changed

+374
-1593
lines changed

packages/core-cairo/CHANGELOG.md

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

3+
## 0.13.0 (2024-05-22)
4+
5+
- **Breaking changes**:
6+
- Use OpenZeppelin Contracts for Cairo v0.13.0. ([#359](https://github.com/OpenZeppelin/contracts-wizard/pull/359))
7+
- Use Hooks with ERC721 and ERC1155.
8+
- Use Hooks for Pausable.
9+
310
## 0.12.0 (2024-05-01)
411

512
- Add `votes` option to ERC20. ([#355](https://github.com/OpenZeppelin/contracts-wizard/pull/355))

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.12.0",
3+
"version": "0.13.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: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getSelfArg } from './common-options';
2-
import type { BaseImplementedTrait, ContractBuilder, ContractFunction } from './contract';
2+
import type { ContractBuilder } from './contract';
33
import { Access, requireAccessControl } from './set-access-control';
44
import { defineFunctions } from './utils/define-functions';
55
import { defineComponents } from './utils/define-components';
@@ -57,6 +57,3 @@ const functions = defineFunctions({
5757
},
5858
});
5959

60-
export function setPausable(c: ContractBuilder, t: BaseImplementedTrait, fn: ContractFunction) {
61-
c.addFunctionCodeBefore(t, fn, 'self.pausable.assert_not_paused()');
62-
}

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.12.0␊
12+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
27+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
47+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
67+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
92+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
117+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
155+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
156156
157157
#[starknet::contract]␊
158158
mod Foo {␊
1 Byte
Binary file not shown.

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

Lines changed: 8 additions & 8 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.12.0␊
12+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
27+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
2828
2929
#[starknet::contract]␊
3030
mod MyContract {␊
@@ -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.12.0␊
83+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
8484
8585
#[starknet::contract]␊
8686
mod MyContract {␊
@@ -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.12.0␊
164+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
165165
166166
#[starknet::contract]␊
167167
mod MyContract {␊
@@ -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.12.0␊
220+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.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.12.0␊
235+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
236236
237237
#[starknet::contract]␊
238238
mod MyContract {␊
@@ -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.12.0␊
291+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
292292
293293
const UPGRADER_ROLE: felt252 = selector!("UPGRADER_ROLE");␊
294294
@@ -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.12.0␊
364+
// Compatible with OpenZeppelin Contracts for Cairo ^0.13.0␊
365365
366366
#[starknet::contract]␊
367367
mod MyContract {␊
1 Byte
Binary file not shown.

0 commit comments

Comments
 (0)