This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const createTrifle = async( | |
wallet: anchor.Wallet, | |
mint: anchor.web3.PublicKey, | |
constraintModel: anchor.web3.PublicKey, | |
) => { | |
const [masterKey] = await anchor.web3.PublicKey.findProgramAddress( | |
[ | |
Buffer.from("metadata"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
PublicKey, | |
Connection, | |
Transaction, | |
TransactionInstruction, | |
SYSVAR_SLOT_HASHES_PUBKEY, | |
SystemProgram, | |
} from "@solana/web3.js"; | |
import { NextApiRequest, NextApiResponse } from "next"; | |
import { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
using namespace std; | |
class Graph { | |
private: | |
int n; | |
int g[10][10]; | |
public: | |
Graph(int x) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdio> | |
#include <cstring> | |
#include <cstdlib> | |
using namespace std; | |
struct n // node declaration | |
{ | |
int p; | |
int info; | |
struct n *l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
class Node { | |
public: | |
int data; | |
Node *left; | |
Node *right; | |
Node(int d) { |
NewerOlder