This is the NFT brun_reward program by receiving spl-token($MAD)
- Install
node
andyarn
- Install
ts-node
as global command - Confirm the solana wallet preparation:
/home/---/.config/solana/id.json
in test case
- Main script source for all functionality is here:
/cli/script.ts
- Program account types are declared here:
/cli/types.ts
- Idl to make the JS binding easy is here:
/cli/brun_reward.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 - Confirm the
ANCHOR_WALLET
environment variable of thets-node
script inpackage.json
- Run
yarn ts-node
First of all, you have to git clone in your PC.
In the folder backend
, in the terminal
-
yarn
-
anchor build
In the last sentence you can see:
To deploy this program:
$ solana program deploy /home/.../backend/target/deploy/brun_reward.so
The program address will default to this keypair (override with --program-id):
/home/.../backend/target/deploy/brun_reward-keypair.json
-
solana-keygen pubkey /home/.../backend/target/deploy/brun_reward-keypair.json
-
You can get the pubkey of the
program ID : ex."5N...x6k"
-
Please add this pubkey to the lib.rs
declare_id!("5N...x6k");
-
Please add this pubkey to the Anchor.toml
brun_reward = "5N...x6k"
-
Please add this pubkey to the types.ts
export const BURN_PROGRAM_ID = new PublicKey("5N...x6k");
-
anchor build
again -
solana program deploy /home/.../backend/target/deploy/brun_reward.so
-
yarn ts-node
then you can getglobal_authority
-
Run the command line like:
spl-token transfer GkXn6PUbcvpwAzVCgJFychVhAhjwZRMJWmtqzar3SnqG 8480000 Gx...PNF9 --fund-recipient
Then, you can enjoy this program 🎭
The project owner should initialize the project. the function initProject
await initProject();
Users can burn their NFT and receive $MAD by using this program.
export const burnReward = async (
mint: PublicKey,
)