GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - hack-chat/hackchat-sc: solana smart contract for the hack.chat ecosystem

BranchesTags
Open more actions menu

Latest commit

 

History

7 Commits
7 Commits

Folders and files

NameName
Last commit message
Last commit date
docs
docs
 
 
secrets
secrets
 
 
src
src
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

hack.chat Solana Smart Contract

This repository contains the native Rust Solana smart contract (program) for the hack.chat ecosystem. It governs decentralized channel ownership, on-chain moderator delegation, and a server donation system that unlocks global chat effects.

Built without heavy frameworks (like Anchor), this program uses raw Native Rust architecture to minimize compute budget and reduce user rent costs.

Network Architecture & Vanity Addresses

This program utilizes three distinct addresses to separate logic, treasury funds, and asset verification:

  • Smart Contract (Program ID): AutHysEUfKrWDETzrDA7S7MwL1eSSc2BjySR2W8EuSEr
    • The executable logic handling all PDA state changes, user authentication, and authorization.
  • Project Treasury: HaCKy1tUTBDkfUkcYcUFkhC887ucAs3tEjcmqRa5cHat
    • The public vault that receives all protocol fees and direct SOL donations.
  • Master NFT Collection: HaCkAvuxxfnfNLfnENxQ1V3aHCjgDS1rMNYcm4qWsYNC
    • The root Metaplex Collection Mint used to cryptographically sync and verify channel-ownership NFTs.

Architecture & State

The smart contract manages two primary Program Derived Addresses (PDAs):

  1. ChannelState PDA:
    • Seeds: [b"channel", channel_name_bytes]
    • Purpose: Stores the channel name, the owner's wallet address, the required NFT Address, and an array of up to 20 authorized moderator tripcodes.
  2. DonationState PDA:
    • Seeds: [b"donation", user_wallet_pubkey]
    • Purpose: A 2-byte ledger that records a user's global chat effect ID.

Instruction Set

Instruction Description
ClaimChannel Initializes a ChannelState PDA. Requires the signer to hold the channel's NFT.
ReclaimChannel Allows an NFT holder to overwrite the owner_wallet of an existing channel and wipe the moderator list.
AssignModerator Allows the channel owner to add a 6-character tripcode to the on-chain moderator array.
RemoveModerator Allows the channel owner to revoke a tripcode's moderation privileges.
CloseChannel Closes the channel PDA, wipes the data, and refunds the storage rent back to the owner.
RecordDonation Performs a CPI transfer of SOL to the HaCKy...5cHat treasury wallet and updates the user's DonationState PDA with a chat effect ID.

Chat Effects Demo

The visual name effects unlocked via the RecordDonation instruction can be previewed interactively. View the Live Effects Demo Here


Building & Testing

Prerequisites

  • Rust
  • Solana CLI (v1.16 or higher)

Build the Program

To compile the smart contract into a deployable .so SBF (Solana Bytecode Format) binary:

cargo build-sbf

Run Tests

The test suite utilizes standard cargo test configurations:

cargo test

About

solana smart contract for the hack.chat ecosystem

Resources

Readme
MIT license
Activity
Custom properties

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.