Skip to content

Commit

Permalink
Merge pull request #1 from husreo/test_branch
Browse files Browse the repository at this point in the history
Test branch
  • Loading branch information
husreo authored Dec 13, 2024
2 parents f7c9cee + ad49913 commit 0769f24
Show file tree
Hide file tree
Showing 63 changed files with 1,731 additions and 1,565 deletions.
8 changes: 4 additions & 4 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ skip-lint = false



[programs.localnet]
pump_science = "46EymXtUWmsPZ9xZH5VtK5uVWR45P7j4UCdYyDdVbYof"
[programs.devnet]
pump_science = "Fmktp2VXcDorWkAyzZAEG5X859mxKMV8XCcayKgZVwBo"

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

[provider]
cluster = "Localnet"
wallet = "./pump_key.json"
cluster = "Devnet"
wallet = "./pump_fun.json"

[scripts]
test = "yarn run ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts"
35 changes: 14 additions & 21 deletions cli/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
Connection,
PublicKey,
} from '@solana/web3.js';
import { migrate, global, createBondingCurve, setClusterConfig } from './script';
import { migrate, global, createBondingCurve, setClusterConfig, addWl } from './script';

program.version('0.0.1');

Expand All @@ -12,52 +12,45 @@ programCommand('migrate')
.action(async (directory, cmd) => {
const { env, keypair, rpc } = cmd.opts();

// console.log('Solana Cluster:', env);
// console.log('Keypair Path:', keypair);
// console.log('RPC URL:', rpc);

await setClusterConfig(env, keypair, rpc)

const txId = await migrate();
console.log("Transaction ID: " ,txId);
const migrateTxId = await migrate();
console.log("Transaction ID: " ,migrateTxId);
});

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

// console.log('Solana Cluster:', env);
// console.log('Keypair Path:', keypair);
// console.log('RPC URL:', rpc);

await setClusterConfig(env, keypair, rpc)

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

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

await setClusterConfig(env, keypair, rpc)
await createBondingCurve();
});

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

await setClusterConfig(env, keypair, rpc)

const txId = await createBondingCurve();
console.log("Transaction ID: " ,txId);
await addWl();
});

function programCommand(name: string) {
return program
.command(name)
.option('-e, --env <string>', 'Solana cluster env name', 'devnet')
.option('-r, --rpc <string>', 'Solana cluster RPC name', 'https://api.devnet.solana.com')
.option('-k, --keypair <string>', 'Solana wallet Keypair Path', '/home/ubuntu/pump-fun-contract/pump-science-contract/pump_key.json')
.option('-r, --rpc <string>', 'Solana cluster RPC name', 'https://devnet.helius-rpc.com/?api-key=926da061-472b-438a-bbb1-f289333c4126')
.option('-k, --keypair <string>', 'Solana wallet Keypair Path', '/home/king/contract_test/pump_science/pump-science-contract//pump_fun.json')
}

program.parse(process.argv);
12 changes: 5 additions & 7 deletions cli/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
} from "@solana/web3.js";
import { BN } from "bn.js";

export const PUMPSCIENCE = new PublicKey("46EymXtUWmsPZ9xZH5VtK5uVWR45P7j4UCdYyDdVbYof");
export const PUMPSCIENCE = new PublicKey("Fmktp2VXcDorWkAyzZAEG5X859mxKMV8XCcayKgZVwBo");
export const PROGRAM_ID = 'Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB';
export const VAULT_SEED = "vault-authority";
export const GLOBAL_VAULT_SEED = "fee-vault";
Expand All @@ -20,21 +20,19 @@ export const SEEDS = Object.freeze({
export enum ProgramStatus { Running, SwapOnly, SwapOnlyNoLaunch, Paused };
export const TOKEN_DECIMALS = 9;
export const INIT_DEFAULTS = {
feeRecipient: null,
initialVirtualTokenReserves: new BN(1073000000000000),
initialVirtualSolReserves: new BN(30 * LAMPORTS_PER_SOL),
initialRealTokenReserves: new BN(793100000000000),
tokenTotalSupply: new BN(1000100000000000),
feeBps: new BN(100),
mintDecimals: TOKEN_DECIMALS,
feeRecipients: null,
feeReceiver: MIGRATION_VAULT,
status: null,
migrateFeeAmount: new BN(500)
migrateFeeAmount: new BN(500),
whitelistEnabled: true,
meteoraConfig: new PublicKey("21PjsfQVgrn56jSypUT5qXwwSjwKWvuoBCKbVZrgTLz4")
}

export const SIMPLE_DEFAULT_BONDING_CURVE_PRESET = {
name: "simpleBondingCurve",
name: "simpleBondingCurve" + Math.floor(Math.random()* 100).toString(),
symbol: "SBC",
uri: "https://www.simpleBondingCurve.com",
startTime: null,
Expand Down
Loading

0 comments on commit 0769f24

Please sign in to comment.