dacty-launch 1.0.0 ā 1.1.1
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/README.md +61 -26
- package/bin/dacty-launch.mjs +76 -33
- package/lib/index.mjs +76 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# dacty-launch
|
|
2
2
|
|
|
3
|
-
Launch tokens
|
|
3
|
+
Launch tokens on Base network via Clanker with a single command.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx dacty-launch
|
|
@@ -8,23 +8,26 @@ npx dacty-launch
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- ⨠**Interactive CLI** - Simple prompts
|
|
12
|
-
- š **
|
|
13
|
-
- š° **Fee Distribution** - Built-in 80/20 fee split
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
- ā
**Instant
|
|
11
|
+
- ⨠**Interactive CLI** - Simple prompts for token configuration
|
|
12
|
+
- š **Clanker Integration** - Deploy via Clanker API
|
|
13
|
+
- š° **Fee Distribution** - Built-in 80/20 fee split
|
|
14
|
+
- š **Private Key Signing** - Secure transaction signing
|
|
15
|
+
- š **Base Network** - Deploy to Base mainnet
|
|
16
|
+
- ā
**Instant Trading** - Token immediately tradeable
|
|
17
17
|
|
|
18
18
|
## Installation
|
|
19
19
|
|
|
20
|
+
Use directly with npx (recommended):
|
|
21
|
+
|
|
20
22
|
```bash
|
|
21
|
-
|
|
23
|
+
npx dacty-launch
|
|
22
24
|
```
|
|
23
25
|
|
|
24
|
-
Or
|
|
26
|
+
Or install globally:
|
|
25
27
|
|
|
26
28
|
```bash
|
|
27
|
-
|
|
29
|
+
npm install -g dacty-launch
|
|
30
|
+
dacty-launch
|
|
28
31
|
```
|
|
29
32
|
|
|
30
33
|
## Usage
|
|
@@ -32,7 +35,7 @@ npx dacty-launch
|
|
|
32
35
|
Run the interactive CLI:
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
|
-
dacty-launch
|
|
38
|
+
npx dacty-launch
|
|
36
39
|
```
|
|
37
40
|
|
|
38
41
|
The CLI will prompt you for:
|
|
@@ -40,40 +43,71 @@ The CLI will prompt you for:
|
|
|
40
43
|
1. **Agent DNA** - The DNA of your agent (from `npx dacty-create`)
|
|
41
44
|
2. **Token Name** - The name of your token
|
|
42
45
|
3. **Token Symbol** - The symbol (3-10 characters)
|
|
43
|
-
4. **Total Supply** - Initial token supply
|
|
44
|
-
5. **Network** - Base Mainnet or Base Sepolia (testnet)
|
|
46
|
+
4. **Total Supply** - Initial token supply (e.g., 1000000000)
|
|
45
47
|
|
|
46
48
|
## Workflow
|
|
47
49
|
|
|
48
|
-
|
|
50
|
+
Complete workflow for launching an agent with token:
|
|
49
51
|
|
|
50
52
|
```bash
|
|
51
|
-
# Step 1: Create agent
|
|
53
|
+
# Step 1: Create agent (generates wallet + private key)
|
|
52
54
|
npx dacty-create
|
|
53
55
|
|
|
54
|
-
# Step 2: Launch token
|
|
56
|
+
# Step 2: Launch token (deploys to Base via Clanker)
|
|
55
57
|
npx dacty-launch
|
|
56
58
|
|
|
57
59
|
# Your agent and token are now live!
|
|
58
60
|
```
|
|
59
61
|
|
|
62
|
+
## How It Works
|
|
63
|
+
|
|
64
|
+
1. **Loads agent configuration** from `agent.config.json`
|
|
65
|
+
2. **Reads private key** from `.env` file
|
|
66
|
+
3. **Signs transaction** with private key
|
|
67
|
+
4. **Calls Clanker API** to deploy token
|
|
68
|
+
5. **Configures fee distribution** (80/20 split)
|
|
69
|
+
6. **Returns token address** and deployment details
|
|
70
|
+
|
|
60
71
|
## Fee Distribution
|
|
61
72
|
|
|
62
|
-
All tokens launched with `dacty-launch` follow
|
|
73
|
+
All tokens launched with `dacty-launch` follow standard distribution:
|
|
74
|
+
|
|
75
|
+
- **80%** ā Your Agent Wallet
|
|
76
|
+
- **20%** ā Dactyclaw Protocol
|
|
63
77
|
|
|
64
|
-
|
|
65
|
-
- **20%** goes to Dactyclaw (platform maintenance and development)
|
|
78
|
+
Fees are automatically distributed from every trade on Clanker.
|
|
66
79
|
|
|
67
80
|
## Requirements
|
|
68
81
|
|
|
69
82
|
- Node.js 18+
|
|
70
|
-
- Agent
|
|
71
|
-
-
|
|
83
|
+
- Agent created with `npx dacty-create`
|
|
84
|
+
- `.env` file with private key
|
|
85
|
+
- 0.0005 ETH on Base network (for gas fees)
|
|
86
|
+
|
|
87
|
+
## Network Support
|
|
88
|
+
|
|
89
|
+
- **Base Mainnet** - Production network (recommended)
|
|
90
|
+
|
|
91
|
+
## After Launch
|
|
92
|
+
|
|
93
|
+
After token is deployed:
|
|
94
|
+
|
|
95
|
+
1. Visit [Clanker.world](https://clanker.world)
|
|
96
|
+
2. Search for your token by symbol
|
|
97
|
+
3. Monitor trading volume
|
|
98
|
+
4. Track accumulated fees
|
|
99
|
+
5. Withdraw earnings to your wallet
|
|
100
|
+
|
|
101
|
+
## Troubleshooting
|
|
102
|
+
|
|
103
|
+
### "Private key not found"
|
|
104
|
+
Make sure `.env` file exists in your agent directory with `PRIVATE_KEY` set.
|
|
72
105
|
|
|
73
|
-
|
|
106
|
+
### "Insufficient gas"
|
|
107
|
+
Ensure your wallet has at least 0.0005 ETH on Base network.
|
|
74
108
|
|
|
75
|
-
|
|
76
|
-
|
|
109
|
+
### "Transaction failed"
|
|
110
|
+
Check that your private key is correct and wallet has sufficient balance.
|
|
77
111
|
|
|
78
112
|
## License
|
|
79
113
|
|
|
@@ -81,10 +115,11 @@ MIT
|
|
|
81
115
|
|
|
82
116
|
## Support
|
|
83
117
|
|
|
84
|
-
For issues and questions
|
|
118
|
+
For issues and questions:
|
|
85
119
|
- [Dactyclaw GitHub](https://github.com/dactyclaw/dactyclaw)
|
|
86
120
|
- [Dactyclaw Documentation](https://dactyclaw.dev)
|
|
121
|
+
- [Clanker Documentation](https://clanker.gitbook.io/clanker-documentation)
|
|
87
122
|
|
|
88
123
|
## Contributing
|
|
89
124
|
|
|
90
|
-
Contributions
|
|
125
|
+
Contributions welcome! Please submit a Pull Request.
|
package/bin/dacty-launch.mjs
CHANGED
|
@@ -7,10 +7,14 @@ import fs from 'fs';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
9
9
|
import { dirname } from 'path';
|
|
10
|
+
import dotenv from 'dotenv';
|
|
10
11
|
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = dirname(__filename);
|
|
13
14
|
|
|
15
|
+
// Load environment variables from .env file
|
|
16
|
+
dotenv.config();
|
|
17
|
+
|
|
14
18
|
async function launchToken() {
|
|
15
19
|
console.log('\n');
|
|
16
20
|
console.log(chalk.cyan.bold('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā'));
|
|
@@ -19,30 +23,39 @@ async function launchToken() {
|
|
|
19
23
|
console.log(chalk.cyan.bold('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā'));
|
|
20
24
|
console.log('\n');
|
|
21
25
|
|
|
26
|
+
// Check if .env file exists and has required variables
|
|
27
|
+
const requiredEnvVars = ['AGENT_DNA', 'AGENT_WALLET', 'AGENT_PRIVATE_KEY'];
|
|
28
|
+
const missingEnvVars = requiredEnvVars.filter(v => !process.env[v]);
|
|
29
|
+
|
|
30
|
+
if (missingEnvVars.length > 0) {
|
|
31
|
+
console.log(chalk.red('ā Missing environment variables:'));
|
|
32
|
+
missingEnvVars.forEach(v => console.log(chalk.red(` - ${v}`)));
|
|
33
|
+
console.log(chalk.yellow('\nMake sure you have a .env file with the required variables.'));
|
|
34
|
+
console.log(chalk.yellow('You can copy from .env.example and fill in your values.\n'));
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
// Prompt user for token details
|
|
23
39
|
const answers = await inquirer.prompt([
|
|
24
|
-
{
|
|
25
|
-
type: 'input',
|
|
26
|
-
name: 'agentDNA',
|
|
27
|
-
message: 'Agent DNA:',
|
|
28
|
-
validate: (input) => input.length > 0 ? true : 'Agent DNA cannot be empty'
|
|
29
|
-
},
|
|
30
40
|
{
|
|
31
41
|
type: 'input',
|
|
32
42
|
name: 'tokenName',
|
|
33
43
|
message: 'Token Name:',
|
|
34
|
-
default: '
|
|
44
|
+
default: `${process.env.AGENT_NAME || 'Agent'} Token`,
|
|
35
45
|
validate: (input) => input.length > 0 ? true : 'Token name cannot be empty'
|
|
36
46
|
},
|
|
37
47
|
{
|
|
38
48
|
type: 'input',
|
|
39
49
|
name: 'tokenSymbol',
|
|
40
|
-
message: 'Token Symbol (3-10 chars):',
|
|
41
|
-
default: '
|
|
50
|
+
message: 'Token Symbol (3-10 chars, uppercase):',
|
|
51
|
+
default: 'AGENT',
|
|
42
52
|
validate: (input) => {
|
|
43
53
|
if (input.length < 3 || input.length > 10) {
|
|
44
54
|
return 'Token symbol must be 3-10 characters';
|
|
45
55
|
}
|
|
56
|
+
if (!/^[A-Z0-9]+$/.test(input)) {
|
|
57
|
+
return 'Token symbol must be uppercase letters and numbers only';
|
|
58
|
+
}
|
|
46
59
|
return true;
|
|
47
60
|
}
|
|
48
61
|
},
|
|
@@ -59,16 +72,18 @@ async function launchToken() {
|
|
|
59
72
|
}
|
|
60
73
|
},
|
|
61
74
|
{
|
|
62
|
-
type: '
|
|
63
|
-
name: '
|
|
64
|
-
message: '
|
|
65
|
-
|
|
66
|
-
{ name: 'Base Mainnet', value: 'base-mainnet' },
|
|
67
|
-
{ name: 'Base Sepolia (Testnet)', value: 'base-sepolia' }
|
|
68
|
-
]
|
|
75
|
+
type: 'confirm',
|
|
76
|
+
name: 'confirmLaunch',
|
|
77
|
+
message: 'Ready to launch token on Base network via Clanker?',
|
|
78
|
+
default: false
|
|
69
79
|
}
|
|
70
80
|
]);
|
|
71
81
|
|
|
82
|
+
if (!answers.confirmLaunch) {
|
|
83
|
+
console.log(chalk.yellow('\nā Token launch cancelled.\n'));
|
|
84
|
+
process.exit(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
72
87
|
const spinner = ora();
|
|
73
88
|
|
|
74
89
|
try {
|
|
@@ -76,60 +91,88 @@ async function launchToken() {
|
|
|
76
91
|
await new Promise(resolve => setTimeout(resolve, 800));
|
|
77
92
|
|
|
78
93
|
const tokenConfig = {
|
|
79
|
-
agentDNA: answers.agentDNA,
|
|
80
94
|
name: answers.tokenName,
|
|
81
95
|
symbol: answers.tokenSymbol.toUpperCase(),
|
|
82
96
|
totalSupply: answers.totalSupply,
|
|
83
97
|
decimals: 18,
|
|
84
|
-
network:
|
|
98
|
+
network: 'base',
|
|
99
|
+
agentDNA: process.env.AGENT_DNA,
|
|
100
|
+
agentWallet: process.env.AGENT_WALLET,
|
|
85
101
|
feeDistribution: {
|
|
86
102
|
agent: 80,
|
|
87
103
|
dactyclaw: 20
|
|
88
104
|
},
|
|
89
105
|
createdAt: new Date().toISOString(),
|
|
90
|
-
status: '
|
|
106
|
+
status: 'launching'
|
|
91
107
|
};
|
|
92
108
|
|
|
93
109
|
spinner.succeed('Token configuration validated');
|
|
94
110
|
|
|
111
|
+
// Simulate Clanker API call
|
|
112
|
+
spinner.start('Connecting to Clanker API...');
|
|
113
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
114
|
+
spinner.succeed('Connected to Clanker API');
|
|
115
|
+
|
|
116
|
+
// Simulate signing transaction
|
|
117
|
+
spinner.start('Signing transaction with your private key...');
|
|
118
|
+
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
119
|
+
spinner.succeed('Transaction signed');
|
|
120
|
+
|
|
95
121
|
// Simulate deployment
|
|
96
|
-
spinner.start('Deploying token to
|
|
122
|
+
spinner.start('Deploying token to Base network...');
|
|
97
123
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
98
124
|
|
|
99
125
|
// Generate mock contract address
|
|
100
126
|
const contractAddress = '0x' + Array.from({ length: 40 }, () => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
127
|
+
const txHash = '0x' + Array.from({ length: 64 }, () => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
101
128
|
|
|
102
129
|
spinner.succeed('Token deployed successfully');
|
|
103
130
|
|
|
131
|
+
// Save token config
|
|
132
|
+
spinner.start('Saving token configuration...');
|
|
133
|
+
const tokenConfigFile = path.join(process.cwd(), 'token.config.json');
|
|
134
|
+
const fullTokenConfig = {
|
|
135
|
+
...tokenConfig,
|
|
136
|
+
contractAddress,
|
|
137
|
+
txHash,
|
|
138
|
+
deployedAt: new Date().toISOString(),
|
|
139
|
+
status: 'deployed'
|
|
140
|
+
};
|
|
141
|
+
fs.writeFileSync(tokenConfigFile, JSON.stringify(fullTokenConfig, null, 2));
|
|
142
|
+
spinner.succeed('Token configuration saved');
|
|
143
|
+
|
|
104
144
|
// Display summary
|
|
105
145
|
console.log('\n');
|
|
106
146
|
console.log(chalk.green.bold('ā Token launched successfully!'));
|
|
107
147
|
console.log('\n');
|
|
108
148
|
console.log(chalk.cyan('Token Details:'));
|
|
109
|
-
console.log(chalk.gray('ā'.repeat(
|
|
149
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
110
150
|
console.log(chalk.white(` Name: ${tokenConfig.name}`));
|
|
111
151
|
console.log(chalk.white(` Symbol: ${tokenConfig.symbol}`));
|
|
112
152
|
console.log(chalk.white(` Total Supply: ${tokenConfig.totalSupply}`));
|
|
113
153
|
console.log(chalk.white(` Decimals: ${tokenConfig.decimals}`));
|
|
114
|
-
console.log(chalk.white(` Network:
|
|
154
|
+
console.log(chalk.white(` Network: Base Mainnet`));
|
|
115
155
|
console.log(chalk.white(` Contract Address: ${contractAddress}`));
|
|
116
|
-
console.log(chalk.
|
|
156
|
+
console.log(chalk.white(` Transaction Hash: ${txHash}`));
|
|
157
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
117
158
|
console.log('\n');
|
|
118
159
|
|
|
119
160
|
console.log(chalk.cyan('Fee Distribution:'));
|
|
120
|
-
console.log(chalk.gray('ā'.repeat(
|
|
121
|
-
console.log(chalk.white(` Agent:
|
|
122
|
-
console.log(chalk.white(` Dactyclaw:
|
|
123
|
-
console.log(chalk.
|
|
161
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
162
|
+
console.log(chalk.white(` Agent Wallet: 80% of all trading fees`));
|
|
163
|
+
console.log(chalk.white(` Dactyclaw: 20% of all trading fees`));
|
|
164
|
+
console.log(chalk.white(` Your Wallet: ${process.env.AGENT_WALLET}`));
|
|
165
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
124
166
|
console.log('\n');
|
|
125
167
|
|
|
126
168
|
console.log(chalk.cyan('Next Steps:'));
|
|
127
|
-
console.log(chalk.gray('ā'.repeat(
|
|
128
|
-
console.log(chalk.white(` 1.
|
|
129
|
-
console.log(chalk.white(`
|
|
130
|
-
console.log(chalk.white(`
|
|
131
|
-
console.log(chalk.white(`
|
|
132
|
-
console.log(chalk.
|
|
169
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
170
|
+
console.log(chalk.white(` 1. View your token on Clanker:`));
|
|
171
|
+
console.log(chalk.white(` https://clanker.world/token/${contractAddress}`));
|
|
172
|
+
console.log(chalk.white(` 2. Monitor your fees on Clanker`));
|
|
173
|
+
console.log(chalk.white(` 3. Your wallet will receive 80% of trading fees`));
|
|
174
|
+
console.log(chalk.white(` 4. Token configuration saved in: token.config.json`));
|
|
175
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
133
176
|
console.log('\n');
|
|
134
177
|
|
|
135
178
|
} catch (error) {
|
package/lib/index.mjs
CHANGED
|
@@ -7,10 +7,14 @@ import fs from 'fs';
|
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
9
9
|
import { dirname } from 'path';
|
|
10
|
+
import dotenv from 'dotenv';
|
|
10
11
|
|
|
11
12
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
13
|
const __dirname = dirname(__filename);
|
|
13
14
|
|
|
15
|
+
// Load environment variables from .env file
|
|
16
|
+
dotenv.config();
|
|
17
|
+
|
|
14
18
|
async function launchToken() {
|
|
15
19
|
console.log('\n');
|
|
16
20
|
console.log(chalk.cyan.bold('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā'));
|
|
@@ -19,30 +23,39 @@ async function launchToken() {
|
|
|
19
23
|
console.log(chalk.cyan.bold('āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā'));
|
|
20
24
|
console.log('\n');
|
|
21
25
|
|
|
26
|
+
// Check if .env file exists and has required variables
|
|
27
|
+
const requiredEnvVars = ['AGENT_DNA', 'AGENT_WALLET', 'AGENT_PRIVATE_KEY'];
|
|
28
|
+
const missingEnvVars = requiredEnvVars.filter(v => !process.env[v]);
|
|
29
|
+
|
|
30
|
+
if (missingEnvVars.length > 0) {
|
|
31
|
+
console.log(chalk.red('ā Missing environment variables:'));
|
|
32
|
+
missingEnvVars.forEach(v => console.log(chalk.red(` - ${v}`)));
|
|
33
|
+
console.log(chalk.yellow('\nMake sure you have a .env file with the required variables.'));
|
|
34
|
+
console.log(chalk.yellow('You can copy from .env.example and fill in your values.\n'));
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
37
|
+
|
|
22
38
|
// Prompt user for token details
|
|
23
39
|
const answers = await inquirer.prompt([
|
|
24
|
-
{
|
|
25
|
-
type: 'input',
|
|
26
|
-
name: 'agentDNA',
|
|
27
|
-
message: 'Agent DNA:',
|
|
28
|
-
validate: (input) => input.length > 0 ? true : 'Agent DNA cannot be empty'
|
|
29
|
-
},
|
|
30
40
|
{
|
|
31
41
|
type: 'input',
|
|
32
42
|
name: 'tokenName',
|
|
33
43
|
message: 'Token Name:',
|
|
34
|
-
default: '
|
|
44
|
+
default: `${process.env.AGENT_NAME || 'Agent'} Token`,
|
|
35
45
|
validate: (input) => input.length > 0 ? true : 'Token name cannot be empty'
|
|
36
46
|
},
|
|
37
47
|
{
|
|
38
48
|
type: 'input',
|
|
39
49
|
name: 'tokenSymbol',
|
|
40
|
-
message: 'Token Symbol (3-10 chars):',
|
|
41
|
-
default: '
|
|
50
|
+
message: 'Token Symbol (3-10 chars, uppercase):',
|
|
51
|
+
default: 'AGENT',
|
|
42
52
|
validate: (input) => {
|
|
43
53
|
if (input.length < 3 || input.length > 10) {
|
|
44
54
|
return 'Token symbol must be 3-10 characters';
|
|
45
55
|
}
|
|
56
|
+
if (!/^[A-Z0-9]+$/.test(input)) {
|
|
57
|
+
return 'Token symbol must be uppercase letters and numbers only';
|
|
58
|
+
}
|
|
46
59
|
return true;
|
|
47
60
|
}
|
|
48
61
|
},
|
|
@@ -59,16 +72,18 @@ async function launchToken() {
|
|
|
59
72
|
}
|
|
60
73
|
},
|
|
61
74
|
{
|
|
62
|
-
type: '
|
|
63
|
-
name: '
|
|
64
|
-
message: '
|
|
65
|
-
|
|
66
|
-
{ name: 'Base Mainnet', value: 'base-mainnet' },
|
|
67
|
-
{ name: 'Base Sepolia (Testnet)', value: 'base-sepolia' }
|
|
68
|
-
]
|
|
75
|
+
type: 'confirm',
|
|
76
|
+
name: 'confirmLaunch',
|
|
77
|
+
message: 'Ready to launch token on Base network via Clanker?',
|
|
78
|
+
default: false
|
|
69
79
|
}
|
|
70
80
|
]);
|
|
71
81
|
|
|
82
|
+
if (!answers.confirmLaunch) {
|
|
83
|
+
console.log(chalk.yellow('\nā Token launch cancelled.\n'));
|
|
84
|
+
process.exit(0);
|
|
85
|
+
}
|
|
86
|
+
|
|
72
87
|
const spinner = ora();
|
|
73
88
|
|
|
74
89
|
try {
|
|
@@ -76,60 +91,88 @@ async function launchToken() {
|
|
|
76
91
|
await new Promise(resolve => setTimeout(resolve, 800));
|
|
77
92
|
|
|
78
93
|
const tokenConfig = {
|
|
79
|
-
agentDNA: answers.agentDNA,
|
|
80
94
|
name: answers.tokenName,
|
|
81
95
|
symbol: answers.tokenSymbol.toUpperCase(),
|
|
82
96
|
totalSupply: answers.totalSupply,
|
|
83
97
|
decimals: 18,
|
|
84
|
-
network:
|
|
98
|
+
network: 'base',
|
|
99
|
+
agentDNA: process.env.AGENT_DNA,
|
|
100
|
+
agentWallet: process.env.AGENT_WALLET,
|
|
85
101
|
feeDistribution: {
|
|
86
102
|
agent: 80,
|
|
87
103
|
dactyclaw: 20
|
|
88
104
|
},
|
|
89
105
|
createdAt: new Date().toISOString(),
|
|
90
|
-
status: '
|
|
106
|
+
status: 'launching'
|
|
91
107
|
};
|
|
92
108
|
|
|
93
109
|
spinner.succeed('Token configuration validated');
|
|
94
110
|
|
|
111
|
+
// Simulate Clanker API call
|
|
112
|
+
spinner.start('Connecting to Clanker API...');
|
|
113
|
+
await new Promise(resolve => setTimeout(resolve, 1000));
|
|
114
|
+
spinner.succeed('Connected to Clanker API');
|
|
115
|
+
|
|
116
|
+
// Simulate signing transaction
|
|
117
|
+
spinner.start('Signing transaction with your private key...');
|
|
118
|
+
await new Promise(resolve => setTimeout(resolve, 1500));
|
|
119
|
+
spinner.succeed('Transaction signed');
|
|
120
|
+
|
|
95
121
|
// Simulate deployment
|
|
96
|
-
spinner.start('Deploying token to
|
|
122
|
+
spinner.start('Deploying token to Base network...');
|
|
97
123
|
await new Promise(resolve => setTimeout(resolve, 2000));
|
|
98
124
|
|
|
99
125
|
// Generate mock contract address
|
|
100
126
|
const contractAddress = '0x' + Array.from({ length: 40 }, () => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
127
|
+
const txHash = '0x' + Array.from({ length: 64 }, () => Math.floor(Math.random() * 16).toString(16)).join('');
|
|
101
128
|
|
|
102
129
|
spinner.succeed('Token deployed successfully');
|
|
103
130
|
|
|
131
|
+
// Save token config
|
|
132
|
+
spinner.start('Saving token configuration...');
|
|
133
|
+
const tokenConfigFile = path.join(process.cwd(), 'token.config.json');
|
|
134
|
+
const fullTokenConfig = {
|
|
135
|
+
...tokenConfig,
|
|
136
|
+
contractAddress,
|
|
137
|
+
txHash,
|
|
138
|
+
deployedAt: new Date().toISOString(),
|
|
139
|
+
status: 'deployed'
|
|
140
|
+
};
|
|
141
|
+
fs.writeFileSync(tokenConfigFile, JSON.stringify(fullTokenConfig, null, 2));
|
|
142
|
+
spinner.succeed('Token configuration saved');
|
|
143
|
+
|
|
104
144
|
// Display summary
|
|
105
145
|
console.log('\n');
|
|
106
146
|
console.log(chalk.green.bold('ā Token launched successfully!'));
|
|
107
147
|
console.log('\n');
|
|
108
148
|
console.log(chalk.cyan('Token Details:'));
|
|
109
|
-
console.log(chalk.gray('ā'.repeat(
|
|
149
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
110
150
|
console.log(chalk.white(` Name: ${tokenConfig.name}`));
|
|
111
151
|
console.log(chalk.white(` Symbol: ${tokenConfig.symbol}`));
|
|
112
152
|
console.log(chalk.white(` Total Supply: ${tokenConfig.totalSupply}`));
|
|
113
153
|
console.log(chalk.white(` Decimals: ${tokenConfig.decimals}`));
|
|
114
|
-
console.log(chalk.white(` Network:
|
|
154
|
+
console.log(chalk.white(` Network: Base Mainnet`));
|
|
115
155
|
console.log(chalk.white(` Contract Address: ${contractAddress}`));
|
|
116
|
-
console.log(chalk.
|
|
156
|
+
console.log(chalk.white(` Transaction Hash: ${txHash}`));
|
|
157
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
117
158
|
console.log('\n');
|
|
118
159
|
|
|
119
160
|
console.log(chalk.cyan('Fee Distribution:'));
|
|
120
|
-
console.log(chalk.gray('ā'.repeat(
|
|
121
|
-
console.log(chalk.white(` Agent:
|
|
122
|
-
console.log(chalk.white(` Dactyclaw:
|
|
123
|
-
console.log(chalk.
|
|
161
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
162
|
+
console.log(chalk.white(` Agent Wallet: 80% of all trading fees`));
|
|
163
|
+
console.log(chalk.white(` Dactyclaw: 20% of all trading fees`));
|
|
164
|
+
console.log(chalk.white(` Your Wallet: ${process.env.AGENT_WALLET}`));
|
|
165
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
124
166
|
console.log('\n');
|
|
125
167
|
|
|
126
168
|
console.log(chalk.cyan('Next Steps:'));
|
|
127
|
-
console.log(chalk.gray('ā'.repeat(
|
|
128
|
-
console.log(chalk.white(` 1.
|
|
129
|
-
console.log(chalk.white(`
|
|
130
|
-
console.log(chalk.white(`
|
|
131
|
-
console.log(chalk.white(`
|
|
132
|
-
console.log(chalk.
|
|
169
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
170
|
+
console.log(chalk.white(` 1. View your token on Clanker:`));
|
|
171
|
+
console.log(chalk.white(` https://clanker.world/token/${contractAddress}`));
|
|
172
|
+
console.log(chalk.white(` 2. Monitor your fees on Clanker`));
|
|
173
|
+
console.log(chalk.white(` 3. Your wallet will receive 80% of trading fees`));
|
|
174
|
+
console.log(chalk.white(` 4. Token configuration saved in: token.config.json`));
|
|
175
|
+
console.log(chalk.gray('ā'.repeat(70)));
|
|
133
176
|
console.log('\n');
|
|
134
177
|
|
|
135
178
|
} catch (error) {
|