Giter VIP home page Giter VIP logo

solr-token-sale's Introduction

SolRazr Token Sale

This repo contains

  • Token Sale program
  • JavaScript bindings (using @solana/web3.js)
  • Test client

Environment Setup

  1. Install the latest Rust stable from https://rustup.rs/
  2. Install Solana v1.6.6 or later from https://docs.solana.com/cli/install-solana-cli-tools

Build

Start a local Solana cluster:

$ solana-test-validator

Build token sale on-chain program

$ cd program
$ cargo build-bpf

Deploy the program to localnet using the command displayed when you run the build above. Note down the public-key of the program once deployed (this is the solrazr-token-sale program id) and do the following.

Update TOKEN_SALE_PROGRAM_ID inside js/client/pubkeys.js with the public-key generated above

Build And Deploy Token Whitelist Program

Build and deploy token whitelist program from https://github.com/solrazr-app/solr-token-whitelist

$ cd program
$ cargo build-bpf

Note down the public-key of the program once deployed (this is the token whitelist program id) and do the following.

Update TOKEN_WHITELIST_PROGRAM_ID inside js/client/pubkeys.js with the public-key generated above

Setup Token Whitelist

In order to run token sale program, you will need token whitelist to be created. You will find instructions here https://github.com/solrazr-app/solr-token-whitelist

Running JS Client

Before running the JS client, please ensure you completed the following steps

  1. Update tokenWhitelistMap inside js/client/pubkeys.js with the public-key of the token whitelist map obtained after setting up token whitelist
  2. In the function ExecuteTokenSale inside js/cli/token-sale-test.js, update tokenWhitelistAccount with the pubkey of the token whitelist account (this is different from the token whitlelist map)

You can use the JS client to test the program

$ cd js
$ npm run start

You can modify js/cli/main.js and js/cli/token-sale-test.js to suit your needs.

solr-token-sale's People

Contributors

peakyblinder255 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.