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

Unable to verify 2.5.4 class #29

Open
Bart-Do opened this issue Jun 19, 2024 · 3 comments
Open

Unable to verify 2.5.4 class #29

Bart-Do opened this issue Jun 19, 2024 · 3 comments
Assignees
Labels
bug Something isn't working P1 Priority 1

Comments

@Bart-Do
Copy link
Contributor

Bart-Do commented Jun 19, 2024

The following class returns an error during verification process.

  • Class: https://sepolia.voyager.online/class/0x065e4bf12d8c0ffb37ef9cd09237bbaf994507f993071b2366770976d8705e40

  • Compiler version: 2.5.4

  • Error:
    image

  • Source code:

    #[starknet::interface]
    pub trait IHelloStarknet<TContractState> {
        fn decrease_balance(ref self: TContractState, amount: felt252);
        fn get_balance(self: @TContractState) -> felt252;
    }
    
    #[starknet::contract]
    mod HelloStarknet {
        #[storage]
        struct Storage {
            balance: felt252, 
        }
    
        #[abi(embed_v0)]
        impl HelloStarknetImpl of super::IHelloStarknet<ContractState> {
            fn decrease_balance(ref self: ContractState, amount: felt252) {
                assert(amount != 0, 'Amount cannot be 0');
                self.balance.write(self.balance.read() + amount);
            }
    
            fn get_balance(self: @ContractState) -> felt252 {
                self.balance.read()
            }
        }
    }
@Bart-Do Bart-Do added bug Something isn't working P1 Priority 1 labels Jun 19, 2024
@cwkang1998 cwkang1998 self-assigned this Jul 1, 2024
@cwkang1998
Copy link
Contributor

Seems this is more of a backend issue than a frontend one. Currently unable to reliably reproduce this.

Recent attempts seems to result in success.

@Bart-Do
Copy link
Contributor Author

Bart-Do commented Jul 18, 2024

Here's my Scarb.toml file:
It seems to happen when I have a dependency in this file.

[package]
name = "mycontract"
version = "0.1.0"
edition = "2023_11"

# See more keys and their definitions at https://docs.swmansion.com/scarb/docs/reference/manifest.html

[dependencies]
starknet = "2.5.4"

[dev-dependencies]
snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.22.0" }

[[target.starknet-contract]]
casm = true

[tool.voyager]
my_contract = { path = "lib.cairo" }

@cwkang1998
Copy link
Contributor

You're right, looking at the backend logs it seems to be the case.
Will investigate the backend implementation.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P1 Priority 1
Projects
None yet
Development

No branches or pull requests

2 participants