damm-sdk 1.1.27 → 1.1.28

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.
Files changed (39) hide show
  1. package/dist/index.cjs +4131 -2334
  2. package/dist/index.cjs.map +33 -24
  3. package/dist/index.js +1376 -96
  4. package/dist/index.js.map +16 -13
  5. package/dist/integrations/gnosis/gnosis.d.ts +1 -1
  6. package/dist/integrations/gnosis/gnosis.d.ts.map +1 -1
  7. package/dist/integrations/index.d.ts +1 -0
  8. package/dist/integrations/index.d.ts.map +1 -1
  9. package/dist/integrations/morphoBlue/index.d.ts +3 -0
  10. package/dist/integrations/morphoBlue/index.d.ts.map +1 -0
  11. package/dist/integrations/morphoBlue/morpho.blue.abi.d.ts +62 -0
  12. package/dist/integrations/morphoBlue/morpho.blue.abi.d.ts.map +1 -0
  13. package/dist/integrations/morphoBlue/morpho.blue.d.ts +92 -0
  14. package/dist/integrations/morphoBlue/morpho.blue.d.ts.map +1 -0
  15. package/dist/integrations/zodiac/delay/index.d.ts +3 -0
  16. package/dist/integrations/zodiac/delay/index.d.ts.map +1 -0
  17. package/dist/integrations/zodiac/delay/zodiac.delay.abi.d.ts +722 -0
  18. package/dist/integrations/zodiac/delay/zodiac.delay.abi.d.ts.map +1 -0
  19. package/dist/integrations/zodiac/delay/zodiac.delay.d.ts +19 -0
  20. package/dist/integrations/zodiac/delay/zodiac.delay.d.ts.map +1 -0
  21. package/dist/integrations/zodiac/index.d.ts +1 -0
  22. package/dist/integrations/zodiac/index.d.ts.map +1 -1
  23. package/dist/integrations/zodiac/roles/zodiac.roles.d.ts +13 -2
  24. package/dist/integrations/zodiac/roles/zodiac.roles.d.ts.map +1 -1
  25. package/dist/lib/constants.d.ts +1 -0
  26. package/dist/lib/constants.d.ts.map +1 -1
  27. package/package.json +3 -3
  28. package/src/integrations/aaveV3/aave.v3.ts +1 -1
  29. package/src/integrations/index.ts +1 -0
  30. package/src/integrations/morphoBlue/index.ts +2 -0
  31. package/src/integrations/morphoBlue/morpho.blue.abi.ts +612 -0
  32. package/src/integrations/morphoBlue/morpho.blue.ts +253 -0
  33. package/src/integrations/zodiac/delay/index.ts +2 -0
  34. package/src/integrations/zodiac/delay/zodiac.delay.abi.ts +394 -0
  35. package/src/integrations/zodiac/delay/zodiac.delay.ts +60 -0
  36. package/src/integrations/zodiac/index.ts +1 -0
  37. package/src/integrations/zodiac/roles/zodiac.roles.ts +42 -4
  38. package/src/lib/constants.ts +2 -0
  39. package/src/lib/contractsRegistry.json +86 -25
