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

Implement TEAL 4 basic ops #67

Merged
merged 6 commits into from
Jun 14, 2021
Merged

Implement TEAL 4 basic ops #67

merged 6 commits into from
Jun 14, 2021

Conversation

jasonpaulos
Copy link
Member

This PR adds support for the following feature from TEAL v4:

  • extra_program_pages transaction field
  • GeneratedID expression
  • BitLen expression
  • Sqrt expression
  • ShiftLeft, ShiftRight, and Exp expressions
    • Also overloads the Python operators for these operations

@jasonpaulos jasonpaulos requested a review from jdtzmn June 11, 2021 21:20
@jasonpaulos
Copy link
Member Author

@jdtzmn does GeneratedID(txnIndex) make sense for the gaid(s) opcode?

@jdtzmn
Copy link
Contributor

jdtzmn commented Jun 11, 2021

Yes, I think that makes sense. @jannotti any thoughts?

@jannotti
Copy link

I'm ambivalent - I don't like that it implies the g is for "generated", as we're going for "group", as with gload and gtxn. But I guess you won't need the g's because it is known from context in pyteal? How will gload appear? Does the g in gtxn show up in pyteal naming?

I do like 'generated' compared to 'created' for being when clearer that it's about the ID that was made in that transaction.

So... I think it's good if you feel it fits in well with other choices in pyteal. I don't know it all that well.

Copy link
Contributor

@jdtzmn jdtzmn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I like the overloads.

@jasonpaulos
Copy link
Member Author

jasonpaulos commented Jun 14, 2021

@jannotti gload will appear in a separate PR after some design work -- I want to explore the idea of having Export/Import operations that would allow contracts to share values using gload.

And yes g does show up in the Gtxn variable, but that's currently the only place. I think I'll merge this with GeneratedID because I believe it's accurate enough, but if we change our mind about that name we'll have some time to update it before PyTeal gets released.

@jasonpaulos jasonpaulos merged commit 67d2fca into master Jun 14, 2021
@jasonpaulos jasonpaulos deleted the teal4-basic-ops branch June 14, 2021 15:44
@jasonpaulos
Copy link
Member Author

Closes #65.

@jasonpaulos jasonpaulos mentioned this pull request Aug 31, 2021
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.

None yet

3 participants