Skip to content
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

Adapt to cairo-lang/Starknet 0.11.2; support scarb #376

Merged
merged 51 commits into from
Jun 22, 2023
Merged

Conversation

FabijanC
Copy link
Collaborator

@FabijanC FabijanC commented Jun 1, 2023

Usage related changes

  • Close Integrate Scarb to support project-compiling and contract imports #379
  • Introduce starknet-build
    • wrapper of Scarb
    • Scarb command or path needs to be provided via starknet.scarbCommand in hardhat config file, or via --scarb-command in the CLI
    • The targeted project needs to have a lib.cairo and a Scarb.toml with sierra and casm set to true under [[target.starknet-contract]]
    • Compilation artifacts are stored in the artifacts directory, as <PACKAGE_NAME>_<CONTRACT_NAME>, so they can be loaded with starknet.getContractFactory("MyPackage_MyContract");
  • This PR keeps the starknet-compile command as it was (useful for single Cairo 1 file compilation)
  • Add support for parsing arrays as return types of Cairo 1 contract methods (partly addresses Support and test Cairo 1 types #341)

Development related changes

  • Update tools
    • cairo-lang to v0.11.2
    • starknet-devnet to v0.5.3
    • cairo compiler to v1.1.0
  • Install scarb as a dev tool
  • Add new dependency @iarna/toml - for Scarb.toml validation
  • Refactor getting image tag by arch
  • Add typecheck of hardhat config files to test.sh
    • Because of this - removed test/configuration-tests/disallow-cairo1BinDir-when-dockerized as it was not valid (not a typescript thing, but our validation was making it invalid).
  • Temporarily disable dockerized Scarb - delegated to issue Support Dockerized Scarb #389
  • Replace spawning a call to cp -a with fs.cpSync

Checklist:

  • Formatted the code
  • No linter errors + tried to avoid introducing linter warnings
  • Performed a self-review of the code
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Documented the changes
  • Updated the test directory (with a test case consisting of network.json, hardhat.config.ts, check.ts)
  • Linked issues which this PR resolves
  • Created a PR to the plugin branch of starknet-hardhat-example:
  • All tests are passing (for external contributors who don't have access to the CI/CD pipeline)

@FabijanC FabijanC force-pushed the adapt-0.11.2 branch 4 times, most recently from 39793ca to 70e0111 Compare June 16, 2023 15:14
@FabijanC FabijanC changed the title Adapt to cairo-lang/Starknet 0.11.2 Adapt to cairo-lang/Starknet 0.11.2; add scarb Jun 16, 2023
@FabijanC FabijanC marked this pull request as ready for review June 22, 2023 13:46
@FabijanC FabijanC changed the title Adapt to cairo-lang/Starknet 0.11.2; add scarb Adapt to cairo-lang/Starknet 0.11.2; support scarb Jun 22, 2023
@FabijanC FabijanC merged commit 972213c into master Jun 22, 2023
@FabijanC FabijanC deleted the adapt-0.11.2 branch June 22, 2023 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Integrate Scarb to support project-compiling and contract imports
1 participant