NethermindEth / starknet-contract-verifier

CLI to verify your starknet contracts classes on block explorers!
18 stars 6 forks source link

`IMPORT NOT RESOLVED: Delegation` on running the verifier inside project's root #55

Closed ayushtom closed 1 week ago

ayushtom commented 1 month ago

I have asdf to manage my versions and hence i run the verifier in the contract's root. The path is added to the zsh config to run the command but I face the error - IMPORT NOT RESOLVED: Delegation error. I also don't use any super imports in the contract which might give this import error.

My Configuration -

Error logs -

starknet-contract-verifier
[1/4] ๐Ÿ“ Getting project information...
[2/4] ๐Ÿ”— Resolving project...
     Running git clone --local --verbose --config core.autocrlf=false --recurse-submodules /Users/ayushtomar/Library/Caches/com.swmansion.scarb/registry/git/db/custom_uri_component-4jc1f38gijv8g.git /Users/ayushtomar/Library/Caches/com.swmansion.scarb/registry/git/checkouts/custom_uri_component-4jc1f38gijv8g/e59d4d0
     Running git reset --hard e59d4d00cfecccb1681fad1862eb835df76184cf
     Running git clone --local --verbose --config core.autocrlf=false --recurse-submodules /Users/ayushtomar/Library/Caches/com.swmansion.scarb/registry/git/db/cairo-contracts-9cboa8jg3jldq.git /Users/ayushtomar/Library/Caches/com.swmansion.scarb/registry/git/checkouts/cairo-contracts-9cboa8jg3jldq/978b4e7
     Running git reset --hard 978b4e75209da355667d8954d2450e32bd71fe49
   Compiling starknet-contract(twitter_nft_contract) twitter_nft_contract v0.1.0 (/Users/ayushtomar/Desktop/work/twitter_nft/contracts/Scarb.toml)
error: IMPORT NOT RESOLVED: Delegation
Error: could not compile `twitter_nft_contract` due to previous error
ayushtom commented 1 month ago

@liam-nethermind can you point which issue is the original one so i can follow for the fix?

liam-nethermind commented 1 month ago

@liam-nethermind can you point which issue is the original one so i can follow for the fix?

@ayushtom You can follow #11.

cwkang1998 commented 1 week ago

Hey @ayushtom can you please share the minimal code for reproducing this or share the project in which this was an issue? Thanks a lot!

ayushtom commented 1 week ago

Hey!

The contract is not open sourced yet but i can share the imports on the main.cairo and the scarb.toml file which can help you. I assume this is related to the import issue which you reffered above

scarb.toml

[package]
name = "twitter_nft_contract"
version = "0.1.0"

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

[dependencies]
starknet = ">=2.4.4"
openzeppelin = { git = "https://github.com/OpenZeppelin/cairo-contracts.git", tag = "v0.13.0" }
custom_uri = { git = "https://github.com/starknet-id/custom_uri_component", rev = "e59d4d00cfecccb1681fad1862eb835df76184cf" }

[[target.starknet-contract]]
sierra = true
casm = true
casm-add-pythonic-hints = true

[lib]
sierra = true
casm = true

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

main.cairo

    use openzeppelin::token::erc1155::erc1155::ERC1155Component::InternalTrait;
    use twitter_nft_contract::interface::{
        erc1155::{
            IERC1155_ID, IERC1155_METADATA_URI_ID, IERC1155_RECEIVER_ID
        },
        twitter_nft::ITwitterNft
    };
    use core::debug::PrintTrait;
    use openzeppelin::{
        introspection::{src5::SRC5Component},
        access::ownable::OwnableComponent,
        token::erc1155::{ERC1155Component, ERC1155HooksEmptyImpl,interface::IERC1155MetadataURI},
        upgrades::{UpgradeableComponent, interface::IUpgradeable},
    };
    use starknet::{get_contract_address, get_caller_address};
    use starknet::{ContractAddress, ClassHash};