This file contains hidden or 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
| describe("anchor-vault-q3", () => { | |
| // Helper function to log a message | |
| const log = async (signature: string): Promise<string> => { | |
| console.log( | |
| `Your transaction signature: https://explorer.solana.com/transaction/${signature}?cluster=custom&customUrl=${connection.rpcEndpoint}\n` | |
| ); | |
| return signature; | |
| }; |
This file contains hidden or 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 mpl_token_metadata::{instruction::create_metadata_accounts_v3, state::Creator as creator_struct}; | |
| pub fn create_metadata(&mut self, name: String, symbol: String, uri: String) -> Result<()> { | |
| let seeds = &[ | |
| &b"creator"[..], | |
| &self.creator.tweet_id.to_le_bytes()[..], | |
| &[self.creator.state_bump], | |
| ]; | |
| let program_id = self.metadata_program.key(); |
This file contains hidden or 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 { Transaction, SystemProgram, Connection, Keypair, LAMPORTS_PER_SOL, sendAndConfirmTransaction, PublicKey, ComputeBudgetProgram } from "@solana/web3.js" | |
| import wallet from "./ji76hHmEkFAUR7oHjrascx9USXp713WijtniVC5Bs6S.json" | |
| import bs58 from 'bs58' | |
| // Import our dev wallet keypair from the wallet file | |
| const from = Keypair.fromSecretKey(new Uint8Array(wallet)); | |
| // Define our WBA public key | |
| const to = new PublicKey("HZwspWyrNGik1AcgGBqN7VaCqs4ZHob8pkYUsgCFZ5FV"); |
This file contains hidden or 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::*; | |
| use anchor_spl::{ | |
| token_interface::{TokenAccount, Mint, TokenInterface, TransferChecked, transfer_checked}, | |
| associated_token::AssociatedToken} | |
| }; | |
| declare_id!("exampleid00121312312312312312312"); | |
| #[program] | |
| pub mod SolanStackExchange { | |
| use super::*; |
This file contains hidden or 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
| 1- Initial Configuration | |
| 1.1- Create Config Accounts | |
| - 1.1.a) Proposal Program | |
| - 1.1.b) Voting Program | |
| - 1.1.c) Staking Program | |
| - 1.1.d) Issue Program | |
| - Initiate configuration accounts for each of these programs; Functions location: available in the IDL. | |
| 1.2 - DAO Config Initialization | |
| Configure the DAO after setting up the mentioned programs. |