GithubHelp home page GithubHelp logo

step-staking's Introduction


step logo

Reward Pool

Program for single token staking and receiving rewards. Ala xSushi

Design Overview

step-staking overview

draw.io editable

Note

  • This code is unaudited. Use at your own risk.

Developing

Anchor is used for developoment, and it's recommended workflow is used here. To get started, see the guide.

Build

anchor build --verifiable

The --verifiable flag should be used before deploying so that your build artifacts can be deterministically generated with docker.

Test

When testing locally, be sure to build with feature "local-testing" to enable the testing IDs. You can do this by editing programs/step-staking/Cargo.toml and uncommenting the default feature set line.

anchor test

Verify

To verify the program deployed on Solana matches your local source code, change directory into the program you want to verify, e.g., cd program, and run

anchor verify <program-id | write-buffer>

A list of build artifacts can be found under releases.

Deploy

To deploy the program, configure your CLI to the desired network/wallet and run

solana program deploy --programid <keypair> target/verifiable/step_staking.so

I would not suggest using anchor deploy at this time; it wouldn't/couldn't really add much value. Be sure to use --programid <keypair> to deploy to the correct address.

Note: By default, programs are deployed to accounts that are twice the size of the original deployment. Doing so leaves room for program growth in future redeployments. For this program, I beleive that's proper - I wouldn't want to limit it, nor do I see growth beyond double.

Initial Migration

After deployment for the first time, you must point your anchor.toml file to the network you've deployed to and run

anchor migrate

This will call the initialize method to create the token vault. No specific calling key is needed - it can be called by anyone, and is a once only operation for PDA vault creation. Subsequent runs will fail.

Any problems in this process can be triaged in the migrations/deploy.js file, which is what anchor migrate executes.

Set Mint Authority

The mint authority of the xSTEP token must be set to the PDA vault address ANYxxG365hutGYaTdtUQG8u2hC4dFX9mFHKuzy9ABQJi

step-staking's People

Contributors

aaronovz1 avatar thesoftwarejedi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.