@whetstone-research/doppler-sdk 1.0.39 → 1.0.41
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 +19 -108
- package/dist/evm/index.cjs +1446 -916
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +1126 -404
- package/dist/evm/index.d.ts +1126 -404
- package/dist/evm/index.js +1445 -913
- package/dist/evm/index.js.map +1 -1
- package/dist/solana/index.cjs +16 -2
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +5 -2
- package/dist/solana/index.d.ts +5 -2
- package/dist/solana/index.js +16 -3
- package/dist/solana/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ The Doppler SDK exposes network-specific entrypoints for creating, managing, and
|
|
|
15
15
|
- **Solana Clients and React**: Read clients, PDA helpers, generated codecs, and optional React bindings
|
|
16
16
|
- **Token Management**: Built-in EVM support for DERC20 tokens with vesting
|
|
17
17
|
- **Type Safety**: Full TypeScript support across EVM and Solana entrypoints
|
|
18
|
-
- **Network Support**: EVM deployments on Base, Arbitrum One, Unichain, Ink, and other supported chains; Solana/SVM support via explicit Solana program deployments
|
|
18
|
+
- **Network Support**: EVM deployments on Base, Arbitrum One, BNB Smart Chain (BSC), Unichain, Ink, and other supported chains; Solana/SVM support via explicit Solana program deployments
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
@@ -459,8 +459,7 @@ const salt =
|
|
|
459
459
|
'0x1111111111111111111111111111111111111111111111111111111111111111' satisfies Hex;
|
|
460
460
|
|
|
461
461
|
const deterministicParams = { ...params, salt };
|
|
462
|
-
const preview =
|
|
463
|
-
await sdk.factory.simulateCreateMulticurve(deterministicParams);
|
|
462
|
+
const preview = await sdk.factory.simulateCreateMulticurve(deterministicParams);
|
|
464
463
|
```
|
|
465
464
|
|
|
466
465
|
Persist and reuse the salt with otherwise identical inputs for a later
|
|
@@ -469,7 +468,6 @@ independent create operation. Builder users can call `.withSalt(salt)` before
|
|
|
469
468
|
preserves the generated-salt behavior. Explicit salts must be `0x` followed by
|
|
470
469
|
exactly 64 hexadecimal characters.
|
|
471
470
|
|
|
472
|
-
|
|
473
471
|
**Market Cap Presets (Low / Medium / High):**
|
|
474
472
|
|
|
475
473
|
```typescript
|
|
@@ -984,7 +982,7 @@ For a runnable release-focused example covering legacy DERC20, DERC20 V2 schedul
|
|
|
984
982
|
|
|
985
983
|
DopplerERC20V1 is the default token template when `type` is omitted. Set `type: 'dopplerERC20V1'` to make that choice explicit, or set `type: 'standard'` to use the legacy token path, where cliff/allocation vesting routes to the legacy DERC20 template. The SDK uses the configured `dopplerERC20V1Factory` by default; `withTokenFactory(address)` takes precedence but must point to a factory compatible with the selected token path and token data ABI. `controller` is optional and defaults to the zero address, so set it only if early balance-limit disable should be possible.
|
|
986
984
|
|
|
987
|
-
When balance limiting is enabled on the default DopplerERC20V1 integration, the SDK encodes user exclusions plus determinable protocol recipients for the selected auction path into deployment-time `excludedFromBalanceLimit`, including initializers, hooks, PoolManager, migrators, known migration pools, no-op governance, launchpad governance multisigs
|
|
985
|
+
When balance limiting is enabled on the default DopplerERC20V1 integration, the SDK encodes user exclusions plus determinable protocol recipients for the selected auction path into deployment-time `excludedFromBalanceLimit`, including initializers, hooks, PoolManager, migrators, known migration pools, no-op governance, and launchpad governance multisigs. It cannot safely predict the nonce-based timelock created by `default` or `custom` governance. For those governance modes, the SDK rejects configurations where `initialSupply - numTokensToSell - vesting allocations` exceeds `maxBalanceLimit`, because Airlock would transfer that excess to the non-excluded timelock and revert. Allocate enough tokens to the sale or vesting, increase the limit, or use no-op or launchpad governance. Custom `withTokenFactory(address)` paths receive only the `excludedFromBalanceLimit` entries supplied in `tokenConfig`, so custom token factory users must provide required deployment-time protocol exclusions themselves. Exclusions cannot be added later through the controller or governance.
|
|
988
986
|
|
|
989
987
|
DopplerERC20V1 supports vesting through `withVesting` while staying on the DopplerERC20V1 factory path: use `duration` with optional `cliffDuration` for a shared schedule, or `allocations` for per-beneficiary schedules.
|
|
990
988
|
|
|
@@ -1246,7 +1244,7 @@ migration: {
|
|
|
1246
1244
|
}
|
|
1247
1245
|
```
|
|
1248
1246
|
|
|
1249
|
-
### Migrate to Uniswap V2 with Proceeds Split
|
|
1247
|
+
### Migrate to Uniswap V2 with Proceeds Split
|
|
1250
1248
|
|
|
1251
1249
|
```typescript
|
|
1252
1250
|
migration: {
|
|
@@ -1259,9 +1257,8 @@ migration: {
|
|
|
1259
1257
|
```
|
|
1260
1258
|
|
|
1261
1259
|
- The split recipient receives the configured share of numeraire proceeds during migration.
|
|
1262
|
-
- If the asset/numeraire pair was topped up in `TopUpDistributor` before migration, the split recipient also receives those top-ups automatically.
|
|
1263
1260
|
|
|
1264
|
-
### Migrate to Uniswap V4 with Proceeds Split
|
|
1261
|
+
### Migrate to Uniswap V4 with Proceeds Split
|
|
1265
1262
|
|
|
1266
1263
|
```typescript
|
|
1267
1264
|
migration: {
|
|
@@ -1284,50 +1281,11 @@ migration: {
|
|
|
1284
1281
|
|
|
1285
1282
|
- `streamableFees` is required for `uniswapV4Split`.
|
|
1286
1283
|
- Beneficiaries must sum to `1e18`, and the Airlock owner must be included with at least 5% shares.
|
|
1287
|
-
- The split recipient also receives any `TopUpDistributor` funds pulled during migration.
|
|
1288
|
-
|
|
1289
|
-
### TopUpDistributor Top-ups
|
|
1290
|
-
|
|
1291
|
-
The SDK exposes `sdk.topUpDistributor` and `sdk.getTopUpDistributor(address?)`
|
|
1292
|
-
for building, simulating, and submitting `topUp({ asset, numeraire, amount })`
|
|
1293
|
-
transactions where `getAddresses(chainId).topUpDistributor` is configured. The helper methods
|
|
1294
|
-
accept the same object shape for `buildTopUpTransaction({ asset, numeraire, amount })` and
|
|
1295
|
-
`simulateTopUp({ asset, numeraire, amount })`. ETH top-ups use `numeraire = ZERO_ADDRESS` and
|
|
1296
|
-
send `value = amount`; ERC20 top-ups send no native value and require the user to approve the
|
|
1297
|
-
`TopUpDistributor` before calling `topUp`.
|
|
1298
|
-
|
|
1299
|
-
```typescript
|
|
1300
|
-
import { ZERO_ADDRESS } from '@whetstone-research/doppler-sdk/evm';
|
|
1301
|
-
import { parseEther } from 'viem';
|
|
1302
|
-
|
|
1303
|
-
const topUps = sdk.topUpDistributor;
|
|
1304
|
-
|
|
1305
|
-
const tx = topUps.buildTopUpTransaction({
|
|
1306
|
-
asset: tokenAddress,
|
|
1307
|
-
numeraire: ZERO_ADDRESS,
|
|
1308
|
-
amount: parseEther('1'),
|
|
1309
|
-
});
|
|
1310
|
-
|
|
1311
|
-
const simulation = await topUps.simulateTopUp({
|
|
1312
|
-
asset: tokenAddress,
|
|
1313
|
-
numeraire: ZERO_ADDRESS,
|
|
1314
|
-
amount: parseEther('1'),
|
|
1315
|
-
});
|
|
1316
|
-
|
|
1317
|
-
await topUps.topUp({
|
|
1318
|
-
asset: tokenAddress,
|
|
1319
|
-
numeraire: ZERO_ADDRESS,
|
|
1320
|
-
amount: parseEther('1'),
|
|
1321
|
-
});
|
|
1322
|
-
```
|
|
1323
|
-
|
|
1324
|
-
Split migrators pull any TopUpDistributor balance for the asset/numeraire pair during migration
|
|
1325
|
-
and pay it to the configured split recipient.
|
|
1326
1284
|
|
|
1327
1285
|
### Migrate via DopplerHookMigrator (Dynamic Auctions)
|
|
1328
1286
|
|
|
1329
|
-
Use this mode when
|
|
1330
|
-
|
|
1287
|
+
Use this mode when the migrated V4 pool needs an optional generic Doppler hook.
|
|
1288
|
+
This migration type is only supported for dynamic auctions.
|
|
1331
1289
|
|
|
1332
1290
|
```typescript
|
|
1333
1291
|
const params = sdk
|
|
@@ -1357,72 +1315,27 @@ const params = sdk
|
|
|
1357
1315
|
lockDuration: 30 * 24 * 60 * 60,
|
|
1358
1316
|
beneficiaries: [
|
|
1359
1317
|
{ beneficiary: '0xYourBeneficiary...', shares: parseEther('0.95') },
|
|
1360
|
-
await sdk.getAirlockBeneficiary(),
|
|
1318
|
+
await sdk.getAirlockBeneficiary(),
|
|
1361
1319
|
],
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
feeRoutingMode: 'directBuyback',
|
|
1366
|
-
feeDistributionInfo: {
|
|
1367
|
-
assetFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1368
|
-
assetFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1369
|
-
assetFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1370
|
-
assetFeesToLpWad: parseEther('0.25'),
|
|
1371
|
-
numeraireFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1372
|
-
numeraireFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1373
|
-
numeraireFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1374
|
-
numeraireFeesToLpWad: parseEther('0.25'),
|
|
1375
|
-
},
|
|
1320
|
+
hook: {
|
|
1321
|
+
hookAddress: '0xYourDopplerHook...',
|
|
1322
|
+
onInitializationCalldata: '0x...',
|
|
1376
1323
|
},
|
|
1377
1324
|
})
|
|
1378
1325
|
.withUserAddress('0xYourAddress...')
|
|
1379
1326
|
.build();
|
|
1380
1327
|
```
|
|
1381
1328
|
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1329
|
+
`dopplerHookMigrator` beneficiaries must include the current Airlock owner with
|
|
1330
|
+
at least 5% shares, and total shares must sum to `1e18`. Omit `hook` for a
|
|
1331
|
+
standard migrated pool without custom hook behavior.
|
|
1332
|
+
|
|
1386
1333
|
For backwards compatibility, the deprecated `DopplerHookMigrationConfig` type
|
|
1387
1334
|
and its `type: 'dopplerHook'` discriminator remain accepted. New code should use
|
|
1388
1335
|
`DopplerHookMigratorConfig` with `type: 'dopplerHookMigrator'`. Multicurve
|
|
1389
1336
|
initializer params similarly accept the deprecated `type: 'dopplerHook'`
|
|
1390
1337
|
discriminator, which resolves to `dopplerHookInitializer`.
|
|
1391
1338
|
|
|
1392
|
-
```typescript
|
|
1393
|
-
migration: {
|
|
1394
|
-
type: 'dopplerHookMigrator',
|
|
1395
|
-
fee: 3000,
|
|
1396
|
-
useDynamicFee: false,
|
|
1397
|
-
tickSpacing: 10,
|
|
1398
|
-
lockDuration: 30 * 24 * 60 * 60,
|
|
1399
|
-
beneficiaries: [
|
|
1400
|
-
{ beneficiary: '0xYourBeneficiary...', shares: parseEther('1') },
|
|
1401
|
-
],
|
|
1402
|
-
rehype: {
|
|
1403
|
-
// optional; defaults to chain rehypeDopplerHookMigrator address
|
|
1404
|
-
// hookAddress: '0xRehypeMigratorHook...',
|
|
1405
|
-
buybackDestination: '0xYourBuybackDestination...',
|
|
1406
|
-
customFee: 3000,
|
|
1407
|
-
feeRoutingMode: 'directBuyback',
|
|
1408
|
-
feeDistributionInfo: {
|
|
1409
|
-
assetFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1410
|
-
assetFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1411
|
-
assetFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1412
|
-
assetFeesToLpWad: parseEther('0.25'),
|
|
1413
|
-
numeraireFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1414
|
-
numeraireFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1415
|
-
numeraireFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1416
|
-
numeraireFeesToLpWad: parseEther('0.25'),
|
|
1417
|
-
},
|
|
1418
|
-
},
|
|
1419
|
-
proceedsSplit: {
|
|
1420
|
-
recipient: '0xProceedsRecipient...',
|
|
1421
|
-
share: parseEther('0.1'),
|
|
1422
|
-
},
|
|
1423
|
-
}
|
|
1424
|
-
```
|
|
1425
|
-
|
|
1426
1339
|
To make configuring the first beneficiary simpler, the SDK now exposes helpers for resolving the
|
|
1427
1340
|
airlock owner and creating the default 5% entry:
|
|
1428
1341
|
|
|
@@ -1850,7 +1763,7 @@ pnpm dev
|
|
|
1850
1763
|
|
|
1851
1764
|
The SDK includes comprehensive tests covering:
|
|
1852
1765
|
|
|
1853
|
-
- **Airlock Whitelisting**: Verifies that all modules are properly whitelisted on Ethereum Mainnet, Arbitrum One, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain
|
|
1766
|
+
- **Airlock Whitelisting**: Verifies that all modules are properly whitelisted on Ethereum Mainnet, Arbitrum One, BNB Smart Chain (BSC), Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain
|
|
1854
1767
|
- **Multicurve Functionality**: Tests multicurve auction creation and quoting
|
|
1855
1768
|
- **Token Address Mining**: Tests for generating optimized token addresses
|
|
1856
1769
|
|
|
@@ -1864,14 +1777,14 @@ pnpm test:whitelisting
|
|
|
1864
1777
|
ALCHEMY_API_KEY=your_key_here pnpm test:whitelisting
|
|
1865
1778
|
|
|
1866
1779
|
# Limit to specific whitelist-audit chains when needed
|
|
1867
|
-
TEST_CHAINS=mainnet,base,base-sepolia,arbitrum,monad-mainnet,robinhood pnpm test:whitelisting
|
|
1780
|
+
TEST_CHAINS=mainnet,base,base-sepolia,arbitrum,bsc,monad-mainnet,robinhood pnpm test:whitelisting
|
|
1868
1781
|
```
|
|
1869
1782
|
|
|
1870
|
-
The whitelisting suite is scoped to the release-audit chains: Ethereum Mainnet, Arbitrum One, Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain.
|
|
1783
|
+
The whitelisting suite is scoped to the release-audit chains: Ethereum Mainnet, Arbitrum One, BNB Smart Chain (BSC), Monad Mainnet, Base Mainnet, Base Sepolia, and Robinhood Chain.
|
|
1871
1784
|
|
|
1872
1785
|
Whitelisting test RPC priority is:
|
|
1873
1786
|
|
|
1874
|
-
1. Chain-specific RPC URL env var (`ETH_MAINNET_RPC_URL`, `ARBITRUM_RPC_URL`, `BASE_RPC_URL`, `BASE_SEPOLIA_RPC_URL`)
|
|
1787
|
+
1. Chain-specific RPC URL env var (`ETH_MAINNET_RPC_URL`, `ARBITRUM_RPC_URL`, `BSC_RPC_URL`, `BASE_RPC_URL`, `BASE_SEPOLIA_RPC_URL`)
|
|
1875
1788
|
2. `ALCHEMY_API_KEY` fallback for supported Alchemy networks, including Monad Mainnet
|
|
1876
1789
|
3. Public/default RPC URL
|
|
1877
1790
|
|
|
@@ -1885,7 +1798,6 @@ ALCHEMY_API_KEY=your_key_here pnpm test:fork
|
|
|
1885
1798
|
ALCHEMY_API_KEY=your_key_here TEST_CHAIN=base pnpm test:fork
|
|
1886
1799
|
ALCHEMY_API_KEY=your_key_here TEST_CHAIN=base-sepolia pnpm test:fork
|
|
1887
1800
|
ALCHEMY_API_KEY=your_key_here TEST_CHAIN=mainnet pnpm test:fork
|
|
1888
|
-
ALCHEMY_API_KEY=your_key_here TEST_CHAIN=eth-sepolia pnpm test:fork
|
|
1889
1801
|
```
|
|
1890
1802
|
|
|
1891
1803
|
You can also provide chain-specific RPC URLs directly:
|
|
@@ -1893,7 +1805,6 @@ You can also provide chain-specific RPC URLs directly:
|
|
|
1893
1805
|
```bash
|
|
1894
1806
|
ETH_MAINNET_RPC_URL=https://... TEST_CHAIN=mainnet pnpm test:fork
|
|
1895
1807
|
ARBITRUM_RPC_URL=https://... TEST_CHAIN=arbitrum pnpm test:fork
|
|
1896
|
-
ETH_SEPOLIA_RPC_URL=https://... TEST_CHAIN=eth-sepolia pnpm test:fork
|
|
1897
1808
|
```
|
|
1898
1809
|
|
|
1899
1810
|
## Migration from Previous SDKs
|