clanker-sdk 4.2.3 → 4.2.5

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.
@@ -18015,6 +18015,8 @@ declare const clankerTokenV4: z.ZodObject<{
18015
18015
  image: z.ZodDefault<z.ZodString>;
18016
18016
  /** Id of the chain that the token will be deployed to. Defaults to base (8453). */
18017
18017
  chainId: z.ZodDefault<z.ZodLiteral<1 | 143 | 8453 | 10143 | 2741 | 84532 | 42161 | 130>>;
18018
+ /** Custom salt for CREATE2 deployment. If provided, this will be used instead of vanity address generation. Takes precedence over vanity. */
18019
+ salt: z.ZodOptional<z.ZodCustom<`0x${string}`, `0x${string}`>>;
18018
18020
  /** Admin for the token. They will be able to change fields like image, metadata, etc. */
18019
18021
  tokenAdmin: z.ZodCustom<`0x${string}`, `0x${string}`>;
18020
18022
  /** Metadata for the token. */
package/dist/cli/cli.js CHANGED
@@ -9,12 +9,12 @@ var __export = (target, all) => {
9
9
  __defProp(target, name, { get: all[name], enumerable: true });
10
10
  };
11
11
 
12
- // node_modules/.pnpm/tsup@8.4.0_typescript@5.8.3/node_modules/tsup/assets/esm_shims.js
12
+ // node_modules/tsup/assets/esm_shims.js
13
13
  import { fileURLToPath } from "url";
14
14
  import path from "path";
15
15
  var getFilename, getDirname, __dirname;
16
16
  var init_esm_shims = __esm({
17
- "node_modules/.pnpm/tsup@8.4.0_typescript@5.8.3/node_modules/tsup/assets/esm_shims.js"() {
17
+ "node_modules/tsup/assets/esm_shims.js"() {
18
18
  "use strict";
19
19
  getFilename = () => fileURLToPath(import.meta.url);
20
20
  getDirname = () => path.dirname(getFilename());
@@ -6282,7 +6282,12 @@ var init_clankers = __esm({
6282
6282
  });
6283
6283
 
6284
6284
  // src/services/vanityAddress.ts
6285
- import { encodeDeployData, keccak256 } from "viem";
6285
+ import {
6286
+ encodeAbiParameters,
6287
+ encodeDeployData,
6288
+ getContractAddress,
6289
+ keccak256
6290
+ } from "viem";
6286
6291
  import { abstract as abstract3, monadTestnet as monadTestnet3 } from "viem/chains";
6287
6292
  var findVanityAddress;
6288
6293
  var init_vanityAddress = __esm({
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- // node_modules/.pnpm/tsup@8.4.0_typescript@5.8.3/node_modules/tsup/assets/esm_shims.js
3
+ // node_modules/tsup/assets/esm_shims.js
4
4
  import { fileURLToPath } from "url";
5
5
  import path from "path";
6
6
  var getFilename = () => fileURLToPath(import.meta.url);
@@ -3137,7 +3137,12 @@ var WETH_ADDRESSES = {
3137
3137
  var DEFAULT_SUPPLY = 100000000000000000000000000000n;
3138
3138
 
3139
3139
  // src/services/vanityAddress.ts
3140
- import { encodeDeployData, keccak256 } from "viem";
3140
+ import {
3141
+ encodeAbiParameters,
3142
+ encodeDeployData,
3143
+ getContractAddress,
3144
+ keccak256
3145
+ } from "viem";
3141
3146
  import { abstract as abstract3, monadTestnet as monadTestnet3 } from "viem/chains";
3142
3147
 
3143
3148
  // src/utils/clankers.ts
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { C as ClankerTokenV3 } from './clankerTokenV3-BqHTF9QY.js';
2
- import { a as Chain, C as ClankerTokenV4, b as ClankerDeployment } from './clankerTokenV4-Btn0ZN4v.js';
3
- export { d as CLANKERS, g as Chains, h as ClankerDeployments, f as Clankers, R as RelatedV3_1, c as RelatedV4, T as Type, i as clankerConfigFor } from './clankerTokenV4-Btn0ZN4v.js';
4
- import { ContractConstructorArgs } from 'viem';
2
+ import { a as Chain, C as ClankerTokenV4, b as ClankerDeployment } from './clankerTokenV4-xiAq6G4R.js';
3
+ export { d as CLANKERS, g as Chains, h as ClankerDeployments, f as Clankers, R as RelatedV3_1, c as RelatedV4, T as Type, i as clankerConfigFor } from './clankerTokenV4-xiAq6G4R.js';
4
+ import { ContractConstructorArgs, Hex } from 'viem';
5
5
  import { C as ClankerToken_v3_1_abi, a as ClankerToken_v4_abi } from './ClankerToken-Dra5lppJ.js';
6
6
  import { StandardMerkleTree } from '@openzeppelin/merkle-tree';
7
7
  import 'zod/v4';
@@ -17,7 +17,8 @@ declare const WETH_ADDRESSES: Record<Chain, `0x${string}`>;
17
17
  declare const DEFAULT_SUPPLY = 100000000000000000000000000000n;
18
18
  declare enum PoolPositions {
19
19
  Standard = "Standard",
20
- Project = "Project"
20
+ Project = "Project",
21
+ TwentyETH = "TwentyETH"
21
22
  }
22
23
  type PoolPosition = {
23
24
  tickLower: number;
@@ -42,6 +43,19 @@ declare const findVanityAddressV4: (args: ContractConstructorArgs<typeof Clanker
42
43
  salt: `0x${string}`;
43
44
  token: `0x${string}`;
44
45
  }>;
46
+ /**
47
+ * Predict the token address for a V4 deployment with a custom salt using CREATE2.
48
+ *
49
+ * The Clanker contract uses: keccak256(abi.encode(tokenAdmin, salt))
50
+ * as the actual CREATE2 salt.
51
+ *
52
+ * @param args Constructor arguments for the token
53
+ * @param config Clanker deployment configuration
54
+ * @param salt Custom salt for CREATE2 deployment
55
+ * @param tokenAdmin Token admin address (used to derive the actual CREATE2 salt)
56
+ * @returns The predicted token address
57
+ */
58
+ declare const predictTokenAddressV4: (args: ContractConstructorArgs<typeof ClankerToken_v4_abi>, config: ClankerDeployment, salt: Hex, tokenAdmin: `0x${string}`) => `0x${string}`;
45
59
 
46
60
  /**
47
61
  * Calculate starting tick and spacing for a token pooled against ETH.
@@ -54,6 +68,20 @@ declare const getTickFromMarketCap: (marketCap: number) => {
54
68
  tickIfToken0IsClanker: number;
55
69
  tickSpacing: number;
56
70
  };
71
+ /**
72
+ * Calculate the tick for a desired market cap in USDC
73
+ *
74
+ * @param marketCapUSDC - Desired market cap in USDC (e.g., 10 for $10)
75
+ * @param tickSpacing - Tick spacing (must be multiple of this, default 200)
76
+ * @returns The tick value rounded to the nearest tickSpacing
77
+ *
78
+ * Formula:
79
+ * - Total supply: 100B tokens (10^11 * 10^18 with decimals = 10^29)
80
+ * - USDC: 6 decimals (10^6)
81
+ * - Price per token = (marketCap * 10^6) / 10^29 = marketCap / 10^23
82
+ * - tick = log(price) / log(1.0001)
83
+ */
84
+ declare function getTickFromMarketCapUSDC(marketCapUSDC: number, tickSpacing?: number): number;
57
85
 
58
86
  interface AirdropEntry {
59
87
  account: `0x${string}`;
@@ -67,4 +95,4 @@ declare function createMerkleTree(entries: AirdropEntry[]): {
67
95
  declare function getMerkleProof(tree: StandardMerkleTree<[string, string]>, entries: [string, string][], account: `0x${string}`, amount: number): `0x${string}`[];
68
96
  declare function encodeAirdropData(merkleRoot: `0x${string}`, lockupDuration: number, vestingDuration: number): `0x${string}`;
69
97
 
70
- export { A0X_ADDRESS, ANON_ADDRESS, type AirdropEntry, CB_BTC_ADDRESS, CLANKER_ADDRESS, Chain, ClankerDeployment, ClankerTokenV4, DEFAULT_SUPPLY, DEGEN_ADDRESS, FEE_CONFIGS, FeeConfigs, HIGHER_ADDRESS, NATIVE_ADDRESS, POOL_POSITIONS, PoolPositions, WETH_ADDRESSES, createMerkleTree, encodeAirdropData, findVanityAddress, findVanityAddressV4, getMerkleProof, getTickFromMarketCap };
98
+ export { A0X_ADDRESS, ANON_ADDRESS, type AirdropEntry, CB_BTC_ADDRESS, CLANKER_ADDRESS, Chain, ClankerDeployment, ClankerTokenV4, DEFAULT_SUPPLY, DEGEN_ADDRESS, FEE_CONFIGS, FeeConfigs, HIGHER_ADDRESS, NATIVE_ADDRESS, POOL_POSITIONS, PoolPositions, WETH_ADDRESSES, createMerkleTree, encodeAirdropData, findVanityAddress, findVanityAddressV4, getMerkleProof, getTickFromMarketCap, getTickFromMarketCapUSDC, predictTokenAddressV4 };
package/dist/index.js CHANGED
@@ -58,6 +58,7 @@ var DEFAULT_SUPPLY = 100000000000000000000000000000n;
58
58
  var PoolPositions = /* @__PURE__ */ ((PoolPositions2) => {
59
59
  PoolPositions2["Standard"] = "Standard";
60
60
  PoolPositions2["Project"] = "Project";
61
+ PoolPositions2["TwentyETH"] = "TwentyETH";
61
62
  return PoolPositions2;
62
63
  })(PoolPositions || {});
63
64
  var POOL_POSITIONS = {
@@ -112,6 +113,48 @@ var POOL_POSITIONS = {
112
113
  positionBps: 500
113
114
  // 5% of LP
114
115
  }
116
+ ],
117
+ TwentyETH: [
118
+ {
119
+ tickLower: -223400,
120
+ // 20 ETH (starting tick)
121
+ tickUpper: -212e3,
122
+ // ~$180K
123
+ positionBps: 1e3
124
+ // 10% of LP
125
+ },
126
+ {
127
+ tickLower: -212e3,
128
+ // ~$180K
129
+ tickUpper: -155e3,
130
+ // ~$50M
131
+ positionBps: 5e3
132
+ // 50% of LP
133
+ },
134
+ {
135
+ tickLower: -201e3,
136
+ // ~$500K
137
+ tickUpper: -155e3,
138
+ // ~$50M
139
+ positionBps: 1500
140
+ // 15% of LP
141
+ },
142
+ {
143
+ tickLower: -155e3,
144
+ // ~$50M
145
+ tickUpper: -12e4,
146
+ // ~$1.5B
147
+ positionBps: 2e3
148
+ // 20% of LP
149
+ },
150
+ {
151
+ tickLower: -141e3,
152
+ // ~$200M
153
+ tickUpper: -12e4,
154
+ // ~$1.5B
155
+ positionBps: 500
156
+ // 5% of LP
157
+ }
115
158
  ]
116
159
  };
117
160
  var FeeConfigs = /* @__PURE__ */ ((FeeConfigs2) => {
@@ -163,7 +206,12 @@ var FEE_CONFIGS = {
163
206
  };
164
207
 
165
208
  // src/services/vanityAddress.ts
166
- import { encodeDeployData, keccak256 } from "viem";
209
+ import {
210
+ encodeAbiParameters,
211
+ encodeDeployData,
212
+ getContractAddress,
213
+ keccak256
214
+ } from "viem";
167
215
  import { abstract as abstract3, monadTestnet as monadTestnet3 } from "viem/chains";
168
216
 
169
217
  // src/abi/v3.1/ClankerToken.ts
@@ -5716,6 +5764,30 @@ var findVanityAddressV4 = async (args, admin, suffix = "0x4b07", config) => {
5716
5764
  const { address, salt } = await response.json();
5717
5765
  return { token: address, salt };
5718
5766
  };
5767
+ var predictTokenAddressV4 = (args, config, salt, tokenAdmin) => {
5768
+ const deployData = encodeDeployData({
5769
+ abi: config.token.abi,
5770
+ bytecode: config.token.bytecode,
5771
+ args
5772
+ });
5773
+ const actualSalt = keccak256(
5774
+ encodeAbiParameters(
5775
+ [
5776
+ { type: "address", name: "tokenAdmin" },
5777
+ { type: "bytes32", name: "salt" }
5778
+ ],
5779
+ [tokenAdmin, salt]
5780
+ )
5781
+ );
5782
+ const predictedAddress = getContractAddress({
5783
+ from: config.address,
5784
+ // deployer (Clanker contract)
5785
+ salt: actualSalt,
5786
+ bytecode: deployData,
5787
+ opcode: "CREATE2"
5788
+ });
5789
+ return predictedAddress;
5790
+ };
5719
5791
 
5720
5792
  // src/utils/market-cap.ts
5721
5793
  var getTickFromMarketCap = (marketCap) => {
@@ -5730,10 +5802,15 @@ var getTickFromMarketCap = (marketCap) => {
5730
5802
  tickSpacing
5731
5803
  };
5732
5804
  };
5805
+ function getTickFromMarketCapUSDC(marketCapUSDC, tickSpacing = 200) {
5806
+ const price = marketCapUSDC / 1e23;
5807
+ const rawTick = Math.log(price) / Math.log(1.0001);
5808
+ return Math.floor(rawTick / tickSpacing) * tickSpacing;
5809
+ }
5733
5810
 
5734
5811
  // src/utils/merkleTree.ts
5735
5812
  import { StandardMerkleTree } from "@openzeppelin/merkle-tree";
5736
- import { encodeAbiParameters } from "viem";
5813
+ import { encodeAbiParameters as encodeAbiParameters2 } from "viem";
5737
5814
  var TOKEN_DECIMALS = 18n;
5738
5815
  function toTokenDecimals(amount) {
5739
5816
  return BigInt(amount) * 10n ** TOKEN_DECIMALS;
@@ -5758,7 +5835,7 @@ function getMerkleProof(tree, entries, account, amount) {
5758
5835
  return proof.map((p) => p);
5759
5836
  }
5760
5837
  function encodeAirdropData(merkleRoot, lockupDuration, vestingDuration) {
5761
- return encodeAbiParameters(
5838
+ return encodeAbiParameters2(
5762
5839
  [{ type: "bytes32" }, { type: "uint256" }, { type: "uint256" }],
5763
5840
  [merkleRoot, BigInt(lockupDuration), BigInt(vestingDuration)]
5764
5841
  );
@@ -5786,5 +5863,7 @@ export {
5786
5863
  findVanityAddress,
5787
5864
  findVanityAddressV4,
5788
5865
  getMerkleProof,
5789
- getTickFromMarketCap
5866
+ getTickFromMarketCap,
5867
+ getTickFromMarketCapUSDC,
5868
+ predictTokenAddressV4
5790
5869
  };
package/dist/v3/index.js CHANGED
@@ -3119,7 +3119,12 @@ var WETH_ADDRESSES = {
3119
3119
  var DEFAULT_SUPPLY = 100000000000000000000000000000n;
3120
3120
 
3121
3121
  // src/services/vanityAddress.ts
3122
- import { encodeDeployData, keccak256 } from "viem";
3122
+ import {
3123
+ encodeAbiParameters,
3124
+ encodeDeployData,
3125
+ getContractAddress,
3126
+ keccak256
3127
+ } from "viem";
3123
3128
  import { abstract as abstract3, monadTestnet as monadTestnet3 } from "viem/chains";
3124
3129
 
3125
3130
  // src/utils/clankers.ts
@@ -1,7 +1,7 @@
1
1
  import { C as ClankerTransactionConfig, f as ClankerAirdrop_v4_abi, c as ClankerResult, g as Clanker_PresaleEthToCreator_v4_1_abi } from '../../write-clanker-contracts-B4LSHPv2.js';
2
2
  import { MerkleTree } from '@openzeppelin/merkle-tree/dist/merkletree.js';
3
3
  import * as z from 'zod/v4';
4
- import { a as Chain, C as ClankerTokenV4 } from '../../clankerTokenV4-Btn0ZN4v.js';
4
+ import { a as Chain, C as ClankerTokenV4 } from '../../clankerTokenV4-xiAq6G4R.js';
5
5
  import { Clanker } from '../index.js';
6
6
  import { C as ClankerError } from '../../errors-5Gv28Tkr.js';
7
7
  import 'viem';
@@ -6861,7 +6861,7 @@ var Clanker_PresaleEthToCreator_v4_1_abi = [
6861
6861
 
6862
6862
  // src/config/clankerTokenV4.ts
6863
6863
  import {
6864
- encodeAbiParameters,
6864
+ encodeAbiParameters as encodeAbiParameters2,
6865
6865
  isAddressEqual as isAddressEqual2,
6866
6866
  stringify as stringify2,
6867
6867
  zeroAddress,
@@ -7023,11 +7023,58 @@ var POOL_POSITIONS = {
7023
7023
  positionBps: 500
7024
7024
  // 5% of LP
7025
7025
  }
7026
+ ],
7027
+ TwentyETH: [
7028
+ {
7029
+ tickLower: -223400,
7030
+ // 20 ETH (starting tick)
7031
+ tickUpper: -212e3,
7032
+ // ~$180K
7033
+ positionBps: 1e3
7034
+ // 10% of LP
7035
+ },
7036
+ {
7037
+ tickLower: -212e3,
7038
+ // ~$180K
7039
+ tickUpper: -155e3,
7040
+ // ~$50M
7041
+ positionBps: 5e3
7042
+ // 50% of LP
7043
+ },
7044
+ {
7045
+ tickLower: -201e3,
7046
+ // ~$500K
7047
+ tickUpper: -155e3,
7048
+ // ~$50M
7049
+ positionBps: 1500
7050
+ // 15% of LP
7051
+ },
7052
+ {
7053
+ tickLower: -155e3,
7054
+ // ~$50M
7055
+ tickUpper: -12e4,
7056
+ // ~$1.5B
7057
+ positionBps: 2e3
7058
+ // 20% of LP
7059
+ },
7060
+ {
7061
+ tickLower: -141e3,
7062
+ // ~$200M
7063
+ tickUpper: -12e4,
7064
+ // ~$1.5B
7065
+ positionBps: 500
7066
+ // 5% of LP
7067
+ }
7026
7068
  ]
7027
7069
  };
7028
7070
 
7029
7071
  // src/services/vanityAddress.ts
7030
- import { encodeDeployData, keccak256 } from "viem";
7072
+ import {
7073
+ encodeAbiParameters,
7074
+ encodeDeployData,
7075
+ getContractAddress,
7076
+ keccak256
7077
+ } from "viem";
7031
7078
  import { abstract as abstract3, monadTestnet as monadTestnet3 } from "viem/chains";
7032
7079
  var findVanityAddressV4 = async (args, admin, suffix = "0x4b07", config) => {
7033
7080
  const data = encodeDeployData({
@@ -7042,6 +7089,30 @@ var findVanityAddressV4 = async (args, admin, suffix = "0x4b07", config) => {
7042
7089
  const { address, salt } = await response.json();
7043
7090
  return { token: address, salt };
7044
7091
  };
7092
+ var predictTokenAddressV4 = (args, config, salt, tokenAdmin) => {
7093
+ const deployData = encodeDeployData({
7094
+ abi: config.token.abi,
7095
+ bytecode: config.token.bytecode,
7096
+ args
7097
+ });
7098
+ const actualSalt = keccak256(
7099
+ encodeAbiParameters(
7100
+ [
7101
+ { type: "address", name: "tokenAdmin" },
7102
+ { type: "bytes32", name: "salt" }
7103
+ ],
7104
+ [tokenAdmin, salt]
7105
+ )
7106
+ );
7107
+ const predictedAddress = getContractAddress({
7108
+ from: config.address,
7109
+ // deployer (Clanker contract)
7110
+ salt: actualSalt,
7111
+ bytecode: deployData,
7112
+ opcode: "CREATE2"
7113
+ });
7114
+ return predictedAddress;
7115
+ };
7045
7116
 
7046
7117
  // src/config/clankerTokenV4.ts
7047
7118
  var NULL_DEVBUY_POOL_CONFIG = {
@@ -7066,6 +7137,8 @@ var clankerTokenV4 = z3.strictObject({
7066
7137
  image: z3.string().default(""),
7067
7138
  /** Id of the chain that the token will be deployed to. Defaults to base (8453). */
7068
7139
  chainId: z3.literal(Chains).default(8453),
7140
+ /** Custom salt for CREATE2 deployment. If provided, this will be used instead of vanity address generation. Takes precedence over vanity. */
7141
+ salt: hexSchema.optional(),
7069
7142
  /** Admin for the token. They will be able to change fields like image, metadata, etc. */
7070
7143
  tokenAdmin: addressSchema.refine((v) => !isAddressEqual2(v, zeroAddress), {
7071
7144
  error: "Admin cannot be zero address"
@@ -7269,23 +7342,24 @@ var clankerTokenV4Converter = async (config) => {
7269
7342
  if (cfg.presale && !clankerConfig?.related?.presale) {
7270
7343
  throw new Error(`Presales are not available on chain ${cfg.chainId}`);
7271
7344
  }
7272
- const { salt, token: expectedAddress } = cfg.vanity ? await findVanityAddressV4(
7273
- [
7274
- cfg.name,
7275
- cfg.symbol,
7276
- DEFAULT_SUPPLY,
7277
- cfg.tokenAdmin,
7278
- cfg.image,
7279
- metadata,
7280
- socialContext,
7281
- BigInt(cfg.chainId)
7282
- ],
7345
+ const tokenArgs = [
7346
+ cfg.name,
7347
+ cfg.symbol,
7348
+ DEFAULT_SUPPLY,
7283
7349
  cfg.tokenAdmin,
7284
- "0x4b07",
7285
- clankerConfig
7286
- ) : {
7350
+ cfg.image,
7351
+ metadata,
7352
+ socialContext,
7353
+ BigInt(cfg.chainId)
7354
+ ];
7355
+ const { salt, token: expectedAddress } = cfg.salt ? {
7356
+ // Use custom salt if provided, predict the address using CREATE2
7357
+ salt: cfg.salt,
7358
+ token: predictTokenAddressV4(tokenArgs, clankerConfig, cfg.salt, cfg.tokenAdmin)
7359
+ } : cfg.vanity ? await findVanityAddressV4(tokenArgs, cfg.tokenAdmin, "0x4b07", clankerConfig) : {
7360
+ // Default case: use zeroHash and predict address
7287
7361
  salt: zeroHash,
7288
- token: void 0
7362
+ token: predictTokenAddressV4(tokenArgs, clankerConfig, zeroHash, cfg.tokenAdmin)
7289
7363
  };
7290
7364
  const airdropAmount = BigInt(cfg.airdrop?.amount || 0) * BigInt(1e18);
7291
7365
  const bpsAirdropped = airdropAmount * 10000n / DEFAULT_SUPPLY + (airdropAmount * 10000n % DEFAULT_SUPPLY ? 1n : 0n);
@@ -7321,7 +7395,7 @@ var clankerTokenV4Converter = async (config) => {
7321
7395
  },
7322
7396
  lockerConfig: {
7323
7397
  locker: cfg.locker.locker === "Locker" ? clankerConfig.related.locker : cfg.locker.locker,
7324
- lockerData: encodeAbiParameters(ClankerLpLocker_Instantiation_v4_abi, [
7398
+ lockerData: encodeAbiParameters2(ClankerLpLocker_Instantiation_v4_abi, [
7325
7399
  {
7326
7400
  feePreference: cfg.rewards.recipients.map(({ token }) => FeeInToInt[token])
7327
7401
  }
@@ -7342,7 +7416,7 @@ var clankerTokenV4Converter = async (config) => {
7342
7416
  },
7343
7417
  mevModuleConfig: {
7344
7418
  mevModule: clankerConfig.related?.mevModuleV2 || clankerConfig.related?.mevModule,
7345
- mevModuleData: clankerConfig.related?.mevModuleV2 ? encodeAbiParameters(Clanker_MevSniperAuction_InitData_v4_1_abi, [
7419
+ mevModuleData: clankerConfig.related?.mevModuleV2 ? encodeAbiParameters2(Clanker_MevSniperAuction_InitData_v4_1_abi, [
7346
7420
  {
7347
7421
  startingFee: cfg.sniperFees.startingFee,
7348
7422
  endingFee: cfg.sniperFees.endingFee,
@@ -7357,7 +7431,7 @@ var clankerTokenV4Converter = async (config) => {
7357
7431
  extension: clankerConfig.related.vault,
7358
7432
  msgValue: 0n,
7359
7433
  extensionBps: cfg.vault.percentage * 100,
7360
- extensionData: encodeAbiParameters(ClankerVault_Instantiation_v4_abi, [
7434
+ extensionData: encodeAbiParameters2(ClankerVault_Instantiation_v4_abi, [
7361
7435
  cfg.vault.recipient ?? cfg.tokenAdmin,
7362
7436
  BigInt(cfg.vault.lockupDuration),
7363
7437
  BigInt(cfg.vault.vestingDuration)
@@ -7370,7 +7444,7 @@ var clankerTokenV4Converter = async (config) => {
7370
7444
  extension: clankerConfig.related.airdrop,
7371
7445
  msgValue: 0n,
7372
7446
  extensionBps: Number(bpsAirdropped),
7373
- extensionData: encodeAbiParameters(ClankerAirdropV2_Instantiation_v4_abi, [
7447
+ extensionData: encodeAbiParameters2(ClankerAirdropV2_Instantiation_v4_abi, [
7374
7448
  cfg.airdrop.admin || cfg.tokenAdmin,
7375
7449
  cfg.airdrop.merkleRoot,
7376
7450
  BigInt(cfg.airdrop.lockupDuration),
@@ -7384,7 +7458,7 @@ var clankerTokenV4Converter = async (config) => {
7384
7458
  extension: clankerConfig.related.devbuy,
7385
7459
  msgValue: BigInt(cfg.devBuy.ethAmount * 1e18),
7386
7460
  extensionBps: 0,
7387
- extensionData: encodeAbiParameters(ClankerUniV4EthDevBuy_Instantiation_v4_abi, [
7461
+ extensionData: encodeAbiParameters2(ClankerUniV4EthDevBuy_Instantiation_v4_abi, [
7388
7462
  cfg.devBuy.poolKey,
7389
7463
  BigInt(cfg.devBuy.amountOutMin * 1e18),
7390
7464
  cfg.tokenAdmin
@@ -7412,7 +7486,7 @@ var clankerTokenV4Converter = async (config) => {
7412
7486
  function encodeFeeConfig(tokenConfig, clankerConfig) {
7413
7487
  const config = tokenConfig.fees;
7414
7488
  if (config.type === "static") {
7415
- const feeData = encodeAbiParameters(ClankerHook_StaticFee_Instantiation_v4_abi, [
7489
+ const feeData = encodeAbiParameters2(ClankerHook_StaticFee_Instantiation_v4_abi, [
7416
7490
  config.clankerFee * 100,
7417
7491
  // uniBps
7418
7492
  config.pairedFee * 100
@@ -7421,7 +7495,7 @@ function encodeFeeConfig(tokenConfig, clankerConfig) {
7421
7495
  if (clankerConfig.related.feeStaticHookV2) {
7422
7496
  return {
7423
7497
  hook: clankerConfig.related.feeStaticHookV2,
7424
- poolData: encodeAbiParameters(Clanker_PoolInitializationData_v4_1_abi, [
7498
+ poolData: encodeAbiParameters2(Clanker_PoolInitializationData_v4_1_abi, [
7425
7499
  {
7426
7500
  extension: tokenConfig.poolExtension.address,
7427
7501
  extensionData: tokenConfig.poolExtension.initData,
@@ -7436,7 +7510,7 @@ function encodeFeeConfig(tokenConfig, clankerConfig) {
7436
7510
  };
7437
7511
  }
7438
7512
  if (config.type === "dynamic") {
7439
- const feeData = encodeAbiParameters(ClankerHook_DynamicFee_Instantiation_v4_abi, [
7513
+ const feeData = encodeAbiParameters2(ClankerHook_DynamicFee_Instantiation_v4_abi, [
7440
7514
  config.baseFee * 100,
7441
7515
  // uniBps
7442
7516
  config.maxFee * 100,
@@ -7450,7 +7524,7 @@ function encodeFeeConfig(tokenConfig, clankerConfig) {
7450
7524
  if (clankerConfig.related.feeDynamicHookV2) {
7451
7525
  return {
7452
7526
  hook: clankerConfig.related.feeDynamicHookV2,
7453
- poolData: encodeAbiParameters(Clanker_PoolInitializationData_v4_1_abi, [
7527
+ poolData: encodeAbiParameters2(Clanker_PoolInitializationData_v4_1_abi, [
7454
7528
  {
7455
7529
  extension: tokenConfig.poolExtension.address,
7456
7530
  extensionData: tokenConfig.poolExtension.initData,
@@ -2,8 +2,8 @@ import { C as ClankerTransactionConfig, d as ClankerFeeLocker_abi, b as ClankerF
2
2
  import * as viem from 'viem';
3
3
  import { WalletClient, Transport, Chain, Account, PublicClient } from 'viem';
4
4
  import { a as ClankerToken_v4_abi } from '../ClankerToken-Dra5lppJ.js';
5
- import { C as ClankerTokenV4 } from '../clankerTokenV4-Btn0ZN4v.js';
6
- export { e as encodeFeeConfig } from '../clankerTokenV4-Btn0ZN4v.js';
5
+ import { C as ClankerTokenV4 } from '../clankerTokenV4-xiAq6G4R.js';
6
+ export { e as encodeFeeConfig } from '../clankerTokenV4-xiAq6G4R.js';
7
7
  import { C as ClankerError } from '../errors-5Gv28Tkr.js';
8
8
  import 'zod/v4';
9
9
 
package/dist/v4/index.js CHANGED
@@ -1401,7 +1401,7 @@ var ClankerVault_Instantiation_v4_abi = [
1401
1401
 
1402
1402
  // src/config/clankerTokenV4.ts
1403
1403
  import {
1404
- encodeAbiParameters,
1404
+ encodeAbiParameters as encodeAbiParameters2,
1405
1405
  isAddressEqual,
1406
1406
  stringify,
1407
1407
  zeroAddress,
@@ -2014,11 +2014,58 @@ var POOL_POSITIONS = {
2014
2014
  positionBps: 500
2015
2015
  // 5% of LP
2016
2016
  }
2017
+ ],
2018
+ TwentyETH: [
2019
+ {
2020
+ tickLower: -223400,
2021
+ // 20 ETH (starting tick)
2022
+ tickUpper: -212e3,
2023
+ // ~$180K
2024
+ positionBps: 1e3
2025
+ // 10% of LP
2026
+ },
2027
+ {
2028
+ tickLower: -212e3,
2029
+ // ~$180K
2030
+ tickUpper: -155e3,
2031
+ // ~$50M
2032
+ positionBps: 5e3
2033
+ // 50% of LP
2034
+ },
2035
+ {
2036
+ tickLower: -201e3,
2037
+ // ~$500K
2038
+ tickUpper: -155e3,
2039
+ // ~$50M
2040
+ positionBps: 1500
2041
+ // 15% of LP
2042
+ },
2043
+ {
2044
+ tickLower: -155e3,
2045
+ // ~$50M
2046
+ tickUpper: -12e4,
2047
+ // ~$1.5B
2048
+ positionBps: 2e3
2049
+ // 20% of LP
2050
+ },
2051
+ {
2052
+ tickLower: -141e3,
2053
+ // ~$200M
2054
+ tickUpper: -12e4,
2055
+ // ~$1.5B
2056
+ positionBps: 500
2057
+ // 5% of LP
2058
+ }
2017
2059
  ]
2018
2060
  };
2019
2061
 
2020
2062
  // src/services/vanityAddress.ts
2021
- import { encodeDeployData, keccak256 } from "viem";
2063
+ import {
2064
+ encodeAbiParameters,
2065
+ encodeDeployData,
2066
+ getContractAddress,
2067
+ keccak256
2068
+ } from "viem";
2022
2069
  import { abstract as abstract3, monadTestnet as monadTestnet3 } from "viem/chains";
2023
2070
 
2024
2071
  // src/abi/v3.1/ClankerToken.ts
@@ -6565,6 +6612,30 @@ var findVanityAddressV4 = async (args, admin, suffix = "0x4b07", config) => {
6565
6612
  const { address, salt } = await response.json();
6566
6613
  return { token: address, salt };
6567
6614
  };
6615
+ var predictTokenAddressV4 = (args, config, salt, tokenAdmin) => {
6616
+ const deployData = encodeDeployData({
6617
+ abi: config.token.abi,
6618
+ bytecode: config.token.bytecode,
6619
+ args
6620
+ });
6621
+ const actualSalt = keccak256(
6622
+ encodeAbiParameters(
6623
+ [
6624
+ { type: "address", name: "tokenAdmin" },
6625
+ { type: "bytes32", name: "salt" }
6626
+ ],
6627
+ [tokenAdmin, salt]
6628
+ )
6629
+ );
6630
+ const predictedAddress = getContractAddress({
6631
+ from: config.address,
6632
+ // deployer (Clanker contract)
6633
+ salt: actualSalt,
6634
+ bytecode: deployData,
6635
+ opcode: "CREATE2"
6636
+ });
6637
+ return predictedAddress;
6638
+ };
6568
6639
 
6569
6640
  // src/utils/zod-onchain.ts
6570
6641
  import { getAddress, isAddress, isHex } from "viem";
@@ -6621,6 +6692,8 @@ var clankerTokenV4 = z2.strictObject({
6621
6692
  image: z2.string().default(""),
6622
6693
  /** Id of the chain that the token will be deployed to. Defaults to base (8453). */
6623
6694
  chainId: z2.literal(Chains).default(8453),
6695
+ /** Custom salt for CREATE2 deployment. If provided, this will be used instead of vanity address generation. Takes precedence over vanity. */
6696
+ salt: hexSchema.optional(),
6624
6697
  /** Admin for the token. They will be able to change fields like image, metadata, etc. */
6625
6698
  tokenAdmin: addressSchema.refine((v) => !isAddressEqual(v, zeroAddress), {
6626
6699
  error: "Admin cannot be zero address"
@@ -6824,23 +6897,24 @@ var clankerTokenV4Converter = async (config) => {
6824
6897
  if (cfg.presale && !clankerConfig?.related?.presale) {
6825
6898
  throw new Error(`Presales are not available on chain ${cfg.chainId}`);
6826
6899
  }
6827
- const { salt, token: expectedAddress } = cfg.vanity ? await findVanityAddressV4(
6828
- [
6829
- cfg.name,
6830
- cfg.symbol,
6831
- DEFAULT_SUPPLY,
6832
- cfg.tokenAdmin,
6833
- cfg.image,
6834
- metadata,
6835
- socialContext,
6836
- BigInt(cfg.chainId)
6837
- ],
6900
+ const tokenArgs = [
6901
+ cfg.name,
6902
+ cfg.symbol,
6903
+ DEFAULT_SUPPLY,
6838
6904
  cfg.tokenAdmin,
6839
- "0x4b07",
6840
- clankerConfig
6841
- ) : {
6905
+ cfg.image,
6906
+ metadata,
6907
+ socialContext,
6908
+ BigInt(cfg.chainId)
6909
+ ];
6910
+ const { salt, token: expectedAddress } = cfg.salt ? {
6911
+ // Use custom salt if provided, predict the address using CREATE2
6912
+ salt: cfg.salt,
6913
+ token: predictTokenAddressV4(tokenArgs, clankerConfig, cfg.salt, cfg.tokenAdmin)
6914
+ } : cfg.vanity ? await findVanityAddressV4(tokenArgs, cfg.tokenAdmin, "0x4b07", clankerConfig) : {
6915
+ // Default case: use zeroHash and predict address
6842
6916
  salt: zeroHash,
6843
- token: void 0
6917
+ token: predictTokenAddressV4(tokenArgs, clankerConfig, zeroHash, cfg.tokenAdmin)
6844
6918
  };
6845
6919
  const airdropAmount = BigInt(cfg.airdrop?.amount || 0) * BigInt(1e18);
6846
6920
  const bpsAirdropped = airdropAmount * 10000n / DEFAULT_SUPPLY + (airdropAmount * 10000n % DEFAULT_SUPPLY ? 1n : 0n);
@@ -6876,7 +6950,7 @@ var clankerTokenV4Converter = async (config) => {
6876
6950
  },
6877
6951
  lockerConfig: {
6878
6952
  locker: cfg.locker.locker === "Locker" ? clankerConfig.related.locker : cfg.locker.locker,
6879
- lockerData: encodeAbiParameters(ClankerLpLocker_Instantiation_v4_abi, [
6953
+ lockerData: encodeAbiParameters2(ClankerLpLocker_Instantiation_v4_abi, [
6880
6954
  {
6881
6955
  feePreference: cfg.rewards.recipients.map(({ token }) => FeeInToInt[token])
6882
6956
  }
@@ -6897,7 +6971,7 @@ var clankerTokenV4Converter = async (config) => {
6897
6971
  },
6898
6972
  mevModuleConfig: {
6899
6973
  mevModule: clankerConfig.related?.mevModuleV2 || clankerConfig.related?.mevModule,
6900
- mevModuleData: clankerConfig.related?.mevModuleV2 ? encodeAbiParameters(Clanker_MevSniperAuction_InitData_v4_1_abi, [
6974
+ mevModuleData: clankerConfig.related?.mevModuleV2 ? encodeAbiParameters2(Clanker_MevSniperAuction_InitData_v4_1_abi, [
6901
6975
  {
6902
6976
  startingFee: cfg.sniperFees.startingFee,
6903
6977
  endingFee: cfg.sniperFees.endingFee,
@@ -6912,7 +6986,7 @@ var clankerTokenV4Converter = async (config) => {
6912
6986
  extension: clankerConfig.related.vault,
6913
6987
  msgValue: 0n,
6914
6988
  extensionBps: cfg.vault.percentage * 100,
6915
- extensionData: encodeAbiParameters(ClankerVault_Instantiation_v4_abi, [
6989
+ extensionData: encodeAbiParameters2(ClankerVault_Instantiation_v4_abi, [
6916
6990
  cfg.vault.recipient ?? cfg.tokenAdmin,
6917
6991
  BigInt(cfg.vault.lockupDuration),
6918
6992
  BigInt(cfg.vault.vestingDuration)
@@ -6925,7 +6999,7 @@ var clankerTokenV4Converter = async (config) => {
6925
6999
  extension: clankerConfig.related.airdrop,
6926
7000
  msgValue: 0n,
6927
7001
  extensionBps: Number(bpsAirdropped),
6928
- extensionData: encodeAbiParameters(ClankerAirdropV2_Instantiation_v4_abi, [
7002
+ extensionData: encodeAbiParameters2(ClankerAirdropV2_Instantiation_v4_abi, [
6929
7003
  cfg.airdrop.admin || cfg.tokenAdmin,
6930
7004
  cfg.airdrop.merkleRoot,
6931
7005
  BigInt(cfg.airdrop.lockupDuration),
@@ -6939,7 +7013,7 @@ var clankerTokenV4Converter = async (config) => {
6939
7013
  extension: clankerConfig.related.devbuy,
6940
7014
  msgValue: BigInt(cfg.devBuy.ethAmount * 1e18),
6941
7015
  extensionBps: 0,
6942
- extensionData: encodeAbiParameters(ClankerUniV4EthDevBuy_Instantiation_v4_abi, [
7016
+ extensionData: encodeAbiParameters2(ClankerUniV4EthDevBuy_Instantiation_v4_abi, [
6943
7017
  cfg.devBuy.poolKey,
6944
7018
  BigInt(cfg.devBuy.amountOutMin * 1e18),
6945
7019
  cfg.tokenAdmin
@@ -6967,7 +7041,7 @@ var clankerTokenV4Converter = async (config) => {
6967
7041
  function encodeFeeConfig(tokenConfig, clankerConfig) {
6968
7042
  const config = tokenConfig.fees;
6969
7043
  if (config.type === "static") {
6970
- const feeData = encodeAbiParameters(ClankerHook_StaticFee_Instantiation_v4_abi, [
7044
+ const feeData = encodeAbiParameters2(ClankerHook_StaticFee_Instantiation_v4_abi, [
6971
7045
  config.clankerFee * 100,
6972
7046
  // uniBps
6973
7047
  config.pairedFee * 100
@@ -6976,7 +7050,7 @@ function encodeFeeConfig(tokenConfig, clankerConfig) {
6976
7050
  if (clankerConfig.related.feeStaticHookV2) {
6977
7051
  return {
6978
7052
  hook: clankerConfig.related.feeStaticHookV2,
6979
- poolData: encodeAbiParameters(Clanker_PoolInitializationData_v4_1_abi, [
7053
+ poolData: encodeAbiParameters2(Clanker_PoolInitializationData_v4_1_abi, [
6980
7054
  {
6981
7055
  extension: tokenConfig.poolExtension.address,
6982
7056
  extensionData: tokenConfig.poolExtension.initData,
@@ -6991,7 +7065,7 @@ function encodeFeeConfig(tokenConfig, clankerConfig) {
6991
7065
  };
6992
7066
  }
6993
7067
  if (config.type === "dynamic") {
6994
- const feeData = encodeAbiParameters(ClankerHook_DynamicFee_Instantiation_v4_abi, [
7068
+ const feeData = encodeAbiParameters2(ClankerHook_DynamicFee_Instantiation_v4_abi, [
6995
7069
  config.baseFee * 100,
6996
7070
  // uniBps
6997
7071
  config.maxFee * 100,
@@ -7005,7 +7079,7 @@ function encodeFeeConfig(tokenConfig, clankerConfig) {
7005
7079
  if (clankerConfig.related.feeDynamicHookV2) {
7006
7080
  return {
7007
7081
  hook: clankerConfig.related.feeDynamicHookV2,
7008
- poolData: encodeAbiParameters(Clanker_PoolInitializationData_v4_1_abi, [
7082
+ poolData: encodeAbiParameters2(Clanker_PoolInitializationData_v4_1_abi, [
7009
7083
  {
7010
7084
  extension: tokenConfig.poolExtension.address,
7011
7085
  extensionData: tokenConfig.poolExtension.initData,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clanker-sdk",
3
- "version": "4.2.3",
3
+ "version": "4.2.5",
4
4
  "description": "SDK for deploying tokens using Clanker",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",