-
Notifications
You must be signed in to change notification settings - Fork 185
Cairo: support v3.0.0 #757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the WalkthroughThis pull request upgrades OpenZeppelin Contracts for Cairo from v2.x to v3.0.0, introducing a new Changes
Sequence Diagram(s)sequenceDiagram
participant User as UI User
participant UICtrl as Control Component
participant Builder as buildERC20()
participant Contract as ContractBuilder
participant Print as printContract()
User->>UICtrl: Configure (access, macros, options)
activate UICtrl
UICtrl->>UICtrl: Collect accessType, DAR fields, macros
Note over UICtrl: AccessControlSection + MacrosSection
UICtrl->>Builder: buildERC20({...opts, access, macros})
deactivate UICtrl
activate Builder
Builder->>Contract: new ContractBuilder(name, macros)
activate Contract
Contract->>Contract: Store macros (withComponents)
Contract->>Contract: addComponent(access.type==='roles-dar'?)
Note over Contract: Skip use clause if withComponents enabled
deactivate Contract
Builder->>Builder: setAccessControl(access.type, darOpts?)
Note over Builder: Handle 'roles-dar' → AccessControlDefaultAdminRulesComponent
deactivate Builder
User->>Print: print(contract)
activate Print
Print->>Print: withComponents enabled?
alt with_components ON
Print->>Print: Emit #[with_components(...)] directive
Print->>Print: Skip component! declarations
Print->>Print: Filter impls by embed=true
else with_components OFF
Print->>Print: Emit component! declarations
Print->>Print: Include component storage
end
Print-->>User: Rendered contract source
deactivate Print
The diagram illustrates the new flow where macros configuration and granular access control options (including DAR) flow through the UI controls, are passed to the builder, and influence both component wiring and code generation output. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Pre-merge checks and finishing touches❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (1 passed)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 6
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
.github/workflows/compile-cairo-alpha-project.yml (2)
72-84:--macrosflag not passed for ERC20/Custom despite outer loop.The outer loop iterates over
macros_option, but line 76 doesn't pass--macros=$macros_option. This causes ERC20 and Custom to be tested twice with identical configurations.Either pass the flag:
- yarn run update_scarb_project --kind=$kind --access=$access_option + yarn run update_scarb_project --kind=$kind --macros=$macros_option --access=$access_optionOr, if macros only applies to ERC721/ERC1155, restructure the loop to avoid duplicate runs.
86-98:--macrosflag not passed for other kinds either.Same issue as ERC20/Custom: line 90 doesn't pass
--macros=$macros_option, causing Account, Multisig, Governor, and Vesting to each be tested twice with identical configurations.
🤖 Fix all issues with AI Agents
In @.github/workflows/compile-cairo-project.yml:
- Around line 86-98: proj_name and the scarb/project invocation omit the macros
option for non-default kinds; update the else branch so proj_name includes the
macros_option (e.g., proj_name="'$kind' ($macros_option) test project") and pass
the macros option into the project generator and build commands — add
--macros=$macros_option to the yarn run update_scarb_project invocation (yarn
run update_scarb_project --kind=$kind --macros=$macros_option) and ensure any
subsequent scarb or build steps that require macros receive the same --macros
flag.
- Around line 72-84: In the ERC20/Custom block inside the loop over
macros_option and access_option, include the macros flag and label so each run
reflects the selected macros: update the proj_name construction (currently
proj_name="'$kind, access: $access_option' test project") to include
macros_option (e.g., include "macros: $macros_option") and pass the macros
option to the updater by changing the yarn invocation update_scarb_project to
include --macros=$macros_option (keep existing --kind and --access flags).
Ensure the echoed "Generating" and any subsequent messages reflect the macros
value so duplicate runs are distinguishable.
In @packages/core/cairo/src/contract.ts:
- Line 51: Multiple component Impl definitions are missing the newly required
embed boolean; update each Impl object to include embed: true or embed: false as
appropriate. Specifically, add the embed field to VestingImpl, ERC2981Impl,
UpgradeableInternalImpl, OwnableMixinImpl, AccessControlInternalImpl,
AccessControlDefaultAdminRulesInternalImpl, MultisigImpl, the ERC20 Impl, and
FooImpl in the test, ensuring each Impl declaration (the object assigned to
those names) explicitly sets embed to the correct boolean value consistent with
how the component should be embedded.
In @packages/core/cairo/src/test.ts:
- Line 61: The temporary directory name is incorrect for the stable cairo
package; update the path string used when constructing generatedSourcesPath (the
path.join(os.tmpdir(), 'oz-wizard-cairo-alpha') call) to the stable package name
(e.g., 'oz-wizard-cairo') so generatedSourcesPath points to the correct sandbox
for packages/core/cairo.
In @packages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts:
- Around line 28-34: testAPIEquivalence is mutating the shared defaults by
writing to options.macros when opts is undefined; instead, create a new options
object that clones defaults before setting macros (e.g., shallow copy via spread
or Object.assign) so assigning options.macros = withComponentsMacroON does not
change the original defaults; update the function to use the cloned object when
opts is undefined and leave opts usage unchanged when provided.
In @packages/core/cairo/src/utils/version.ts:
- Line 4: The exported constant contractsVersion currently reads '3.0.0' but
that tag doesn't exist as a stable OpenZeppelin Contracts release; update the
value of contractsVersion to an actual release tag (e.g., '3.0.0-alpha.3' to
match the cairo_alpha package or a real stable version if one is chosen) so the
code references a valid OpenZeppelin Contracts tag.
🧹 Nitpick comments (14)
packages/core/cairo/src/generate/custom.ts (1)
1-31: LGTM - Clean refactoring with improved separation of concerns.The introduction of
GeneratorOptionstype andprepareBlueprinthelper cleanly separates option resolution from blueprint generation. The explicit calls toresolveAccessControlOptionsandresolveMacrosOptionsmake the configuration flow more transparent and maintainable.If
GeneratorOptionsis reused across other generators (ERC20, ERC721, etc.), consider extracting it to a shared types file for consistency across the codebase.packages/core/cairo/src/set-access-control.ts (1)
281-321: Factor shared duration‑parsing / error‑wrapping logic (optional)
getInitialDelay,getDefaultAdminDelayIncreaseWait, andgetDefaultAdminMaxTransferDelayall duplicate the sametry { durationToSeconds(...) } catch (e) { new OptionsError({ ... }) }pattern, differing only in the field key. You could consider a small internal helper likedurationOptionToSeconds(key, value)to centralize this and make it harder to introduce inconsistencies if fields change in the future.packages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.md (1)
865-880: Replace hard tabs in code blocks to satisfy markdownlint (MD010)markdownlint is flagging
no-hard-tabsin severaluse ... { ... }blocks where inner items are indented with tab characters. To quiet MD010 for this file, replace those tab characters with spaces in the affected code blocks (e.g., around the multi‑lineuse ...::{ DefaultConfig as ..., ... }statements).Also applies to: 1193-1197, 1401-1408, 1520-1521, 1845-1848, 2087-2088, 2613-2615
packages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.md (1)
61-61: Fix hard tabs in snapshots to clear markdownlint MD010This markdown file still contains tab characters in several code blocks (e.g., within multi‑line
use ...::{ ... }imports), which triggersmarkdownlint’sMD010 (no-hard-tabs)warnings. Converting those tab characters to spaces in the indicated locations should resolve the linter failures without changing the generated Cairo semantics.Also applies to: 134-135, 452-454, 828-829, 903-904, 1051-1052, 1138-1138, 1237-1244, 1346-1347, 2264-2265
packages/core/cairo/src/tests/with_components_on/erc1155/erc1155.test.ts (1)
39-45: Consider avoiding direct mutation of options object.Line 41 mutates the
optionsobject, which could either be the passedoptsparameter or the shareddefaultsobject. This mutation could lead to unexpected side effects ifdefaultsis reused elsewhere or if callers don't expect their options to be modified.🔎 Proposed fix
function testAPIEquivalence(title: string, opts?: ERC1155Options) { - const options = opts === undefined ? defaults : opts; - options.macros = withComponentsMacroON; + const options = { + ...(opts === undefined ? defaults : opts), + macros: withComponentsMacroON, + }; test(title, t => { t.is(erc1155.print(options), printContract(buildERC1155(options))); }); }packages/core/cairo/src/tests/with_components_on/multisig/multisig.test.ts (1)
14-14: Consider extracting macros configuration to a constant for consistency.The inline object
{ withComponents: true }works correctly, but the account test file (line 9 inaccount.test.ts) uses a named constantwithComponentsMacroON = { withComponents: true }. Using a constant improves consistency across the test suite and makes future changes easier.🔎 Suggested refactor
+const withComponentsMacroON = { withComponents: true }; + const defaults: MultisigOptions = { name: 'MyMultisig', quorum: '2', upgradeable: commonDefaults.upgradeable, info: commonDefaults.info, - macros: { withComponents: true }, + macros: withComponentsMacroON, };packages/core/cairo/src/tests/with_components_on/account/account.test.ts (1)
38-55: Consider avoiding mutation of the options object.Line 40 mutates the
optionsobject directly (options.macros = withComponentsMacroON), which could cause side effects if the same object is reused elsewhere. While safe in the current usage, creating a new object would be cleaner and more maintainable.🔎 Suggested refactor
function testAPIEquivalence(title: string, opts?: AccountOptions) { - const options = opts === undefined ? defaults : opts; - options.macros = withComponentsMacroON; + const options = opts === undefined ? { ...defaults, macros: withComponentsMacroON } : { ...opts, macros: withComponentsMacroON }; test(title, t => { t.is( account.print(options),packages/core/cairo/src/tests/with_components_on/governor/governor.test.ts (1)
1-33: Well-structured test helpers with minor refactor opportunity.The test file introduces clean helpers (
testGovernor,testAPIEquivalence) that validate both contract generation and API parity. Good test design.However, line 29 mutates
options.macrosafter const assignment. Consider refactoring to avoid mutation:🔎 Optional refactor to eliminate mutation
function testAPIEquivalence(title: string, opts?: GovernorOptions) { - const options = opts === undefined ? defaults : opts; - options.macros = withComponentsMacroON; + const options = { + ...(opts === undefined ? defaults : opts), + macros: withComponentsMacroON, + }; test(title, t => { t.is(governor.print(options), printContract(buildGovernor(options))); }); }packages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts (1)
1-55: Excellent test structure with minor refactor opportunity.The test file provides comprehensive ERC721 test coverage with well-designed helpers. The
allFeaturesONconstant nicely consolidates feature flags for full-featured testing.Similar to the governor tests, line 51 mutates
options.macrosafter const assignment. Consider the same refactoring pattern:🔎 Optional refactor to eliminate mutation
function testAPIEquivalence(title: string, opts?: ERC721Options) { - const options = opts === undefined ? defaults : opts; - options.macros = withComponentsMacroON; + const options = { + ...(opts === undefined ? defaults : opts), + macros: withComponentsMacroON, + }; test(title, t => { t.is(erc721.print(options), printContract(buildERC721(options))); }); }packages/core/cairo/src/generate/multisig.ts (1)
21-23: Suggest optional refactor: Consider inlining prepareBlueprint.Since
prepareBlueprintis only called once and the blueprint is simple, you could consider inlining it directly intogenerateMultisigOptionsfor simplicity. However, the current structure is clear and maintainable, so this is purely optional.🔎 Optional inline refactor
-function prepareBlueprint(opts: GeneratorOptions) { - return { - name: ['MyMultisig'], - quorum: ['1', '2', '42'], - upgradeable: [true, false], - info: infoOptions, - macros: resolveMacrosOptions(opts.macros), - }; -} - export function* generateMultisigOptions(opts: GeneratorOptions): Generator<Required<MultisigOptions>> { - const blueprint = prepareBlueprint(opts); + const blueprint = { + name: ['MyMultisig'], + quorum: ['1', '2', '42'], + upgradeable: [true, false], + info: infoOptions, + macros: resolveMacrosOptions(opts.macros), + }; yield* generateAlternatives(blueprint); }packages/ui/src/cairo/AccessControlSection.svelte (1)
59-93: LGTM! Clean implementation of the DAR configuration UI.The new "Roles (Default Admin Rules)" option and conditional input fields are well-structured. Error handling is correctly wired via the
use:errordirective for each DAR parameter.One minor observation: the
placeholder=""attributes on lines 76, 84, and 91 are empty strings. Consider whether placeholder hints (e.g., "e.g., 86400" for delay in seconds) would improve UX.packages/core/cairo/src/scripts/update-scarb-project.ts (2)
18-34: Consider aligning CLI argument name with type property name.The CLI argument uses
--royalty=...(line 32:args.royalty) but the internal property is namedroyaltyInfo. While this works correctly, aligning the names would reduce confusion for users and maintainers.- royaltyInfo: parseRoyaltyInfoSubset(args.royalty ?? defaults.royaltyInfo), + royaltyInfo: parseRoyaltyInfoSubset(args.royaltyInfo ?? args.royalty ?? defaults.royaltyInfo),Alternatively, document the
--royaltyflag if the shorter name is preferred.
177-190: Inconsistent undefined handling in parseMacrosSubset.Unlike other parse functions (
parseKindSubset,parseAccessSubset,parseRoyaltyInfoSubset) that acceptstring | undefinedand throw onundefined, this function only acceptsstring. While this works because the caller always provides a default, it's inconsistent with the pattern used elsewhere.🔎 Proposed fix for consistency
-function parseMacrosSubset(value: string): MacrosSubset { +function parseMacrosSubset(value: string | undefined): MacrosSubset { + if (value === undefined) { + throw new Error(`Failed to resolve macros subset from 'undefined'.`); + } switch (value.toLowerCase()) {packages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.md (1)
392-395: Consider using spaces instead of tabs in code blocks.The markdownlint tool flags hard tabs at lines 393-394 within the import block. While this doesn't affect functionality, consistent use of spaces improves readability across different editors.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (27)
packages/core/cairo/src/account.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/contract.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/custom.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/erc1155.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/erc20.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/erc721.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/governor.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/multisig.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/account/account.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/contract/contract.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/erc1155/erc1155.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/governor/governor.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/account/account.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/custom/custom.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/erc1155/erc1155.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/governor/governor.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/multisig/multisig.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/tests/with_components_on/vesting/vesting.test.ts.snapis excluded by!**/*.snappackages/core/cairo/src/vesting.test.ts.snapis excluded by!**/*.snappackages/core/cairo/test_project/Scarb.lockis excluded by!**/*.lock
📒 Files selected for processing (90)
.github/workflows/compile-cairo-alpha-project.yml.github/workflows/compile-cairo-project.ymlpackages/common/src/ai/descriptions/cairo.tspackages/core/cairo/CHANGELOG.mdpackages/core/cairo/README.mdpackages/core/cairo/ava.config.jspackages/core/cairo/package.jsonpackages/core/cairo/src/account.tspackages/core/cairo/src/add-pausable.tspackages/core/cairo/src/common-components.tspackages/core/cairo/src/common-options.tspackages/core/cairo/src/contract.tspackages/core/cairo/src/custom.tspackages/core/cairo/src/erc1155.test.ts.mdpackages/core/cairo/src/erc1155.tspackages/core/cairo/src/erc20.tspackages/core/cairo/src/erc721.tspackages/core/cairo/src/generate/account.tspackages/core/cairo/src/generate/custom.tspackages/core/cairo/src/generate/erc1155.tspackages/core/cairo/src/generate/erc20.tspackages/core/cairo/src/generate/erc721.tspackages/core/cairo/src/generate/governor.tspackages/core/cairo/src/generate/multisig.tspackages/core/cairo/src/generate/sources.tspackages/core/cairo/src/generate/vesting.tspackages/core/cairo/src/governor.tspackages/core/cairo/src/index.tspackages/core/cairo/src/multisig.tspackages/core/cairo/src/print.tspackages/core/cairo/src/scripts/update-scarb-project.tspackages/core/cairo/src/set-access-control.tspackages/core/cairo/src/set-macros.tspackages/core/cairo/src/set-royalty-info.tspackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/src/test.tspackages/core/cairo/src/tests/with_components_off/account/account.test.tspackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/contract/contract.test.tspackages/core/cairo/src/tests/with_components_off/contract/contract.test.ts.mdpackages/core/cairo/src/tests/with_components_off/custom/custom.test.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc1155/erc1155.test.tspackages/core/cairo/src/tests/with_components_off/erc1155/erc1155.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.tspackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_off/governor/governor.test.tspackages/core/cairo/src/tests/with_components_off/governor/governor.test.ts.mdpackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.tspackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.ts.mdpackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.tspackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.ts.mdpackages/core/cairo/src/tests/with_components_on/account/account.test.tspackages/core/cairo/src/tests/with_components_on/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_on/custom/custom.test.tspackages/core/cairo/src/tests/with_components_on/custom/custom.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc1155/erc1155.test.tspackages/core/cairo/src/tests/with_components_on/erc1155/erc1155.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.tspackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.tspackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_on/governor/governor.test.tspackages/core/cairo/src/tests/with_components_on/governor/governor.test.ts.mdpackages/core/cairo/src/tests/with_components_on/multisig/multisig.test.tspackages/core/cairo/src/tests/with_components_on/multisig/multisig.test.ts.mdpackages/core/cairo/src/tests/with_components_on/vesting/vesting.test.tspackages/core/cairo/src/tests/with_components_on/vesting/vesting.test.ts.mdpackages/core/cairo/src/utils/duration.tspackages/core/cairo/src/utils/version.tspackages/core/cairo/src/vesting.tspackages/core/cairo/test_project/Scarb.tomlpackages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.tspackages/ui/api/ai-assistant/function-definitions/cairo-shared.tspackages/ui/api/ai-assistant/function-definitions/cairo.tspackages/ui/src/cairo/AccessControlSection.sveltepackages/ui/src/cairo/AccountControls.sveltepackages/ui/src/cairo/App.sveltepackages/ui/src/cairo/CustomControls.sveltepackages/ui/src/cairo/ERC1155Controls.sveltepackages/ui/src/cairo/ERC20Controls.sveltepackages/ui/src/cairo/ERC721Controls.sveltepackages/ui/src/cairo/GovernorControls.sveltepackages/ui/src/cairo/MacrosSection.sveltepackages/ui/src/cairo/MultisigControls.sveltepackages/ui/src/cairo/RoyaltyInfoSection.sveltepackages/ui/src/cairo/UpgradeabilityField.sveltepackages/ui/src/cairo/VestingControls.svelte
💤 Files with no reviewable changes (1)
- packages/core/cairo/src/erc1155.test.ts.md
🧰 Additional context used
🧠 Learnings (20)
📓 Common learnings
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 638
File: packages/core/cairo_alpha/src/account.test.ts.md:18-18
Timestamp: 2025-08-19T15:21:06.991Z
Learning: In the OpenZeppelin contracts-wizard repository, the cairo_alpha package (packages/core/cairo_alpha) and the stable cairo package (packages/core/cairo) are separate implementations that do not need to have the same code or matching dependency versions. The cairo_alpha package targets dependencies that are either newer than or the same as the stable cairo package, allowing it to test and support newer Cairo/Scarb/OpenZeppelin versions while the stable version maintains compatibility with stable releases.
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 663
File: packages/core/cairo_alpha/src/custom.test.ts.md:12-12
Timestamp: 2025-09-12T15:07:08.673Z
Learning: In the OpenZeppelin contracts-wizard cairo_alpha package changelog (packages/core/cairo_alpha/CHANGELOG.md), each alpha version gets its own separate entry under the "Unreleased" section rather than updating a single entry. This allows tracking of changes across different alpha releases (e.g., v3.0.0-alpha.0, v3.0.0-alpha.1, v3.0.0-alpha.2 all have separate entries).
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 638
File: packages/core/cairo_alpha/src/scripts/update-scarb-project.ts:62-79
Timestamp: 2025-08-19T15:18:09.410Z
Learning: In the cairo_alpha package (packages/core/cairo_alpha), the OpenZeppelin dependency in test_project/Scarb.toml is expected to be in { git, tag } form rather than a simple registry-style string, so the update script only needs to update the tag value, not convert between formats.
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: .changeset/sour-hats-grow.md:2-6
Timestamp: 2025-08-15T22:49:25.653Z
Learning: In OpenZeppelin contracts-wizard, breaking changes that have concrete migration paths (like dependency migrations from Community Contracts to OpenZeppelin Contracts) can be handled as minor version bumps instead of major bumps, per maintainer ernestognw's versioning policy.
📚 Learning: 2025-08-15T23:23:13.097Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:31-38
Timestamp: 2025-08-15T23:23:13.097Z
Learning: In OpenZeppelin contracts-wizard, the `setUpgradeableAccount` function deliberately sets `c.upgradeable = false` after upgradeable setup to exclude EIP712Upgradeable and ERC7739Upgradeable variants (avoiding per-call SLOAD overhead). This architectural pattern necessitates manual `_disableInitializers()` setup in both account.ts and signer.ts since the standard upgradeable constructor logic doesn't apply when upgradeability is disabled post-setup.
Applied to files:
packages/core/cairo/src/tests/with_components_on/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_on/custom/custom.test.ts.mdpackages/core/cairo/src/tests/with_components_on/account/account.test.tspackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.mdpackages/core/cairo/src/account.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/ui/src/cairo/AccountControls.sveltepackages/ui/src/cairo/MultisigControls.svelte
📚 Learning: 2025-08-15T22:52:34.129Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/account.ts:89-0
Timestamp: 2025-08-15T22:52:34.129Z
Learning: In OpenZeppelin contracts-wizard, non-upgradeable accounts still require initializer logic (Initializable, _disableInitializers(), and initialize() function) because ERC-4337 accounts are typically deployed by factories as minimal clone proxies, which cannot use constructors effectively for initialization. This is the intended deployment pattern for ERC-4337 account abstraction, even for non-upgradeable accounts.
Applied to files:
packages/core/cairo/src/tests/with_components_on/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.md
📚 Learning: 2025-08-20T20:23:30.259Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/set-upgradeable.ts:0-0
Timestamp: 2025-08-20T20:23:30.259Z
Learning: In OpenZeppelin contracts-wizard, upgradeable contracts use two different strategies for Initializable imports: Account contracts directly import from contracts-upgradeable/proxy/utils/Initializable.sol for explicit clarity, while other upgradeable contracts (ERC20, ERC721, Governor, etc.) use helpers to automatically transpile imports to upgradeable versions. This architectural separation is intentional due to the special ERC-4337 requirements of account contracts.
Applied to files:
packages/core/cairo/src/tests/with_components_on/account/account.test.ts.mdpackages/ui/src/cairo/ERC721Controls.sveltepackages/core/cairo/README.mdpackages/ui/src/cairo/GovernorControls.sveltepackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/ui/src/cairo/ERC20Controls.sveltepackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/ui/src/cairo/UpgradeabilityField.sveltepackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/ui/src/cairo/AccountControls.sveltepackages/ui/src/cairo/MultisigControls.sveltepackages/core/cairo/src/multisig.ts
📚 Learning: 2025-08-19T15:31:24.984Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 0
File: :0-0
Timestamp: 2025-08-19T15:31:24.984Z
Learning: Changes within packages/core/cairo_alpha should have a corresponding changelog entry in packages/core/cairo_alpha/CHANGELOG.md under the Unreleased section to track these changes. When cairo_alpha is eventually promoted to cairo (stable), these entries will be moved into a changeset for cairo (stable).
Applied to files:
packages/core/cairo/CHANGELOG.mdpackages/core/cairo/src/set-macros.tspackages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.tspackages/core/cairo/README.mdpackages/core/cairo/src/scripts/update-scarb-project.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/ui/api/ai-assistant/function-definitions/cairo.tspackages/core/cairo/package.jsonpackages/core/cairo/src/utils/version.tspackages/ui/api/ai-assistant/function-definitions/cairo-shared.tspackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/common/src/ai/descriptions/cairo.tspackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/test_project/Scarb.tomlpackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.md
📚 Learning: 2025-09-12T15:07:08.673Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 663
File: packages/core/cairo_alpha/src/custom.test.ts.md:12-12
Timestamp: 2025-09-12T15:07:08.673Z
Learning: In the OpenZeppelin contracts-wizard cairo_alpha package changelog (packages/core/cairo_alpha/CHANGELOG.md), each alpha version gets its own separate entry under the "Unreleased" section rather than updating a single entry. This allows tracking of changes across different alpha releases (e.g., v3.0.0-alpha.0, v3.0.0-alpha.1, v3.0.0-alpha.2 all have separate entries).
Applied to files:
packages/core/cairo/CHANGELOG.mdpackages/core/cairo/src/tests/with_components_off/contract/contract.test.ts.mdpackages/ui/src/cairo/RoyaltyInfoSection.sveltepackages/core/cairo/src/tests/with_components_on/custom/custom.test.ts.mdpackages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.tspackages/ui/src/cairo/ERC721Controls.sveltepackages/core/cairo/src/erc721.tspackages/core/cairo/README.mdpackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/ui/src/cairo/ERC20Controls.sveltepackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.mdpackages/core/cairo/src/scripts/update-scarb-project.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/test.tspackages/ui/api/ai-assistant/function-definitions/cairo.tspackages/core/cairo/package.jsonpackages/core/cairo/src/utils/version.tspackages/ui/src/cairo/ERC1155Controls.sveltepackages/core/cairo/src/custom.tspackages/ui/src/cairo/UpgradeabilityField.sveltepackages/ui/api/ai-assistant/function-definitions/cairo-shared.tspackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.ts.mdpackages/core/cairo/src/erc1155.tspackages/common/src/ai/descriptions/cairo.tspackages/core/cairo/test_project/Scarb.tomlpackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/core/cairo/src/erc20.tspackages/core/cairo/src/set-royalty-info.tspackages/core/cairo/src/vesting.ts
📚 Learning: 2025-08-19T15:21:06.991Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 638
File: packages/core/cairo_alpha/src/account.test.ts.md:18-18
Timestamp: 2025-08-19T15:21:06.991Z
Learning: In the OpenZeppelin contracts-wizard repository, the cairo_alpha package (packages/core/cairo_alpha) and the stable cairo package (packages/core/cairo) are separate implementations that do not need to have the same code or matching dependency versions. The cairo_alpha package targets dependencies that are either newer than or the same as the stable cairo package, allowing it to test and support newer Cairo/Scarb/OpenZeppelin versions while the stable version maintains compatibility with stable releases.
Applied to files:
packages/core/cairo/CHANGELOG.mdpackages/core/cairo/src/tests/with_components_off/contract/contract.test.ts.mdpackages/core/cairo/src/set-macros.tspackages/ui/src/cairo/RoyaltyInfoSection.sveltepackages/core/cairo/src/tests/with_components_on/custom/custom.test.ts.mdpackages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.tspackages/core/cairo/src/erc721.tspackages/core/cairo/README.mdpackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.mdpackages/core/cairo/src/add-pausable.tspackages/core/cairo/src/common-options.tspackages/core/cairo/src/scripts/update-scarb-project.tspackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.tspackages/core/cairo/src/account.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/test.tspackages/ui/api/ai-assistant/function-definitions/cairo.tspackages/core/cairo/package.jsonpackages/core/cairo/src/contract.tspackages/core/cairo/src/utils/version.tspackages/ui/src/cairo/ERC1155Controls.sveltepackages/core/cairo/src/custom.tspackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.ts.mdpackages/ui/api/ai-assistant/function-definitions/cairo-shared.tspackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.ts.mdpackages/core/cairo/src/erc1155.tspackages/core/cairo/src/tests/with_components_off/governor/governor.test.ts.mdpackages/common/src/ai/descriptions/cairo.tspackages/ui/src/cairo/App.sveltepackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/test_project/Scarb.tomlpackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/core/cairo/src/erc20.tspackages/core/cairo/src/common-components.ts
📚 Learning: 2025-08-15T22:49:25.653Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: .changeset/sour-hats-grow.md:2-6
Timestamp: 2025-08-15T22:49:25.653Z
Learning: In OpenZeppelin contracts-wizard, breaking changes that have concrete migration paths (like dependency migrations from Community Contracts to OpenZeppelin Contracts) can be handled as minor version bumps instead of major bumps, per maintainer ernestognw's versioning policy.
Applied to files:
packages/core/cairo/CHANGELOG.mdpackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/package.jsonpackages/core/cairo/src/utils/version.tspackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/erc20.ts
📚 Learning: 2025-08-19T15:18:09.410Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 638
File: packages/core/cairo_alpha/src/scripts/update-scarb-project.ts:62-79
Timestamp: 2025-08-19T15:18:09.410Z
Learning: In the cairo_alpha package (packages/core/cairo_alpha), the OpenZeppelin dependency in test_project/Scarb.toml is expected to be in { git, tag } form rather than a simple registry-style string, so the update script only needs to update the tag value, not convert between formats.
Applied to files:
packages/core/cairo/src/tests/with_components_off/contract/contract.test.ts.mdpackages/ui/src/cairo/RoyaltyInfoSection.svelte.github/workflows/compile-cairo-project.ymlpackages/core/cairo/src/tests/with_components_on/custom/custom.test.ts.mdpackages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.tspackages/core/cairo/src/erc721.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.tspackages/core/cairo/README.mdpackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.ts.md.github/workflows/compile-cairo-alpha-project.ymlpackages/core/cairo/src/add-pausable.tspackages/core/cairo/src/scripts/update-scarb-project.tspackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.tspackages/core/cairo/src/tests/with_components_off/erc1155/erc1155.test.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/test.tspackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.tspackages/core/cairo/package.jsonpackages/core/cairo/src/utils/version.tspackages/ui/src/cairo/UpgradeabilityField.sveltepackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.ts.mdpackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.tspackages/core/cairo/src/tests/with_components_off/account/account.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.ts.mdpackages/core/cairo/src/tests/with_components_off/governor/governor.test.ts.mdpackages/common/src/ai/descriptions/cairo.tspackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/test_project/Scarb.tomlpackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/core/cairo/src/erc20.ts
📚 Learning: 2025-09-24T20:55:43.331Z
Learnt from: CoveMB
Repo: OpenZeppelin/contracts-wizard PR: 665
File: packages/ui/src/solidity/remix.node.test.ts:0-0
Timestamp: 2025-09-24T20:55:43.331Z
Learning: In the OpenZeppelin contracts-wizard project, the UI package tests use AVA framework which provides browser API polyfills, so `atob` and other browser APIs are available in the test environment.
Applied to files:
packages/core/cairo/src/tests/with_components_on/erc1155/erc1155.test.tspackages/core/cairo/src/tests/with_components_on/governor/governor.test.tspackages/core/cairo/src/tests/with_components_off/account/account.test.tspackages/core/cairo/src/tests/with_components_on/account/account.test.tspackages/core/cairo/src/tests/with_components_on/custom/custom.test.tspackages/core/cairo/src/tests/with_components_on/erc20/erc20.test.tspackages/core/cairo/src/tests/with_components_on/erc721/erc721.test.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.tspackages/core/cairo/src/tests/with_components_off/governor/governor.test.tspackages/core/cairo/src/tests/with_components_on/multisig/multisig.test.tspackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.tspackages/core/cairo/src/tests/with_components_off/erc1155/erc1155.test.tspackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.tspackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.tspackages/core/cairo/src/tests/with_components_off/vesting/vesting.test.tspackages/core/cairo/src/tests/with_components_off/contract/contract.test.ts
📚 Learning: 2025-10-24T11:16:17.021Z
Learnt from: immrsd
Repo: OpenZeppelin/contracts-wizard PR: 698
File: packages/core/cairo_alpha/src/set-access-control.ts:0-0
Timestamp: 2025-10-24T11:16:17.021Z
Learning: In Cairo code generation (packages/core/cairo_alpha), trait imports like `DefaultConfig` must remain in scope even if not explicitly referenced in the generated code, as Cairo's compiler uses them implicitly for trait resolution.
Applied to files:
packages/core/cairo/src/index.tspackages/core/cairo/src/set-macros.tspackages/core/cairo/src/generate/custom.tspackages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.tspackages/core/cairo/README.mdpackages/core/cairo/src/scripts/update-scarb-project.tspackages/core/cairo/src/account.tspackages/core/cairo/src/test.tspackages/core/cairo/src/custom.tspackages/core/cairo/src/tests/with_components_off/governor/governor.test.ts.mdpackages/ui/src/cairo/App.sveltepackages/core/cairo/test_project/Scarb.tomlpackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/core/cairo/src/erc20.ts
📚 Learning: 2025-09-12T20:50:43.101Z
Learnt from: CoveMB
Repo: OpenZeppelin/contracts-wizard PR: 644
File: packages/ui/api/services/open-ai.ts:43-56
Timestamp: 2025-09-12T20:50:43.101Z
Learning: In the OpenZeppelin contracts-wizard project, the current streaming implementation in packages/ui/api/services/open-ai.ts intentionally handles text deltas and function_calls with different formats (raw text chunks vs JSON objects). While this can cause JSON.parse issues, harmonizing the response format is considered outside scope of dependency updates as it requires UI refactoring to handle unified streaming responses.
Applied to files:
packages/core/cairo/src/erc721.ts
📚 Learning: 2025-08-29T22:26:44.931Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 653
File: packages/core/solidity/src/account.ts:189-201
Timestamp: 2025-08-29T22:26:44.931Z
Learning: In ERC-7579, accounts support multiple execution paths: the standard ERC-4337 path requiring validators for UserOp validation, and the module execution path where executor modules can directly call executeFromExecutor to execute transactions on behalf of the account. This means accounts initialized with only an executor module are functional and valid according to the ERC-7579 specification.
Applied to files:
packages/core/cairo/README.md
📚 Learning: 2025-08-19T01:15:58.945Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:45-49
Timestamp: 2025-08-19T01:15:58.945Z
Learning: The OpenZeppelin contracts-upgradeable package includes upgradeable versions of signer contracts like SignerECDSAUpgradeable, SignerP256Upgradeable, SignerRSAUpgradeable, MultiSignerERC7913Upgradeable, and MultiSignerERC7913WeightedUpgradeable in the contracts/utils/cryptography/signers directory.
Applied to files:
packages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/ui/src/cairo/UpgradeabilityField.sveltepackages/core/cairo/src/tests/with_components_off/multisig/multisig.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.mdpackages/core/cairo/src/multisig.ts
📚 Learning: 2025-08-19T01:15:58.945Z
Learnt from: ernestognw
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/signer.ts:45-49
Timestamp: 2025-08-19T01:15:58.945Z
Learning: All OpenZeppelin signer contracts have upgradeable variants available in the contracts-upgradeable package: SignerECDSAUpgradeable, SignerP256Upgradeable, SignerRSAUpgradeable, MultiSignerERC7913Upgradeable, and MultiSignerERC7913WeightedUpgradeable all exist in contracts/utils/cryptography/signers/ directory.
Applied to files:
packages/core/cairo/src/tests/with_components_on/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/ui/src/cairo/UpgradeabilityField.sveltepackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.mdpackages/core/cairo/src/set-upgradeable.tspackages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.md
📚 Learning: 2025-11-03T12:18:33.779Z
Learnt from: typicalHuman
Repo: OpenZeppelin/contracts-wizard PR: 715
File: packages/core/solidity/src/stablecoin.ts:74-77
Timestamp: 2025-11-03T12:18:33.779Z
Learning: In packages/core/solidity/src/stablecoin.ts, the ERC20Restricted base contract from openzeppelin/community-contracts provides a default implementation of isUserAllowed that returns true for non-BLOCKED users (blocklist logic). Only allowlist mode needs to override isUserAllowed to check for Restriction.ALLOWED instead. Blocklist mode uses the default implementation without override.
Applied to files:
packages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.mdpackages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.md
📚 Learning: 2025-09-18T20:18:23.799Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 652
File: packages/ui/api/ai-assistant/function-definitions/confidential.ts:32-38
Timestamp: 2025-09-18T20:18:23.799Z
Learning: In OpenZeppelin Wizard, the AI Assistant defines its own function definitions separately and does not use the MCP tools. This means the AI Assistant function definitions and MCP schemas can have different shapes without causing validation conflicts.
Applied to files:
packages/ui/api/ai-assistant/function-definitions/cairo.ts
📚 Learning: 2025-09-18T19:26:06.112Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 652
File: packages/core/confidential/print-versioned.js:1-1
Timestamp: 2025-09-18T19:26:06.112Z
Learning: CJS shims like `module.exports = require('./dist/print-versioned')` in packages/core/confidential are expected to be CJS-only and are used specifically within packages/ui, not as general-purpose exports requiring conditional exports mapping.
Applied to files:
packages/core/cairo/src/utils/version.ts
📚 Learning: 2025-08-21T19:44:06.797Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 609
File: packages/core/solidity/src/account.ts:191-204
Timestamp: 2025-08-21T19:44:06.797Z
Learning: Initializable is available in both openzeppelin/contracts and openzeppelin/contracts-upgradeable packages, so conditional imports like `openzeppelin/${opts.upgradeable ? 'contracts-upgradeable' : 'contracts'}/proxy/utils/Initializable.sol` are valid and will resolve correctly.
Applied to files:
packages/ui/src/cairo/UpgradeabilityField.sveltepackages/core/cairo/src/set-upgradeable.ts
📚 Learning: 2025-09-19T14:28:19.048Z
Learnt from: ericglau
Repo: OpenZeppelin/contracts-wizard PR: 652
File: packages/core/confidential/src/zip-hardhat.test.ts.md:116-121
Timestamp: 2025-09-19T14:28:19.048Z
Learning: In OpenZeppelin Confidential Contracts, the decimals() function is limited to 6, not the typical 18 decimals found in standard ERC20 tokens. This affects overflow calculations when working with premint amounts and SafeCast.toUint64().
Applied to files:
packages/core/cairo/src/erc20.ts
🧬 Code graph analysis (19)
packages/core/cairo/src/tests/with_components_on/account/account.test.ts (1)
packages/core/cairo_alpha/src/tests/with_components_on/account/account.test.ts (2)
testEthAccount(23-33)testAccount(11-21)
packages/core/cairo/src/generate/vesting.ts (1)
packages/core/cairo/src/vesting.ts (1)
VestingOptions(31-39)
packages/ui/api/ai-assistant/function-definitions/cairo-alpha-shared.ts (1)
packages/common/src/ai/descriptions/cairo.ts (1)
cairoAccessDescriptions(35-43)
packages/core/cairo/src/generate/erc20.ts (5)
packages/core/cairo/src/set-access-control.ts (2)
AccessSubset(52-52)resolveAccessControlOptions(54-79)packages/core/cairo/src/set-upgradeable.ts (1)
upgradeableOptions(9-9)packages/core/cairo_alpha/src/generate/erc20.ts (1)
prepareBlueprint(17-34)packages/core/cairo/src/erc20.ts (1)
ERC20Options(42-53)packages/core/cairo_alpha/src/erc20.ts (1)
ERC20Options(42-53)
packages/core/cairo/src/erc721.ts (1)
packages/core/cairo/src/contract.ts (2)
ContractBuilder(103-314)components(128-130)
packages/core/cairo/src/common-options.ts (1)
packages/core/cairo/src/set-access-control.ts (1)
AccessControl(43-48)
packages/core/cairo/src/scripts/update-scarb-project.ts (3)
packages/core/cairo/src/generate/sources.ts (2)
KindSubset(25-25)writeGeneratedSources(167-192)packages/core/cairo/src/set-access-control.ts (1)
AccessSubset(52-52)packages/core/cairo/src/set-royalty-info.ts (2)
RoyaltyInfoSubset(16-16)defaults(10-14)
packages/core/cairo/src/account.ts (1)
packages/core/cairo/src/contract.ts (2)
ContractBuilder(103-314)components(128-130)
packages/core/cairo/src/set-access-control.ts (3)
packages/core/cairo/src/contract.ts (3)
ContractBuilder(103-314)components(128-130)BaseImplementedTrait(59-70)packages/core/cairo/src/common-components.ts (1)
addSRC5Component(60-72)packages/core/cairo/src/utils/duration.ts (1)
durationToSeconds(14-26)
packages/core/cairo/src/test.ts (5)
packages/core/cairo/src/generate/sources.ts (2)
KindSubset(25-25)writeGeneratedSources(167-192)packages/core/cairo_alpha/src/generate/sources.ts (2)
KindSubset(25-25)writeGeneratedSources(167-192)packages/core/cairo/src/set-access-control.ts (1)
AccessSubset(52-52)packages/core/cairo/src/set-royalty-info.ts (1)
RoyaltyInfoSubset(16-16)packages/core/cairo_alpha/src/set-royalty-info.ts (1)
RoyaltyInfoSubset(16-16)
packages/ui/api/ai-assistant/function-definitions/cairo.ts (3)
packages/common/src/ai/descriptions/cairo.ts (1)
cairoPrompts(4-16)packages/ui/api/ai-assistant/function-definitions/shared.ts (1)
addFunctionPropertiesFrom(31-46)packages/ui/api/ai-assistant/function-definitions/cairo-shared.ts (1)
cairoSharedFunctionDefinition(71-104)
packages/core/cairo/src/contract.ts (1)
packages/core/cairo_alpha/src/contract.ts (1)
Contract(4-18)
packages/core/cairo/src/utils/version.ts (1)
packages/core/cairo_alpha/src/utils/version.ts (6)
contractsVersion(4-4)contractsVersionTag(5-5)edition(10-10)cairoVersion(11-11)scarbVersion(12-12)compatibleContractsSemver(19-19)
packages/core/cairo/src/custom.ts (1)
packages/core/cairo/src/contract.ts (1)
ContractBuilder(103-314)
packages/core/cairo/src/erc1155.ts (1)
packages/core/cairo/src/contract.ts (2)
ContractBuilder(103-314)components(128-130)
packages/core/cairo/src/generate/erc721.ts (1)
packages/core/cairo/src/set-royalty-info.ts (2)
RoyaltyInfoSubset(16-16)resolveRoyaltyOptionsSubset(32-48)
packages/core/cairo/src/print.ts (1)
packages/core/cairo/src/contract.ts (3)
Contract(4-18)constants(140-142)Variable(90-96)
packages/core/cairo/src/governor.ts (1)
packages/core/cairo/src/utils/duration.ts (1)
durationToSeconds(14-26)
packages/core/cairo/src/multisig.ts (3)
packages/core/cairo_alpha/src/multisig.ts (3)
defaults(13-19)buildMultisig(38-52)MultisigOptions(25-28)packages/core/cairo/src/set-upgradeable.ts (1)
setUpgradeableMultisig(51-56)packages/core/cairo_alpha/src/set-upgradeable.ts (1)
setUpgradeableMultisig(51-56)
🪛 GitHub Check: CodeQL
packages/core/cairo/src/generate/sources.ts
[failure] 98-98: Use of a broken or weak cryptographic algorithm
A broken or weak cryptographic algorithm depends on sensitive data from a call to generateAccountOptions.
🪛 markdownlint-cli2 (0.18.1)
packages/core/cairo/src/tests/with_components_on/governor/governor.test.ts.md
22-22: Hard tabs
Column: 9
(MD010, no-hard-tabs)
177-177: Hard tabs
Column: 9
(MD010, no-hard-tabs)
262-262: Hard tabs
Column: 9
(MD010, no-hard-tabs)
347-347: Hard tabs
Column: 9
(MD010, no-hard-tabs)
432-432: Hard tabs
Column: 9
(MD010, no-hard-tabs)
517-517: Hard tabs
Column: 9
(MD010, no-hard-tabs)
612-612: Hard tabs
Column: 9
(MD010, no-hard-tabs)
697-697: Hard tabs
Column: 9
(MD010, no-hard-tabs)
782-782: Hard tabs
Column: 9
(MD010, no-hard-tabs)
packages/core/cairo/src/tests/with_components_off/erc721/erc721.test.ts.md
866-866: Hard tabs
Column: 9
(MD010, no-hard-tabs)
867-867: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1195-1195: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1294-1294: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1401-1401: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1402-1402: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1407-1407: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1520-1520: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1846-1846: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1847-1847: Hard tabs
Column: 9
(MD010, no-hard-tabs)
2087-2087: Hard tabs
Column: 9
(MD010, no-hard-tabs)
2614-2614: Hard tabs
Column: 9
(MD010, no-hard-tabs)
packages/core/cairo/src/tests/with_components_off/erc20/erc20.test.ts.md
61-61: Hard tabs
Column: 9
(MD010, no-hard-tabs)
134-134: Hard tabs
Column: 9
(MD010, no-hard-tabs)
452-452: Hard tabs
Column: 9
(MD010, no-hard-tabs)
453-453: Hard tabs
Column: 9
(MD010, no-hard-tabs)
828-828: Hard tabs
Column: 9
(MD010, no-hard-tabs)
903-903: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1051-1051: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1138-1138: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1237-1237: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1238-1238: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1243-1243: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1346-1346: Hard tabs
Column: 9
(MD010, no-hard-tabs)
2264-2264: Hard tabs
Column: 9
(MD010, no-hard-tabs)
2265-2265: Hard tabs
Column: 9
(MD010, no-hard-tabs)
packages/core/cairo/src/tests/with_components_off/governor/governor.test.ts.md
17-17: Hard tabs
Column: 9
(MD010, no-hard-tabs)
20-20: Hard tabs
Column: 9
(MD010, no-hard-tabs)
21-21: Hard tabs
Column: 9
(MD010, no-hard-tabs)
27-27: Hard tabs
Column: 9
(MD010, no-hard-tabs)
161-161: Hard tabs
Column: 9
(MD010, no-hard-tabs)
164-164: Hard tabs
Column: 9
(MD010, no-hard-tabs)
165-165: Hard tabs
Column: 9
(MD010, no-hard-tabs)
281-281: Hard tabs
Column: 9
(MD010, no-hard-tabs)
284-284: Hard tabs
Column: 9
(MD010, no-hard-tabs)
285-285: Hard tabs
Column: 9
(MD010, no-hard-tabs)
291-291: Hard tabs
Column: 9
(MD010, no-hard-tabs)
425-425: Hard tabs
Column: 9
(MD010, no-hard-tabs)
428-428: Hard tabs
Column: 9
(MD010, no-hard-tabs)
429-429: Hard tabs
Column: 9
(MD010, no-hard-tabs)
435-435: Hard tabs
Column: 9
(MD010, no-hard-tabs)
569-569: Hard tabs
Column: 9
(MD010, no-hard-tabs)
572-572: Hard tabs
Column: 9
(MD010, no-hard-tabs)
573-573: Hard tabs
Column: 9
(MD010, no-hard-tabs)
579-579: Hard tabs
Column: 9
(MD010, no-hard-tabs)
713-713: Hard tabs
Column: 9
(MD010, no-hard-tabs)
716-716: Hard tabs
Column: 9
(MD010, no-hard-tabs)
717-717: Hard tabs
Column: 9
(MD010, no-hard-tabs)
723-723: Hard tabs
Column: 9
(MD010, no-hard-tabs)
857-857: Hard tabs
Column: 9
(MD010, no-hard-tabs)
860-860: Hard tabs
Column: 9
(MD010, no-hard-tabs)
861-861: Hard tabs
Column: 9
(MD010, no-hard-tabs)
867-867: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1010-1010: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1013-1013: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1014-1014: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1020-1020: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1154-1154: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1157-1157: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1158-1158: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1164-1164: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1298-1298: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1301-1301: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1302-1302: Hard tabs
Column: 9
(MD010, no-hard-tabs)
1308-1308: Hard tabs
Column: 9
(MD010, no-hard-tabs)
packages/core/cairo/src/tests/with_components_off/custom/custom.test.ts.md
393-393: Hard tabs
Column: 9
(MD010, no-hard-tabs)
394-394: Hard tabs
Column: 9
(MD010, no-hard-tabs)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: boostsecurity - boostsecurityio/semgrep-pro
- GitHub Check: validate-cairo
- GitHub Check: build (solidity, default)
- GitHub Check: semgrep-cloud-platform/scan
- GitHub Check: validate-cairo
Key Changes
v2.0.0totv3.0.0v3.0.0audit fixes in both Cairo-stable and Cairo-alpha3.0.0to hide the switch UI element for Cairo tab