OpenZeppelin / cairo-contracts

OpenZeppelin Contracts written in Cairo for Starknet, a decentralized ZK Rollup
https://docs.openzeppelin.com/contracts-cairo
MIT License
813 stars 329 forks source link

Version Conflict Between StarkNet v2.3.0-rc0 and OpenZeppelin v0.7.0-rc.0 Causes Compilation Failure in Scarb #785

Closed henryf10h closed 10 months ago

henryf10h commented 11 months ago

Description: Upon upgrading to StarkNet version v2.3.0-rc0, I encountered a compilation failure when attempting to build contracts using scarb build. The scarb test command resulted in an error regarding a version mismatch between openzeppelin version v0.7.0-rc.0 and starknet version v2.3.0-rc0. Here's the error message I received:

henryf10h@DESKTOP-M3O4F7U:/mnt/c/Users/Henry Alberto/desktop/reflect_cairo$ scarb test
     Running cairo-test reflect_cairo
Error: scarb metadata exited with error

stdout:
{"status":"updating","message":"git repository https://github.com/openzeppelin/cairo-contracts"}
{"type":"error","message":"Version solving failed:\n- openzeppelin v0.7.0-rc.0 (git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.7.0-rc.0#fbdd7593681a1515dabcbf722fb99c88edf200fe) cannot use starknet v2.3.0-rc0 (std), because openzeppelin requires starknet >=2.2.0\n\nScarb does not have real version solving algorithm yet.\nPerhaps in the future this conflict could be resolved, but currently,\nplease upgrade your dependencies to use latest versions of their dependencies."}

stderr:

In an attempt to resolve this issue, I downgraded StarkNet to version v2.2.0, after which the contracts compiled successfully with scarb build.

Steps to Reproduce: Upgrade StarkNet to version v2.3.0-rc0. Attempt to build contracts using scarb build. Observe the compilation failure and error message regarding version mismatch. Downgrade StarkNet to version v2.2.0. Attempt to build contracts again using scarb build. Observe successful compilation. Expected Behavior: The contracts should compile successfully with the latest versions of StarkNet and OpenZeppelin.

Actual Behavior: A version conflict between StarkNet v2.3.0-rc0 and OpenZeppelin v0.7.0-rc.0 causes a compilation failure in Scarb.

Environment: OS: (e.g., Ubuntu 20.04) Scarb version: (provide version if known) StarkNet version: v2.3.0-rc0 OpenZeppelin version: v0.7.0-rc.0

pd: thanks beforehand :)