solana-spl-staker
solana-spl-staker copied to clipboard
stake solana spl token and get other spl token as reward
Solana DeFi Stake Program Rust
Solana mint spl token (old token program)
Solana mint spl authority
Solana update spl token metadata
Stake Program
programs/staker/src/lib.rs
solana rust program in anchor ehich have 3 functions:
create_myspl_atacreate ata for stake frogram for hold user tokensstakeget user token save them in program ata and give the stake tokenunstakeget stake token back from user and give his token back to him
Get accounts for call stake program functions
run script for get functions params address ts-node scripts/getPdaAndAtaAddressForProgram.ts
Mint spl tokens and update them
scripts/spl
- for mint spl token 1st set the
.envrequirements - set the token metadata in
scripts/spl/splHelper/consts.ts - after mint mint address and other info will save in
scripts/spl/outputsfolder with the token name
Run scripts
scripts/spl/call/mint.tsfor mint new spl token (before this.envandconts.tsshould be set)scripts/spl/call/update.tsfor update spl token metadata (before this.envandconts.tsshould be set)scripts/spl/call/disableMintAuthority.tsfor disable mint authorityscripts/spl/call/disableMetadataMutable.tsfor disable metadata mutablescripts/spl/call/disableFreezeAuthority.tsfor disable freeze authority