launchpad smart contract create token, bonding curve, pool creation on solana

Overview

Tokenix Smart Contract

This repository contains the smart contract for Tokenix, a launchpad project currently under development at https://tokenix.finance.

Overview

Tokenix is a decentralized launchpad platform built on the Solana blockchain. It aims to provide a seamless and efficient way for projects to launch their tokens and for users to participate in token sales.

Features (In Development)

  • Token Creation: Easily create new tokens with customizable parameters.
  • Pool Creation: Set up bonding curve pools for token distribution.
  • Token Purchase: Allow users to buy tokens directly from the pool.
  • Dynamic Pricing: Implement a bonding curve mechanism for price discovery.

Please note that this project is currently in the development phase and features are subject to change.

Installation

To set up the project locally, follow these steps:

  1. Clone the repository:

    git clone https://github.com/tokenix/tokenix-launchpad.git
    cd tokenix
    
  2. Install dependencies:

    yarn install
    
  3. Build the project:

    anchor build
    

Running Tests

To run the tests, use the following command:

anchor test --skip-local-validator

Test Results

Here are the latest test results:

=== Token Creation ===
Token creation TX: 4znrmXdBLokfd3kAAHzs8R55eMXFJCe31eLoFtPUrncHU1Uo1UQUSXRyPRRqm4dsJ1YxGugDroKSFSfZuDvEGBZJ
Token address (mint): GzsMKTqH3PuZGXL1B4A7CVeLsbcV8tsmQdNPiiuo96hN
Initial supply: 100000000000000000
Minted to (token account): C7XgYTq8YqAnijcSXQwGaqSRDQj5dfNKXp6VwpkqieRP
    ✔ Creates a token (457ms)

=== Pool Creation ===
Pool creation TX: 3FEgKD36F8RV57EJz6am1bDrgKHbhiTdGchwjHzxnLZBfaBp8Rckccx625V8cqA3VtZYHcyXUYknHSEwYqDaigh5
Pool address (bonding curve): 2h9W9v9rG82V7Et5LK59F9JoTcFVemsoAVNZ9cQHv3bj
Pool token account: Fd9NLRxz4zKK2N65ssJMYyzeoB6gsE3n2RgxXaRppTm5
Pool initial price: 10000
Pool total supply: 100000000000000000
    ✔ Creates a pool (405ms)

=== Token Purchase ===
Buyer address: GEDbafFFyNsc1WnUVUXfUTx91bzb32CuTVji1P6sPDM1
Buyer initial balance: 10000000000000
Amount to buy: 1
Pool info before purchase:
Pool info:
  Total supply: 100000000000000000
  Current price: 10000
Buy transaction signature: 2TBr3BUknNFz89dPovwEgKs4JpoxRbCjAey6HZiKzJVKwWN9SUsphrCqemFxtn4ojYFLsWFX8NVB8tV2cDmSY8xp
Buyer final balance: 8999997950720
Buyer token balance: 1e-9
Pool info after purchase:
Pool info:
  Total supply: 99999999999999999
  Current price: 1000000009999
    ✔ Buys tokens (809ms)

3 passing (2s)

Disclaimer

This project is in active development. The code and features are subject to change. Do not use in production environments.

Contributing

We welcome contributions to the Tokenix project. Please feel free to submit issues and pull requests.

License

MIT License

Contact

For any inquiries or support, please contact us at:

Security

We take the security of our smart contracts seriously. If you discover any security issues, please report them to [email protected].

Acknowledgements

We would like to thank the Solana and Anchor teams for their excellent documentation and tools, which have been instrumental in the development of this project.

Development Setup

For developers looking to contribute or modify the smart contract:

  1. Install Rust and Cargo:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  2. Install Solana CLI tools:

    sh -c "$(curl -sSfL https://release.solana.com/v1.14.11/install)"
    
  3. Install Anchor:

    cargo install --git https://github.com/project-serum/anchor avm --locked --force
    avm install latest
    avm use latest
    
  4. Set up a local Solana validator:

    solana-test-validator
    

Smart Contract Structure

The main components of the Tokenix smart contract are:

  • lib.rs: Contains the core logic for token creation, pool management, and token purchases.
  • state.rs: Defines the state structures used in the contract.
  • errors.rs: Custom error types for better error handling.

Testing

We use Anchor's testing framework for our unit and integration tests. To add new tests:

  1. Navigate to the tests directory.
  2. Add your test cases to the existing test files or create new ones.
  3. Run the tests using the command mentioned in the "Running Tests" section.

Deployment

To deploy the smart contract to the Solana devnet:

  1. Build the project:

    anchor build
    
  2. Get the program ID:

    solana address -k target/deploy/tokenix-keypair.json
    
  3. Update the program ID in Anchor.toml and lib.rs.

  4. Deploy the program:

    anchor deploy --provider.cluster devnet
    

