foundry-rs / starknet-foundry

Blazing fast toolkit for developing Starknet contracts.
https://foundry-rs.github.io/starknet-foundry/
MIT License
324 stars 175 forks source link

Make `sncast declare` work with scarb 2.7.0 #2352

Closed ksew1 closed 2 months ago

ksew1 commented 3 months ago

Which component is your feature related to?

Cast

Feature Request

When running sncast declare on Scarb 2.7.0, we get the following error:

error: An error occurred in the called contract = ContractErrorData { revert_error: "Sierra compilation error: Unable to compile Sierra to Casm. No matching ContractClass or CasmContractClass found for version 1.6.0" }

Because of this, the CI currently runs on the previous versions. After making sncast declare work with Scarb 2.7.0, please also change the CI to run on 2.7.0. Additionally, unignore this test: test_script_init_happy_case().


integraledelebesgue commented 2 months ago

Solving this issue is blocked until devnet's next release with my fix and starknet-rs fix of an issue I reported

integraledelebesgue commented 2 months ago

We just need to bump starknet-rs to 660a732

integraledelebesgue commented 2 months ago

It turns out that the issue still remains (on Devnet) despite the starknet-rs fix - starknet-devnet-rs uses outdated starknet-rs dependencies without that fix. Marking as blocked until devnet bumps SDK.

integraledelebesgue commented 2 months ago

The issue has been solved in general. Devnet-related aspect is now an item of #2459

qiaopengjun5162 commented 1 month ago
➜ sncast --profile dev-profile declare --contract-name ERC20 --fee-token strk
   Compiling snforge_scarb_plugin v0.31.0 (git+https://github.com/foundry-rs/starknet-foundry?tag=v0.31.0#72ea785ca354e9e506de3e5d687da9fb2c1b3c67)
    Finished `release` profile [optimized] target(s) in 0.16s
   Compiling starknet_erc20 v0.1.0 (/Users/qiaopengjun/Code/starknet-code/hello_starknet/starknet_erc20/Scarb.toml)
    Finished release target(s) in 4 seconds
[WARNING] Profile dev-profile does not exist in scarb, using 'release' profile.
command: declare
error: An error occurred in the called contract = ContractErrorData { revert_error: "Sierra compilation error: Unable to compile Sierra to Casm. No matching ContractClass or CasmContractClass found for version 1.6.0" }

Does anyone have a solution to this problem? What is the reason?