Closed ryanRfox closed 4 years ago
Hi Ryan, this is definitely something we've been planning on and hope to have in a future expansion of TEAL. It's been designed as an opcode named concat
. No word yet on when that will happen though.
If you want the details of what we're proposing to do, you can look at @algobolson's work in #637: https://github.com/algorand/go-algorand/pull/637/files#diff-ece92c5f928e8cdec0723b27bf000532R97
Spec in the works https://github.com/algorandfoundation/specs/pull/23
fixed in TEAL v2 and never closed.
User Story:
As a TEAL user I desire the ability to concatenate two stack elements of type
bytes
so the resultingbytes
may be processed later in the program.Example Scenario:
Sample TEAL code snippet of desired functionality:
In this scenario the program is loading two
bytes
type elements onto the stack. A new operator.
is introduced which intends to concatenate the top two stack elements, both of typebytes
, then returnbytes
to the stack. Note: the stack will now contain a number of bytes equal to the sum of bytesarg_0
andarg_1
. Finally, the concatenated bytes are hashed, leaving 32 bytes on the stack and the program continues.