-
Notifications
You must be signed in to change notification settings - Fork 244
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
dev: make EVM an implicit argument of EVM-modifying functions #885
Comments
Hey there! Could I take this one? I believe the idea is to modify the attributes of the EVM received so we don't create a new instance with almost all the parms being the same on the second instance creation, correct? |
@ClementWalter should we go forward with this? |
@joseSalazar4 it wouldn't save any steps actually, it's just to (possibly) increase readability. Tbh I'm not 100% sure that it'd be much better though, because the explicit If you want to give it a try, please, but be aware of the fact that upon PR, when actually seing it, we may decide to close instead of merge |
(to be more precise, in Cairo Zero, using an implicit arg is exactly the same as defining the same arg (same name and type) as input and output |
Your comment makes a lot of sense, this is better being explicit, agreed. |
func charge_gas{range_check_ptr}(self: model.EVM*, amount: felt) -> model.EVM* {
takes the EVM as explicit parameters and returns a new instance.
It could be refactored to
func charge_gas{range_check_ptr, evm: model.EVM*}(amount: felt) {
The text was updated successfully, but these errors were encountered: