Browse Source

examples: Fix token init (#610)

Armani Ferrante 4 năm trước cách đây
mục cha
commit
941e439429
1 tập tin đã thay đổi với 4 bổ sung0 xóa
  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,