OpenZeppelin / contracts-wizard

Interactive smart contract generator based on OpenZeppelin Contracts.
https://wizard.openzeppelin.com
MIT License
245 stars 135 forks source link

Add Cairo compilation workflow #368

Closed ericnordelo closed 2 months ago

ericnordelo commented 2 months ago

This PR adds a script for updating a local scarb "test_project" required for compiling the files since we don't have a javascript compiler yet, and we need scarb for module resolution (importing the oz library).

This PR also adds a workflow that generates the scarb project and tries to compile it.

How to test this:

  1. From project root, yarn install
  2. Install scarb using asdf (the version for the current PR is 2.6.5)
  3. packages/core-cairo directory, run yarn run update_scarb_project
  4. From packages/core-cairo directory, run scarb build

Note that some contracts are failing to compile (missing a ContractAddress import). I plan to add a fix for those on a separate PR that will also migrate to the library version 0.14.0.

socket-security[bot] commented 2 months ago

Removed dependencies detected. Learn more about Socket for GitHub ↗︎

🚮 Removed packages: npm/@alloc/quick-lru@5.2.0, npm/@babel/code-frame@7.24.2, npm/@isaacs/cliui@8.0.2, npm/@jridgewell/gen-mapping@0.3.5, npm/@jridgewell/source-map@0.3.6, npm/@mapbox/node-pre-gyp@1.0.11, npm/@types/istanbul-lib-coverage@2.0.6, npm/@types/node@18.19.36, npm/camelcase@5.3.1, npm/cliui@5.0.0, npm/console-control-strings@1.1.0, npm/cross-spawn@6.0.5, npm/decamelize@1.2.0, npm/find-up@3.0.0, npm/glob@7.2.3, npm/minipass@5.0.0, npm/path-key@2.0.1, npm/rimraf@3.0.2, npm/semver@7.6.2, npm/string-width@3.1.0, npm/strip-ansi@5.2.0, npm/throat@4.1.0, npm/typescript@4.9.5, npm/wsrun@5.2.4, npm/yargs-parser@13.1.2

View full report↗︎