A small script to manage some common operations with tokens.
Modify the following variables:
/* Number of decimals for the token */
const TOKEN_DECIMALS = 0;
/* One of 'create', 'mint', 'airdrop', 'verify-airdrop' */
const ACTION = 'create';
const NODE = 'https://ssc-dao.genesysgo.net/';
/* Number of tokens to mint */
const TOKEN_SUPPLY = 100000;
You can change loadSeed
to loadPrivateKey
if you have the private key in a base58 format, if you exported from phantom, for example.
- Create a new token. Token will have 0 decimals by default.
- Mint private key. Can generate this with
solana-keygen
. Can be a vanity address. Should be located inmint.json
.
Example:
[251,204,206,182,109,188,156,211,71,63,211,46,193,53,166,0,232,96,64,183,51,199,34,40,134,65,76,19,215,167,134,6,9,101,234,98,247,199,77,184,236,192,250,110,96,246,145,124,139,138,12,45,124,94,217,100,79,101,142,90,187,32,53,142]
- Private key to pay for token creation. Will cost around 0.002 SOL. Should be located in
privateKey.json
. Same format as mint private key.
- Mint tokens for a mint you have already created.
- Mint private key. Can generate this with
solana-keygen
. Can be a vanity address. Should be located inmint.json
. - Private key to pay for token creation. Will cost around 0.002 SOL. Should be located in
privateKey.json
. Same format as mint private key.
- Airdrop created tokens to specific addresses
- Mint private key. Can generate this with
solana-keygen
. Can be a vanity address. Should be located inmint.json
. - Private key to pay for token creation. Will cost around 0.002 SOL. Should be located in
privateKey.json
. Same format as mint private key. - Airdrop destinations. Should be a JSON array with elements 'addr' and 'count'.
Example:
[
{
"addr": "3Ycvz1q5uaqSiMYVoGuHM9D865gzKFHcKt2MsSrBS7Xn",
"count": 1
},
{
"addr": "EPuAgBXH6nyfHwHo5k8QX7vGA1y1T7W32mFS9TY2Wx7g",
"count": 2
}
]
- Verify airdrop completed successfully
- Mint private key. Can generate this with
solana-keygen
. Can be a vanity address. Should be located inmint.json
. - Private key to pay for token creation. Will cost around 0.002 SOL. Should be located in
privateKey.json
. Same format as mint private key. - Airdrop destinations. Should be a JSON array with elements 'addr' and 'count'.