mirror of
https://github.com/d0zingcat/ore.git
synced 2026-05-13 15:09:57 +00:00
sdk
This commit is contained in:
@@ -148,19 +148,19 @@ pub fn claim_ore(signer: Pubkey, amount: u64) -> Instruction {
|
||||
}
|
||||
}
|
||||
|
||||
// let [signer_info, board_info, config_info, fee_collector_info, miner_info, sender_info, square_info, system_program] =
|
||||
// let [signer_info, authority_info, automation_info, board_info, miner_info, round_info, system_program] =
|
||||
|
||||
pub fn deploy(
|
||||
signer: Pubkey,
|
||||
authority: Pubkey,
|
||||
amount: u64,
|
||||
round_id: u64,
|
||||
squares: [bool; 25],
|
||||
alt_miners: Vec<Pubkey>,
|
||||
) -> Instruction {
|
||||
let automation_address = automation_pda(authority).0;
|
||||
let board_address = board_pda().0;
|
||||
let miner_address = miner_pda(authority).0;
|
||||
// let square_address = square_pda().0;
|
||||
let round_address = round_pda(round_id).0;
|
||||
|
||||
// Convert array of 25 booleans into a 32-bit mask where each bit represents whether
|
||||
// that square index is selected (1) or not (0)
|
||||
@@ -171,26 +171,17 @@ pub fn deploy(
|
||||
}
|
||||
}
|
||||
|
||||
let mut accounts = vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(authority, false),
|
||||
AccountMeta::new(automation_address, false),
|
||||
AccountMeta::new(board_address, false),
|
||||
AccountMeta::new(miner_address, false),
|
||||
// AccountMeta::new(square_address, false),
|
||||
AccountMeta::new_readonly(system_program::ID, false),
|
||||
];
|
||||
|
||||
// Add miners that might need to be refunded.
|
||||
for miner in alt_miners {
|
||||
if miner != Pubkey::default() {
|
||||
accounts.push(AccountMeta::new(miner_pda(miner).0, false));
|
||||
}
|
||||
}
|
||||
|
||||
Instruction {
|
||||
program_id: crate::ID,
|
||||
accounts,
|
||||
accounts: vec![
|
||||
AccountMeta::new(signer, true),
|
||||
AccountMeta::new(authority, false),
|
||||
AccountMeta::new(automation_address, false),
|
||||
AccountMeta::new(board_address, false),
|
||||
AccountMeta::new(miner_address, false),
|
||||
AccountMeta::new(round_address, false),
|
||||
AccountMeta::new_readonly(system_program::ID, false),
|
||||
],
|
||||
data: Deploy {
|
||||
amount: amount.to_le_bytes(),
|
||||
squares: mask.to_le_bytes(),
|
||||
|
||||
Reference in New Issue
Block a user