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

chore: convert ex00_base to new_syntax #65

Open
wants to merge 1 commit into
base: cairo2
Choose a base branch
from

Conversation

codeWhizperer
Copy link

No description provided.

@codeWhizperer
Copy link
Author

codeWhizperer commented Jul 12, 2023

@omarespejel ex00_base.cairo contains internal functions, I created a separate file for its interface (Iex00_base.cairo) and its implementation is the ex00_base.cairo. The functions in the module an be referenced in other module using the dispatcher generated.

@dbejarano820
Copy link

dbejarano820 commented Jul 13, 2023

@codeWhizperer is using a dispatcher truly the behavior we want to replace using the imported functions with? Wouldn't this be an actual call instead on inheriting the logic internally?

**EDIT: Reading into it a bit more, would we use a library dispatcher instead of a contract dispatcher?

I'm trying to refactor ERC20_base which has some similar behavior, there are some internal functions which are imported directly elsewhere and used.

@codeWhizperer
Copy link
Author

codeWhizperer commented Jul 13, 2023

@dbejarano820 good observation. I think this kind of bid the question, what's exact behavior is expected whenever a call is made? Comparing contract dispatcher to library dispatcher, I understand that,

contract dispatcher executes the external contract's logic within its context, allowing state modifications, while the library dispatcher executes the call in the calling contract's context without the ability to modify the target contract's state

@Chomtana
Copy link

I think it should be a component instead of contract?

@omarespejel
Copy link
Collaborator

I think @Chomtana is right, we might need to convert it to a component. Thanks @codeWhizperer for the contribution and @dbejarano820 for the review.

@Chomtana @dbejarano820 do you have any further insights so we can start with the conversion?

@dbejarano820
Copy link

I think @Chomtana is right, we might need to convert it to a component. Thanks @codeWhizperer for the contribution and @dbejarano820 for the review.

@Chomtana @dbejarano820 do you have any further insights so we can start with the conversion?

Yes! Now that cairo components is out, we can leverage that here

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 this pull request may close these issues.

None yet

4 participants