@@ -6,6 +6,7 @@ use solana_program::instruction::AccountMeta;
6
6
use solana_program:: instruction:: Instruction ;
7
7
use solana_program:: program_error:: ProgramError ;
8
8
use solana_program:: pubkey:: Pubkey ;
9
+ use solana_program:: sysvar;
9
10
use std:: mem:: size_of;
10
11
11
12
/// Fee rate as a ratio
@@ -50,7 +51,9 @@ pub enum StakePoolInstruction {
50
51
/// 4. `[w]` User account to receive pool tokens
51
52
/// 5. `[w]` Account to receive pool fee tokens
52
53
/// 6. `[w]` Pool token mint account
53
- /// 7. `[]` Pool token program id
54
+ /// 7. '[]' Sysvar clock account (reserved for future use)
55
+ /// 8. `[]` Pool token program id,
56
+ /// 9. `[]` Stake program id,
54
57
Deposit ,
55
58
56
59
/// Withdraw the token from the pool at the current ratio.
@@ -63,7 +66,9 @@ pub enum StakePoolInstruction {
63
66
/// 4. `[]` User account to set as a new withdraw authority
64
67
/// 5. `[w]` User account with pool tokens to burn from
65
68
/// 6. `[w]` Pool token mint account
66
- /// 7. `[]` Pool token program id
69
+ /// 7. '[]' Sysvar clock account (reserved for future use)
70
+ /// 8. `[]` Pool token program id
71
+ /// 9. `[]` Stake program id,
67
72
/// userdata: amount to withdraw
68
73
Withdraw ( u64 ) ,
69
74
@@ -76,7 +81,9 @@ pub enum StakePoolInstruction {
76
81
/// 3. `[]` User account to set as a new withdraw authority
77
82
/// 4. `[w]` User account with pool tokens to burn from
78
83
/// 5. `[w]` Pool token mint account
79
- /// 6. `[]` Pool token program id
84
+ /// 6. '[]' Sysvar clock account (reserved for future use)
85
+ /// 7. `[]` Pool token program id
86
+ /// 8. `[]` Stake program id,
80
87
Claim ,
81
88
82
89
/// Update the staking pubkey for a stake
@@ -86,6 +93,8 @@ pub enum StakePoolInstruction {
86
93
/// 2. `[]` withdraw authority
87
94
/// 3. `[w]` Stake to update the staking pubkey
88
95
/// 4. '[]` Staking pubkey.
96
+ /// 5. '[]' Sysvar clock account (reserved for future use)
97
+ /// 6. `[]` Stake program id,
89
98
SetStakingAuthority ,
90
99
91
100
/// Update owner
@@ -202,6 +211,7 @@ pub fn deposit(
202
211
pool_fee_to : & Pubkey ,
203
212
pool_mint : & Pubkey ,
204
213
token_program_id : & Pubkey ,
214
+ stake_program_id : & Pubkey ,
205
215
) -> Result < Instruction , ProgramError > {
206
216
let args = StakePoolInstruction :: Deposit ;
207
217
let data = args. serialize ( ) ?;
@@ -213,7 +223,9 @@ pub fn deposit(
213
223
AccountMeta :: new( * pool_tokens_to, false ) ,
214
224
AccountMeta :: new( * pool_fee_to, false ) ,
215
225
AccountMeta :: new( * pool_mint, false ) ,
226
+ AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
216
227
AccountMeta :: new_readonly( * token_program_id, false ) ,
228
+ AccountMeta :: new_readonly( * stake_program_id, false ) ,
217
229
] ;
218
230
Ok ( Instruction {
219
231
program_id : * program_id,
@@ -233,6 +245,7 @@ pub fn withdraw(
233
245
burn_from : & Pubkey ,
234
246
pool_mint : & Pubkey ,
235
247
token_program_id : & Pubkey ,
248
+ stake_program_id : & Pubkey ,
236
249
amount : u64 ,
237
250
) -> Result < Instruction , ProgramError > {
238
251
let args = StakePoolInstruction :: Withdraw ( amount) ;
@@ -245,7 +258,9 @@ pub fn withdraw(
245
258
AccountMeta :: new_readonly( * user_withdrawer, false ) ,
246
259
AccountMeta :: new( * burn_from, true ) ,
247
260
AccountMeta :: new( * pool_mint, false ) ,
261
+ AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
248
262
AccountMeta :: new_readonly( * token_program_id, false ) ,
263
+ AccountMeta :: new_readonly( * stake_program_id, false ) ,
249
264
] ;
250
265
Ok ( Instruction {
251
266
program_id : * program_id,
@@ -264,6 +279,7 @@ pub fn claim(
264
279
burn_from : & Pubkey ,
265
280
pool_mint : & Pubkey ,
266
281
token_program_id : & Pubkey ,
282
+ stake_program_id : & Pubkey ,
267
283
amount : u64 ,
268
284
) -> Result < Instruction , ProgramError > {
269
285
let args = StakePoolInstruction :: Withdraw ( amount) ;
@@ -275,7 +291,9 @@ pub fn claim(
275
291
AccountMeta :: new_readonly( * user_withdrawer, false ) ,
276
292
AccountMeta :: new( * burn_from, true ) ,
277
293
AccountMeta :: new( * pool_mint, false ) ,
294
+ AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
278
295
AccountMeta :: new_readonly( * token_program_id, false ) ,
296
+ AccountMeta :: new_readonly( * stake_program_id, false ) ,
279
297
] ;
280
298
Ok ( Instruction {
281
299
program_id : * program_id,
@@ -292,6 +310,7 @@ pub fn set_staking_authority(
292
310
stake_pool_withdraw : & Pubkey ,
293
311
stake_account_to_update : & Pubkey ,
294
312
stake_account_new_authority : & Pubkey ,
313
+ stake_program_id : & Pubkey ,
295
314
) -> Result < Instruction , ProgramError > {
296
315
let args = StakePoolInstruction :: SetStakingAuthority ;
297
316
let data = args. serialize ( ) ?;
@@ -301,6 +320,8 @@ pub fn set_staking_authority(
301
320
AccountMeta :: new_readonly( * stake_pool_withdraw, false ) ,
302
321
AccountMeta :: new( * stake_account_to_update, false ) ,
303
322
AccountMeta :: new_readonly( * stake_account_new_authority, false ) ,
323
+ AccountMeta :: new_readonly( sysvar:: clock:: id( ) , false ) ,
324
+ AccountMeta :: new_readonly( * stake_program_id, false ) ,
304
325
] ;
305
326
Ok ( Instruction {
306
327
program_id : * program_id,
0 commit comments