Skip to content

Commit 8fc66db

Browse files
authored
Merge pull request #267 from sivajisj/patch-1
Fix: Update content and layout for Anchor Vault challenge page
2 parents 7aa004b + 8297af8 commit 8fc66db

File tree

8 files changed

+38
-37
lines changed

8 files changed

+38
-37
lines changed

src/app/content/challenges/anchor-vault/de/challenge.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ pub struct VaultAction<'info> {
9090
Lassen Sie uns jede Account-Einschränkung genauer betrachten:
9191

9292
1. `signer`: Die `mut`-Einschränkung ist notwendig, da wir dessen Lamports während der Übertragungen ändern werden.
93-
2. `vault`:
94-
- `mut` weil wir dessen Lamports ändern werden
95-
- `seeds` & `bumps` definiert, wie ein gültiger PDA aus den Seeds abgeleitet wird
96-
3. `system_program`: prüft, ob das Konto als ausführbar markiert ist und ob die Adresse die des System-Programms ist
93+
2. `vault`:
94+
- `mut` weil wir dessen Lamports ändern werden.
95+
- `seeds` & `bumps` definiert, wie ein gültiger PDA aus den Seeds abgeleitet wird.
96+
3. `system_program`: prüft, ob das Konto als ausführbar markiert ist und ob die Adresse die des System-Programms ist.
9797

9898
<ArticleSection name="Errors" id="errors" level="h2" />
9999

src/app/content/challenges/anchor-vault/en/challenge.mdx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Since both instruction use the same accounts, to make it easier and more readabl
6868
The `VaultAction` account struct will need to have:
6969
- `signer`: this is the owner of the vault, and the only person that can withdraw the lamports after creating the vault.
7070
- `vault`: a PDA derived from the following seeds: `[b"vault", signer.key().as_ref()]` that holds the lamports for the signer.
71-
- `system_program`: the system program account that needs to be included since we're going to use the transfer instruction CPI from the system program
71+
- `system_program`: the system program account that needs to be included since we're going to use the transfer instruction CPI from the system program
7272

7373
Here's how we define the account struct:
7474

@@ -89,19 +89,20 @@ pub struct VaultAction<'info> {
8989

9090
Let's break down each account constraint:
9191

92+
9293
1. `signer`: The `mut` constraint is needed because we'll be modifying its lamports during transfers.
93-
2. `vault`:
94-
- `mut` because we'll be modifying its lamports
95-
- `seeds` & `bumps` defines how to derive a valid PDA from the seeds
96-
3. `system_program`: checks if the account is set to executable and that the address is the System Program one
94+
2. `vault`:
95+
- `mut` because we'll be modifying its lamports.
96+
- `seeds` & `bumps` define how to derive a valid PDA from the seeds.
97+
3. `system_program`: checks if the account is set to executable and that the address is the System Program one.
9798

9899
<ArticleSection name="Errors" id="errors" level="h2" />
99100

100101
We don't need a lot of errors for this small programs, so we're just going to create 2 enums:
101102
- `VaultAlreadyExists`: that let us know if there are already some lamports in the account since it would mean that the vault exists already.
102103
- `InvalidAmount`: we can't deposit an amount that is less than the minimum rent for a basic account, so we check that the amount is greater than that.
103104

104-
It will look something like this:
105+
It will look something like this:
105106

106107
```rust
107108
#[error_code]
@@ -200,6 +201,6 @@ Start by building your program using the following command in your terminal
200201
anchor build
201202
```
202203

203-
This generated a `.so` file directly in your `target/deploy` folder.
204+
This generated a `.so` file directly in your `target/deploy` folder.
204205

205206
Now click on the `take challenge` button and drop the file there!

src/app/content/challenges/anchor-vault/fr/challenge.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,19 +89,19 @@ pub struct VaultAction<'info> {
8989

9090
Détaillons les contraintes de chaque compte :
9191

92-
1. `signer`: La contrainte `mut` est nécessaire puisque nous allons modifier ses lamports pendant les transferts
93-
2. `vault`:
94-
- `mut` car nous allons modifier ses lamports
95-
- `seeds` & `bumps` définit comment dériver un PDA valide à partir des seeds
96-
3. `system_program`: vérifie que le compte est exécutable et que l'adresse est celle du programme système
92+
1. `signer`: La contrainte `mut` est nécessaire puisque nous allons modifier ses lamports pendant les transferts.
93+
2. `vault`:
94+
- `mut` car nous allons modifier ses lamports.
95+
- `seeds` & `bumps` définit comment dériver un PDA valide à partir des seeds.
96+
3. `system_program`: vérifie que le compte est exécutable et que l'adresse est celle du programme système.
9797

9898
<ArticleSection name="Erreurs" id="errors" level="h2" />
9999

100100
Nous n'avons pas besoin de beaucoup d'erreurs pour ce petit programme, nous allons donc créer 2 enums :
101101
- `VaultAlreadyExists`: cela nous permet de savoir s'il y a déjà des lamports dans le compte. Cela signifierait dans ce cas que le vault existe déjà.
102102
- `InvalidAmount`: nous ne pouvons pas déposer un montant inférieur à la rente minimale d'un compte de base, nous vérifions donc que le montant est supérieur à cette rente.
103103

104-
Cela ressemblera à quelque chose comme ça :
104+
Cela ressemblera à quelque chose comme ça :
105105

106106
```rust
107107
#[error_code]
@@ -200,6 +200,6 @@ Commencez par compiler votre programme en utilisant la commande suivante dans vo
200200
anchor build
201201
```
202202

203-
Cela générera un fichier `.so` directement dans votre dossier `target/deploy`.
203+
Cela générera un fichier `.so` directement dans votre dossier `target/deploy`.
204204

