-
Notifications
You must be signed in to change notification settings - Fork 28
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Problem
The TEAL opcode extract has the syntax:
extract S L where S: start position, L: length
A range of bytes from A starting at S up to but not including S+L.
If L is 0, then extract to the end of the string. If S or S+L is larger than the array length, the program fails
The behavior of L=0 isn't immediately obvious.
Solution
Introduce a new op named suffix with same behavior as https://pyteal.readthedocs.io/en/stable/api.html#pyteal.Suffix.
Instead of writting op.extract(..., 7, 0), you would write op.suffix(..., 7)
Proposal
The new op.suffix(..., 7) would compile to TEAL extract 7 0
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request