fix: распаковать источник из обёртки smart-updown в корень ветки
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
use anchor_lang::prelude::*;
|
||||
|
||||
use crate::{constants::GLOBAL_SEED, state::Global};
|
||||
|
||||
#[derive(Accounts)]
|
||||
pub struct Initialize {
|
||||
#[account(mut)]
|
||||
pub admin: Signer,
|
||||
#[account(
|
||||
init,
|
||||
payer = admin,
|
||||
seeds = [GLOBAL_SEED],
|
||||
bump
|
||||
)]
|
||||
pub global: Account<Global>,
|
||||
pub system_program: Program<System>,
|
||||
}
|
||||
|
||||
pub fn handler(
|
||||
ctx: &mut Context<Initialize>,
|
||||
min_amount: u64,
|
||||
max_amount: u64,
|
||||
multiplier_bps: u64,
|
||||
expiry_seconds: i64,
|
||||
) -> Result<()> {
|
||||
let global = &mut ctx.accounts.global;
|
||||
global.admin = *ctx.accounts.admin.address();
|
||||
global.relayer = *ctx.accounts.admin.address();
|
||||
global.counter = 0;
|
||||
global.min_amount = min_amount;
|
||||
global.max_amount = max_amount;
|
||||
global.multiplier_bps = multiplier_bps;
|
||||
global.paused = 0;
|
||||
global.expiry_seconds = expiry_seconds;
|
||||
Ok(())
|
||||
}
|
||||
Reference in New Issue
Block a user