Pārlūkot izejas kodu

examples: Fix token init (#610)

Armani Ferrante 4 gadi atpakaļ
vecāks
revīzija
941e439429
1 mainītis faili ar 4 papildinājumiem un 0 dzēšanām
  1. 4 0
      examples/cfo/programs/cfo/src/lib.rs

+ 4 - 0
examples/cfo/programs/cfo/src/lib.rs

@@ -293,6 +293,7 @@ pub struct CreateOfficer<'info> {
     #[account(
         init,
         token::mint = mint,
+        token::authority = officer,
         associated = officer, with = b"vault",
         payer = authority,
     )]
@@ -300,6 +301,7 @@ pub struct CreateOfficer<'info> {
     #[account(
         init,
         token::mint = mint,
+        token::authority = officer,
         associated = officer, with = b"stake",
         space = TokenAccount::LEN,
         payer = authority,
@@ -308,6 +310,7 @@ pub struct CreateOfficer<'info> {
     #[account(
         init,
         token::mint = mint,
+        token::authority = officer,
         associated = officer, with = b"treasury",
         payer = authority,
     )]
@@ -336,6 +339,7 @@ pub struct CreateOfficerToken<'info> {
     #[account(
         init,
         token::mint = mint,
+        token::authority = officer,
         associated = officer, with = mint,
         space = TokenAccount::LEN,
         payer = payer,