SHA256
Обновить казну и управление Shine Payments
This commit is contained in:
@@ -3,6 +3,7 @@ use pyth_solana_receiver_sdk::error::GetPriceError;
|
||||
use pyth_solana_receiver_sdk::price_update::{get_feed_id_from_hex, FeedId, PriceUpdateV2};
|
||||
use solana_program::{
|
||||
account_info::{next_account_info, AccountInfo},
|
||||
bpf_loader_upgradeable,
|
||||
clock::Clock,
|
||||
entrypoint,
|
||||
entrypoint::ProgramResult,
|
||||
@@ -30,6 +31,7 @@ const IX_BUY_TICKET_SOL: u8 = 6;
|
||||
const IX_MANAGER_ADD_TICKET: u8 = 7;
|
||||
const IX_STEP_PAYOUT: u8 = 8;
|
||||
const IX_CHANGE_TICKET_RECIPIENT: u8 = 9;
|
||||
const IX_UPDATE_DAO_TREASURY: u8 = 10;
|
||||
|
||||
/// Значение байта статуса тикета «закрыт пропуском без выплаты».
|
||||
const TICKET_STATUS_SKIPPED: u8 = 2;
|
||||
@@ -42,9 +44,9 @@ enum PaymentsError {
|
||||
InvalidPdaAddress = 3,
|
||||
EmptyState = 4,
|
||||
InvalidAccountData = 5,
|
||||
InvalidSettingsWallet = 6,
|
||||
InvalidSettingsTreasury = 6,
|
||||
InvalidInflowVault = 7,
|
||||
InvalidDaoWallet = 8,
|
||||
InvalidDaoTreasury = 8,
|
||||
UnauthorizedManager = 9,
|
||||
UnauthorizedDao = 10,
|
||||
InvalidCoefficient = 11,
|
||||
@@ -74,6 +76,7 @@ enum PaymentsError {
|
||||
InvalidSystemProgram = 35,
|
||||
PdaAlreadyExists = 36,
|
||||
TicketPurchaseTooSmall = 37,
|
||||
InvalidUpgradeAuthority = 38,
|
||||
}
|
||||
|
||||
impl From<PaymentsError> for ProgramError {
|
||||
@@ -145,10 +148,17 @@ pub struct ChangeTicketRecipientArgs {
|
||||
pub new_recipient_wallet: Pubkey,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct UpdateDaoTreasuryArgs {
|
||||
pub new_treasury: Pubkey,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ConfigState {
|
||||
pub version: u8,
|
||||
pub dao_wallet: Pubkey,
|
||||
/// Получатель доходов DAO. Это не административный signer: административные
|
||||
/// инструкции проверяют текущую upgrade authority ProgramData.
|
||||
pub dao_treasury: Pubkey,
|
||||
pub inflow_vault: Pubkey,
|
||||
}
|
||||
|
||||
@@ -274,7 +284,7 @@ impl StateCodec for ConfigState {
|
||||
fn encode(&self) -> Vec<u8> {
|
||||
let mut out = Vec::with_capacity(65);
|
||||
out.push(self.version);
|
||||
out.extend_from_slice(self.dao_wallet.as_ref());
|
||||
out.extend_from_slice(self.dao_treasury.as_ref());
|
||||
out.extend_from_slice(self.inflow_vault.as_ref());
|
||||
out
|
||||
}
|
||||
@@ -282,10 +292,10 @@ impl StateCodec for ConfigState {
|
||||
fn decode(data: &[u8]) -> Result<Self, ProgramError> {
|
||||
let mut reader = Reader::new(data, PaymentsError::InvalidAccountData.into());
|
||||
let version = reader.read_u8()?;
|
||||
let dao_wallet = reader.read_pubkey()?;
|
||||
let dao_treasury = reader.read_pubkey()?;
|
||||
let inflow_vault = reader.read_pubkey()?;
|
||||
require!(reader.cursor == data.len(), PaymentsError::InvalidAccountData);
|
||||
Ok(Self { version, dao_wallet, inflow_vault })
|
||||
Ok(Self { version, dao_treasury, inflow_vault })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -452,6 +462,7 @@ enum Instruction {
|
||||
ManagerAddTicket(ManagerAddTicketArgs),
|
||||
StepPayout,
|
||||
ChangeTicketRecipient(ChangeTicketRecipientArgs),
|
||||
UpdateDaoTreasury(UpdateDaoTreasuryArgs),
|
||||
}
|
||||
|
||||
pub fn process_instruction(
|
||||
@@ -469,6 +480,7 @@ pub fn process_instruction(
|
||||
Instruction::ManagerAddTicket(args) => process_manager_add_ticket(program_id, accounts, args),
|
||||
Instruction::StepPayout => process_step_payout(program_id, accounts),
|
||||
Instruction::ChangeTicketRecipient(args) => process_change_ticket_recipient(program_id, accounts, args),
|
||||
Instruction::UpdateDaoTreasury(args) => process_update_dao_treasury(program_id, accounts, args),
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,6 +525,9 @@ fn parse_instruction(data: &[u8]) -> Result<Instruction, ProgramError> {
|
||||
IX_CHANGE_TICKET_RECIPIENT => Instruction::ChangeTicketRecipient(ChangeTicketRecipientArgs {
|
||||
new_recipient_wallet: reader.read_pubkey()?,
|
||||
}),
|
||||
IX_UPDATE_DAO_TREASURY => Instruction::UpdateDaoTreasury(UpdateDaoTreasuryArgs {
|
||||
new_treasury: reader.read_pubkey()?,
|
||||
}),
|
||||
_ => return Err(ProgramError::InvalidInstructionData),
|
||||
};
|
||||
reader.finish()?;
|
||||
@@ -535,12 +550,12 @@ fn process_init(program_id: &Pubkey, accounts: &[AccountInfo]) -> ProgramResult
|
||||
require!(is_uninitialized_account(queues_pda), PaymentsError::SystemAlreadyInitialized);
|
||||
require!(is_uninitialized_account(inflow_vault_pda), PaymentsError::SystemAlreadyInitialized);
|
||||
|
||||
let dao_wallet = Pubkey::from_str(settings::DAO_WALLET)
|
||||
.map_err(|_| ProgramError::from(PaymentsError::InvalidSettingsWallet))?;
|
||||
let dao_treasury = Pubkey::from_str(settings::DEFAULT_DAO_TREASURY)
|
||||
.map_err(|_| ProgramError::from(PaymentsError::InvalidSettingsTreasury))?;
|
||||
|
||||
let config = ConfigState {
|
||||
version: 1,
|
||||
dao_wallet,
|
||||
dao_treasury,
|
||||
inflow_vault: *inflow_vault_pda.key,
|
||||
};
|
||||
create_and_store_state(
|
||||
@@ -617,12 +632,13 @@ fn process_update_coef_limit(
|
||||
let signer = next_signer_account(account_iter)?;
|
||||
let config_pda = next_account_info(account_iter)?;
|
||||
let coef_limit_pda = next_account_info(account_iter)?;
|
||||
let program_ai = next_account_info(account_iter)?;
|
||||
let programdata_ai = next_account_info(account_iter)?;
|
||||
require!(account_iter.next().is_none(), PaymentsError::InvalidInstruction);
|
||||
|
||||
validate_upgrade_authority(program_id, signer, program_ai, programdata_ai)?;
|
||||
validate_singleton_state_pda(program_id, config_pda, settings::CONFIG_SEED)?;
|
||||
validate_singleton_state_pda(program_id, coef_limit_pda, settings::COEF_LIMIT_SEED)?;
|
||||
let config = read_state::<ConfigState>(config_pda)?;
|
||||
require_keys_eq!(config.dao_wallet, *signer.key, PaymentsError::UnauthorizedDao);
|
||||
require!(args.coef_ppm > 0, PaymentsError::InvalidCoefficient);
|
||||
require!(args.limit_usd_cents > 0, PaymentsError::InvalidLimit);
|
||||
require!(
|
||||
@@ -643,16 +659,22 @@ fn process_grant_manager_limits(
|
||||
args: GrantManagerLimitsArgs,
|
||||
) -> ProgramResult {
|
||||
let account_iter = &mut accounts.iter();
|
||||
let signer = next_signer_account(account_iter)?;
|
||||
let authority = next_signer_account(account_iter)?;
|
||||
// Authority и плательщик rent разделены: после передачи authority DAO
|
||||
// governance PDA может авторизовать лимит, а обычный подписант оплатит
|
||||
// создание нового manager_allowance PDA.
|
||||
let rent_payer = next_signer_account(account_iter)?;
|
||||
let config_pda = next_account_info(account_iter)?;
|
||||
let manager_allowance_pda = next_account_info(account_iter)?;
|
||||
let system_program_ai = next_account_info(account_iter)?;
|
||||
let program_ai = next_account_info(account_iter)?;
|
||||
let programdata_ai = next_account_info(account_iter)?;
|
||||
require!(account_iter.next().is_none(), PaymentsError::InvalidInstruction);
|
||||
require_system_program(system_program_ai)?;
|
||||
require!(rent_payer.is_writable, PaymentsError::InvalidSigner);
|
||||
|
||||
validate_upgrade_authority(program_id, authority, program_ai, programdata_ai)?;
|
||||
validate_singleton_state_pda(program_id, config_pda, settings::CONFIG_SEED)?;
|
||||
let config = read_state::<ConfigState>(config_pda)?;
|
||||
require_keys_eq!(config.dao_wallet, *signer.key, PaymentsError::UnauthorizedDao);
|
||||
require!(
|
||||
args.add_q1_usd_cents > 0 || args.add_q2_usd_cents > 0 || args.add_q3_usd_cents > 0,
|
||||
PaymentsError::InvalidAmount
|
||||
@@ -671,7 +693,7 @@ fn process_grant_manager_limits(
|
||||
};
|
||||
create_state_with_seeds(
|
||||
program_id,
|
||||
signer,
|
||||
rent_payer,
|
||||
system_program_ai,
|
||||
manager_allowance_pda,
|
||||
&[
|
||||
@@ -694,6 +716,29 @@ fn process_grant_manager_limits(
|
||||
write_state(manager_allowance_pda, &state)
|
||||
}
|
||||
|
||||
/// Меняет только адрес, куда программа направляет DAO-доходы. Право берётся
|
||||
/// из ProgramData, поэтому после передачи upgrade authority оно автоматически
|
||||
/// переходит governance PDA DAO.
|
||||
fn process_update_dao_treasury(
|
||||
program_id: &Pubkey,
|
||||
accounts: &[AccountInfo],
|
||||
args: UpdateDaoTreasuryArgs,
|
||||
) -> ProgramResult {
|
||||
let account_iter = &mut accounts.iter();
|
||||
let signer = next_signer_account(account_iter)?;
|
||||
let config_pda = next_account_info(account_iter)?;
|
||||
let program_ai = next_account_info(account_iter)?;
|
||||
let programdata_ai = next_account_info(account_iter)?;
|
||||
require!(account_iter.next().is_none(), PaymentsError::InvalidInstruction);
|
||||
|
||||
validate_upgrade_authority(program_id, signer, program_ai, programdata_ai)?;
|
||||
validate_singleton_state_pda(program_id, config_pda, settings::CONFIG_SEED)?;
|
||||
require!(config_pda.is_writable, PaymentsError::InvalidAccountData);
|
||||
let mut config = read_state::<ConfigState>(config_pda)?;
|
||||
config.dao_treasury = args.new_treasury;
|
||||
write_state(config_pda, &config)
|
||||
}
|
||||
|
||||
fn process_buy_ticket(
|
||||
program_id: &Pubkey,
|
||||
accounts: &[AccountInfo],
|
||||
@@ -812,7 +857,7 @@ fn process_step_payout(program_id: &Pubkey, accounts: &[AccountInfo]) -> Program
|
||||
let inflow_vault_pda = next_account_info(account_iter)?;
|
||||
let next_ticket_pda = next_account_info(account_iter)?;
|
||||
let ticket_recipient_wallet = next_account_info(account_iter)?;
|
||||
let dao_wallet = next_account_info(account_iter)?;
|
||||
let dao_treasury = next_account_info(account_iter)?;
|
||||
let sol_usd_price_update = next_account_info(account_iter)?;
|
||||
require!(account_iter.next().is_none(), PaymentsError::InvalidInstruction);
|
||||
|
||||
@@ -825,7 +870,7 @@ fn process_step_payout(program_id: &Pubkey, accounts: &[AccountInfo]) -> Program
|
||||
let mut queues = read_state::<QueuesState>(queues_pda)?;
|
||||
let _vault_state = read_state::<VaultState>(inflow_vault_pda)?;
|
||||
|
||||
require_keys_eq!(*dao_wallet.key, config.dao_wallet, PaymentsError::InvalidDaoWallet);
|
||||
require_keys_eq!(*dao_treasury.key, config.dao_treasury, PaymentsError::InvalidDaoTreasury);
|
||||
require_keys_eq!(*inflow_vault_pda.key, config.inflow_vault, PaymentsError::InvalidInflowVault);
|
||||
|
||||
let q1_pending = checked_sub(queues.q1_tickets_total, queues.q1_tickets_paid)?;
|
||||
@@ -833,7 +878,7 @@ fn process_step_payout(program_id: &Pubkey, accounts: &[AccountInfo]) -> Program
|
||||
let q3_pending = checked_sub(queues.q3_tickets_total, queues.q3_tickets_paid)?;
|
||||
|
||||
if q1_pending == 0 && q2_pending == 0 && q3_pending == 0 {
|
||||
transfer_all_available_to_dao(inflow_vault_pda, dao_wallet)?;
|
||||
transfer_all_available_to_dao(inflow_vault_pda, dao_treasury)?;
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
@@ -882,7 +927,7 @@ fn process_step_payout(program_id: &Pubkey, accounts: &[AccountInfo]) -> Program
|
||||
require!(available_vault_lamports(inflow_vault_pda)? >= needed, PaymentsError::NotEnoughInflowForStep);
|
||||
|
||||
transfer_from_vault(inflow_vault_pda, ticket_recipient_wallet, ticket_lamports)?;
|
||||
transfer_from_vault(inflow_vault_pda, dao_wallet, dao_lamports)?;
|
||||
transfer_from_vault(inflow_vault_pda, dao_treasury, dao_lamports)?;
|
||||
transfer_from_vault(inflow_vault_pda, signer, coef_limit.call_reward_lamports)?;
|
||||
|
||||
ticket.is_paid = true;
|
||||
@@ -948,7 +993,7 @@ struct BuyTicketAccounts<'a, 'info> {
|
||||
coef_limit_pda: &'a AccountInfo<'info>,
|
||||
queues_pda: &'a AccountInfo<'info>,
|
||||
ticket_pda: &'a AccountInfo<'info>,
|
||||
dao_wallet: &'a AccountInfo<'info>,
|
||||
dao_treasury: &'a AccountInfo<'info>,
|
||||
sol_usd_price_update: &'a AccountInfo<'info>,
|
||||
system_program_ai: &'a AccountInfo<'info>,
|
||||
}
|
||||
@@ -961,7 +1006,7 @@ impl<'a, 'info> BuyTicketAccounts<'a, 'info> {
|
||||
let coef_limit_pda = next_account_info(account_iter)?;
|
||||
let queues_pda = next_account_info(account_iter)?;
|
||||
let ticket_pda = next_account_info(account_iter)?;
|
||||
let dao_wallet = next_account_info(account_iter)?;
|
||||
let dao_treasury = next_account_info(account_iter)?;
|
||||
let sol_usd_price_update = next_account_info(account_iter)?;
|
||||
let system_program_ai = next_account_info(account_iter)?;
|
||||
require!(account_iter.next().is_none(), PaymentsError::InvalidInstruction);
|
||||
@@ -972,7 +1017,7 @@ impl<'a, 'info> BuyTicketAccounts<'a, 'info> {
|
||||
coef_limit_pda,
|
||||
queues_pda,
|
||||
ticket_pda,
|
||||
dao_wallet,
|
||||
dao_treasury,
|
||||
sol_usd_price_update,
|
||||
system_program_ai,
|
||||
})
|
||||
@@ -1008,6 +1053,46 @@ fn validate_singleton_state_pda(
|
||||
Ok(())
|
||||
}
|
||||
|
||||
/// Проверяет не переданный клиентом адрес, а текущую upgrade authority ProgramData
|
||||
/// именно этой программы. Layout соответствует UpgradeableLoaderState:
|
||||
/// Program = [2:u32LE, programdata:32], ProgramData =
|
||||
/// [3:u32LE, slot:u64LE, Option<Pubkey>:1+32].
|
||||
fn validate_upgrade_authority(
|
||||
program_id: &Pubkey,
|
||||
signer: &AccountInfo,
|
||||
program_ai: &AccountInfo,
|
||||
programdata_ai: &AccountInfo,
|
||||
) -> ProgramResult {
|
||||
require!(signer.is_signer, PaymentsError::InvalidSigner);
|
||||
require_keys_eq!(*program_ai.key, *program_id, PaymentsError::InvalidUpgradeAuthority);
|
||||
require!(
|
||||
program_ai.executable && *program_ai.owner == bpf_loader_upgradeable::id(),
|
||||
PaymentsError::InvalidUpgradeAuthority
|
||||
);
|
||||
let program_data = program_ai.try_borrow_data()?;
|
||||
require!(
|
||||
program_data.len() >= 36 && program_data[0..4] == 2u32.to_le_bytes(),
|
||||
PaymentsError::InvalidUpgradeAuthority
|
||||
);
|
||||
require!(
|
||||
program_data[4..36] == programdata_ai.key.to_bytes(),
|
||||
PaymentsError::InvalidUpgradeAuthority
|
||||
);
|
||||
require!(
|
||||
*programdata_ai.owner == bpf_loader_upgradeable::id(),
|
||||
PaymentsError::InvalidUpgradeAuthority
|
||||
);
|
||||
let programdata = programdata_ai.try_borrow_data()?;
|
||||
require!(
|
||||
programdata.len() >= 45
|
||||
&& programdata[0..4] == 3u32.to_le_bytes()
|
||||
&& programdata[12] == 1
|
||||
&& programdata[13..45] == signer.key.to_bytes(),
|
||||
PaymentsError::InvalidUpgradeAuthority
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn find_single_pda(program_id: &Pubkey, seed: &[u8]) -> (Pubkey, u8) {
|
||||
Pubkey::find_program_address(&[seed], program_id)
|
||||
}
|
||||
@@ -1050,7 +1135,7 @@ fn buy_ticket_by_purchase_usd(
|
||||
let coef_limit = read_state::<CoefLimitState>(ctx.coef_limit_pda)?;
|
||||
let mut queues = read_state::<QueuesState>(ctx.queues_pda)?;
|
||||
|
||||
require_keys_eq!(*ctx.dao_wallet.key, config.dao_wallet, PaymentsError::InvalidDaoWallet);
|
||||
require_keys_eq!(*ctx.dao_treasury.key, config.dao_treasury, PaymentsError::InvalidDaoTreasury);
|
||||
// Получатель тикета не должен совпадать с inflow-вольтом: иначе в step_payout
|
||||
// вольт окажется и источником, и получателем перевода (алиасинг одного аккаунта),
|
||||
// второй mutable-займ в transfer_from_vault упадёт, и такой тикет навсегда
|
||||
@@ -1074,7 +1159,7 @@ fn buy_ticket_by_purchase_usd(
|
||||
let payout_usd_cents = checked_mul(purchase_usd_cents, coef_limit.coef_ppm)? / settings::COEF_SCALE_PPM;
|
||||
require!(payout_usd_cents > 0, PaymentsError::InvalidPayoutAmount);
|
||||
|
||||
transfer_from_signer_to_target(ctx.signer, ctx.dao_wallet, ctx.system_program_ai, transfer_lamports)?;
|
||||
transfer_from_signer_to_target(ctx.signer, ctx.dao_treasury, ctx.system_program_ai, transfer_lamports)?;
|
||||
|
||||
let ticket = TicketState {
|
||||
version: 1,
|
||||
@@ -1348,9 +1433,9 @@ fn credit_leaves_rent_exempt(lamports: u64, amount: u64, min_balance: u64) -> bo
|
||||
lamports.saturating_add(amount) >= min_balance
|
||||
}
|
||||
|
||||
fn transfer_all_available_to_dao(vault: &AccountInfo, dao_wallet: &AccountInfo) -> ProgramResult {
|
||||
fn transfer_all_available_to_dao(vault: &AccountInfo, dao_treasury: &AccountInfo) -> ProgramResult {
|
||||
let available = available_vault_lamports(vault)?;
|
||||
transfer_from_vault(vault, dao_wallet, available)
|
||||
transfer_from_vault(vault, dao_treasury, available)
|
||||
}
|
||||
|
||||
fn next_signer_account<'a, 'info>(
|
||||
@@ -1553,4 +1638,86 @@ mod tests {
|
||||
// Награда за шаг выплаты — не больше 10% минимального тикета.
|
||||
assert!(settings::MAX_CALL_REWARD_LAMPORTS * 10 <= settings::MIN_TICKET_PURCHASE_LAMPORTS);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn config_treasury_keeps_existing_binary_layout() {
|
||||
let config = ConfigState {
|
||||
version: 1,
|
||||
dao_treasury: Pubkey::new_from_array([4; 32]),
|
||||
inflow_vault: Pubkey::new_from_array([5; 32]),
|
||||
};
|
||||
let encoded = config.encode();
|
||||
assert_eq!(encoded.len(), ConfigState::encoded_len());
|
||||
assert_eq!(encoded[0], 1);
|
||||
assert_eq!(&encoded[1..33], &[4; 32]);
|
||||
assert_eq!(&encoded[33..65], &[5; 32]);
|
||||
let decoded = ConfigState::decode(&encoded).unwrap();
|
||||
assert_eq!(decoded.dao_treasury, config.dao_treasury);
|
||||
assert_eq!(decoded.inflow_vault, config.inflow_vault);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn update_dao_treasury_instruction_is_parsed() {
|
||||
let treasury = Pubkey::new_from_array([6; 32]);
|
||||
let mut data = vec![IX_UPDATE_DAO_TREASURY];
|
||||
data.extend_from_slice(treasury.as_ref());
|
||||
match parse_instruction(&data).unwrap() {
|
||||
Instruction::UpdateDaoTreasury(args) => assert_eq!(args.new_treasury, treasury),
|
||||
_ => panic!("ожидалась инструкция update_dao_treasury"),
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn upgrade_authority_is_read_only_from_own_programdata() {
|
||||
let signer_key = Pubkey::new_from_array([7; 32]);
|
||||
let programdata_key = Pubkey::new_from_array([8; 32]);
|
||||
let loader = bpf_loader_upgradeable::id();
|
||||
let system_owner = system_program::id();
|
||||
|
||||
let mut signer_lamports = 0;
|
||||
let mut signer_data: [u8; 0] = [];
|
||||
let signer = AccountInfo::new(
|
||||
&signer_key,
|
||||
true,
|
||||
false,
|
||||
&mut signer_lamports,
|
||||
&mut signer_data,
|
||||
&system_owner,
|
||||
false,
|
||||
0,
|
||||
);
|
||||
|
||||
let mut program_lamports = 0;
|
||||
let mut program_data = vec![0; 36];
|
||||
program_data[..4].copy_from_slice(&2u32.to_le_bytes());
|
||||
program_data[4..36].copy_from_slice(programdata_key.as_ref());
|
||||
let program = AccountInfo::new(
|
||||
&ID,
|
||||
false,
|
||||
false,
|
||||
&mut program_lamports,
|
||||
&mut program_data,
|
||||
&loader,
|
||||
true,
|
||||
0,
|
||||
);
|
||||
|
||||
let mut programdata_lamports = 0;
|
||||
let mut programdata_data = vec![0; 45];
|
||||
programdata_data[..4].copy_from_slice(&3u32.to_le_bytes());
|
||||
programdata_data[12] = 1;
|
||||
programdata_data[13..45].copy_from_slice(signer_key.as_ref());
|
||||
let programdata = AccountInfo::new(
|
||||
&programdata_key,
|
||||
false,
|
||||
false,
|
||||
&mut programdata_lamports,
|
||||
&mut programdata_data,
|
||||
&loader,
|
||||
false,
|
||||
0,
|
||||
);
|
||||
|
||||
assert!(validate_upgrade_authority(&ID, &signer, &program, &programdata).is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,5 +112,7 @@ pub const RESERVED_RECIPIENTS: &[Pubkey] = &[
|
||||
pubkey!("SHiGxGsXGioQYCYhchQ5R7KWoxN5UjFAFsucPf6sfnh"),
|
||||
];
|
||||
|
||||
/// `DAO_WALLET` — адрес кошелька DAO-казны для `shine_payments`.
|
||||
pub const DAO_WALLET: &str = "aiShm43fZjm3YkMs22sYL1bpXaL3bVxv7SSraPHzVgq";
|
||||
/// `DEFAULT_DAO_TREASURY` — адрес native treasury основного DAO. Он записывается
|
||||
/// в новый Config PDA при публичном `init`; для каждого кластера его можно заменить
|
||||
/// отдельной инструкцией, подписанной текущей upgrade authority программы.
|
||||
pub const DEFAULT_DAO_TREASURY: &str = "AcJRevXj3Yux2ecxXromMwwxEpPBz6AN53hH6KdqWJ9A";
|
||||
|
||||
Reference in New Issue
Block a user