Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 16 additions & 13 deletions .github/workflows/compile-cairo-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
fail-fast: false
matrix:
kind: [ERC20, ERC721, ERC1155, Account, Multisig, Governor, Vesting, Custom]
kind: [ERC20, ERC721, ERC1155, ERC6909, Account, Multisig, Governor, Vesting, Custom]
concurrency:
group: validate-cairo-${{ matrix.kind }}-${{ github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -54,28 +54,31 @@ jobs:

declare -a all_macros_options=("none" "with_components")
declare -a all_access_options=("disabled" "ownable" "roles" "roles-dar-default" "roles-dar-custom")
declare -a all_upgradeable_options=("true" "false")
declare -a all_royalty_options=("disabled" "enabled-default" "enabled-custom")

kind="$KIND"

for macros_option in "${all_macros_options[@]}"; do
if [[ "$kind" == "ERC721" || "$kind" == "ERC1155" ]]; then
for access_option in "${all_access_options[@]}"; do
for royalty_option in "${all_royalty_options[@]}"; do
proj_name="'$kind, macros: $macros_option, access: $access_option, royalty: $royalty_option' test project"
echo "Generating $proj_name..."
yarn run update_scarb_project --kind=$kind --macros=$macros_option --access=$access_option --royalty=$royalty_option

echo "Compiling $proj_name..."
scarb clean
scarb build

echo "✅ Compiled $proj_name!"
echo "---------------------------------"
for upgradeable_option in "${all_upgradeable_options[@]}"; do
for royalty_option in "${all_royalty_options[@]}"; do
proj_name="'$kind, macros: $macros_option, access: $access_option, upgradeable: $upgradeable_option, royalty: $royalty_option' test project"
echo "Generating $proj_name..."
yarn run update_scarb_project --kind=$kind --macros=$macros_option --access=$access_option --upgradeable=$upgradeable_option --royalty=$royalty_option

echo "Compiling $proj_name..."
scarb clean
scarb build

echo "✅ Compiled $proj_name!"
echo "---------------------------------"
done
done
done

elif [[ "$kind" == "ERC20" || "$kind" == "Custom" ]]; then
elif [[ "$kind" == "ERC20" || "$kind" == "ERC6909" || "$kind" == "Custom" ]]; then
for access_option in "${all_access_options[@]}"; do
proj_name="'$kind, macros: $macros_option, access: $access_option' test project"
echo "Generating $proj_name..."
Expand Down
20 changes: 20 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,26 @@
# Changelog


## 0.2.0 (2026-09-01)

- Cairo: support OpenZeppelin Contracts for Cairo v4.0.1. ([#861](https://github.com/OpenZeppelin/contracts-wizard/pull/861))
- Add ERC6909 contract kind ([#771](https://github.com/OpenZeppelin/contracts-wizard/pull/771))
- Add ERC6909Metadata extension ([#793](https://github.com/OpenZeppelin/contracts-wizard/pull/793))
- Add ERC6909ContentURI extension ([#793](https://github.com/OpenZeppelin/contracts-wizard/pull/793))
- Add ERC6909TokenSupply extension ([#793](https://github.com/OpenZeppelin/contracts-wizard/pull/793))
- Add ERC1155URIStorage extension ([#772](https://github.com/OpenZeppelin/contracts-wizard/pull/772))
- Add ERC1155Supply extension ([#765](https://github.com/OpenZeppelin/contracts-wizard/pull/765))
- Add ERC721URIStorage extension ([#772](https://github.com/OpenZeppelin/contracts-wizard/pull/772))
- Add ERC721Wrapper extension ([#764](https://github.com/OpenZeppelin/contracts-wizard/pull/764))
- Add ERC721Consecutive extension ([#800](https://github.com/OpenZeppelin/contracts-wizard/pull/800))
- Add ERC20Wrapper extension ([#763](https://github.com/OpenZeppelin/contracts-wizard/pull/763))
- **Breaking changes**:
- Use OpenZeppelin Contracts for Cairo v4.0.1. ([#861](https://github.com/OpenZeppelin/contracts-wizard/pull/861))

- Updated dependencies [[`3cd90c8`](https://github.com/OpenZeppelin/contracts-wizard/commit/3cd90c82cf6d1a0185e14754c9f1e6373fa8708c)]:
- @openzeppelin/wizard-cairo@4.0.0
- @openzeppelin/wizard-common@0.5.8

## 0.1.7 (2026-08-26)

- Add a supported-languages table and an example command for each language to the README. No functional changes. ([#857](https://github.com/OpenZeppelin/contracts-wizard/pull/857))
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Commands are named in the format `<language>-<contract>`.
| Language | Contracts |
| --- | --- |
| solidity | erc20, erc721, erc1155, stablecoin, rwa, account, governor, custom |
| cairo | erc20, erc721, erc1155, account, multisig, governor, vesting, custom |
| cairo | erc20, erc721, erc1155, erc6909, account, multisig, governor, vesting, custom |
| confidential | erc7984 |
| stellar | fungible, stablecoin, non-fungible, governor, vault, account |
| stylus | erc20, erc721, erc1155 |
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openzeppelin/contracts-cli",
"version": "0.1.7",
"version": "0.2.0",
"description": "CLI for generating smart contracts using OpenZeppelin Contracts Wizard",
"license": "AGPL-3.0-only",
"repository": "https://github.com/OpenZeppelin/contracts-wizard",
Expand All @@ -27,9 +27,9 @@
},
"dependencies": {
"zod": "^4.0",
"@openzeppelin/wizard-common": "^0.5.7",
"@openzeppelin/wizard-common": "^0.5.8",
"@openzeppelin/wizard": "^0.10.14",
"@openzeppelin/wizard-cairo": "^3.0.0",
"@openzeppelin/wizard-cairo": "^4.0.0",
"@openzeppelin/wizard-stellar": "^0.6.4",
"@openzeppelin/wizard-stylus": "^0.3.0",
"@openzeppelin/wizard-confidential": "^0.1.2",
Expand Down
27 changes: 27 additions & 0 deletions packages/cli/src/cli-options.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
erc20 as cairoErc20,
erc721 as cairoErc721,
erc1155 as cairoErc1155,
erc6909 as cairoErc6909,
account as cairoAccount,
multisig as cairoMultisig,
governor as cairoGovernor,
Expand Down Expand Up @@ -461,6 +462,32 @@ test('cairo-erc1155: most options', t => {
t.is(output, cairoErc1155.print(opts));
});

test('cairo-erc6909: most options', t => {
const opts = {
name: 'TestMultiToken',
burnable: true,
mintable: true,
pausable: true,
contentUri: true,
tokenSupply: true,
metadata: true,
upgradeable: true,
};
const output = run(
'cairo-erc6909',
'--name',
opts.name,
'--burnable',
'--mintable',
'--pausable',
'--contentUri',
'--tokenSupply',
'--metadata',
'--upgradeable',
);
t.is(output, cairoErc6909.print(opts));
});

test('cairo-account: most options', t => {
const opts = {
name: 'TestAccount',
Expand Down
36 changes: 34 additions & 2 deletions packages/cli/src/cli.test.ts.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Generated by [AVA](https://avajs.dev).
`Usage: npx @openzeppelin/contracts-cli <command> [options]␊
␊
Commands:␊
solidity-erc20, solidity-erc721, solidity-erc1155, solidity-stablecoin, solidity-rwa, solidity-account, solidity-governor, solidity-custom, cairo-erc20, cairo-erc721, cairo-erc1155, cairo-account, cairo-multisig, cairo-governor, cairo-vesting, cairo-custom, stellar-fungible, stellar-governor, stellar-stablecoin, stellar-non-fungible, stellar-vault, stellar-account, stylus-erc20, stylus-erc721, stylus-erc1155, confidential-erc7984, uniswap-hooks, tron-trc20, tron-trc721, tron-trc1155, tron-governor, tron-custom␊
solidity-erc20, solidity-erc721, solidity-erc1155, solidity-stablecoin, solidity-rwa, solidity-account, solidity-governor, solidity-custom, cairo-erc20, cairo-erc721, cairo-erc1155, cairo-erc6909, cairo-account, cairo-multisig, cairo-governor, cairo-vesting, cairo-custom, stellar-fungible, stellar-governor, stellar-stablecoin, stellar-non-fungible, stellar-vault, stellar-account, stylus-erc20, stylus-erc721, stylus-erc1155, confidential-erc7984, uniswap-hooks, tron-trc20, tron-trc721, tron-trc1155, tron-governor, tron-custom␊
␊
Generated contract source code is printed to stdout.␊
␊
Expand All @@ -25,7 +25,7 @@ Generated by [AVA](https://avajs.dev).
`Usage: npx @openzeppelin/contracts-cli <command> [options]␊
␊
Commands:␊
solidity-erc20, solidity-erc721, solidity-erc1155, solidity-stablecoin, solidity-rwa, solidity-account, solidity-governor, solidity-custom, cairo-erc20, cairo-erc721, cairo-erc1155, cairo-account, cairo-multisig, cairo-governor, cairo-vesting, cairo-custom, stellar-fungible, stellar-governor, stellar-stablecoin, stellar-non-fungible, stellar-vault, stellar-account, stylus-erc20, stylus-erc721, stylus-erc1155, confidential-erc7984, uniswap-hooks, tron-trc20, tron-trc721, tron-trc1155, tron-governor, tron-custom␊
solidity-erc20, solidity-erc721, solidity-erc1155, solidity-stablecoin, solidity-rwa, solidity-account, solidity-governor, solidity-custom, cairo-erc20, cairo-erc721, cairo-erc1155, cairo-erc6909, cairo-account, cairo-multisig, cairo-governor, cairo-vesting, cairo-custom, stellar-fungible, stellar-governor, stellar-stablecoin, stellar-non-fungible, stellar-vault, stellar-account, stylus-erc20, stylus-erc721, stylus-erc1155, confidential-erc7984, uniswap-hooks, tron-trc20, tron-trc721, tron-trc1155, tron-governor, tron-custom␊
␊
Generated contract source code is printed to stdout.␊
␊
Expand Down Expand Up @@ -266,6 +266,7 @@ Generated by [AVA](https://avajs.dev).
--pausable Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.␊
--premint <string> The number of tokens to premint for the deployer.␊
--mintable Whether privileged accounts will be able to create more supply or emit more tokens␊
--wrapper Whether to include ERC20Wrapper functionality for depositing and withdrawing an underlying token.␊
--votes Whether to keep track of historical balances for voting in on-chain governance, with a way to delegate one's voting power to a trusted account.␊
--appName <string> Required when votes is enabled, for hashing and signing typed structured data. Name for domain separator implementing SNIP12Metadata trait. Prevents two applications from producing the same hash.␊
--appVersion <string> Required when votes is enabled, for hashing and signing typed structured data. Version for domain separator implementing SNIP12Metadata trait. Prevents two versions of the same application from producing the same hash.␊
Expand Down Expand Up @@ -295,7 +296,10 @@ Generated by [AVA](https://avajs.dev).
--pausable Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.␊
--mintable Whether privileged accounts will be able to create more supply or emit more tokens␊
--enumerable Whether to allow on-chain enumeration of all tokens or those owned by an account. Increases gas cost of transfers.␊
--wrapper Whether to include ERC721Wrapper functionality for wrapping an underlying ERC721.␊
--uriStorage Allows updating token URIs for individual token IDs.␊
--votes Whether to keep track of individual units for voting in on-chain governance. Voting durations can be expressed as block numbers or timestamps.␊
--consecutive Enables gas-efficient batch minting of consecutive token IDs during construction (ERC-2309). The contract owner must call \`mint_consecutive\` from the constructor to issue the initial batch. Cannot be combined with enumerable.␊
--royaltyInfo.enabled Whether to enable royalty feature for the contract␊
--royaltyInfo.defaultRoyaltyFraction <string> The royalty fraction that will be default for all tokens. It will be used for a token if there's no custom royalty fraction set for it.␊
--royaltyInfo.feeDenominator <string> The denominator used to interpret a token's fee and to calculate the result fee fraction.␊
Expand Down Expand Up @@ -325,6 +329,8 @@ Generated by [AVA](https://avajs.dev).
--burnable Whether token holders will be able to destroy their tokens␊
--pausable Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.␊
--mintable Whether privileged accounts will be able to create more supply or emit more tokens␊
--supply Whether to keep track of total supply of tokens.␊
--uriStorage Allows updating token URIs for individual token IDs.␊
--updatableUri Whether privileged accounts will be able to set a new URI for all token types.␊
--royaltyInfo.enabled Whether to enable royalty feature for the contract␊
--royaltyInfo.defaultRoyaltyFraction <string> The royalty fraction that will be default for all tokens. It will be used for a token if there's no custom royalty fraction set for it.␊
Expand All @@ -339,6 +345,32 @@ Generated by [AVA](https://avajs.dev).
--macros.withComponents Whether to use the "with_components" macro for simplified contract structure.␊
`

## cairo-erc6909 --help

> Snapshot 1

`cairo-erc6909: Make a minimal multi-token per the ERC-6909 standard.␊
␊
Required:␊
--name <string> The name of the contract␊
␊
Options:␊
--burnable Whether token holders will be able to destroy their tokens␊
--pausable Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response.␊
--mintable Whether privileged accounts will be able to create more supply or emit more tokens␊
--contentUri Whether to include Content URI extension for contract-level and per-token URI metadata.␊
--tokenSupply Whether to keep track of total supply per token ID.␊
--metadata Whether to include per-token metadata extension providing name, symbol, and decimals per token ID.␊
--access.type <false|ownable|roles|roles-dar> The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. Roles (Default Admin Rules) provides additional enforced security measures on top of standard Roles mechanism for managing the most privileged role: default admin.␊
--access.darInitialDelay <string> The initial delay for the default admin role (in case Roles (Default Admin Rules) is used). Default is "1 day".␊
--access.darDefaultDelayIncrease <string> The default delay increase for the default admin role (in case Roles (Default Admin Rules) is used). Default is "5 days".␊
--access.darMaxTransferDelay <string> The maximum delay for a default admin transfer (in case Roles (Default Admin Rules) is used). Default is "30 days".␊
--upgradeable Whether the smart contract is upgradeable.␊
--info.securityContact <string> Email where people can contact you to report security issues. Will only be visible if contract source code is verified.␊
--info.license <string> The license used by the contract, default is "MIT"␊
--macros.withComponents Whether to use the "with_components" macro for simplified contract structure.␊
`

## cairo-account --help

> Snapshot 1
Expand Down
Binary file modified packages/cli/src/cli.test.ts.snap
Binary file not shown.
3 changes: 3 additions & 0 deletions packages/cli/src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
erc20 as cairoErc20,
erc721 as cairoErc721,
erc1155 as cairoErc1155,
erc6909 as cairoErc6909,
account as cairoAccount,
multisig as cairoMultisig,
governor as cairoGovernor,
Expand All @@ -44,6 +45,7 @@ import {
cairoERC20Schema,
cairoERC721Schema,
cairoERC1155Schema,
cairoERC6909Schema,
cairoAccountSchema,
cairoMultisigSchema,
cairoGovernorSchema,
Expand Down Expand Up @@ -129,6 +131,7 @@ export const registry = {
'cairo-erc20': createRegistryEntry(cairoERC20Schema, opts => cairoErc20.print(opts), cairoPrompts.ERC20),
'cairo-erc721': createRegistryEntry(cairoERC721Schema, opts => cairoErc721.print(opts), cairoPrompts.ERC721),
'cairo-erc1155': createRegistryEntry(cairoERC1155Schema, opts => cairoErc1155.print(opts), cairoPrompts.ERC1155),
'cairo-erc6909': createRegistryEntry(cairoERC6909Schema, opts => cairoErc6909.print(opts), cairoPrompts.ERC6909),
'cairo-account': createRegistryEntry(cairoAccountSchema, opts => cairoAccount.print(opts), cairoPrompts.Account),
'cairo-multisig': createRegistryEntry(cairoMultisigSchema, opts => cairoMultisig.print(opts), cairoPrompts.Multisig),
'cairo-governor': createRegistryEntry(cairoGovernorSchema, opts => cairoGovernor.print(opts), cairoPrompts.Governor),
Expand Down
16 changes: 16 additions & 0 deletions packages/common/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
# Changelog


## 0.5.8 (2026-09-01)

- Cairo: support OpenZeppelin Contracts for Cairo v4.0.1. ([#861](https://github.com/OpenZeppelin/contracts-wizard/pull/861))
- Add ERC6909 contract kind ([#771](https://github.com/OpenZeppelin/contracts-wizard/pull/771))
- Add ERC6909Metadata extension ([#793](https://github.com/OpenZeppelin/contracts-wizard/pull/793))
- Add ERC6909ContentURI extension ([#793](https://github.com/OpenZeppelin/contracts-wizard/pull/793))
- Add ERC6909TokenSupply extension ([#793](https://github.com/OpenZeppelin/contracts-wizard/pull/793))
- Add ERC1155URIStorage extension ([#772](https://github.com/OpenZeppelin/contracts-wizard/pull/772))
- Add ERC1155Supply extension ([#765](https://github.com/OpenZeppelin/contracts-wizard/pull/765))
- Add ERC721URIStorage extension ([#772](https://github.com/OpenZeppelin/contracts-wizard/pull/772))
- Add ERC721Wrapper extension ([#764](https://github.com/OpenZeppelin/contracts-wizard/pull/764))
- Add ERC721Consecutive extension ([#800](https://github.com/OpenZeppelin/contracts-wizard/pull/800))
- Add ERC20Wrapper extension ([#763](https://github.com/OpenZeppelin/contracts-wizard/pull/763))
- **Breaking changes**:
- Use OpenZeppelin Contracts for Cairo v4.0.1. ([#861](https://github.com/OpenZeppelin/contracts-wizard/pull/861))

## 0.5.7 (2026-08-25)

- Add support for TRON Contracts. ([#806](https://github.com/OpenZeppelin/contracts-wizard/pull/806))
Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openzeppelin/wizard-common",
"version": "0.5.7",
"version": "0.5.8",
"description": "Common library for OpenZeppelin Contracts Wizard components. Used internally.",
"license": "AGPL-3.0-only",
"repository": "https://github.com/OpenZeppelin/contracts-wizard",
Expand Down Expand Up @@ -35,7 +35,7 @@
},
"devDependencies": {
"@openzeppelin/wizard": "^0.10.14",
"@openzeppelin/wizard-cairo": "^3.0.0",
"@openzeppelin/wizard-cairo": "^4.0.0",
"@openzeppelin/wizard-stellar": "^0.6.4",
"@openzeppelin/wizard-stylus": "^0.3.0",
"@openzeppelin/wizard-confidential": "^0.1.2",
Expand Down
Loading
Loading