31 lines
786 B
Rust
31 lines
786 B
Rust
|
use crate::{error::MangoError, state::*};
|
||
|
use anchor_lang::prelude::*;
|
||
|
use anchor_spl::token::Mint;
|
||
|
|
||
|
#[derive(Accounts)]
|
||
|
pub struct StubOracleCreate<'info> {
|
||
|
#[account(
|
||
|
has_one = admin,
|
||
|
constraint = group.load()?.is_ix_enabled(IxGate::StubOracleCreate) @ MangoError::IxIsDisabled,
|
||
|
)]
|
||
|
pub group: AccountLoader<'info, Group>,
|
||
|
|
||
|
#[account(
|
||
|
init,
|
||
|
seeds = [b"StubOracle".as_ref(), group.key().as_ref(), mint.key().as_ref()],
|
||
|
bump,
|
||
|
payer = payer,
|
||
|
space = 8 + std::mem::size_of::<StubOracle>(),
|
||
|
)]
|
||
|
pub oracle: AccountLoader<'info, StubOracle>,
|
||
|
|
||
|
pub admin: Signer<'info>,
|
||
|
|
||
|
pub mint: Account<'info, Mint>,
|
||
|
|
||
|
#[account(mut)]
|
||
|
pub payer: Signer<'info>,
|
||
|
|
||
|
pub system_program: Program<'info, System>,
|
||
|
}
|