dacty-launch 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/dacty-launch.mjs +158 -157
- package/lib/index.mjs +158 -157
- package/package.json +4 -2
package/bin/dacty-launch.mjs
CHANGED
|
@@ -1,217 +1,218 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import inquirer from 'inquirer';
|
|
5
|
-
import ora from 'ora';
|
|
6
3
|
import fs from 'fs';
|
|
7
4
|
import path from 'path';
|
|
8
5
|
import { fileURLToPath } from 'url';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import readline from 'readline';
|
|
7
|
+
import { Clanker } from 'clanker-sdk/v4';
|
|
8
|
+
import { createWalletClient, createPublicClient, privateKeyToAccount, http } from 'viem';
|
|
9
|
+
import { base } from 'viem/chains';
|
|
11
10
|
|
|
12
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = dirname(__filename);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const rl = readline.createInterface({
|
|
15
|
+
input: process.stdin,
|
|
16
|
+
output: process.stdout,
|
|
17
|
+
});
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function question(prompt) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
rl.question(prompt, (answer) => {
|
|
22
|
+
resolve(answer);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
async function main() {
|
|
28
|
+
console.log('\n╔═══════════════════════════════════════╗');
|
|
29
|
+
console.log('║ DACTYCLAW - Token Launch ║');
|
|
30
|
+
console.log('║ Powered by Clanker v4.0.0 ║');
|
|
31
|
+
console.log('╚═══════════════════════════════════════╝\n');
|
|
32
|
+
|
|
33
|
+
// Check if agent.config.json exists
|
|
34
|
+
const agentConfigPath = path.join(process.cwd(), 'agent.config.json');
|
|
35
|
+
if (!fs.existsSync(agentConfigPath)) {
|
|
36
|
+
console.error('❌ Error: agent.config.json not found!');
|
|
37
|
+
console.error(' Please run `npx dacty-create` first to create an agent.');
|
|
29
38
|
process.exit(1);
|
|
30
39
|
}
|
|
31
40
|
|
|
32
|
-
// Load agent
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
// Load agent configuration
|
|
42
|
+
const agentConfig = JSON.parse(fs.readFileSync(agentConfigPath, 'utf-8'));
|
|
43
|
+
console.log(`✓ Agent loaded: ${agentConfig.name} (DNA: ${agentConfig.dna})`);
|
|
44
|
+
console.log(`✓ Wallet: ${agentConfig.wallet}\n`);
|
|
45
|
+
|
|
46
|
+
// Check if .env exists with private key
|
|
47
|
+
const envPath = path.join(process.cwd(), '.env');
|
|
48
|
+
if (!fs.existsSync(envPath)) {
|
|
49
|
+
console.error('❌ Error: .env file not found!');
|
|
50
|
+
console.error(' Private key should be in .env file.');
|
|
39
51
|
process.exit(1);
|
|
40
52
|
}
|
|
41
53
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
console.
|
|
54
|
+
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
55
|
+
const privateKeyMatch = envContent.match(/PRIVATE_KEY=(.+)/);
|
|
56
|
+
if (!privateKeyMatch) {
|
|
57
|
+
console.error('❌ Error: PRIVATE_KEY not found in .env file!');
|
|
46
58
|
process.exit(1);
|
|
47
59
|
}
|
|
48
60
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
type: 'input',
|
|
53
|
-
name: 'tokenName',
|
|
54
|
-
message: 'Token name:',
|
|
55
|
-
default: `${agentConfig.name} Token`,
|
|
56
|
-
validate: (input) => input.length > 0 && input.length <= 50 ? true : 'Token name must be 1-50 characters',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: 'input',
|
|
60
|
-
name: 'tokenSymbol',
|
|
61
|
-
message: 'Token symbol (uppercase):',
|
|
62
|
-
default: agentConfig.name.substring(0, 4).toUpperCase(),
|
|
63
|
-
validate: (input) => /^[A-Z0-9]{1,10}$/.test(input) ? true : 'Symbol must be 1-10 uppercase letters/numbers',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'input',
|
|
67
|
-
name: 'supply',
|
|
68
|
-
message: 'Total supply (in billions):',
|
|
69
|
-
default: '1',
|
|
70
|
-
validate: (input) => !isNaN(input) && parseFloat(input) > 0 ? true : 'Supply must be a positive number',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: 'confirm',
|
|
74
|
-
name: 'confirmLaunch',
|
|
75
|
-
message: 'Ready to deploy token on Base network via Clanker?',
|
|
76
|
-
default: false,
|
|
77
|
-
},
|
|
78
|
-
]);
|
|
79
|
-
|
|
80
|
-
if (!answers.confirmLaunch) {
|
|
81
|
-
console.log(chalk.yellow('\n✗ Token launch cancelled.\n'));
|
|
82
|
-
process.exit(0);
|
|
83
|
-
}
|
|
61
|
+
const privateKey = privateKeyMatch[1].trim();
|
|
62
|
+
console.log('✓ Private key loaded from .env\n');
|
|
84
63
|
|
|
85
|
-
|
|
64
|
+
// Get token details from user
|
|
65
|
+
const tokenName = await question('Token Name: ');
|
|
66
|
+
const tokenSymbol = await question('Token Symbol: ');
|
|
67
|
+
const initialSupply = await question('Initial Supply (default: 1000000000): ') || '1000000000';
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
console.log('\n📋 Configuration:');
|
|
70
|
+
console.log(` Name: ${tokenName}`);
|
|
71
|
+
console.log(` Symbol: ${tokenSymbol}`);
|
|
72
|
+
console.log(` Supply: ${initialSupply}`);
|
|
73
|
+
console.log(` Agent Wallet: ${agentConfig.wallet}`);
|
|
74
|
+
console.log(` Fee Distribution: 80% Agent, 20% Dactyclaw\n`);
|
|
90
75
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const totalSupply = BigInt(supplyInBillions) * BigInt(10) ** BigInt(9) * BigInt(10) ** BigInt(18);
|
|
76
|
+
// Dactyclaw wallet address (should be configured)
|
|
77
|
+
const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x0000000000000000000000000000000000000000';
|
|
94
78
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
79
|
+
try {
|
|
80
|
+
console.log('🔄 Initializing Clanker SDK...');
|
|
81
|
+
|
|
82
|
+
// Setup viem clients
|
|
83
|
+
const account = privateKeyToAccount(`0x${privateKey.replace(/^0x/, '')}`);
|
|
84
|
+
const publicClient = createPublicClient({ chain: base, transport: http() });
|
|
85
|
+
const walletClient = createWalletClient({ account, chain: base, transport: http() });
|
|
86
|
+
|
|
87
|
+
// Initialize Clanker SDK
|
|
88
|
+
const clanker = new Clanker({
|
|
89
|
+
publicClient,
|
|
90
|
+
wallet: walletClient,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
console.log('✓ Clanker SDK initialized');
|
|
94
|
+
console.log('✓ Connected to Base network');
|
|
95
|
+
console.log('✓ Account:', account.address);
|
|
96
|
+
|
|
97
|
+
console.log('\n🚀 Deploying token...');
|
|
98
|
+
|
|
99
|
+
// Deploy token with 80/20 reward split
|
|
100
|
+
const { txHash, waitForTransaction, error } = await clanker.deploy({
|
|
101
|
+
name: tokenName,
|
|
102
|
+
symbol: tokenSymbol,
|
|
103
|
+
tokenAdmin: account.address,
|
|
104
|
+
vanity: true, // Generate vanity address with "b07" suffix
|
|
105
|
+
rewards: {
|
|
106
|
+
recipients: [
|
|
108
107
|
{
|
|
109
108
|
recipient: agentConfig.wallet,
|
|
110
109
|
admin: agentConfig.wallet,
|
|
111
|
-
bps:
|
|
112
|
-
token: '
|
|
110
|
+
bps: 8_000, // 80% of rewards
|
|
111
|
+
token: 'Paired', // Take fees in WETH
|
|
113
112
|
},
|
|
114
113
|
{
|
|
115
114
|
recipient: DACTYCLAW_WALLET,
|
|
116
115
|
admin: DACTYCLAW_WALLET,
|
|
117
|
-
bps:
|
|
118
|
-
token: 'Both', //
|
|
116
|
+
bps: 2_000, // 20% of rewards
|
|
117
|
+
token: 'Both', // Take fees in both tokens
|
|
119
118
|
},
|
|
120
119
|
],
|
|
121
|
-
pool: {
|
|
122
|
-
positions: 'Standard', // Meme token configuration
|
|
123
|
-
},
|
|
124
|
-
fees: {
|
|
125
|
-
type: 'static',
|
|
126
|
-
clankerFee: 100, // 1% in bps
|
|
127
|
-
pairedFee: 100, // 1% in bps
|
|
128
|
-
},
|
|
129
120
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
fees: {
|
|
122
|
+
type: 'static',
|
|
123
|
+
clankerFee: 100, // 1%
|
|
124
|
+
pairedFee: 100, // 1%
|
|
125
|
+
},
|
|
126
|
+
metadata: {
|
|
127
|
+
description: `${tokenName} - Created with DACTYCLAW`,
|
|
128
|
+
},
|
|
129
|
+
context: {
|
|
130
|
+
interface: 'DACTYCLAW',
|
|
131
|
+
},
|
|
132
|
+
});
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
if (!tokenConfig.symbol || tokenConfig.symbol.length === 0) {
|
|
140
|
-
throw new Error('Token symbol is required');
|
|
134
|
+
if (error) {
|
|
135
|
+
console.error('❌ Deployment error:', error);
|
|
136
|
+
process.exit(1);
|
|
141
137
|
}
|
|
142
138
|
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
console.log(`✓ Transaction submitted: ${txHash}`);
|
|
140
|
+
console.log('⏳ Waiting for confirmation...\n');
|
|
141
|
+
|
|
142
|
+
const result = await waitForTransaction();
|
|
145
143
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
if (result.error) {
|
|
145
|
+
console.error('❌ Transaction failed:', result.error);
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
149
|
+
const tokenAddress = result.address;
|
|
153
150
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
console.log('✅ Token deployed successfully!');
|
|
152
|
+
console.log(`\n📊 Token Details:`);
|
|
153
|
+
console.log(` Address: ${tokenAddress}`);
|
|
154
|
+
console.log(` Name: ${tokenName}`);
|
|
155
|
+
console.log(` Symbol: ${tokenSymbol}`);
|
|
156
|
+
console.log(` Supply: ${initialSupply}`);
|
|
157
|
+
console.log(` Network: Base`);
|
|
158
|
+
console.log(` Explorer: https://basescan.org/token/${tokenAddress}`);
|
|
157
159
|
|
|
158
|
-
|
|
160
|
+
console.log(`\n💰 Fee Distribution:`);
|
|
161
|
+
console.log(` Agent (${agentConfig.wallet}): 80%`);
|
|
162
|
+
console.log(` Dactyclaw: 20%`);
|
|
159
163
|
|
|
160
164
|
// Save token configuration
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
const tokenConfig = {
|
|
166
|
+
name: tokenName,
|
|
167
|
+
symbol: tokenSymbol,
|
|
168
|
+
address: tokenAddress,
|
|
169
|
+
supply: initialSupply,
|
|
165
170
|
txHash,
|
|
166
171
|
deployedAt: new Date().toISOString(),
|
|
167
|
-
|
|
172
|
+
network: 'base',
|
|
173
|
+
agentDNA: agentConfig.dna,
|
|
174
|
+
agentWallet: agentConfig.wallet,
|
|
175
|
+
fees: {
|
|
176
|
+
agent: 80,
|
|
177
|
+
dactyclaw: 20,
|
|
178
|
+
},
|
|
168
179
|
};
|
|
169
180
|
|
|
170
|
-
fs.writeFileSync(
|
|
181
|
+
fs.writeFileSync(
|
|
182
|
+
path.join(process.cwd(), 'token.config.json'),
|
|
183
|
+
JSON.stringify(tokenConfig, null, 2)
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
console.log('\n✓ Token configuration saved to token.config.json');
|
|
171
187
|
|
|
172
188
|
// Update agent config with token info
|
|
173
189
|
agentConfig.token = {
|
|
174
|
-
name:
|
|
175
|
-
symbol:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
deploymentDate: tokenConfig.deploymentDate,
|
|
190
|
+
name: tokenName,
|
|
191
|
+
symbol: tokenSymbol,
|
|
192
|
+
address: tokenAddress,
|
|
193
|
+
deployedAt: new Date().toISOString(),
|
|
179
194
|
};
|
|
180
195
|
|
|
181
|
-
fs.writeFileSync(
|
|
182
|
-
|
|
183
|
-
spinner.succeed('Configuration saved');
|
|
184
|
-
|
|
185
|
-
// Display summary
|
|
186
|
-
console.log(chalk.green.bold('\n✓ Token launched successfully!\n'));
|
|
187
|
-
|
|
188
|
-
console.log(chalk.cyan('[ TOKEN DETAILS ]'));
|
|
189
|
-
console.log(chalk.white(`Name: ${tokenConfig.name}`));
|
|
190
|
-
console.log(chalk.white(`Symbol: ${tokenConfig.symbol}`));
|
|
191
|
-
console.log(chalk.white(`Total Supply: ${supplyInBillions}B`));
|
|
192
|
-
console.log(chalk.white(`Network: Base Mainnet`));
|
|
193
|
-
console.log(chalk.white(`Contract Address: ${contractAddress}`));
|
|
194
|
-
console.log(chalk.white(`Transaction: ${txHash}`));
|
|
195
|
-
|
|
196
|
-
console.log(chalk.cyan('\n[ FEE DISTRIBUTION ]'));
|
|
197
|
-
console.log(chalk.white(`Agent Wallet: 80% of trading fees`));
|
|
198
|
-
console.log(chalk.white(`Dactyclaw: 20% of trading fees`));
|
|
199
|
-
console.log(chalk.white(`Your Address: ${agentConfig.wallet}`));
|
|
196
|
+
fs.writeFileSync(agentConfigPath, JSON.stringify(agentConfig, null, 2));
|
|
197
|
+
console.log('✓ Agent configuration updated');
|
|
200
198
|
|
|
201
|
-
console.log(
|
|
202
|
-
console.log(
|
|
203
|
-
console.log(
|
|
204
|
-
console.log(
|
|
205
|
-
console.log(
|
|
199
|
+
console.log('\n🎉 Ready to trade!');
|
|
200
|
+
console.log(`\n📱 View on Clanker: https://clanker.world/token/${tokenAddress}`);
|
|
201
|
+
console.log(`🔗 View on Basescan: https://basescan.org/token/${tokenAddress}`);
|
|
202
|
+
console.log(`\n💡 Next steps:`);
|
|
203
|
+
console.log(` 1. Fund your wallet with ETH for gas fees`);
|
|
204
|
+
console.log(` 2. Monitor your token on Clanker.world`);
|
|
205
|
+
console.log(` 3. Check your earnings: npx dacty-status`);
|
|
206
206
|
|
|
207
|
+
rl.close();
|
|
207
208
|
} catch (error) {
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
console.error('❌ Error:', error.message);
|
|
210
|
+
rl.close();
|
|
210
211
|
process.exit(1);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
|
|
214
|
-
|
|
215
|
-
console.error(
|
|
215
|
+
main().catch((error) => {
|
|
216
|
+
console.error('❌ Fatal error:', error);
|
|
216
217
|
process.exit(1);
|
|
217
218
|
});
|
package/lib/index.mjs
CHANGED
|
@@ -1,217 +1,218 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import chalk from 'chalk';
|
|
4
|
-
import inquirer from 'inquirer';
|
|
5
|
-
import ora from 'ora';
|
|
6
3
|
import fs from 'fs';
|
|
7
4
|
import path from 'path';
|
|
8
5
|
import { fileURLToPath } from 'url';
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import readline from 'readline';
|
|
7
|
+
import { Clanker } from 'clanker-sdk/v4';
|
|
8
|
+
import { createWalletClient, createPublicClient, privateKeyToAccount, http } from 'viem';
|
|
9
|
+
import { base } from 'viem/chains';
|
|
11
10
|
|
|
12
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
13
|
-
const __dirname = dirname(__filename);
|
|
12
|
+
const __dirname = path.dirname(__filename);
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
const rl = readline.createInterface({
|
|
15
|
+
input: process.stdin,
|
|
16
|
+
output: process.stdout,
|
|
17
|
+
});
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function question(prompt) {
|
|
20
|
+
return new Promise((resolve) => {
|
|
21
|
+
rl.question(prompt, (answer) => {
|
|
22
|
+
resolve(answer);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
async function main() {
|
|
28
|
+
console.log('\n╔═══════════════════════════════════════╗');
|
|
29
|
+
console.log('║ DACTYCLAW - Token Launch ║');
|
|
30
|
+
console.log('║ Powered by Clanker v4.0.0 ║');
|
|
31
|
+
console.log('╚═══════════════════════════════════════╝\n');
|
|
32
|
+
|
|
33
|
+
// Check if agent.config.json exists
|
|
34
|
+
const agentConfigPath = path.join(process.cwd(), 'agent.config.json');
|
|
35
|
+
if (!fs.existsSync(agentConfigPath)) {
|
|
36
|
+
console.error('❌ Error: agent.config.json not found!');
|
|
37
|
+
console.error(' Please run `npx dacty-create` first to create an agent.');
|
|
29
38
|
process.exit(1);
|
|
30
39
|
}
|
|
31
40
|
|
|
32
|
-
// Load agent
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
41
|
+
// Load agent configuration
|
|
42
|
+
const agentConfig = JSON.parse(fs.readFileSync(agentConfigPath, 'utf-8'));
|
|
43
|
+
console.log(`✓ Agent loaded: ${agentConfig.name} (DNA: ${agentConfig.dna})`);
|
|
44
|
+
console.log(`✓ Wallet: ${agentConfig.wallet}\n`);
|
|
45
|
+
|
|
46
|
+
// Check if .env exists with private key
|
|
47
|
+
const envPath = path.join(process.cwd(), '.env');
|
|
48
|
+
if (!fs.existsSync(envPath)) {
|
|
49
|
+
console.error('❌ Error: .env file not found!');
|
|
50
|
+
console.error(' Private key should be in .env file.');
|
|
39
51
|
process.exit(1);
|
|
40
52
|
}
|
|
41
53
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
console.
|
|
54
|
+
const envContent = fs.readFileSync(envPath, 'utf-8');
|
|
55
|
+
const privateKeyMatch = envContent.match(/PRIVATE_KEY=(.+)/);
|
|
56
|
+
if (!privateKeyMatch) {
|
|
57
|
+
console.error('❌ Error: PRIVATE_KEY not found in .env file!');
|
|
46
58
|
process.exit(1);
|
|
47
59
|
}
|
|
48
60
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
{
|
|
52
|
-
type: 'input',
|
|
53
|
-
name: 'tokenName',
|
|
54
|
-
message: 'Token name:',
|
|
55
|
-
default: `${agentConfig.name} Token`,
|
|
56
|
-
validate: (input) => input.length > 0 && input.length <= 50 ? true : 'Token name must be 1-50 characters',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
type: 'input',
|
|
60
|
-
name: 'tokenSymbol',
|
|
61
|
-
message: 'Token symbol (uppercase):',
|
|
62
|
-
default: agentConfig.name.substring(0, 4).toUpperCase(),
|
|
63
|
-
validate: (input) => /^[A-Z0-9]{1,10}$/.test(input) ? true : 'Symbol must be 1-10 uppercase letters/numbers',
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
type: 'input',
|
|
67
|
-
name: 'supply',
|
|
68
|
-
message: 'Total supply (in billions):',
|
|
69
|
-
default: '1',
|
|
70
|
-
validate: (input) => !isNaN(input) && parseFloat(input) > 0 ? true : 'Supply must be a positive number',
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
type: 'confirm',
|
|
74
|
-
name: 'confirmLaunch',
|
|
75
|
-
message: 'Ready to deploy token on Base network via Clanker?',
|
|
76
|
-
default: false,
|
|
77
|
-
},
|
|
78
|
-
]);
|
|
79
|
-
|
|
80
|
-
if (!answers.confirmLaunch) {
|
|
81
|
-
console.log(chalk.yellow('\n✗ Token launch cancelled.\n'));
|
|
82
|
-
process.exit(0);
|
|
83
|
-
}
|
|
61
|
+
const privateKey = privateKeyMatch[1].trim();
|
|
62
|
+
console.log('✓ Private key loaded from .env\n');
|
|
84
63
|
|
|
85
|
-
|
|
64
|
+
// Get token details from user
|
|
65
|
+
const tokenName = await question('Token Name: ');
|
|
66
|
+
const tokenSymbol = await question('Token Symbol: ');
|
|
67
|
+
const initialSupply = await question('Initial Supply (default: 1000000000): ') || '1000000000';
|
|
86
68
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
69
|
+
console.log('\n📋 Configuration:');
|
|
70
|
+
console.log(` Name: ${tokenName}`);
|
|
71
|
+
console.log(` Symbol: ${tokenSymbol}`);
|
|
72
|
+
console.log(` Supply: ${initialSupply}`);
|
|
73
|
+
console.log(` Agent Wallet: ${agentConfig.wallet}`);
|
|
74
|
+
console.log(` Fee Distribution: 80% Agent, 20% Dactyclaw\n`);
|
|
90
75
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
const totalSupply = BigInt(supplyInBillions) * BigInt(10) ** BigInt(9) * BigInt(10) ** BigInt(18);
|
|
76
|
+
// Dactyclaw wallet address (should be configured)
|
|
77
|
+
const DACTYCLAW_WALLET = process.env.DACTYCLAW_WALLET || '0x0000000000000000000000000000000000000000';
|
|
94
78
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
79
|
+
try {
|
|
80
|
+
console.log('🔄 Initializing Clanker SDK...');
|
|
81
|
+
|
|
82
|
+
// Setup viem clients
|
|
83
|
+
const account = privateKeyToAccount(`0x${privateKey.replace(/^0x/, '')}`);
|
|
84
|
+
const publicClient = createPublicClient({ chain: base, transport: http() });
|
|
85
|
+
const walletClient = createWalletClient({ account, chain: base, transport: http() });
|
|
86
|
+
|
|
87
|
+
// Initialize Clanker SDK
|
|
88
|
+
const clanker = new Clanker({
|
|
89
|
+
publicClient,
|
|
90
|
+
wallet: walletClient,
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
console.log('✓ Clanker SDK initialized');
|
|
94
|
+
console.log('✓ Connected to Base network');
|
|
95
|
+
console.log('✓ Account:', account.address);
|
|
96
|
+
|
|
97
|
+
console.log('\n🚀 Deploying token...');
|
|
98
|
+
|
|
99
|
+
// Deploy token with 80/20 reward split
|
|
100
|
+
const { txHash, waitForTransaction, error } = await clanker.deploy({
|
|
101
|
+
name: tokenName,
|
|
102
|
+
symbol: tokenSymbol,
|
|
103
|
+
tokenAdmin: account.address,
|
|
104
|
+
vanity: true, // Generate vanity address with "b07" suffix
|
|
105
|
+
rewards: {
|
|
106
|
+
recipients: [
|
|
108
107
|
{
|
|
109
108
|
recipient: agentConfig.wallet,
|
|
110
109
|
admin: agentConfig.wallet,
|
|
111
|
-
bps:
|
|
112
|
-
token: '
|
|
110
|
+
bps: 8_000, // 80% of rewards
|
|
111
|
+
token: 'Paired', // Take fees in WETH
|
|
113
112
|
},
|
|
114
113
|
{
|
|
115
114
|
recipient: DACTYCLAW_WALLET,
|
|
116
115
|
admin: DACTYCLAW_WALLET,
|
|
117
|
-
bps:
|
|
118
|
-
token: 'Both', //
|
|
116
|
+
bps: 2_000, // 20% of rewards
|
|
117
|
+
token: 'Both', // Take fees in both tokens
|
|
119
118
|
},
|
|
120
119
|
],
|
|
121
|
-
pool: {
|
|
122
|
-
positions: 'Standard', // Meme token configuration
|
|
123
|
-
},
|
|
124
|
-
fees: {
|
|
125
|
-
type: 'static',
|
|
126
|
-
clankerFee: 100, // 1% in bps
|
|
127
|
-
pairedFee: 100, // 1% in bps
|
|
128
|
-
},
|
|
129
120
|
},
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
121
|
+
fees: {
|
|
122
|
+
type: 'static',
|
|
123
|
+
clankerFee: 100, // 1%
|
|
124
|
+
pairedFee: 100, // 1%
|
|
125
|
+
},
|
|
126
|
+
metadata: {
|
|
127
|
+
description: `${tokenName} - Created with DACTYCLAW`,
|
|
128
|
+
},
|
|
129
|
+
context: {
|
|
130
|
+
interface: 'DACTYCLAW',
|
|
131
|
+
},
|
|
132
|
+
});
|
|
134
133
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
}
|
|
139
|
-
if (!tokenConfig.symbol || tokenConfig.symbol.length === 0) {
|
|
140
|
-
throw new Error('Token symbol is required');
|
|
134
|
+
if (error) {
|
|
135
|
+
console.error('❌ Deployment error:', error);
|
|
136
|
+
process.exit(1);
|
|
141
137
|
}
|
|
142
138
|
|
|
143
|
-
|
|
144
|
-
|
|
139
|
+
console.log(`✓ Transaction submitted: ${txHash}`);
|
|
140
|
+
console.log('⏳ Waiting for confirmation...\n');
|
|
141
|
+
|
|
142
|
+
const result = await waitForTransaction();
|
|
145
143
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
144
|
+
if (result.error) {
|
|
145
|
+
console.error('❌ Transaction failed:', result.error);
|
|
146
|
+
process.exit(1);
|
|
147
|
+
}
|
|
150
148
|
|
|
151
|
-
|
|
152
|
-
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
149
|
+
const tokenAddress = result.address;
|
|
153
150
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
151
|
+
console.log('✅ Token deployed successfully!');
|
|
152
|
+
console.log(`\n📊 Token Details:`);
|
|
153
|
+
console.log(` Address: ${tokenAddress}`);
|
|
154
|
+
console.log(` Name: ${tokenName}`);
|
|
155
|
+
console.log(` Symbol: ${tokenSymbol}`);
|
|
156
|
+
console.log(` Supply: ${initialSupply}`);
|
|
157
|
+
console.log(` Network: Base`);
|
|
158
|
+
console.log(` Explorer: https://basescan.org/token/${tokenAddress}`);
|
|
157
159
|
|
|
158
|
-
|
|
160
|
+
console.log(`\n💰 Fee Distribution:`);
|
|
161
|
+
console.log(` Agent (${agentConfig.wallet}): 80%`);
|
|
162
|
+
console.log(` Dactyclaw: 20%`);
|
|
159
163
|
|
|
160
164
|
// Save token configuration
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
+
const tokenConfig = {
|
|
166
|
+
name: tokenName,
|
|
167
|
+
symbol: tokenSymbol,
|
|
168
|
+
address: tokenAddress,
|
|
169
|
+
supply: initialSupply,
|
|
165
170
|
txHash,
|
|
166
171
|
deployedAt: new Date().toISOString(),
|
|
167
|
-
|
|
172
|
+
network: 'base',
|
|
173
|
+
agentDNA: agentConfig.dna,
|
|
174
|
+
agentWallet: agentConfig.wallet,
|
|
175
|
+
fees: {
|
|
176
|
+
agent: 80,
|
|
177
|
+
dactyclaw: 20,
|
|
178
|
+
},
|
|
168
179
|
};
|
|
169
180
|
|
|
170
|
-
fs.writeFileSync(
|
|
181
|
+
fs.writeFileSync(
|
|
182
|
+
path.join(process.cwd(), 'token.config.json'),
|
|
183
|
+
JSON.stringify(tokenConfig, null, 2)
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
console.log('\n✓ Token configuration saved to token.config.json');
|
|
171
187
|
|
|
172
188
|
// Update agent config with token info
|
|
173
189
|
agentConfig.token = {
|
|
174
|
-
name:
|
|
175
|
-
symbol:
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
deploymentDate: tokenConfig.deploymentDate,
|
|
190
|
+
name: tokenName,
|
|
191
|
+
symbol: tokenSymbol,
|
|
192
|
+
address: tokenAddress,
|
|
193
|
+
deployedAt: new Date().toISOString(),
|
|
179
194
|
};
|
|
180
195
|
|
|
181
|
-
fs.writeFileSync(
|
|
182
|
-
|
|
183
|
-
spinner.succeed('Configuration saved');
|
|
184
|
-
|
|
185
|
-
// Display summary
|
|
186
|
-
console.log(chalk.green.bold('\n✓ Token launched successfully!\n'));
|
|
187
|
-
|
|
188
|
-
console.log(chalk.cyan('[ TOKEN DETAILS ]'));
|
|
189
|
-
console.log(chalk.white(`Name: ${tokenConfig.name}`));
|
|
190
|
-
console.log(chalk.white(`Symbol: ${tokenConfig.symbol}`));
|
|
191
|
-
console.log(chalk.white(`Total Supply: ${supplyInBillions}B`));
|
|
192
|
-
console.log(chalk.white(`Network: Base Mainnet`));
|
|
193
|
-
console.log(chalk.white(`Contract Address: ${contractAddress}`));
|
|
194
|
-
console.log(chalk.white(`Transaction: ${txHash}`));
|
|
195
|
-
|
|
196
|
-
console.log(chalk.cyan('\n[ FEE DISTRIBUTION ]'));
|
|
197
|
-
console.log(chalk.white(`Agent Wallet: 80% of trading fees`));
|
|
198
|
-
console.log(chalk.white(`Dactyclaw: 20% of trading fees`));
|
|
199
|
-
console.log(chalk.white(`Your Address: ${agentConfig.wallet}`));
|
|
196
|
+
fs.writeFileSync(agentConfigPath, JSON.stringify(agentConfig, null, 2));
|
|
197
|
+
console.log('✓ Agent configuration updated');
|
|
200
198
|
|
|
201
|
-
console.log(
|
|
202
|
-
console.log(
|
|
203
|
-
console.log(
|
|
204
|
-
console.log(
|
|
205
|
-
console.log(
|
|
199
|
+
console.log('\n🎉 Ready to trade!');
|
|
200
|
+
console.log(`\n📱 View on Clanker: https://clanker.world/token/${tokenAddress}`);
|
|
201
|
+
console.log(`🔗 View on Basescan: https://basescan.org/token/${tokenAddress}`);
|
|
202
|
+
console.log(`\n💡 Next steps:`);
|
|
203
|
+
console.log(` 1. Fund your wallet with ETH for gas fees`);
|
|
204
|
+
console.log(` 2. Monitor your token on Clanker.world`);
|
|
205
|
+
console.log(` 3. Check your earnings: npx dacty-status`);
|
|
206
206
|
|
|
207
|
+
rl.close();
|
|
207
208
|
} catch (error) {
|
|
208
|
-
|
|
209
|
-
|
|
209
|
+
console.error('❌ Error:', error.message);
|
|
210
|
+
rl.close();
|
|
210
211
|
process.exit(1);
|
|
211
212
|
}
|
|
212
213
|
}
|
|
213
214
|
|
|
214
|
-
|
|
215
|
-
console.error(
|
|
215
|
+
main().catch((error) => {
|
|
216
|
+
console.error('❌ Fatal error:', error);
|
|
216
217
|
process.exit(1);
|
|
217
218
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dacty-launch",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.4",
|
|
4
4
|
"description": "Launch tokens for agents in the Dactyclaw ecosystem",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -21,11 +21,13 @@
|
|
|
21
21
|
"author": "Dactyclaw",
|
|
22
22
|
"license": "MIT",
|
|
23
23
|
"dependencies": {
|
|
24
|
+
"clanker-sdk": "^4.0.0",
|
|
24
25
|
"chalk": "^5.3.0",
|
|
25
26
|
"inquirer": "^9.2.12",
|
|
26
27
|
"ora": "^8.0.1",
|
|
27
28
|
"axios": "^1.6.5",
|
|
28
|
-
"dotenv": "^16.3.1"
|
|
29
|
+
"dotenv": "^16.3.1",
|
|
30
|
+
"viem": "^2.0.0"
|
|
29
31
|
},
|
|
30
32
|
"devDependencies": {
|
|
31
33
|
"@types/node": "^20.10.5"
|