Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use intcblock, bytecblock information for intc*, bytec* instructions #127

Merged
merged 6 commits into from
Jan 26, 2023

Conversation

S3v3ru5
Copy link
Contributor

@S3v3ru5 S3v3ru5 commented Jan 9, 2023

Intcblock, bytecblock instructions are used as a way to reduce contract size. Executing a Intcblock/bytecblock instruction fills constant's storage with the values given in the immediate arguments. This constant values can then referred using intc*/bytec* instructions.

intcblock 11 12 13 14 15 16 ...              // fills the constant's storage with values (11, 12, 13, 14, 15, ...)
intc_0                     // results in value `11` at runtime: value at 0th index in constant's storage that is filled by above ins
intc_1                     // results in value `12`
intc_2                     // 13
intc_3                     // 14
intc 5                     // 16

This PR adds support for calculating the information from intcblock/bytecblock instructions and using that information during analyses.
Information from intcblock/bytecblock is calculated if and only if:

  • Intcblock and bytecblock occur only once in the entire contract and that too in the entry basic block.

Partly fixes #86
https://developer.algorand.org/docs/get-details/dapps/avm/teal/specification/#constants

Base automatically changed from dev-itxn_field to dev January 10, 2023 10:22
@montyly montyly merged commit 3787cb1 into dev Jan 26, 2023
@montyly montyly deleted the dev-fix-intcblock branch January 26, 2023 14:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants