MCPcopy Index your code
hub / github.com/cutupdev/Solana-Token-Staking-Smart-Contract

github.com/cutupdev/Solana-Token-Staking-Smart-Contract @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
73 symbols 138 edges 25 files 4 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Solana-Token-Staking-Smart-Contract

Token staking smart contract on solana. It supports multi-staking pool creation, user staking, reward claiming so on. Admin can create pool and can set staking token, APY, boost so on about new staking pool. So users can stake to any pool supporting specific token that they have. Also users can claim reward by sol. It's not full code for staking smart contract, feel free to reach out of me when you need smart contract development[telegram: https://t.me/DevCutup or whatsapp: https://wa.me/13137423660].

Core Functionalities

  1. Create the staking pool with pool configuration[APY, Locking period, Minimum/Maximum staking amount]
  2. Staking to different pool
  3. Withdraw
  4. Claiming Staking reward
  5. Delete the pool

How to use it

Ready to use

# Clone the repository
git clone https://github.com/cutupdev/Solana-Token-Staking-Smart-Contract.git

# Navigate to project directory
cd Solana-Token-Staking-Smart-Contract

# Install dependencies
npm install

# Configure environment variables
# Create a .env file with your settings (see .env.example Setup section)
# Make sure your system supports rust and anchor 

Test case

# Run test case
anchor build 
anchor test 

# Run cli test case
yarn script ...

# Reference cli/command.ts
  • Program address D2dTLQp2w485kQDwDvngfDo2GV1r7DdeGgYWxjAaDkPv

Contact

  • Telegram: https://t.me/DevCutup
  • Whatsapp: https://wa.me/13137423660
  • Twitter: https://x.com/devcutup

Extension points exported contracts — how you extend this code

UserAccount (Interface)
(no doc)
programs/staking/src/state.rs

Core symbols most depended-on inside this repo

setClusterConfig
called by 9
cli/scripts.ts
programCommand
called by 9
cli/command.ts
execTx
called by 8
lib/util.ts
process
called by 8
programs/staking/src/instructions/stake.rs
convertToFloat
called by 3
tests/utils.ts
getAssociatedTokenAccount
called by 2
lib/util.ts
createAssociatedTokenAccountInstruction
called by 2
lib/util.ts
createConfigTx
called by 1
lib/scripts.ts

Shape

Function 41
Class 20
Method 10
Enum 1
Interface 1

Languages

Rust63%
TypeScript37%

Modules by API surface

programs/staking/src/events.rs9 symbols
cli/scripts.ts9 symbols
programs/staking/src/lib.rs8 symbols
lib/scripts.ts8 symbols
programs/staking/src/utils.rs6 symbols
programs/staking/src/state.rs6 symbols
tests/utils.ts5 symbols
lib/util.ts4 symbols
programs/staking/src/instructions/withdraw.rs2 symbols
programs/staking/src/instructions/stake.rs2 symbols
programs/staking/src/instructions/set_pause.rs2 symbols
programs/staking/src/instructions/purchase_boost.rs2 symbols

For agents

$ claude mcp add Solana-Token-Staking-Smart-Contract \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact