Skip to content

Regularize account, asa, and app references in AVM. #2258

@jannotti

Description

@jannotti

Currently, various opcodes require arguments that represent accounts, asas, or apps, and they take them in different ways.

Accounts are usually taken as indexes into the Accounts array of the transaction. Assets and Apps, however, are sometimes indexes into their respective foreign arrays, but are sometimes given as explicit uint64 ids of the things in question. There are principles at work here, but it is confusing, and will get worse as we add the ability to perform transfers from AVM.

All op codes that take these objects should be changed to accept either form. In addition, in all cases the thing being referenced must exist in the corresponding array of the transaction. This will be a new restriction for checking asa balances and touching app local state, but this restriction is important as we consider greatly opening up the ability for accounts to hold very many assets and apps.

In the case of asa and app ids, the rule will be that any id low enough to be a reference into the array will be treated as such, or else it is direct id.

Previous versions of teal will not see this change.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions