@@ -10,19 +10,23 @@ import {
10
10
} from "@ai16z/eliza" ;
11
11
import { composeContext } from "@ai16z/eliza" ;
12
12
import { generateObject } from "@ai16z/eliza" ;
13
-
13
+ import { Percent } from "@uniswap/sdk-core" ;
14
14
import {
15
15
getStarknetAccount ,
16
16
getStarknetProvider ,
17
+ parseFormatedAmount ,
18
+ parseFormatedPercentage ,
17
19
validateSettings ,
18
20
} from "../utils/index.ts" ;
19
21
import { DeployData , Factory } from "@unruggable_starknet/core" ;
20
-
21
- interface SwapContent {
22
- sellTokenAddress : string ;
23
- buyTokenAddress : string ;
24
- sellAmount : string ;
25
- }
22
+ import {
23
+ AMM ,
24
+ EKUBO_TICK_SPACING ,
25
+ LiquidityType ,
26
+ QUOTE_TOKEN_SYMBOL ,
27
+ RECOMMENDED_EKUBO_FEES ,
28
+ } from "@unruggable_starknet/core/constants" ;
29
+ import { ACCOUNTS , TOKENS } from "../utils/constants.ts" ;
26
30
27
31
export function isDeployTokenContent (
28
32
content : DeployData
@@ -108,6 +112,7 @@ export const deployToken: Action = {
108
112
context : deployContext ,
109
113
modelClass : ModelClass . MEDIUM ,
110
114
} ) ;
115
+
111
116
elizaLogger . log ( "init supply." + response . initialSupply ) ;
112
117
elizaLogger . log ( response ) ;
113
118
@@ -127,20 +132,65 @@ export const deployToken: Action = {
127
132
chainId : await provider . getChainId ( ) ,
128
133
} ) ;
129
134
130
- const { tokenAddress, calls } = factory . getDeployCalldata ( {
131
- name : response . name ,
132
- symbol : response . symbol ,
133
- owner : response . owner ,
134
- initialSupply : response . initialSupply ,
135
- } ) ;
135
+ const { tokenAddress, calls : deployCalls } =
136
+ factory . getDeployCalldata ( {
137
+ name : response . name ,
138
+ symbol : response . symbol ,
139
+ owner : response . owner ,
140
+ initialSupply : response . initialSupply ,
141
+ } ) ;
142
+
143
+ const data = await factory . getMemecoinLaunchData ( tokenAddress ) ;
144
+
145
+ const { calls : launchCalls } = await factory . getEkuboLaunchCalldata (
146
+ {
147
+ address : tokenAddress ,
148
+ name : response . name ,
149
+ symbol : response . symbol ,
150
+ owner : response . owner ,
151
+ totalSupply : response . initialSupply ,
152
+ decimals : 18 ,
153
+ ...data ,
154
+ } ,
155
+ {
156
+ fees : parseFormatedPercentage ( "3" ) ,
157
+ amm : AMM . EKUBO ,
158
+ teamAllocations : [
159
+ {
160
+ address : ACCOUNTS . ELIZA ,
161
+ amount : new Percent (
162
+ 2.5 ,
163
+ response . initialSupply
164
+ ) . toFixed ( 0 ) ,
165
+ } ,
166
+ {
167
+ address : ACCOUNTS . BLOBERT ,
168
+ amount : new Percent (
169
+ 2.5 ,
170
+ response . initialSupply
171
+ ) . toFixed ( 0 ) ,
172
+ } ,
173
+ ] ,
174
+ holdLimit : parseFormatedPercentage ( "2" ) ,
175
+ antiBotPeriod : 3600 ,
176
+ quoteToken : {
177
+ address : TOKENS . LORDS ,
178
+ symbol : "LORDS" as QUOTE_TOKEN_SYMBOL ,
179
+ name : "Lords" ,
180
+ decimals : 18 ,
181
+ camelCased : false ,
182
+ } ,
183
+ startingMarketCap : parseFormatedAmount ( "5000" ) ,
184
+ }
185
+ ) ;
136
186
137
187
elizaLogger . log (
138
188
"Deployment has been initiated for coin: " +
139
189
response . name +
140
190
" at address: " +
141
191
tokenAddress
142
192
) ;
143
- const tx = await account . execute ( calls ) ;
193
+ const tx = await account . execute ( [ ... deployCalls , ... launchCalls ] ) ;
144
194
145
195
callback ?.( {
146
196
text :
0 commit comments