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

Approval Application On Create: Accessing Application Arguments. Not possible? #30

Open
mangoplane opened this issue Jun 8, 2023 · 0 comments

Comments

@mangoplane
Copy link

Hi,

When handling the on-create method, by checking if the application index is 0, how do you access the application arguments to initialize things dynamically? There's no such property on transaction. It would make sense to expose these app args as a list of byte[] as with PyTeal.

protected override int ApprovalProgram(in AppCallTransactionReference transaction)

Another alternative, which would be neater than if logic that catches the common lifecycle stages of a contract like create/update/delete, is to handle these stages by linting functions with attributes like the following that will take care of initialization:

[SmartContractOnCreate]
[SmartContractOnUpdate]
[SmartContractOnDelete]

This linting approach would be ideal. It is very important you don't sacrifice too much flexibility in what can be made, otherwise it becomes very limiting and many applications aren't possible. So it's a kind of balancing act.

Kind regards.

@mangoplane mangoplane changed the title Approval Application Create: Accessing Application Arguments Approval Application On Create: Accessing Application Arguments. Not possible? Jun 8, 2023
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

No branches or pull requests

1 participant