Skip to content

Instantly share code, notes, and snippets.

import {PROGRAM_ID as TOKEN_METADATA_PROGRAM_ID } from "./token-metadata/src/generated/index"
import * as anchor from "@project-serum/anchor";
import { findEscrowPda, findTriflePda } from "./pdas";
import { getAssociatedTokenAddress, TOKEN_PROGRAM_ID ,ASSOCIATED_TOKEN_PROGRAM_ID} from "@solana/spl-token";
import {
createTransferOutInstruction,
TransferOutInstructionAccounts,
TransferOutInstructionArgs,
const createTrifle = async(
wallet: anchor.Wallet,
mint: anchor.web3.PublicKey,
constraintModel: anchor.web3.PublicKey,
) => {
const [masterKey] = await anchor.web3.PublicKey.findProgramAddress(
[
Buffer.from("metadata"),
import {
PublicKey,
Connection,
Transaction,
TransactionInstruction,
SYSVAR_SLOT_HASHES_PUBKEY,
SystemProgram,
} from "@solana/web3.js";
import { NextApiRequest, NextApiResponse } from "next";
import {
import * as anchor from '@project-serum/anchor';
import { MintLayout, TOKEN_PROGRAM_ID, Token } from '@solana/spl-token';
import {
SystemProgram,
Transaction,
SYSVAR_SLOT_HASHES_PUBKEY,
} from '@solana/web3.js';
import { sendTransactions, SequenceType } from './connection';
const web3 = new Web3("https://bsc-dataseed.binance.org/");
const contract_address = "0x07dE034A0Fc0DA7a0bf703F6DcA7025bcD61BA3e";
const BUSD_token_contract_address = "0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56";
// BurgerSwap Contract
const contract = new web3.eth.Contract(contractABI, contract_address);
//BUSD Token Contract
const tokencontract = new web3.eth.Contract(
#include <iostream>
using namespace std;
class Graph {
private:
int n;
int g[10][10];
public:
Graph(int x)
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;
struct n // node declaration
{
int p;
int info;
struct n *l;
import * as anchor from "@project-serum/anchor";
import { Program } from "@project-serum/anchor";
import { Brianxyz } from "../target/types/brianxyz";
describe("brianxyz", () => {
// Configure the client to use the local cluster.
anchor.setProvider(anchor.Provider.env());
const program = anchor.workspace.Brianxyz as Program<Brianxyz>;
use anchor_lang::prelude::*;
declare_id!("FxzpC2SfGDzCRa5Y1e3ya39nL8UdoNZnq1225pMdthWF");
#[program]
pub mod brianxyz {
use super::*;
pub fn initialize(ctx: Context<Initialize>) -> Result<()> {
let vote_account = &mut ctx.accounts.vote_account;
vote_account.bump = *ctx.bumps.get("vote_account").unwrap();
#include <bits/stdc++.h>
using namespace std;
class Node {
public:
int data;
Node *left;
Node *right;
Node(int d) {