205205
Cliquez ensuite sur le bouton `Relever le challenge` et déposez le fichier !

src/app/content/challenges/anchor-vault/id/challenge.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,10 @@ pub struct VaultAction<'info> {
9090
Mari kita uraikan setiap batasan akun:
9191

9292
1. `signer`: Batasan `mut` diperlukan karena kita akan memodifikasi lamports-nya selama transfer.
93-
2. `vault`:
94-
- `mut` karena kita akan memodifikasi lamports-nya
95-
- `seeds` & `bumps` mendefinisikan cara menurunkan PDA yang valid dari seeds
96-
3. `system_program`: memeriksa apakah akun diatur sebagai executable dan alamatnya adalah alamat System Program
93+
2. `vault`:
94+
- `mut` karena kita akan memodifikasi lamports-nya.
95+
- `seeds` & `bumps` mendefinisikan cara menurunkan PDA yang valid dari seeds.
96+
3. `system_program`: memeriksa apakah akun diatur sebagai executable dan alamatnya adalah alamat System Program.
9797

9898
<ArticleSection name="Errors" id="errors" level="h2" />
9999

src/app/content/challenges/anchor-vault/uk/challenge.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,18 @@ pub struct VaultAction<'info> {
9090
Розглянемо кожне обмеження облікового запису:
9191

9292
1. `signer`: Обмеження `mut` потрібне, оскільки ми будемо змінювати його лампорти під час переказів.
93-
2. `vault`:
94-
- `mut` тому що ми будемо змінювати його лампорти
95-
- `seeds` і `bumps` визначають, як отримати дійсний PDA з сідів
96-
3. `system_program`: перевіряє, чи обліковий запис встановлено як виконуваний, і чи адреса відповідає System Program
93+
2. `vault`:
94+
- `mut` тому що ми будемо змінювати його лампорти.
95+
- `seeds` і `bumps` визначають, як отримати дійсний PDA з сідів.
96+
3. `system_program`: перевіряє, чи обліковий запис встановлено як виконуваний, і чи адреса відповідає System Program.
9797

9898
<ArticleSection name="Errors" id="errors" level="h2" />
9999

100100
Для цієї невеликої програми нам не потрібно багато помилок, тому ми створимо лише 2 переліки:
101101
- `VaultAlreadyExists`: повідомляє нас, якщо в обліковому записі вже є лампорти, що означає, що сховище вже існує.
102102
- `InvalidAmount`: ми не можемо внести суму, меншу за мінімальну ренту для базового облікового запису, тому перевіряємо, що сума більша за це значення.
103103

104-
Це виглядатиме приблизно так:
104+
Це виглядатиме приблизно так:
105105

106106
```rust
107107
#[error_code]
@@ -200,6 +200,6 @@ transfer(
200200
anchor build
201201
```
202202

203-
Це згенерувало файл `.so` безпосередньо у вашій папці `target/deploy`.
203+
Це згенерувало файл `.so` безпосередньо у вашій папці `target/deploy`.
204204

205205
Тепер натисніть на кнопку `take challenge` і перетягніть туди файл!

src/app/content/challenges/anchor-vault/vi/challenge.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ Hãy phân tích từng ràng buộc của account:
9191

9292
1. `signer`: ràng buộc `mut` cần thiết vì chúng ta sẽ thay đổi lamport của account trong quá trình chuyển tiền.
9393
2. `vault`:
94-
- `mut` vì chúng ta sẽ thay đổi lamport của nó
95-
- `seeds` & `bumps` định nghĩa cách tạo PDA hợp lệ từ các seed
96-
3. `system_program`: kiểm tra xem account có được đặt thành executable và địa chỉ có phải là System Program không
94+
- `mut` vì chúng ta sẽ thay đổi lamport của nó.
95+
- `seeds` & `bumps` định nghĩa cách tạo PDA hợp lệ từ các seed.
96+
3. `system_program`: kiểm tra xem account có được đặt thành executable và địa chỉ có phải là System Program không.
9797

9898
<ArticleSection name="Errors" id="errors" level="h2" />
9999

src/app/content/challenges/anchor-vault/zh-CN/challenge.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ pub struct VaultAction<'info> {
9191

9292
1. `signer`:需要使用`mut`约束,因为我们将在转账过程中修改其 lamports。
9393
2. `vault`
94-
- `mut`,因为我们将在转账过程中修改其 lamports
95-
- `seeds``bumps` 定义了如何从种子派生出有效的 PDA
96-
3. `system_program`:检查账户是否设置为可执行,并且地址是否为系统程序地址
94+
- `mut`,因为我们将在转账过程中修改其 lamports
95+
- `seeds``bumps` 定义了如何从种子派生出有效的 PDA
96+
3. `system_program`:检查账户是否设置为可执行,并且地址是否为系统程序地址
9797

9898
<ArticleSection name="Errors" id="errors" level="h2" />
9999

src/app/content/challenges/anchor-vault/zh-HK/challenge.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@ pub struct VaultAction<'info> {
9191

9292
1. `signer`:需要 `mut` 約束,因為我們將在轉賬過程中修改其 lamports。
9393
2. `vault`
94-
- `mut`,因為我們將修改其 lamports
95-
- `seeds``bumps` 定義了如何從種子派生出有效的 PDA
96-
3. `system_program`:檢查帳戶是否設置為可執行,並且地址是否為系統程序的地址
94+
- `mut`,因為我們將修改其 lamports
95+
- `seeds``bumps` 定義了如何從種子派生出有效的 PDA
96+
3. `system_program`:檢查帳戶是否設置為可執行,並且地址是否為系統程序的地址
9797

9898
<ArticleSection name="Errors" id="errors" level="h2" />
9999

0 commit comments

Comments
 (0)