Blockchain

Job ID: 33460809

Budget: $10 – $50 USD

Write a Solana program in Rust to accept donations as a native currencies (in lamports). Main functionality

Make donations in lamports.

Withdraw donations to the wallet of the creator of the program. This action can only be performed by the creator of the program.

Store the addresses of all users who have made donations (for example, in PDA).

Store the donation amounts of each user.

Write a unit test.

Deploy the contract to devnet.

Write a minimal client to interact with the contract in devnet. The program can be written in pure Rust, but it is recommended to use Anchor framework. It is recommended to write tests/client in typescript. Check list Install the sollet extension as a wallet. Load generated private key information into sollet. The program has the function of entering any amount of lamports as donations. The program has a function to withdraw all donations to the account of the owner of the program, which can only be called by the owner. These functions must be tested. The date of the account should store information about everyone who has ever contributed donations. It should be possible to access the contract deployed in devnet through a typescript client (example https://project-serum.github.io/anchor/tutorials/tuto..) so that you can: Make a donation, Withdraw donations to the owner's account, Display a list of all users who have ever made donations, Display the sum of all donations made by a specific user.
A Minimal Example | ⚓ Anchor
project-serum.github.io
Related categories: Blockchain Rust Smart Contracts Solana