1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
pub mod constants;
pub mod errors;
pub mod processor;
pub mod state;
pub mod utils;

use anchor_lang::prelude::*;
pub use errors::CandyError;
pub use processor::*;
pub use state::*;
pub use utils::*;
declare_id!("cndy3Z4yapfJBmL3ShUp5exZKqR3z33thTzeNMm2gRZ");

#[program]
pub mod candy_machine {

    use super::*;

    pub fn initialize_candy_machine(
        ctx: Context<InitializeCandyMachine>,
        data: CandyMachineData,
    ) -> Result<()> {
        handle_initialize_candy_machine(ctx, data)
    }

    pub fn update_candy_machine(
        ctx: Context<UpdateCandyMachine>,
        data: CandyMachineData,
    ) -> Result<()> {
        handle_update_candy_machine(ctx, data)
    }

    pub fn update_authority(
        ctx: Context<UpdateCandyMachine>,
        new_authority: Option<Pubkey>,
    ) -> Result<()> {
        handle_update_authority(ctx, new_authority)
    }

    pub fn add_config_lines(
        ctx: Context<AddConfigLines>,
        index: u32,
        config_lines: Vec<ConfigLine>,
    ) -> Result<()> {
        handle_add_config_lines(ctx, index, config_lines)
    }

    pub fn set_collection(ctx: Context<SetCollection>) -> Result<()> {
        handle_set_collection(ctx)
    }

    pub fn remove_collection(ctx: Context<RemoveCollection>) -> Result<()> {
        handle_remove_collection(ctx)
    }

    pub fn mint_nft<'info>(
        ctx: Context<'_, '_, '_, 'info, MintNFT<'info>>,
        creator_bump: u8,
    ) -> Result<()> {
        handle_mint_nft(ctx, creator_bump)
    }

    pub fn set_collection_during_mint(ctx: Context<SetCollectionDuringMint>) -> Result<()> {
        handle_set_collection_during_mint(ctx)
    }

    pub fn withdraw_funds<'info>(ctx: Context<WithdrawFunds<'info>>) -> Result<()> {
        handle_withdraw_funds(ctx)
    }
}