Skip to content

Commit

Permalink
Merge pull request #95 from jannotti/v9-low-resources
Browse files Browse the repository at this point in the history
Explain the ban on low resource IDs
  • Loading branch information
algofoundation authored Apr 26, 2023
2 parents 82d70ad + eb132d6 commit 9014f88
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions dev/TEAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,18 @@ _available_.
indicates the application ID of the app called by that
transaction. No box is ever _available_ to a ClearStateProgram.

Regardless of _availability_, any attempt to access an Asset or
Application with an ID less than 256 from within a Contract will fail
immediately. This avoids any ambiguity in opcodes that interpret their
integer arguments as resource IDs _or_ indexes into the
`txn.ForeignAssets` or `txn.ForeignApplications` arrays.

It is recommended that contract authors avoid supplying array indexes
to these opcodes, and always use explicit resource IDs. By using
explicit IDs, contracts will better take advantage of group resource
sharing. The array indexing interpretation may be deprecated in a
future version.

## Constants

Constants can be pushed onto the stack in two different ways:
Expand Down

0 comments on commit 9014f88

Please sign in to comment.