Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion content/hello-world-solana/en/hello-world-solana.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ There is nothing special about the name initialize in this context, and so we ca
When the tests run against a node, we will be able to query the node for state changes. If you are not able to get the node to run, it is okay to run `anchor test` without the `--skip-local-validator` flag. However, you will have a harder time developing and testing, so we recommend getting the local validator to work.

## Troubleshooting
Solana is a rapidly developing software, and you may run into installation issues. We've documented the ones you are most likely to encounter the following sections.
Solana is a rapidly developing software, and you may run into installation issues. We've documented the ones you are most likely to encounter in the following sections.

Our tutorial series was written with the following versions:
* Anchor = version 0.29.0
Expand Down
2 changes: 1 addition & 1 deletion content/solana-require-macro/en/solana-require-macro.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ Note how all the functions in Solana have a return type of `Result<()>`. A [resu
If you add it, your code won't compile. If the final statement in Rust does not have a semicolon, then the value on that line is returned.

### Why does `Ok(())` have an extra set of parenthesis?
The `()` means "unit" in Rust, which you can think of as being a void in C or a Nothing in Haskell. Here, `Ok` is an enum which contains a unit type. That is what get returns. Functions that don't return things implicitly return the unit type in Rust. An `Ok(())` with no semicolon is syntactically equivalent to return `Ok(())`;. Note the semicolon at the end.
The `()` means "unit" in Rust, which you can think of as being a void in C or a Nothing in Haskell. Here, `Ok` is an enum which contains a unit type. That is what get returns. Functions that don't return things implicitly return the unit type in Rust. An `Ok(())` with no semicolon is syntactically equivalent to `return Ok(());`. Note the semicolon at the end.


### How come the `if statements` above are missing parenthesis?
Expand Down
2 changes: 1 addition & 1 deletion content/spl-token/spl-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ Unlike Ethereum where balances exist implicitly in the contract's storage, Solan

Hence, before sending any tokens, we must create the ATA for the user-token pair. The ATA address is derived deterministically off-chain using the wallet address and mint address. Once derived, we use the Associated Token Account Program to create the ATA on-chain if it doesn't already exist. This raises an important security question: if anyone can create an ATA for someone else, could they also assign themselves as the ATA owner and close authority? Fortunately, no. When creating an ATA for another wallet, the ATA Program enforces that the `owner` and `close_authority` fields are always set to the wallet address for which the ATA is being created, not the transaction signer. This security guarantee is built into the [ATA Program's code](https://github.com/solana-program/associated-token-account/blob/c8a2aad5bfc5af81cd95b7685aee30a7ba6f3ba2/program/src/processor.rs#L150), ensuring that only the rightful wallet owner maintains control over their tokens and the ability to close their account.

To illustrate: when Alice wants to send tokens to Bob, she derives Bob's ATA address, creates it on-chain if it doesn't exist, then calls the Token Program's `Transfer` instruction with Bob's ATA as the destination. (In practice, client libraries like `@solana/spl-token` provide helper functions that combine the ATA derivation and creation steps).To illustrate: when Alice wants to send tokens to Bob, she derives Bob's ATA address, creates it on-chain if it doesn't exist, then calls the Token Program's `Transfer` instruction with Bob's ATA as the destination. (In practice, client libraries like `@solana/spl-token` provide helper functions that combine the ATA derivation and creation steps).
To illustrate: when Alice wants to send tokens to Bob, she derives Bob's ATA address, creates it on-chain if it doesn't exist, then calls the Token Program's `Transfer` instruction with Bob's ATA as the destination. (In practice, client libraries like `@solana/spl-token` provide helper functions that combine the ATA derivation and creation steps).

The diagram shows the contents of the ATA program.

Expand Down