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
cycle n m: rotates the top n elements of the stack m places (i.e., so top of the stack now contains the element that was m elements down, and the element that was at the top of the stack has n-m elements above it). Fails if there are fewer than n elements on the stack or if m > n. cycle n 0 and cycle n n are both no-ops unless there are fewer than n elements on the stack.
In general, this would make stack manipulate easier and more efficient, since it essentially is a general form cover and uncover that can move multiple elements at a time.
Specifically, this opcode would make it easier for PyTeal to spill multiple local slots to the stack, then "cover" them, before invoking a recursive subroutine call.
Urgency
Nice to have for AVM 1.1.
The text was updated successfully, but these errors were encountered:
Summary
Introduce a new opcode for stack manipulation:
cycle n m
: rotates the top n elements of the stack m places (i.e., so top of the stack now contains the element that was m elements down, and the element that was at the top of the stack has n-m elements above it). Fails if there are fewer than n elements on the stack or if m > n. cycle n 0 and cycle n n are both no-ops unless there are fewer than n elements on the stack.In general, this would make stack manipulate easier and more efficient, since it essentially is a general form
cover
anduncover
that can move multiple elements at a time.Specifically, this opcode would make it easier for PyTeal to spill multiple local slots to the stack, then "cover" them, before invoking a recursive subroutine call.
Urgency
Nice to have for AVM 1.1.
The text was updated successfully, but these errors were encountered: