#![allow(
clippy::all,
clippy::pedantic,
clippy::nursery,
clippy::expect_used,
clippy::unwrap_used,
clippy::indexing_slicing,
clippy::allow_attributes,
clippy::allow_attributes_without_reason,
clippy::mem_forget,
unfulfilled_lint_expectations,
unexpected_cfgs,
unused_imports
)]
use solana_address::Address;
use crate::launchpad::generated::SEND_LAUNCHPAD_ID;
pub const CREATOR_FEE_CONFIG_SEED: &'static [u8] = &[
99, 114, 101, 97, 116, 111, 114, 95, 102, 101, 101, 95, 99, 111, 110, 102,
105, 103,
];
pub fn create_creator_fee_config_pda(
base_mint: Address,
quote_mint: Address,
bump: u8,
) -> Result<solana_address::Address, solana_address::error::AddressError> {
solana_address::Address::create_program_address(
&[
CREATOR_FEE_CONFIG_SEED,
base_mint.as_ref(),
quote_mint.as_ref(),
&[bump],
],
&SEND_LAUNCHPAD_ID,
)
}
pub fn find_creator_fee_config_pda(
base_mint: &Address,
quote_mint: &Address,
) -> (solana_address::Address, u8) {
solana_address::Address::find_program_address(
&[
CREATOR_FEE_CONFIG_SEED,
base_mint.as_ref(),
quote_mint.as_ref(),
],
&SEND_LAUNCHPAD_ID,
)
}