Remember to thoroughly test on devnet before considering mainnet deployment.

You might also like...
A slightly smart clipboard tool - leverage the filesystem to persist across machines after shutdown.

clipd A slightly smart clipboard using the filesystem under ~/.clipd to persist after shutdown. cowsay "clipd is great" | clipd copy clipd paste ____

Haylou Smart Watch 2 (LS02) reverse-engineering project

Haywatch Haywatch Hello Haylou Watch features Device communication General command structure Pairing Unpairing Battery Firmware Date and time Pulses U

zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit
zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit

zkPoEX enables white hat hackers to report live vulnerabilities in smart contracts while maintaining the confidentiality of the exploit, facilitating efficient communication and collaboration between hackers and project owners for a more secure DeFi ecosystem.

Rust implementation of world of warcraft client v3.3.5a (smart CLI)

idewave-cli This is Rust implementation of World of Warcraft client v3.3.5a. Smart CLI. You can use the CLI to debug TCP packets from/to World of Warc

A cute and smart arm warmer sleeve ^_^
A cute and smart arm warmer sleeve ^_^

LuLuu! A cute and smart arm-warmer sleeve with a 1.3" full color TFT display built into the back of the hand ^_^ Hardware Runs on a RaspberryPi RP2040

🚧 Meta Programming language automating multilang communications in a smart way

Table of Contents Merge TLDR Manifest merge-lang Inference File Structure Compile Scheduling Execution Runtime Package Manager API Merge NOTE: Any of

Configurable, smart and fast CSS/SCSS/Sass/Less formatter.

🌷 Malva Malva is a configurable, smart and fast CSS/SCSS/Sass/Less formatter. Why? Configurable Malva is configurable. It provides several configurat

Command line interface for Solana Metaplex programs.

Metaplex Command Line Interface This is a command line interface for creating and managing non-fungible tokens on the Solana blockchain through the Me

A template with cookie cutter CLI, Program and Integration tests for Solana blockchain
A template with cookie cutter CLI, Program and Integration tests for Solana blockchain

About solana-cli-program template is a sample app demonstrating the creation of a minimal CLI application written in Rust to interact with Solana and

Hilbert curve but in Rust for j2kun/pmpf-code

About this code This repository contains code for matrix multiplication using Hilbert Curves. The original code (2) is part of @j2kun's code for his n

Christoph Siedentop 1 Jan 10, 2022
An enhanced version of filetime, which can set file creation time on Windows.

filetime_creation Documentation An enhanced version of filetime, which can set file creation time on Windows. Internally, this use SetFileTime Win32 A

29 4 Dec 5, 2022
EmbedAnything is a powerful python library designed to streamline the creation and management of embedding pipelines

EmbedAnything is a powerful python library designed to streamline the creation and management of embedding pipelines. Built in Rust with no heavy dependencies.

Starlight 39 May 7, 2024
An anchor CPI client for the SPL token lending program

anchor-lending anchor-lending is an anchor CPI client for any program that implements or extends the instruction interface found in the spl token lend

Rohan Kapur 11 Oct 24, 2022
Tool for audit and reclaim of delegated SPL Token accounts

Usage Install prerequisites System development libraries sudo apt install libssl-dev libudev-dev pkg-config gcc Rust curl --proto '=https' --tlsv1.2

Solana Foundation 4 Jan 27, 2022
A Twitch OAuth token revoker written in Rust.

Revoker - A Twitch OAuth Token Revoker Details Revoker is a small CLI tool written in Rust, made so you can easily and urgently remove a Twitch OAuth

Mykola 4 May 20, 2022
Design token framework — adopt a unified design language across platforms, codebases, and teams

Palette Design tokens framework with atomic classes for React and Master CSS. Deliver a consistent visual identity across your apps with design tokens

Foretag 4 Aug 23, 2022
🚀 Blazing fast and Powerful Discord Token Grabber, no popo made with python

Rusty-Grabber ?? a blazing fast Discord Token Grabber, no popo made with python Fastest Token Grabber ever : Rusty-Grabber> time ./target/release/grab

bishop 5 Sep 1, 2023
Command line utility for controlling LIFX smart lights

lifxc is a command line utility for controlling LIFX smart lights. Currently, communication over the LIFX LAN protocol is supported.

Harrison Rigg 1 Nov 17, 2021
CLI for the Goki Smart Wallet system.

goki-cli CLI for the Goki Smart Wallet system. Installation First, make sure you have the Solana CLI tools installed. Follow the instructions here. Ne

Goki Protocol 18 Jul 18, 2022