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: library calls #41

Closed
enitrat opened this issue Jun 21, 2023 · 7 comments · Fixed by #194
Closed

feat: library calls #41

enitrat opened this issue Jun 21, 2023 · 7 comments · Fixed by #194
Assignees

Comments

@enitrat
Copy link
Collaborator

enitrat commented Jun 21, 2023

In this section, we show an example of how to perform a Library Call in Cairo using the high-levels LibraryDispatcher and LibraryDispatcherTrait which perform a library_call syscall (reference here https://docs.starknet.io/documentation/architecture_and_concepts/Contracts/system-calls/#library_call)

Library calls are used to invoke functions from classes directly, not contracts.
It is already covered in surface in the Cairo book but the section needs to be reworked.

This example will demonstrate the implementation of a very simple contract intended to be used as a library, and how we can use XXXLibraryDispatcher to make library calls to this contract from another contract.
A simple could be a contract named MathUtils with a add function and from our contract we could call IMathUtilsLibraryDispatcher.add(a,b)

@neelkamath
Copy link

Is this for using a library via Scarb?

@enitrat
Copy link
Collaborator Author

enitrat commented Jun 30, 2023

Just updated the description @neelkamath, sorry for the confusion

@OkoliEvans
Copy link
Contributor

Is this issue still open? I'd love to work on it @julio4 @enitrat

@julio4
Copy link
Contributor

julio4 commented May 16, 2024

Is this issue still open? I'd love to work on it @julio4 @enitrat

Hello, yes I can assign you!

@OkoliEvans
Copy link
Contributor

Is this issue still open? I'd love to work on it @julio4 @enitrat

Hello, yes I can assign you!

Okay, thank you

@julio4
Copy link
Contributor

julio4 commented May 23, 2024

@OkoliEvans Do you need any help for this?

@OkoliEvans
Copy link
Contributor

I started working on it this morning, I have not had any blocks yet. I will reach out if I need any assistance @julio4

@julio4 julio4 mentioned this issue May 30, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants