Sol.College

Full lesson

fusogen

What it does

From the project README:

Fusogen is a platform designed to facilitate mergers and acquisitions (M&A) like actions for decentralized autonomous organizations (DAOs). As decentralized communities and blockchain-based entities grow, there is a growing need for DAOs to consolidate resources, collaborate, and merge effectively—much like traditional businesses. However, DAOs operate under different rules, relying on smart contracts and decentralized governance, so traditional M&A processes don’t apply. Fusogen addresses this gap by providing a framework to streamline the merging of DAOs, allowing them to combine assets, gov
Original
somthn0somthn/fusogen
SuperStack fork
Blockchains/fusogen @ 72562eb
Stars
0
Last push (original)
2024-12-03
Languages
TypeScript, Rust, JavaScript, CSS
Detected stack
AnchorNext.jsweb3.js
Categories
Other
Licence
MIT
Homepage
https://fusogen.vercel.app

Architecture

40 source files. By extension: .tsx ×25, .ts ×9, .js ×5, .rs ×1.

Top-level directorySource files
web27
anchor7
scripts4
(root)2

On-chain programs: anchor/programs/fusogen

Dapp: devnet deploy pending

⏳ Devnet deploy pending — goes live when the devnet wallet is topped up. This fork's own dapp is not deployed yet, so there is no program address or transaction to show. It is queued in dapp-queue.txt; once devnet SOL is available it is deployed, exercised with real devnet transactions, and this section switches to the live dapp at /dapps/fusogen/. Until then, the lesson and step-by-step guide below are complete, and you can run it locally with the commands below.

Key code, explained

Excerpts chosen automatically where the code uses the most Solana concepts, pinned to the fork's commit.

somthn0somthn/fusogen · anchor/programs/fusogen/src/lib.rs L1–24 @ 72562eb · MIT · original
use anchor_lang::prelude::*;use anchor_spl::token::{self, Burn, Mint, MintTo, Token, TokenAccount, Transfer};use anchor_spl::associated_token::AssociatedToken; declare_id!("8u5DoSAV7cZxQAPYumVRZCJeYoijkkjCHsGgC6gKyp4m"); #[program]pub mod fusogen {    use super::*;          //TODO parameterize the token payout ammounts    pub fn merge_dao_treasuries(ctx: Context<MergeTreasuries>) -> Result<()> {        let treasury_a_balance = ctx.accounts.treasury_a_ata.amount;        let treasury_b_balance = ctx.accounts.treasury_b_ata.amount;         let cpi_a_accounts = Burn {            mint: ctx.accounts.mint_treasury_a.to_account_info(),            from: ctx.accounts.treasury_a_ata.to_account_info(),            authority: ctx.accounts.treasury_a_authority.to_account_info(),        };        let cpi_a_program = ctx.accounts.token_program.to_account_info();        let cpi_a_ctx = CpiContext::new(cpi_a_program, cpi_a_accounts);         token::burn(cpi_a_ctx, treasury_a_balance)?;
  1. Line 2 use anchor_spl::token::{self, Burn, Mint, MintTo, Token, TokenAccount, Transfer};: Mints new tokens. The mint authority must sign.
  2. Line 22 let cpi_a_ctx = CpiContext::new(cpi_a_program, cpi_a_accounts);: Makes a cross-program invocation into another program.

How to run, build and test

These commands come from the repo's own manifests (package.json scripts, Anchor.toml, Cargo, go.mod, Makefile). Check the README for prerequisites and environment variables.

DirectoryCommandRuns
.npm run devnx serve web
.npm run buildnx build web
anchoranchor buildcompile programs and generate IDLs
anchoranchor testlocal validator + test suite
anchoranchor run test../node_modules/.bin/nx run anchor:jest

What you could build from it