@@ -0,0 +1,60 @@
1
+ import { ethers } from "ethers";
2
+ import ZodiacDelay from "./zodiac.delay.abi";
3
+ import type { HexString, Call } from "damm-sdk";
4
+ import type { Address } from "viem";
5
+
6
+ const zodiacDelayInterface = new ethers.utils.Interface(ZodiacDelay);
7
+
8
+ export type DelayedTransactionArgs = Readonly<{
9
+ to: Address;
10
+ value: bigint;
11
+ data: HexString;
12
+ operation: number;
13
+ }>;
14
+
15
+ export const DelayedTransactionCalldata = ({ to, value, data, operation }: DelayedTransactionArgs): HexString => {
16
+ return zodiacDelayInterface.encodeFunctionData("execTransactionFromModule", [
17
+ to,
18
+ value,
19
+ data,
20
+ operation,
21
+ ]) as HexString;
22
+ };
23
+
24
+ export const execTransactionWithDelay = ({
25
+ args,
26
+ delayModuleAddress,
27
+ }: {
28
+ args: DelayedTransactionArgs;
29
+ delayModuleAddress: Address;
30
+ }): Call => {
31
+ const data = DelayedTransactionCalldata(args);
32
+
33
+ return {
34
+ operation: 0,
35
+ to: delayModuleAddress,
36
+ value: 0n,
37
+ data,
38
+ };
39
+ };
40
+
41
+ export const NextTxCalldata = ({ to, value, data, operation }: DelayedTransactionArgs): HexString => {
42
+ return zodiacDelayInterface.encodeFunctionData("executeNextTx", [to, value, data, operation]) as HexString;
43
+ };
44
+
45
+ export const executeNextTx = ({
46
+ args,
47
+ delayModuleAddress,
48
+ }: {
49
+ args: DelayedTransactionArgs;
50
+ delayModuleAddress: Address;
51
+ }): Call => {
52
+ const data = NextTxCalldata(args);
53
+
54
+ return {
55
+ operation: 0,
56
+ to: delayModuleAddress,
57
+ value: 0n,
58
+ data,
59
+ };
60
+ };
@@ -1 +1,2 @@
1
1
  export * from "./roles";
2
+ export * from "./delay";
@@ -14,7 +14,7 @@ export type ExecWithRoleArgs = Readonly<{
14
14
  shouldRevert: boolean;
15
15
  }>;
16
16
 
