Setup Token Sale (IDO)
Last updated
Was this helpful?
Last updated
Was this helpful?
Clone the repo from
This repo contains
Token Sale program
JavaScript bindings (using @solana/web3.js)
Test client
Install the latest Rust stable from
Install Solana v1.6.6 or later from
Start a local Solana cluster:
Build token sale on-chain program
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
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
Before running the JS client, please ensure you completed the following steps
Update tokenWhitelistMap
inside js/client/pubkeys.js
with the public-key of the token whitelist map obtained after setting up token whitelist
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
You can modify js/cli/main.js
and js/cli/token-sale-test.js
to suit your needs.
Build and deploy token whitelist program from
In order to run token sale program, you will need token whitelist to be created. You will find instructions here