lawmeskiviahs / staking-program

A staking program in solana

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Solana Staking Program

This repository contains the program login and integrations for a token staking contract for solana.

Overview

It includes the following features:

  • A solana smart contract that implements staking logic for an spl token
  • A script that creates some accounts, creates a token and mints it to the accounts
  • Scripts to call the various functions in the staking contract.
  • Readme for each function in the contract

Installation of required dependencies

Prerequisites:

Clone this repo using:

git clone https://github.com/lawmeskiviahs/staking-program.git
cd staking-program/

Install the contract dependencies with npm:

npm install

Test the contract:

anchor test

Building the contract

anchor build

Deploy the contract:

anchor deploy

To proceed to interacting with the deployed contract find the integration Scripts in:

cd ./app

Note:- Find the proper documentation for each function in the docs folder in the root directory.

cd ./docs

Correct order of scripts to be called in order to avail the staking functionality:

  1. createAndDistributeTokens
  2. initialize
  3. stake
  4. unstake/get_rewards

About

A staking program in solana


Languages

Language:JavaScript 73.1%Language:Rust 25.9%Language:TypeScript 0.9%