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

feat: Import a library ([starknet::component]) inside another library ([starknet::component]) #4574

Open
1 of 2 tasks
rajeebkm opened this issue Dec 16, 2023 · 2 comments
Open
1 of 2 tasks
Labels
enhancement New feature or request

Comments

@rajeebkm
Copy link

rajeebkm commented Dec 16, 2023

Feature Request

Describe the Feature Request

Import a library ([starknet::component]) inside another library ([starknet::component])

Describe Preferred Solution

It would be great if cairo supports importing library in another library. We can easily use other libraries as well.

Describe Alternatives

Related Code

use project::{interfaces::IFees, libraries::LibAsset::LibAsset as LibAssetComponent};

#[starknet::component]
mod LibFees {
use starknet::ContractAddress;
use super::LibAssetComponent;

component!(path: LibAssetComponent, storage: libAsset, event: LibAssetEvent);

}

Additional Context

image

If the feature request is approved, would you be willing to submit a PR?
(Help can be provided if you need assistance submitting a PR)

  • Yes
  • No
@rajeebkm rajeebkm added the enhancement New feature or request label Dec 16, 2023
@tensojka
Copy link
Contributor

Isn't this possible already? See https://community.starknet.io/t/cairo-components/101136 , section Component dependencies

@orizi
Copy link
Collaborator

orizi commented Aug 26, 2024

starting with the 2.7.* releases new style of storage pointers are available - allows to write proper generics based code - describing a general component.

following storage_node would be possibly generics - allowing easily mixing such types to share generic logics and storage across components and contracts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants