Skip to content

Commit

Permalink
disable tip collection ix
Browse files Browse the repository at this point in the history
  • Loading branch information
miralandlabs committed Aug 12, 2024
1 parent 40b366f commit 5edf962
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions src/gateway/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,35 +230,35 @@ impl Gateway {
// Add in user instructions
final_ixs.extend_from_slice(ixs);

// Add tip collection instructions
if self.rpc_url.eq(RPC_URL) {
let mut rng = rand::thread_rng();
let tip_accounts = &[
// Miraland donation account only
Pubkey::from_str("9h9TXFtSsDAiL5kpCRZuKUxPE4Nv3W56fcSyUC3zmQip").unwrap(),
];
let i = rng.gen_range(0..tip_accounts.len());
let ix = solana_sdk::system_instruction::transfer(
&signer.pubkey(),
&tip_accounts[i],
TIP_AMOUNT,
);
final_ixs.push(ix);
} else {
// half tip
let mut rng = rand::thread_rng();
let tip_accounts = &[
// Miraland donation account only
Pubkey::from_str("9h9TXFtSsDAiL5kpCRZuKUxPE4Nv3W56fcSyUC3zmQip").unwrap(),
];
let i = rng.gen_range(0..tip_accounts.len());
let ix = solana_sdk::system_instruction::transfer(
&signer.pubkey(),
&tip_accounts[i],
TIP_AMOUNT / 2,
);
final_ixs.push(ix);
}
// // Add tip collection instructions
// if self.rpc_url.eq(RPC_URL) {
// let mut rng = rand::thread_rng();
// let tip_accounts = &[
// // Miraland donation account only
// Pubkey::from_str("9h9TXFtSsDAiL5kpCRZuKUxPE4Nv3W56fcSyUC3zmQip").unwrap(),
// ];
// let i = rng.gen_range(0..tip_accounts.len());
// let ix = solana_sdk::system_instruction::transfer(
// &signer.pubkey(),
// &tip_accounts[i],
// TIP_AMOUNT,
// );
// final_ixs.push(ix);
// } else {
// // half tip
// let mut rng = rand::thread_rng();
// let tip_accounts = &[
// // Miraland donation account only
// Pubkey::from_str("9h9TXFtSsDAiL5kpCRZuKUxPE4Nv3W56fcSyUC3zmQip").unwrap(),
// ];
// let i = rng.gen_range(0..tip_accounts.len());
// let ix = solana_sdk::system_instruction::transfer(
// &signer.pubkey(),
// &tip_accounts[i],
// TIP_AMOUNT / 2,
// );
// final_ixs.push(ix);
// }

// Build tx
let send_cfg = RpcSendTransactionConfig {
Expand Down

0 comments on commit 5edf962

Please sign in to comment.