https://github.com/cutupdev/solana-nft-unstaking
Solana NFT Unstaking Smart Contract
https://github.com/cutupdev/solana-nft-unstaking
javascript nft-staking smart-contracts typescript web3 web3js
Last synced: 8 months ago
JSON representation
Solana NFT Unstaking Smart Contract
- Host: GitHub
- URL: https://github.com/cutupdev/solana-nft-unstaking
- Owner: cutupdev
- Created: 2024-03-30T08:30:32.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-06-27T12:13:01.000Z (10 months ago)
- Last Synced: 2025-07-10T23:53:35.437Z (10 months ago)
- Topics: javascript, nft-staking, smart-contracts, typescript, web3, web3js
- Language: TypeScript
- Homepage: https://artpunks.fun/
- Size: 137 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Nft-Staking-Contract
## Install Dependencies
- Install `node` and `yarn`
- Install `script` as global command
- Confirm the solana wallet preparation. ex: `wallet.json`
## Usage
- Main script source for all functionality is here: `/lib/script.ts`
- Program account types are declared here: `/lib/types.ts`
Able to test the script functions working in this way.
- Change commands properly in the main functions of the `script.ts` file to call the other functions
- Run `yarn script` with parameters
# Features
## How to deploy this program?
First of all, you have to git clone in your PC.
In the folder `nft_staking-staking`, in the terminal
1. `yarn`
2. `anchor build`
In the last sentence you can see:
```
To deploy this program:
$ solana program deploy ./target/deploy/nft_staking.so
The program address will default to this keypair (override with --program-id):
./target/deploy/nft_staking-keypair.json
```
3. `solana-keygen pubkey ./target/deploy/nft_staking.json`
4. You can get the pubkey of the `program ID : ex."5N...x6k"`
5. Please add this pubkey to the lib.rs
`declare_id!("5N...x6k");`
6. Please add this pubkey to the Anchor.toml
`nft_staking = "5N...x6k"`
7. `anchor build` again
8. `solana program deploy ./target/deploy/nft_staking.so`
Then, you can enjoy this program
## How to use?
### A Project Owner
First of all, open the directory and `yarn`
#### Initialize project
```js
yarn script init
```
### A Player
#### Stake NFT
```js
yarn script stake -m
```
#### Unstake NFT
```js
yarn script unstake -m
```
#### Get user status
```js
yarn script user-status -a
```
Get status of user .
#### Get all users
```js
yarn script get-users
```
Get all users stake info