17
- export const execTransactionWithRoleCalldata = ({
17
+ export const TransactionWithRoleCalldata = ({
18
18
  to,
19
19
  value,
20
20
  data,
@@ -39,7 +39,7 @@ export const execWithRoleTrx = ({
39
39
  args: ExecWithRoleArgs;
40
40
  rolesModAddress: Address;
41
41
  }): Call => {
42
- const data = execTransactionWithRoleCalldata(args);
42
+ const data = TransactionWithRoleCalldata(args);
43
43
 
44
44
  return {
45
45
  operation: 0,
@@ -58,7 +58,7 @@ export type ExecWithRoleReturnDataArgs = Readonly<{
58
58
  shouldRevert: boolean;
59
59
  }>;
60
60
 
61
- export const execTransactionWithRoleReturnDataCalldata = ({
61
+ export const TransactionWithRoleReturnDataCalldata = ({
62
62
  to,
63
63
  value,
64
64
  data,
@@ -83,7 +83,45 @@ export const execWithRoleReturnDataTrx = ({
83
83
  args: ExecWithRoleReturnDataArgs;
84
84
  rolesModAddress: Address;
85
85
  }): Call => {
86
- const data = execTransactionWithRoleReturnDataCalldata(args);
86
+ const data = TransactionWithRoleReturnDataCalldata(args);
87
+
88
+ return {
89
+ operation: 0,
90
+ to: rolesModAddress,
91
+ value: 0n,
92
+ data,
93
+ };
94
+ };
95
+
96
+ export type ExecTransactionFromModuleArgs = Readonly<{
97
+ to: Address;
98
+ value: bigint;
99
+ data: HexString;
100
+ operation: number;
101
+ }>;
102
+
103
+ export const TransactionFromModuleCalldata = ({
104
+ to,
105
+ value,
106
+ data,
107
+ operation,
108
+ }: ExecTransactionFromModuleArgs): HexString => {
109
+ return zodiacRolesInterface.encodeFunctionData("execTransactionFromModule", [
110
+ to,
111
+ value,
112
+ data,
113
+ operation,
114
+ ]) as HexString;
115
+ };
116
+
117
+ export const execTransactionFromModuleTrx = ({
118
+ args,
119
+ rolesModAddress,
120
+ }: {
121
+ args: ExecTransactionFromModuleArgs;
122
+ rolesModAddress: Address;
123
+ }): Call => {
124
+ const data = TransactionFromModuleCalldata(args);
87
125
 
88
126
  return {
89
127
  operation: 0,
@@ -14,3 +14,5 @@ export const PERMIT2_ADDRESS_CANONICAL: Address = "0x000000000022D473030F116dDEE
14
14
 
15
15
  export const CALL_OP_CODE = 0;
16
16
  export const DELEGATE_CALL_OP_CODE = 1;
17
+
18
+ export const SENTINEL_ADDRESS: Address = "0x0000000000000000000000000000000000000001";
@@ -18,14 +18,15 @@
18
18
  "poolManager": "0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32",
19
19
  "stateView": "0x76Fd297e2D437cd7f76d50F01AfE6160f86e9990",
20
20
  "zodiacVerifiers": {
21
- "positionMintVerifier": "0x84fb10583C1a0E3eF5b78dDff77884c2232B55B8",
22
- "takeAllVerifier": "0x44E3356bdFE47F0FB6e4C62eCb281d4E389E68A3",
23
- "settleAllVerifier": "0x0fC9Ec86faefa5873bb380158866501D19bE8c53",
24
- "swapExactInSingleVerifier": "0x9e3Fb8d8b32980d8084b83AD43af6af17786b57B",
25
- "sweepVerifier": "0x069d8457D0cEDdf3F0965A82D5B9b5712F9dD84E",
26
- "takePairVerifier": "0x8fFf2A621253b5722eA99a8219dc941f0Ad1BE6e",
27
- "decreaseLiquidityVerifier": "0x2C5F8ccE821C577e54178f215207517E396070A9",
28
- "settlePairVerifier": "0x07Aad0Dd94f3F31D8AE2e593699b5AD4520B568f"
21
+ "positionMintVerifier": "0xA0B62aCD2fD69720744d03d5E11b021D715BEc04",
22
+ "takeAllVerifier": "0x16e75e91aa5C9c0976d48bd36035A71f2E54A18c",
23
+ "settleAllVerifier": "0x66ABaaC16293a9d2a291f3C7A88d8B1b65953752",
24
+ "swapExactInSingleVerifier": "0xB21d73547b40438bA661Dd4B6EA99cF938F67Af8",
25
+ "swapExactOutSingleVerifier": "0xc3f0bC7CfFec898EC5aD9d40e4f7eA80d9641B7B",
26
+ "sweepVerifier": "0xc6af34fE57e4293D58eA2ad3D68b3f8BaA43A5D4",
27
+ "takePairVerifier": "0x78a8bBa010bb4E0EC0A3A50049C77cFd3abEA495",
28
+ "decreaseLiquidityVerifier": "0x34fA7F29A69989cdA0822f3F65F2aA47e3C80f3A",
29
+ "settlePairVerifier": "0x83a502479931508f977321615BA7e6F2AA933Cf1"
29
30
  }
30
31
  },
31
32
  "gnosisSafe": {
@@ -38,7 +39,8 @@
38
39
  },
39
40
  "zodiac": {
40
41
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
41
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
42
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
43
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
42
44
  },
43
45
  "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11",
44
46
  "permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
@@ -62,7 +64,11 @@
62
64
  "1inch": {
63
65
  "aggregatorV6": "0x111111125421cA6dc452d289314280a0f8842A65"
64
66
  },
65
- "wrappedNativeToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1"
67
+ "wrappedNativeToken": "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
68
+ "morpho": {
69
+ "morphoBlue": "0x6c247b1F6182318877311737BaC0844bAa518F5e"
70
+ },
71
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
66
72
  },
67
73
  "base": {
68
74
  "tokens": {
@@ -93,12 +99,17 @@
93
99
  },
94
100
  "zodiac": {
95
101
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
96
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
102
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
103
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
97
104
  },
98
105
  "1inch": {
99
106
  "aggregatorV6": "0x111111125421cA6dc452d289314280a0f8842A65"
100
107
  },
101
- "wrappedNativeToken": "0x4200000000000000000000000000000000000006"
108
+ "wrappedNativeToken": "0x4200000000000000000000000000000000000006",
109
+ "morpho": {
110
+ "morphoBlue": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb"
111
+ },
112
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
102
113
  },
103
114
  "polygon": {
104
115
  "uniswapV3": {
@@ -123,12 +134,17 @@
123
134
  },
124
135
  "zodiac": {
125
136
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
126
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
137
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
138
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
127
139
  },
128
140
  "1inch": {
129
141
  "aggregatorV6": "0x111111125421cA6dc452d289314280a0f8842A65"
130
142
  },
131
- "wrappedNativeToken": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"
143
+ "wrappedNativeToken": "0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619",
144
+ "morpho": {
145
+ "morphoBlue": "0x1bF0c2541F820E775182832f06c0B7Fc27A25f67"
146
+ },
147
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
132
148
  },
133
149
  "bsc": {
134
150
  "uniswapV3": {
@@ -151,7 +167,8 @@
151
167
  },
152
168
  "zodiac": {
153
169
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
154
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
170
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
171
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
155
172
  },
156
173
  "1inch": {
157
174
  "aggregatorV6": "0x111111125421cA6dc452d289314280a0f8842A65"
@@ -179,7 +196,11 @@
179
196
  "multicall3": "0xcA11bde05977b3631167028862bE2a173976CA11",
180
197
  "1inch": {
181
198
  "aggregatorV6": "0x111111125421cA6dc452d289314280a0f8842A65"
182
- }
199
+ },
200
+ "morpho": {
201
+ "morphoBlue": "0xce95AfbB8EA029495c66020883F87aaE8864AF92"
202
+ },
203
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
183
204
  },
184
205
  "mainnet": {
185
206
  "uniswapV3": {
@@ -223,7 +244,8 @@
223
244
  "1inch": {
224
245
  "aggregatorV6": "0x111111125421cA6dc452d289314280a0f8842A65"
225
246
  },
226
- "wrappedNativeToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
247
+ "wrappedNativeToken": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
248
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
227
249
  },
228
250
  "unichain": {
229
251
  "uniswapV4": {
@@ -232,14 +254,25 @@
232
254
  "poolManager": "0x1F98400000000000000000000000000000000004",
233
255
  "stateView": "0x86e8631A016F9068C3f085fAF484Ee3F5fDee8f2"
234
256
  },
257
+ "uniswapV3": {
258
+ "router": "0x73855d06DE49d0fe4A9c42636Ba96c62da12FF9C",
259
+ "positionManager": "0x943e6e07a7E8E791dAFC44083e54041D743C46E9"
260
+ },
235
261
  "lagoonV0_5": {
236
262
  "factory": "0xaba1A2e157Dae248f8630cA550bd826725Ff745c",
237
263
  "registry": "0x652716FaD571f04D26a3c8fFd9E593F17123Ab20",
238
264
  "vaultImpl": "0xE50554ec802375C9c3F9c087a8a7bb8C26d3DEDf"
239
265
  },
266
+ "tokens": {
267
+ "usdc": "0x078D782b760474a361dDA0AF3839290b0EF57AD6",
268
+ "usdt": "0x9151434b16b9763660705744891fA906F660EcC5",
269
+ "dai": "0x20CAb320A855b39F724131C69424240519573f81",
270
+ "weth": "0x4200000000000000000000000000000000000006"
271
+ },
240
272
  "zodiac": {
241
273
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
242
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
274
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
275
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
243
276
  },
244
277
  "gnosisSafe": {
245
278
  "v1_4_1": {
@@ -248,7 +281,15 @@
248
281
  "safeL2Singleton": "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
249
282
  "proxyFactory": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
250
283
  }
251
- }
284
+ },
285
+ "enso": {
286
+ "routerV2": "0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf"
287
+ },
288
+ "permit2": "0x000000000022D473030F116dDEE9F6B43aC78BA3",
289
+ "morpho": {
290
+ "morphoBlue": "0x8f5ae9CddB9f68de460C77730b018Ae7E04a140A"
291
+ },
292
+ "wrappedNativeToken": "0x4200000000000000000000000000000000000006"
252
293
  },
253
294
  "mantle": {
254
295
  "agniV1": {
@@ -268,7 +309,8 @@
268
309
  },
269
310
  "zodiac": {
270
311
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
271
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
312
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
313
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
272
314
  },
273
315
  "tokens": {
274
316
  "ausd": "0x00000000eFE302BEAA2b3e6e1b18d08D69a9012a",
@@ -282,9 +324,16 @@
282
324
  "registry": "0x47A144e67834408716cB40Fa87fc886D63362ddC",
283
325
  "vaultImpl": "0xA7260Cee56B679eC05a736A7b603b8DA8525Dd69"
284
326
  },
285
- "wrappedNativeToken": "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8"
327
+ "wrappedNativeToken": "0x78c1b0C915c4FAA5FffA6CAbf0219DA63d7f4cb8",
328
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
286
329
  },
287
330
  "worldchain": {
331
+ "tokens": {
332
+ "wld": "0x2cFc85d8E48F8EAB294be644d9E25C3030863003",
333
+ "usdc": "0x79A02482A880bCE3F13e09Da970dC34db4CD24d1",
334
+ "weth": "0x4200000000000000000000000000000000000006",
335
+ "wbtc": "0x03C7054BCB39f7b2e5B2c7AcB37583e32D70Cfa3"
336
+ },
288
337
  "lagoonV0_5": {
289
338
  "factory": "0x600fA26581771F56221FC9847A834B3E5fd34AF7",
290
339
  "registry": "0x68e793658def657551fd4D3cA6Bc04b4E7723655",
@@ -293,9 +342,14 @@
293
342
  "enso": {
294
343
  "routerV2": "0xF75584eF6673aD213a685a1B58Cc0330B8eA22Cf"
295
344
  },
345
+ "uniswapV3": {
346
+ "positionManager": "0xec12a9F9a09f50550686363766Cc153D03c27b5e",
347
+ "router": "0x091AD9e2e6e5eD44c1c66dB50e49A601F9f36cF6"
348
+ },
296
349
  "zodiac": {
297
350
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
298
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
351
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
352
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
299
353
  },
300
354
  "morpho": {
301
355
  "morphoBlue": "0xE741BC7c34758b4caE05062794E8Ae24978AF432"
@@ -307,7 +361,9 @@
307
361
  "safeL2Singleton": "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
308
362
  "proxyFactory": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
309
363
  }
310
- }
364
+ },
365
+ "wrappedNativeToken": "0x4200000000000000000000000000000000000006",
366
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
311
367
  },
312
368
  "sepolia": {
313
369
  "lagoonV0_5": {
@@ -326,7 +382,8 @@
326
382
  },
327
383
  "zodiac": {
328
384
  "rolesModule": "0x9646fDAD06d3e24444381f44362a3B0eB343D337",
329
- "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236"
385
+ "moduleProxyFactory": "0x000000000000aDdB49795b0f9bA5BC298cDda236",
386
+ "delayModule": "0x01F8cabB808D7dE0dF4202D4B60C8310d2f1339b"
330
387
  },
331
388
  "gnosisSafe": {
332
389
  "v1_4_1": {
@@ -335,6 +392,10 @@
335
392
  "safeL2Singleton": "0x29fcB43b46531BcA003ddC8FCB67FFE91900C762",
336
393
  "proxyFactory": "0x4e1DCf7AD4e460CfD30791CCC4F9c8a4f820ec67"
337
394
  }
338
- }
395
+ },
396
+ "morpho": {
397
+ "morphoBlue": "0xd011EE229E7459ba1ddd22631eF7bF528d424A14"
398
+ },
399
+ "poster": "0x000000000000cd17345801aa8147b8D3950260FF"
339
400
  }
340
401
  }