A Solana program for managing whitelisted token sales. This program allows for the creation of a token sale with a whitelist, enabling only approved addresses to participate in the sale.
The program has been deployed on Solana devnet with the following Program ID:
8CfNbqPDAVDWZhTWEKg475aRzERSkXhRd4R37CHBShhQ
- Initialize a token sale with customizable parameters
- Manage a whitelist of approved buyers
- Enforce purchase limits per wallet
- Track total supply and total sold tokens
- Rust and Cargo
- Solana CLI tools
- Node.js and npm
- Anchor framework
-
Clone the repository:
git clone https://github.com/akshatcoder-hash/whitelist-token-sale.git cd whitelist-token-sale
-
Install dependencies:
npm install
-
Build the program:
anchor build
Run the test suite:
anchor test
-
Initialize the sale:
await program.methods .initialize(price, maxPerWallet, totalSupply) .accounts({ // ... account details }) .rpc();
-
Add a user to the whitelist:
await program.methods .addToWhitelist(userPublicKey) .accounts({ // ... account details }) .rpc();
-
Purchase tokens (for whitelisted users):
await program.methods .buyTokens(amount) .accounts({ // ... account details }) .rpc();
We welcome contributions to the Whitelist Token Sale project! Please see our Contributing Guide for more details on how to get started.
This project is licensed under the MIT License - see the LICENSE file for details.
For any questions or concerns, please open an issue on this repository or contact the maintainer:
- GitHub: @akshatcoder-hash