123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- use anchor_lang::prelude::*;
- declare_id!("FmpfPa1LHEYRbueNMnwNVd2JvyQ89GXGWdyZEXNNKV8w");
- // This program is simply used to generate the IDL for the token program.
- //
- // Note that we manually add the COption<Pubkey> type to the IDL after
- // compiling.
- //
- #[program]
- pub mod spl_token {
- use super::*;
- pub fn initialize_mint(
- ctx: Context<InitializeMint>,
- decimals: u8,
- mint_authority: Pubkey,
- // freeze_authority: COption<Pubkey>,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn initialize_account(ctx: Context<InitializeAccount>) -> ProgramResult {
- Ok(())
- }
- pub fn initialize_multisig(ctx: Context<InitializeMultisig>, m: u8) -> ProgramResult {
- Ok(())
- }
- pub fn transfer(ctx: Context<Transfer>, amount: u64) -> ProgramResult {
- Ok(())
- }
- pub fn approve(ctx: Context<Approve>, amount: u64) -> ProgramResult {
- Ok(())
- }
- pub fn revoke(ctx: Context<Revoke>) -> ProgramResult {
- Ok(())
- }
- pub fn set_authority(
- ctx: Context<SetAuthority>,
- authority_type: u8,
- // new_authority: COption<Pubkey>,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn mint_to(ctx: Context<MintTo>, amount: u64) -> ProgramResult {
- Ok(())
- }
- pub fn burn(ctx: Context<Burn>, amount: u64) -> ProgramResult {
- Ok(())
- }
- pub fn close_account(ctx: Context<CloseAccount>) -> ProgramResult {
- Ok(())
- }
- pub fn freeze_account(ctx: Context<FreezeAccount>) -> ProgramResult {
- Ok(())
- }
- pub fn thaw_account(ctx: Context<ThawAccount>) -> ProgramResult {
- Ok(())
- }
- pub fn transfer_checked(
- ctx: Context<TransferChecked>,
- amount: u64,
- decimals: u8,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn approve_checked(
- ctx: Context<ApproveChecked>,
- amount: u64,
- decimals: u8,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn mint_to_checked(
- ctx: Context<MintToChecked>,
- amount: u64,
- decimals: u8,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn burn_checked(ctx: Context<BurnChecked>, amount: u64, decimals: u8) -> ProgramResult {
- Ok(())
- }
- pub fn initialize_account_2(
- ctx: Context<InitializeAccount2>,
- authority: Pubkey,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn sync_native(ctx: Context<SyncNative>) -> ProgramResult {
- Ok(())
- }
- pub fn initialize_account3(
- ctx: Context<InitializeAccount3>,
- authority: Pubkey,
- ) -> ProgramResult {
- Ok(())
- }
- pub fn initialize_multisig_2(ctx: Context<InitializeMultisig2>, m: u8) -> ProgramResult {
- Ok(())
- }
- pub fn initialize_mint_2(
- ctx: Context<InitializeMint2>,
- decimals: u8,
- mint_authority: Pubkey,
- // freeze_authority: COption<Pubkey>,
- ) -> ProgramResult {
- Ok(())
- }
- }
- #[derive(Accounts)]
- pub struct InitializeMint<'info> {
- #[account(mut)]
- mint: AccountInfo<'info>,
- rent: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct InitializeAccount<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- authority: AccountInfo<'info>,
- rent: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct InitializeMultisig<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- rent: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct Transfer<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- #[account(mut)]
- destination: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct Approve<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- delegate: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct Revoke<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct SetAuthority<'info> {
- #[account(mut)]
- pub mint: AccountInfo<'info>,
- pub authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct MintTo<'info> {
- #[account(mut)]
- pub mint: AccountInfo<'info>,
- #[account(mut)]
- pub to: AccountInfo<'info>,
- pub authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct Burn<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- #[account(mut)]
- mint: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct CloseAccount<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- #[account(mut)]
- destination: AccountInfo<'info>,
- authority: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct FreezeAccount<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct ThawAccount<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct TransferChecked<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- #[account(mut)]
- destination: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct ApproveChecked<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- delegate: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct MintToChecked<'info> {
- #[account(mut)]
- mint: AccountInfo<'info>,
- #[account(mut)]
- to: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct BurnChecked<'info> {
- #[account(mut)]
- source: AccountInfo<'info>,
- #[account(mut)]
- mint: AccountInfo<'info>,
- authority: Signer<'info>,
- }
- #[derive(Accounts)]
- pub struct InitializeAccount2<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- rent: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct SyncNative<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct InitializeAccount3<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- mint: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct InitializeMultisig2<'info> {
- #[account(mut)]
- account: AccountInfo<'info>,
- }
- #[derive(Accounts)]
- pub struct InitializeMint2<'info> {
- #[account(mut)]
- mint: AccountInfo<'info>,
- }
|