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

fix and improve token-program-advance course #535

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wuuer
Copy link
Contributor

@wuuer wuuer commented Sep 27, 2024

Problem

[creating NFTs with Metaplex] link is wrong.
[previous chapter] link is wrong.
[Transfering Tokens] link is wrong.
The import @solana/web3.js statements in the section Brun Tokens are wrong.
The return value type "web3.Transaction" is wrong in the section Brun Tokens.
Missing delegate account for demonstration for the section Delegating tokens.
A wrong argument passes to calling the revoke function in the typescript for Revoke Delegate.
Missing some instructions for Delegating tokens, Revoke Delegate, and Burn Tokens.

Summary of Changes

Delete "web3." for "web3.Transaction" in the section Brun Tokens.
Using the system program as the delegate in the typescript of Delegating tokens.
Add some instructions for Delegating tokens, Revoke Delegate, and Burn Tokens.
Fix [creating NFTs with Metaplex] link.
Fix [previous chapter] link.
Fix [Transferring Tokens] link.
Fix the import @solana/web3.js statements in the section Brun Tokens.
Fix a wrong argument passed to calling the revoke function in the typescript for Revoke Delegate.

Jeff Wood and others added 3 commits September 27, 2024 09:58
Using the system program as the delegate in the typescript of Delegating tokens.
Add some instructions for Delegating tokens, Revoke Delegate, and Burn Tokens.
Fix [creating NFTs with Metaplex] link.
Fix [previous chapter] link.
Fix [Transferring Tokens] link.
Fix the import @solana/web3.js statements in the section Brun Tokens.
Fix a wrong argument passed to calling the revoke function in the typescript for Revoke Delegate.
@mikemaccana
Copy link
Collaborator

mikemaccana commented Oct 2, 2024

Hey @wuuer ! You already have a PR open that fixes https://token-program-advanced.md/ - #342 - please don't make multiple PRs for the same lesson, it splits the conversation into too many places.

Copy link
Collaborator

@mikemaccana mikemaccana left a comment

Choose a reason for hiding this comment

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

Good but needs a few small fixes!

[`createBurnInstruction()`](https://solana-labs.github.io/solana-program-library/token/js/functions/createBurnInstruction.html#createBurnInstruction)
function.
Under the hood, the `burn` function creates a transaction with instructions
obtained from the `createBurnInstruction` function:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why remove the links?

[`createApproveInstruction()`](https://solana-labs.github.io/solana-program-library/token/js/functions/createApproveInstruction.html#createApproveInstruction)
function.
Under the hood, the `approve` function creates a transaction with instructions
obtained from the `createApproveInstruction` function:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above re: links.


```typescript
import { PublicKey, Transaction } from "@solana/web3.js";
import { createRevokeInstruction } from "@solana/spl-token";
import { revoke } from "@solana/spl-token";
Copy link
Collaborator

@mikemaccana mikemaccana Oct 17, 2024

Choose a reason for hiding this comment

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

Much nicer! Especially since we're using burn later.

This lab extends the concepts covered in the previous lesson on the
[Token Program](/content/courses/tokens-and-nfts/token-program.md).
This lab extends the lab from the
[previous chapter](/content/courses/tokens-and-nfts/token-program.md).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Much clearer. 👍

delegated amount to 0.

Create a new file `revoke-approve-tokens.ts`.

```typescript filename="revoke-approve-tokens.ts"
```typescript
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why remove the filenames?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants