Skip to content

Commit c6480c4

Browse files
committed
feat: migrate logic && sol, token amount calcualte
1 parent 0b3bfe3 commit c6480c4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+692
-854
lines changed

Anchor.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ skip-lint = false
66

77

88

9-
[programs.localnet]
10-
pump_science = "4HNtUwX2P8z275jK3R6x7KoFqPx3bQWjXxhWtAFCiuvW"
9+
[programs.devnet]
10+
pump_science = "HAV7nVFUHfpJfm21fGKokxvDcJWPYyUzwfSm91zcvAc1"
1111

1212
[registry]
1313
url = "https://api.apr.dev"
1414

1515
[provider]
16-
cluster = "Localnet"
16+
cluster = "Devnet"
1717
wallet = "./pump_key.json"
1818

1919
[scripts]

cli/command.ts

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import {
33
Connection,
44
PublicKey,
55
} from '@solana/web3.js';
6-
import { migrate, global, createBondingCurve, setClusterConfig } from './script';
6+
import { migrate, global, createBondingCurve, setClusterConfig, addWl } from './script';
77

88
program.version('0.0.1');
99

@@ -12,52 +12,48 @@ programCommand('migrate')
1212
.action(async (directory, cmd) => {
1313
const { env, keypair, rpc } = cmd.opts();
1414

15-
// console.log('Solana Cluster:', env);
16-
// console.log('Keypair Path:', keypair);
17-
// console.log('RPC URL:', rpc);
18-
1915
await setClusterConfig(env, keypair, rpc)
20-
21-
const txId = await migrate();
22-
console.log("Transaction ID: " ,txId);
16+
const migrateTxId = await migrate();
17+
console.log("Transaction ID: " ,migrateTxId);
2318
});
2419

2520
programCommand('global')
2621
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2722
.action(async (directory, cmd) => {
2823
const { env, keypair, rpc } = cmd.opts();
2924

30-
// console.log('Solana Cluster:', env);
31-
// console.log('Keypair Path:', keypair);
32-
// console.log('RPC URL:', rpc);
33-
3425
await setClusterConfig(env, keypair, rpc)
3526

3627
const txId = await global();
3728
console.log("Transaction ID: " ,txId);
3829
});
3930

4031
programCommand('createCurve')
41-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4232
.action(async (directory, cmd) => {
4333
const { env, keypair, rpc } = cmd.opts();
34+
35+
await setClusterConfig(env, keypair, rpc)
36+
await createBondingCurve();
37+
});
4438

45-
// console.log('Solana Cluster:', env);
46-
// console.log('Keypair Path:', keypair);
47-
// console.log('RPC URL:', rpc);
39+
programCommand('addWl')
40+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
41+
.action(async (directory, cmd) => {
42+
const { env, keypair, rpc } = cmd.opts();
4843

4944
await setClusterConfig(env, keypair, rpc)
5045

46+
await addWl();
47+
5148
const txId = await createBondingCurve();
5249
console.log("Transaction ID: " ,txId);
5350
});
54-
5551
function programCommand(name: string) {
5652
return program
5753
.command(name)
5854
.option('-e, --env <string>', 'Solana cluster env name', 'devnet')
59-
.option('-r, --rpc <string>', 'Solana cluster RPC name', 'https://api.devnet.solana.com')
60-
.option('-k, --keypair <string>', 'Solana wallet Keypair Path', '/home/ubuntu/pump-fun-contract/pump-science-contract/pump_key.json')
55+
.option('-r, --rpc <string>', 'Solana cluster RPC name', 'rpc')
56+
.option('-k, --keypair <string>', 'Solana wallet Keypair Path', '/home/king/contract_test/pump_science/pump-science-contract//pump_key.json')
6157
}
6258

6359
program.parse(process.argv);

cli/constants.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
} from "@solana/web3.js";
55
import { BN } from "bn.js";
66

7-
export const PUMPSCIENCE = new PublicKey("4HNtUwX2P8z275jK3R6x7KoFqPx3bQWjXxhWtAFCiuvW");
7+
export const PUMPSCIENCE = new PublicKey("HAV7nVFUHfpJfm21fGKokxvDcJWPYyUzwfSm91zcvAc1");
88
export const PROGRAM_ID = 'Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB';
99
export const VAULT_SEED = "vault-authority";
1010
export const GLOBAL_VAULT_SEED = "fee-vault";
@@ -20,21 +20,19 @@ export const SEEDS = Object.freeze({
2020
export enum ProgramStatus { Running, SwapOnly, SwapOnlyNoLaunch, Paused };
2121
export const TOKEN_DECIMALS = 9;
2222
export const INIT_DEFAULTS = {
23-
feeRecipient: null,
2423
initialVirtualTokenReserves: new BN(1073000000000000),
2524
initialVirtualSolReserves: new BN(30 * LAMPORTS_PER_SOL),
2625
initialRealTokenReserves: new BN(793100000000000),
2726
tokenTotalSupply: new BN(1000100000000000),
28-
feeBps: new BN(100),
2927
mintDecimals: TOKEN_DECIMALS,
30-
feeRecipients: null,
3128
feeReceiver: MIGRATION_VAULT,
3229
status: null,
33-
migrateFeeAmount: new BN(500)
30+
migrateFeeAmount: new BN(500),
31+
whitelistEnabled: true,
32+
meteoraConfig: new PublicKey("21PjsfQVgrn56jSypUT5qXwwSjwKWvuoBCKbVZrgTLz4")
3433
}
35-
3634
export const SIMPLE_DEFAULT_BONDING_CURVE_PRESET = {
37-
name: "simpleBondingCurve",
35+
name: "simpleBondingCurve" + Math.floor(Math.random()* 100).toString(),
3836
symbol: "SBC",
3937
uri: "https://www.simpleBondingCurve.com",
4038
startTime: null,

0 commit comments

Comments
 (0)