Skip to content

mayhemmode/ANCHOR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Mayhem Controller - Solana Program

Advanced token management program for interacting with the Mayhem protocol on Solana.

📁 Directory Structure

github/
├── docs/                          # Documentation
│   ├── CONNECTION_GUIDE.md       # How to connect to programs
│   └── CUSTOM_PROGRAM_GUIDE.md   # Build custom programs
│
├── program/                       # Solana program source
│   ├── src/
│   │   └── lib.rs                # Main program code
│   ├── Cargo.toml                # Rust dependencies
│   ├── Anchor.toml               # Anchor configuration
│   └── README.md                 # Program documentation
│
└── README.md                      # This file

🚀 Quick Start

Prerequisites

  • Solana CLI tools installed
  • Anchor framework (v0.29.0)
  • Rust toolchain
  • Node.js & npm/yarn

Setup

  1. Install Solana CLI
sh -c "$(curl -sSfL https://release.solana.com/stable/install)"
  1. Install Anchor
cargo install --git https://github.com/coral-xyz/anchor --tag v0.29.0 anchor-cli
  1. Configure for Devnet
solana config set --url https://api.devnet.solana.com
  1. Build Program
cd program
anchor build
  1. Deploy to Devnet
anchor deploy --provider.cluster devnet

📚 Documentation

Read First

  1. CONNECTION_GUIDE.md - Learn how to connect to Mayhem and the controller
  2. CUSTOM_PROGRAM_GUIDE.md - Build custom programs that interact with Mayhem

Program Features

Mint Management - Control token creation with authority ✅ Fee Collection - Automated fee gathering system
Buyback Operations - Strategic token buybacks ✅ Burn Mechanism - Supply reduction controls ✅ Authority Takeover - Gain control of token mints

🔗 Program IDs

Mayhem Protocol (Mainnet)

MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e

Controller (Your Program)

Devnet:  Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS
Mainnet: [TO BE DEPLOYED]

🎯 Use Cases

  • Token Creators: Manage minting and burning post-launch
  • DAOs: Automated fee collection and redistribution
  • Market Makers: Buyback mechanisms for price stability
  • Protocols: Takeover and manage abandoned tokens

🔐 Security

  • Authority-based access control
  • PDA-based configuration
  • Emergency pause mechanism
  • Input validation on all operations
  • Tested on devnet before mainnet

📝 Example Usage

// Initialize controller
await program.methods
  .initialize(
    MAYHEM_PROGRAM_ID,
    feeCollector,
    buybackWallet
  )
  .rpc();

// Mint tokens
await program.methods
  .mintTokens(new BN(1000000))
  .accounts({ mint, recipient })
  .rpc();

// Burn tokens
await program.methods
  .burnTokens(new BN(500000))
  .accounts({ mint, tokenAccount })
  .rpc();

🌐 Solana Playground

Deploy directly to Solana Playground:

  1. Visit https://beta.solpg.io
  2. Create new Anchor project
  3. Copy code from program/src/lib.rs
  4. Build & Deploy

🤝 Contributing

Contributions welcome! Please:

  1. Test thoroughly on devnet
  2. Follow Rust/Anchor best practices
  3. Document new features
  4. Submit PRs with clear descriptions

⚠️ Disclaimer

This program is provided as-is for educational purposes. Always audit code before deploying to mainnet with real funds.

📄 License

MIT License - see LICENSE file for details

About

First composed version on dev net.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages