repo_id stringclasses 6
values | file_path stringlengths 35 93 | content stringlengths 38 446k | __index_level_0__ int64 0 0 |
|---|---|---|---|
test_repos/0xlarry | test_repos/0xlarry/byo_mint/Cargo.toml | [workspace]
members = [
"programs/*"
]
[profile.release]
overflow-checks = true
lto = "fat"
codegen-units = 1
[profile.release.build-override]
opt-level = 3
incremental = false
codegen-units = 1
| 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/LICENSE | The MIT License (MIT)
Copyright © 2024 0xLarry (Matt Treiber)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, mer... | 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "aead"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877"
dependencies = [
"generic-ar... | 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/.prettierignore |
.anchor
.DS_Store
target
node_modules
dist
build
test-ledger
| 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/README.md | ## **ByoMint - a compressed NFT (cNFT) mint program for custom minting and controlled distribution of assets on Solana.**
This program leverages **compression on Solana** enabling creators to **mint and distribute cNFTs with minter customization and control**.
**Mainnet Program ID: GnukyHhbXhqeswaZbzDiTLZeMSHMuWNT... | 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/Anchor.toml | [features]
seeds = false
skip-lint = false
[programs.localnet]
byo_mint = "GnukyHhbXhqeswaZbzDiTLZeMSHMuWNTNxw4buhS6zpg"
[programs.devnet]
byo_mint = "GnukyHhbXhqeswaZbzDiTLZeMSHMuWNTNxw4buhS6zpg"
[programs.mainnet]
byo_mint = "GnukyHhbXhqeswaZbzDiTLZeMSHMuWNTNxw4buhS6zpg"
[registry]
url = "https://api.apr.dev"
[pro... | 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/package-lock.json | {
"name": "byo_mint",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"dependencies": {
"@coral-xyz/anchor": "^0.28.0",
"@metaplex-foundation/amman": "^0.12.1",
"@metaplex-foundation/js": "^0.19.4",
"@metaple... | 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/package.json | {
"scripts": {
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check",
"airdrops": "solana airdrop 100 && solana airdrop 100 cXBtcARJkBDXpkEr5yK8gVtcsCP9TU46x7wFJ9F5Xfh && solana airdrop 100 AEb8XJLe3ChELQC7nN3gB4QB1CBM3diHkYkQe8kc9w8y && ... | 0 |
test_repos/0xlarry | test_repos/0xlarry/byo_mint/tsconfig.json | {
"compilerOptions": {
"types": ["mocha", "chai"],
"typeRoots": ["./node_modules/@types"],
"lib": ["es2015"],
"module": "commonjs",
"target": "es6",
"esModuleInterop": true
}
}
| 0 |
test_repos/0xlarry/byo_mint | test_repos/0xlarry/byo_mint/migrations/deploy.ts | // Migrations are an early feature. Currently, they're nothing more than this
// single deploy script that's invoked from the CLI, injecting a provider
// configured from the workspace's Anchor.toml.
const anchor = require("@coral-xyz/anchor");
module.exports = async function (provider) {
// Configure client to use... | 0 |
test_repos/0xlarry/byo_mint | test_repos/0xlarry/byo_mint/tests/byoMint-tests.ts | import {Connection, Keypair, LAMPORTS_PER_SOL } from "@solana/web3.js";
import * as anchor from "@coral-xyz/anchor";
import base58 from 'bs58';
import {
findFaucetPda, findMetadataMapPda,
executeTx,
addNewTree, createFaucetIx, createMetadataMapIx, deleteMetadataMapIx, updateFaucetIx, mintCnftIx, payoutIx
} from... | 0 |
test_repos/0xlarry/byo_mint | test_repos/0xlarry/byo_mint/tests/byoMint-client.ts | import {Connection, LAMPORTS_PER_SOL, PublicKey, Transaction, sendAndConfirmTransaction, SYSVAR_INSTRUCTIONS_PUBKEY, TransactionMessage, VersionedTransaction} from "@solana/web3.js";
import {TOKEN_PROGRAM_ID, ASSOCIATED_TOKEN_PROGRAM_ID, getAssociatedTokenAddress } from "@solana/spl-token";
import { MPL_BUBBLEGUM_PROGR... | 0 |
test_repos/0xlarry/byo_mint | test_repos/0xlarry/byo_mint/tests/wlMint-tests.ts | import {Connection, Keypair, LAMPORTS_PER_SOL } from "@solana/web3.js";
import * as anchor from "@coral-xyz/anchor";
import base58 from 'bs58';
import {
findMetadataMapPda,
executeTx,
createMetadataMapIx,updateFaucetWlIx, payoutWlIx, creatWlFaucetIx, mintWlIx, addNewTreeWl, findFaucetWlPda
} from "./byoMint-cli... | 0 |
test_repos/0xlarry/byo_mint/programs | test_repos/0xlarry/byo_mint/programs/byo_mint/Cargo.toml | [package]
name = "byo_mint"
version = "0.2.0"
description = "Created with Anchor"
edition = "2021"
[lib]
crate-type = ["cdylib", "lib"]
name = "byo_mint"
[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []
[dependencies]
anchor-lang = { version = "0.29.0", features = ["... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint | test_repos/0xlarry/byo_mint/programs/byo_mint/src/lib.rs | use std::str::FromStr;
use anchor_lang::prelude::*;
pub mod byom_error;
pub use byom_error::*;
pub mod state;
pub use state::*;
pub mod actions;
pub use actions::*;
declare_id!("GnukyHhbXhqeswaZbzDiTLZeMSHMuWNTNxw4buhS6zpg");
#[program]
pub mod byo_mint {
use super::*;
// ************************************... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint | test_repos/0xlarry/byo_mint/programs/byo_mint/src/byom_error.rs | use anchor_lang::prelude::*;
#[error_code]
pub enum ByomError {
#[msg("Too many items")]
TooManyLayers,
#[msg("Supply cap")]
SupplyCap,
#[msg("Item not found")]
ItemNotFound,
#[msg("Invalid Rarity")]
InvalidRoyalty,
#[msg("Invalid Authority")]
InvalidAuthority,
#[msg("Nothin... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint | test_repos/0xlarry/byo_mint/programs/byo_mint/src/mod.rs | mod byom_error;
pub use byom_error::*; | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/state/wl_mint.rs | use crate::*;
#[account]
pub struct WlMint {}
impl WlMint {
pub const LEN: usize = 8;
} | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/state/metadata_map.rs | use crate::*;
#[account]
pub struct MetadataMap {
pub authority: Pubkey,
pub layers: [u8; 10], // array of max 10 layers, u8 -> layer variant, 0 == no trait
pub seller_fee_basis_points: u16,
pub symbol: String,
pub uri_prefix: String
}
impl MetadataMap {
pub const LEN: usize = 8
+ 32... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/state/faucet_wl.rs | use crate::*;
use anchor_spl::token::TokenAccount;
use mpl_token_metadata::state::{Metadata, TokenMetadataAccount};
#[account]
pub struct FaucetWl {
pub authority: Pubkey,
pub collection_mint: Pubkey,
pub merkle_tree: Pubkey,
pub metadata_map: Pubkey,
pub current_supply: u64,
pub supply_cap: u... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/state/mod.rs | pub mod faucet;
pub use faucet::*;
pub mod metadata_map;
pub use metadata_map::*;
pub mod byo_mint;
pub use byo_mint::*;
pub mod wl_mint;
pub use wl_mint::*;
pub mod faucet_wl;
pub use faucet_wl::*; | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/state/faucet.rs | use crate::*;
#[account]
pub struct Faucet {
pub authority: Pubkey,
pub collection_mint: Pubkey,
pub merkle_tree: Pubkey,
pub metadata_map: Pubkey,
pub current_supply: u64,
pub supply_cap: u64,
pub mint_price: u64,
pub bump: u8,
}
impl Faucet {
pub const LEN: usize = 8
+... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/state/byo_mint.rs | use crate::*;
#[account]
pub struct ByoMint {}
impl ByoMint {
pub const LEN: usize = 8;
} | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/util.rs | pub fn is_valid_hex_color(input: &str) -> bool {
// Check if the input starts with '#' and has a length of 7
if input.len() == 7 && input.starts_with('#') {
// Check if all characters following '#' are hexadecimal
input[1..].chars().all(|c| c.is_digit(16))
} else {
false
}
} | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/mod.rs | use crate::*;
pub mod faucet;
pub use faucet::*;
pub mod metadata_map;
pub use metadata_map::*;
pub mod util;
pub use util::*;
pub struct TokenProgram;
impl anchor_lang::Id for TokenProgram {
fn id() -> Pubkey {
anchor_spl::token::ID
}
}
pub struct MplMetadataProgram;
impl anchor_lang::Id for MplMetada... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/metadata_map/mod.rs | pub mod create_metadata_map;
pub use create_metadata_map::*;
pub mod delete_metadata_map;
pub use delete_metadata_map::*; | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/metadata_map/delete_metadata_map.rs | use crate::*;
// *******************
// DELETE METADATA MAP
// *******************
#[derive(Accounts)]
pub struct DeleteMetadataMap<'info> {
#[account(
mut,
close = auth
)]
pub metadata_map: Account<'info, MetadataMap>,
#[account(mut)]
pub auth: Signer<'info>,
/// CHECK: system ... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/metadata_map/create_metadata_map.rs | use crate::*;
// *********************************
// CREATE FAUCET
// *********************************
pub fn create_metadata_map(ctx: Context<CreateMetadataMap>, params: CreateMetadataMapParams) -> Result<()> {
*ctx.accounts.metadata_map = MetadataMap::new(
ctx.accounts.auth.key(),
params.layers... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/add_new_tree_wl.rs |
use crate::*;
use anchor_lang::solana_program::pubkey::Pubkey;
use mpl_bubblegum::instructions::CreateTreeConfigCpiBuilder;
// The program will support only trees of the following parameters:
const MAX_TREE_DEPTH: u32 = 14;
const MAX_TREE_BUFFER_SIZE: u32 = 64;
// this corresponds to account with a canopy depth 11.
... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/update_faucet.rs |
use crate::*;
// *********************************
// UPDATE FAUCET
// *********************************
pub fn update_faucet(ctx: Context<UpdateFaucet>, params: UpdateFaucetParams) -> Result<()> {
require!(ctx.accounts.faucet_auth.key() == ctx.accounts.faucet.authority, ByomError::InvalidAccount);
match para... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/withdraw_fees_wl.rs |
use crate::*;
// *********************************
// WITHDRAW FEES WL
// *********************************
pub fn withdraw_fees_wl(ctx: Context<WithdrawFeesWl>) -> Result<()> {
require!(ctx.accounts.faucet_auth.key() == ctx.accounts.faucet.authority, ByomError::InvalidAccount);
let total_lamports = ctx.accou... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/mint_cnft.rs | use crate::*;
use anchor_lang::solana_program::program::invoke;
use anchor_lang::solana_program::pubkey::Pubkey;
use anchor_lang::solana_program::system_instruction;
use mpl_bubblegum::instructions::MintToCollectionV1CpiBuilder;
use mpl_bubblegum::types::{Creator, Collection, MetadataArgs, TokenProgramVersion, TokenSta... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/add_new_tree.rs |
use crate::*;
use anchor_lang::solana_program::pubkey::Pubkey;
use mpl_bubblegum::instructions::CreateTreeConfigCpiBuilder;
// The program will support only trees of the following parameters:
const MAX_TREE_DEPTH: u32 = 14;
const MAX_TREE_BUFFER_SIZE: u32 = 64;
// this corresponds to account with a canopy depth 11.
... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/mint_cnft_wl.rs | use crate::*;
use anchor_lang::solana_program::program::invoke;
use anchor_lang::solana_program::pubkey::Pubkey;
use anchor_lang::solana_program::system_instruction;
use anchor_spl::token::TokenAccount;
use mpl_bubblegum::instructions::MintToCollectionV1CpiBuilder;
use mpl_bubblegum::types::{Creator, Collection, Metada... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/create_faucet_wl.rs | use crate::*;
use anchor_lang::solana_program::pubkey::Pubkey;
use anchor_spl::{
associated_token::AssociatedToken,
metadata::{
create_master_edition_v3,
create_metadata_accounts_v3,
CreateMasterEditionV3,
CreateMetadataAccountsV3,
Metadata,
mpl_token_metadata... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/create_faucet.rs | use crate::*;
use anchor_lang::solana_program::pubkey::Pubkey;
use anchor_spl::{
associated_token::AssociatedToken,
metadata::{
create_master_edition_v3,
create_metadata_accounts_v3,
CreateMasterEditionV3,
CreateMetadataAccountsV3,
Metadata,
mpl_token_metadata... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/update_faucet_wl.rs |
use crate::*;
// *********************************
// UPDATE FAUCET WL
// *********************************
pub fn update_faucet_wl(ctx: Context<UpdateFaucetWl>, params: UpdateFaucetWlParams) -> Result<()> {
require!(ctx.accounts.faucet_auth.key() == ctx.accounts.faucet.authority, ByomError::InvalidAccount);
... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/mod.rs | pub mod create_faucet;
pub use create_faucet::*;
pub mod add_new_tree;
pub use add_new_tree::*;
pub mod mint_cnft;
pub use mint_cnft::*;
pub mod withdraw_fees;
pub use withdraw_fees::*;
pub mod update_faucet;
pub use update_faucet::*;
pub const COLLECTION_CPI_PREFIX: &str = "collection_cpi";
pub mod create_faucet_wl;
p... | 0 |
test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions | test_repos/0xlarry/byo_mint/programs/byo_mint/src/actions/faucet/withdraw_fees.rs |
use crate::*;
// *********************************
// WITHDRAW FEES
// *********************************
pub fn withdraw_fees(ctx: Context<WithdrawFees>) -> Result<()> {
require!(ctx.accounts.faucet_auth.key() == ctx.accounts.faucet.authority, ByomError::InvalidAccount);
let total_lamports = ctx.accounts.fauc... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.