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

Add new transaction and script templates #31

Open
joshuahannan opened this issue Jul 20, 2020 · 1 comment
Open

Add new transaction and script templates #31

joshuahannan opened this issue Jul 20, 2020 · 1 comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed Improvement SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board

Comments

@joshuahannan
Copy link
Member

joshuahannan commented Jul 20, 2020

Issue To Be Solved

There are many ways a fungible token can be used and we want more transaction templates to be defined for them.

Suggest A Solution

Please leave comments in this issue if you think of a transaction that you would like to be added as a template.
This issue will also be updated with ideas as they are added.

When adding a new template:

  1. Create an issue for the template you are adding and assign it to yourself. Leave a comment on this post that you are working on it. Include any relevant questions or discussion about your template in the issue that you create.
  2. Write the template as a .cdc file and save it in the transactions directory.
  3. Save the fungible token address as 0xFUNGIBLETOKENADDRESS
  4. Save the example token address as 0xTOKENADDRESS
  5. Use ExampleToken as the token name and exampleTokenVault, etc. as the token and storage name
  6. Use transaction parameters instead of hard-coded values.
  7. Write a go template getter in lib/go/templates/ and run make generate in that directory.
  8. Write a test for your transaction in lib/go/test/ and make sure the test passes.
  9. Ensure that your template and test are well commented.

Template Suggestions

Feel free to choose a template from this list to work on, or make a comment to add your own idea.

  • Send tokens to multiple addresses. The addresses and amounts can be configurable parameters to the transaction.
  • Remove the public receiver capability from an account.
  • Remove the balance capability from an account.
  • Create a provider capability and store it in another account's /private/ domain.
  • Use an account's provider capability in your /private/ domain to withdraw tokens from their account and deposit it in your account.
@joshuahannan joshuahannan added good first issue Good for newcomers help wanted Extra attention is needed Improvement labels Jul 20, 2020
@joshuahannan
Copy link
Member Author

Anyone else have any suggestions for transactions or scripts you'd like to see? Leave a comment with your suggestions! 😄

@franklywatson franklywatson added the SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board label May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed Improvement SC-Eng Issues that we want to see surfaced in SC-Eng ZH Board
Projects
None yet
Development

No branches or pull requests

2 participants