You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I propose to add the ability to pass additional arguments to the procedure, which is called in the loop forall, this can save gas on reading repeated data in the procedure.
Example:
procedure Procedure(value: ListType, arg1: Type1, arg2: Type2, arg3: Type3)
(* actions *)
end
transition Transition(list: List ListType)
arg1 <- state_arg1;
arg2 <- state_arg2;
arg3 <- state_arg3;
forall list Procedure arg1 arg2 arg3
end
The text was updated successfully, but these errors were encountered:
Following up a Telegram conversation, another variant that can be useful is to have an accumulator procedure.
For example: given a list of keys, its values must be fetched from a map field and added up. Right now this can be done using a temporary accumulator field in the procedure used with forall. That's gas expensive though.
I propose to add the ability to pass additional arguments to the procedure, which is called in the loop forall, this can save gas on reading repeated data in the procedure.
Example:
The text was updated successfully, but these errors were encountered: