-
Notifications
You must be signed in to change notification settings - Fork 88
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
Comments
Is this for using a library via Scarb? |
Just updated the description @neelkamath, sorry for the confusion |
@OkoliEvans Do you need any help for this? |
I started working on it this morning, I have not had any blocks yet. I will reach out if I need any assistance @julio4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In this section, we show an example of how to perform a Library Call in Cairo using the high-levels
LibraryDispatcher
andLibraryDispatcherTrait
which perform alibrary_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 aadd
function and from our contract we could callIMathUtilsLibraryDispatcher.add(a,b)
The text was updated successfully, but these errors were encountered: