Const
create a box named A, of length B. Fail if the name A is empty or B exceeds 32,768. Returns 0 if A already existed, else 1
Newly created boxes are filled with 0 bytes. box_create
will fail if the referenced box already exists with a different size. Otherwise, existing boxes are unchanged by box_create
.
Native TEAL opcode: box_create
Min AVM version: 8
read C bytes from box A, starting at offset B. Fail if A does not exist, or the byte range is outside A's size.
Native TEAL opcode: box_extract
Min AVM version: 8
write byte-array C into box A, starting at offset B. Fail if A does not exist, or the byte range is outside A's size.
Native TEAL opcode: box_replace
Min AVM version: 8
change the size of box named A to be of length B, adding zero bytes to end or removing bytes from the end, as needed. Fail if the name A is empty, A is not an existing box, or B exceeds 32,768.
Native TEAL opcode: box_resize
Min AVM version: 10
set box A to contain its previous bytes up to index B, followed by D, followed by the original bytes of A that began at index B+C. Boxes are of constant length. If C < len(D), then len(D)-C bytes will be removed from the end. If C > len(D), zero bytes will be appended to the end to reach the box length.
Native TEAL opcode: box_splice
Min AVM version: 10
Get or modify box state