@safe-global/protocol-kit 6.1.1 → 7.0.0
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/dist/cjs/src/index.cjs +1538 -203
- package/dist/cjs/test-utils/index.cjs +622 -75
- package/dist/esm/src/index.mjs +1500 -146
- package/dist/esm/test-utils/index.mjs +604 -38
- package/dist/src/Safe.d.ts +125 -3
- package/dist/src/Safe.d.ts.map +1 -1
- package/dist/src/SafeProvider.d.ts.map +1 -1
- package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.d.ts +1 -0
- package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.d.ts.map +1 -1
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.d.ts +33 -0
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/CreateCall/CreateCallBaseContract.d.ts +1 -0
- package/dist/src/contracts/CreateCall/CreateCallBaseContract.d.ts.map +1 -1
- package/dist/src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.d.ts +38 -0
- package/dist/src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.d.ts +36 -0
- package/dist/src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.d.ts.map +1 -0
- package/dist/src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.d.ts +86 -0
- package/dist/src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/MultiSend/MultiSendBaseContract.d.ts +1 -0
- package/dist/src/contracts/MultiSend/MultiSendBaseContract.d.ts.map +1 -1
- package/dist/src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.d.ts +26 -0
- package/dist/src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.d.ts +26 -0
- package/dist/src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/Safe/SafeBaseContract.d.ts +1 -0
- package/dist/src/contracts/Safe/SafeBaseContract.d.ts.map +1 -1
- package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.d.ts +1 -1
- package/dist/src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.d.ts +156 -0
- package/dist/src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.d.ts +60 -0
- package/dist/src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.d.ts +1 -0
- package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.d.ts.map +1 -1
- package/dist/src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.d.ts +34 -0
- package/dist/src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.d.ts +1 -0
- package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.d.ts.map +1 -1
- package/dist/src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.d.ts +31 -0
- package/dist/src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.d.ts.map +1 -0
- package/dist/src/contracts/config.d.ts +1 -1
- package/dist/src/contracts/config.d.ts.map +1 -1
- package/dist/src/contracts/contractInstances.d.ts +18 -8
- package/dist/src/contracts/contractInstances.d.ts.map +1 -1
- package/dist/src/contracts/index.d.ts +2 -1
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/safeDeploymentContracts.d.ts +2 -1
- package/dist/src/contracts/safeDeploymentContracts.d.ts.map +1 -1
- package/dist/src/contracts/utils.d.ts.map +1 -1
- package/dist/src/index.d.ts +4 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/fallbackHandlerManager.d.ts +1 -0
- package/dist/src/managers/fallbackHandlerManager.d.ts.map +1 -1
- package/dist/src/managers/moduleManager.d.ts +7 -0
- package/dist/src/managers/moduleManager.d.ts.map +1 -1
- package/dist/src/types/contracts.d.ts +22 -8
- package/dist/src/types/contracts.d.ts.map +1 -1
- package/dist/src/types/passkeys.d.ts +13 -2
- package/dist/src/types/passkeys.d.ts.map +1 -1
- package/dist/src/utils/eip-3770/config.d.ts.map +1 -1
- package/dist/src/utils/passkeys/PasskeyClient.d.ts +1 -1
- package/dist/src/utils/passkeys/PasskeyClient.d.ts.map +1 -1
- package/dist/src/utils/passkeys/extractPasskeyData.d.ts +8 -11
- package/dist/src/utils/passkeys/extractPasskeyData.d.ts.map +1 -1
- package/dist/src/utils/passkeys/isSharedSigner.d.ts +1 -1
- package/dist/src/utils/passkeys/isSharedSigner.d.ts.map +1 -1
- package/dist/src/utils/safeVersions.d.ts +8 -5
- package/dist/src/utils/safeVersions.d.ts.map +1 -1
- package/dist/test-utils/passkeys.d.ts +2 -2
- package/dist/test-utils/passkeys.d.ts.map +1 -1
- package/package.json +7 -5
package/dist/esm/src/index.mjs
CHANGED
|
@@ -33,6 +33,7 @@ import { waitForTransactionReceipt } from "viem/actions";
|
|
|
33
33
|
import {
|
|
34
34
|
getCompatibilityFallbackHandlerDeployments,
|
|
35
35
|
getCreateCallDeployments,
|
|
36
|
+
getExtensibleFallbackHandlerDeployments,
|
|
36
37
|
getMultiSendCallOnlyDeployments,
|
|
37
38
|
getMultiSendDeployments,
|
|
38
39
|
getProxyFactoryDeployments,
|
|
@@ -45,8 +46,22 @@ import {
|
|
|
45
46
|
getSafeWebAuthnSignerFactoryDeployment,
|
|
46
47
|
getSafeWebAuthnShareSignerDeployment
|
|
47
48
|
} from "@safe-global/safe-modules-deployments";
|
|
48
|
-
var DEFAULT_SAFE_VERSION = "1.
|
|
49
|
+
var DEFAULT_SAFE_VERSION = "1.4.1";
|
|
49
50
|
var safeDeploymentsVersions = {
|
|
51
|
+
"1.5.0": {
|
|
52
|
+
safeSingletonVersion: "1.5.0",
|
|
53
|
+
safeSingletonL2Version: "1.5.0",
|
|
54
|
+
safeProxyFactoryVersion: "1.5.0",
|
|
55
|
+
compatibilityFallbackHandler: "1.5.0",
|
|
56
|
+
extensibleFallbackHandler: "1.5.0",
|
|
57
|
+
multiSendVersion: "1.5.0",
|
|
58
|
+
multiSendCallOnlyVersion: "1.5.0",
|
|
59
|
+
signMessageLibVersion: "1.5.0",
|
|
60
|
+
createCallVersion: "1.5.0",
|
|
61
|
+
simulateTxAccessorVersion: "1.5.0",
|
|
62
|
+
safeWebAuthnSignerFactoryVersion: "0.2.1",
|
|
63
|
+
safeWebAuthnSharedSignerVersion: "0.2.1"
|
|
64
|
+
},
|
|
50
65
|
"1.4.1": {
|
|
51
66
|
safeSingletonVersion: "1.4.1",
|
|
52
67
|
safeSingletonL2Version: "1.4.1",
|
|
@@ -119,6 +134,7 @@ var contractFunctions = {
|
|
|
119
134
|
safeSingletonL2Version: getSafeL2SingletonDeployments,
|
|
120
135
|
safeProxyFactoryVersion: getProxyFactoryDeployments,
|
|
121
136
|
compatibilityFallbackHandler: getCompatibilityFallbackHandlerDeployments,
|
|
137
|
+
extensibleFallbackHandler: getExtensibleFallbackHandlerDeployments,
|
|
122
138
|
multiSendVersion: getMultiSendDeployments,
|
|
123
139
|
multiSendCallOnlyVersion: getMultiSendCallOnlyDeployments,
|
|
124
140
|
signMessageLibVersion: getSignMessageLibDeployments,
|
|
@@ -246,6 +262,8 @@ var networks = [
|
|
|
246
262
|
{ chainId: 146n, shortName: "sonic" },
|
|
247
263
|
{ chainId: 148n, shortName: "shimmerevm" },
|
|
248
264
|
{ chainId: 150n, shortName: "sixt" },
|
|
265
|
+
{ chainId: 151n, shortName: "rbn" },
|
|
266
|
+
{ chainId: 153n, shortName: "rbn-testnet" },
|
|
249
267
|
{ chainId: 155n, shortName: "tenet-testnet" },
|
|
250
268
|
{ chainId: 169n, shortName: "manta" },
|
|
251
269
|
{ chainId: 173n, shortName: "eni" },
|
|
@@ -266,7 +284,7 @@ var networks = [
|
|
|
266
284
|
{ chainId: 255n, shortName: "kroma" },
|
|
267
285
|
{ chainId: 274n, shortName: "lachain" },
|
|
268
286
|
{ chainId: 280n, shortName: "zksync-goerli" },
|
|
269
|
-
{ chainId: 282n, shortName: "zkTCRO" },
|
|
287
|
+
{ chainId: 282n, shortName: "deprecated-zkTCRO" },
|
|
270
288
|
{ chainId: 288n, shortName: "boba" },
|
|
271
289
|
{ chainId: 291n, shortName: "orderly" },
|
|
272
290
|
{ chainId: 295n, shortName: "hedera-mainnet" },
|
|
@@ -299,7 +317,10 @@ var networks = [
|
|
|
299
317
|
{ chainId: 690n, shortName: "redstone" },
|
|
300
318
|
{ chainId: 698n, shortName: "Matchain" },
|
|
301
319
|
{ chainId: 747n, shortName: "flow-mainnet" },
|
|
320
|
+
{ chainId: 756n, shortName: "capx-testnet" },
|
|
321
|
+
{ chainId: 757n, shortName: "capx" },
|
|
302
322
|
{ chainId: 787n, shortName: "aca" },
|
|
323
|
+
{ chainId: 841n, shortName: "tara" },
|
|
303
324
|
{ chainId: 842n, shortName: "taratest" },
|
|
304
325
|
{ chainId: 870n, shortName: "AMN" },
|
|
305
326
|
{ chainId: 919n, shortName: "modesep" },
|
|
@@ -307,8 +328,9 @@ var networks = [
|
|
|
307
328
|
{ chainId: 943n, shortName: "t4pls" },
|
|
308
329
|
{ chainId: 964n, shortName: "bittensor-evm-mainnet" },
|
|
309
330
|
{ chainId: 970n, shortName: "ccn" },
|
|
331
|
+
{ chainId: 988n, shortName: "stable" },
|
|
310
332
|
{ chainId: 995n, shortName: "5ire" },
|
|
311
|
-
{ chainId: 999n, shortName: "
|
|
333
|
+
{ chainId: 999n, shortName: "hyper_evm" },
|
|
312
334
|
{ chainId: 1001n, shortName: "kaia-kairos" },
|
|
313
335
|
{ chainId: 1008n, shortName: "eun" },
|
|
314
336
|
{ chainId: 1030n, shortName: "cfx" },
|
|
@@ -342,9 +364,11 @@ var networks = [
|
|
|
342
364
|
{ chainId: 1559n, shortName: "tenet" },
|
|
343
365
|
{ chainId: 1625n, shortName: "gravity" },
|
|
344
366
|
{ chainId: 1663n, shortName: "Gobi" },
|
|
367
|
+
{ chainId: 1672n, shortName: "pharos" },
|
|
345
368
|
{ chainId: 1729n, shortName: "reya" },
|
|
346
369
|
{ chainId: 1740n, shortName: "metall2-testnet" },
|
|
347
370
|
{ chainId: 1750n, shortName: "metall2" },
|
|
371
|
+
{ chainId: 1776n, shortName: "injective" },
|
|
348
372
|
{ chainId: 1807n, shortName: "rana" },
|
|
349
373
|
{ chainId: 1811n, shortName: "lif3-testnet" },
|
|
350
374
|
{ chainId: 1868n, shortName: "soneium" },
|
|
@@ -366,6 +390,7 @@ var networks = [
|
|
|
366
390
|
{ chainId: 2039n, shortName: "aleph" },
|
|
367
391
|
{ chainId: 2187n, shortName: "g7" },
|
|
368
392
|
{ chainId: 2192n, shortName: "snax" },
|
|
393
|
+
{ chainId: 2201n, shortName: "stable-testnet" },
|
|
369
394
|
{ chainId: 2221n, shortName: "tkava" },
|
|
370
395
|
{ chainId: 2222n, shortName: "kava" },
|
|
371
396
|
{ chainId: 2331n, shortName: "rss3-testnet" },
|
|
@@ -375,10 +400,14 @@ var networks = [
|
|
|
375
400
|
{ chainId: 2391n, shortName: "tacchain_2391-1" },
|
|
376
401
|
{ chainId: 2424n, shortName: "inevm-testnet" },
|
|
377
402
|
{ chainId: 2442n, shortName: "zkevm-testnet-cardona" },
|
|
403
|
+
{ chainId: 2522n, shortName: "fraxtal-testnet" },
|
|
378
404
|
{ chainId: 2741n, shortName: "abstract" },
|
|
405
|
+
{ chainId: 2787n, shortName: "creator-chain-mainnet" },
|
|
379
406
|
{ chainId: 2810n, shortName: "hmorph" },
|
|
380
407
|
{ chainId: 2818n, shortName: "morph" },
|
|
408
|
+
{ chainId: 2910n, shortName: "morph-hoodi-testnet" },
|
|
381
409
|
{ chainId: 3068n, shortName: "bfc" },
|
|
410
|
+
{ chainId: 3111n, shortName: "alpha" },
|
|
382
411
|
{ chainId: 3338n, shortName: "PEAQ" },
|
|
383
412
|
{ chainId: 3501n, shortName: "JFIN" },
|
|
384
413
|
{ chainId: 3636n, shortName: "BTNXt" },
|
|
@@ -393,23 +422,30 @@ var networks = [
|
|
|
393
422
|
{ chainId: 4158n, shortName: "crossfi" },
|
|
394
423
|
{ chainId: 4162n, shortName: "SXR" },
|
|
395
424
|
{ chainId: 4202n, shortName: "lisksep" },
|
|
425
|
+
{ chainId: 4326n, shortName: "megaeth" },
|
|
396
426
|
{ chainId: 4337n, shortName: "beam" },
|
|
397
427
|
{ chainId: 4460n, shortName: "orderlyl2" },
|
|
398
428
|
{ chainId: 4488n, shortName: "HYDRA" },
|
|
429
|
+
{ chainId: 4509n, shortName: "SC" },
|
|
399
430
|
{ chainId: 4653n, shortName: "gold" },
|
|
400
431
|
{ chainId: 4661n, shortName: "appchaintestnet" },
|
|
401
432
|
{ chainId: 4689n, shortName: "iotex-mainnet" },
|
|
433
|
+
{ chainId: 4801n, shortName: "wcsep" },
|
|
402
434
|
{ chainId: 4918n, shortName: "txvm" },
|
|
403
435
|
{ chainId: 4919n, shortName: "xvm" },
|
|
404
436
|
{ chainId: 5000n, shortName: "mantle" },
|
|
405
437
|
{ chainId: 5001n, shortName: "mantle-testnet" },
|
|
406
438
|
{ chainId: 5003n, shortName: "mnt-sep" },
|
|
439
|
+
{ chainId: 5031n, shortName: "Somnia" },
|
|
407
440
|
{ chainId: 5115n, shortName: "citrea-testnet" },
|
|
408
441
|
{ chainId: 5165n, shortName: "ftn" },
|
|
409
442
|
{ chainId: 5330n, shortName: "sseed" },
|
|
443
|
+
{ chainId: 5464n, shortName: "saga" },
|
|
410
444
|
{ chainId: 5611n, shortName: "obnbt" },
|
|
411
445
|
{ chainId: 5700n, shortName: "tsys" },
|
|
412
446
|
{ chainId: 5851n, shortName: "OntologyTestnet" },
|
|
447
|
+
{ chainId: 5887n, shortName: "dukong" },
|
|
448
|
+
{ chainId: 5888n, shortName: "mantrachain" },
|
|
413
449
|
{ chainId: 6001n, shortName: "bouncebit-mainnet" },
|
|
414
450
|
{ chainId: 6102n, shortName: "cascadia" },
|
|
415
451
|
{ chainId: 6321n, shortName: "eaura" },
|
|
@@ -426,13 +462,17 @@ var networks = [
|
|
|
426
462
|
{ chainId: 7070n, shortName: "planq" },
|
|
427
463
|
{ chainId: 7171n, shortName: "bitrock" },
|
|
428
464
|
{ chainId: 7200n, shortName: "xsat" },
|
|
465
|
+
{ chainId: 7208n, shortName: "nxra-mainnet" },
|
|
429
466
|
{ chainId: 7332n, shortName: "EON" },
|
|
467
|
+
{ chainId: 7336n, shortName: "pruvtestnet" },
|
|
468
|
+
{ chainId: 7337n, shortName: "pruvmainnet" },
|
|
430
469
|
{ chainId: 7341n, shortName: "shyft" },
|
|
431
470
|
{ chainId: 7560n, shortName: "cyeth" },
|
|
432
471
|
{ chainId: 7700n, shortName: "canto" },
|
|
433
472
|
{ chainId: 7771n, shortName: "tbitrock" },
|
|
434
473
|
{ chainId: 7897n, shortName: "arena-z" },
|
|
435
474
|
{ chainId: 8008n, shortName: "polynomial" },
|
|
475
|
+
{ chainId: 8150n, shortName: "alpen" },
|
|
436
476
|
{ chainId: 8192n, shortName: "tqf" },
|
|
437
477
|
{ chainId: 8194n, shortName: "ttqf" },
|
|
438
478
|
{ chainId: 8217n, shortName: "kaia-mainnet" },
|
|
@@ -440,6 +480,8 @@ var networks = [
|
|
|
440
480
|
{ chainId: 8333n, shortName: "b3" },
|
|
441
481
|
{ chainId: 8408n, shortName: "zentest" },
|
|
442
482
|
{ chainId: 8453n, shortName: "base" },
|
|
483
|
+
{ chainId: 8700n, shortName: "ACN" },
|
|
484
|
+
{ chainId: 8765n, shortName: "ward" },
|
|
443
485
|
{ chainId: 8801n, shortName: "okto-testnet" },
|
|
444
486
|
{ chainId: 8822n, shortName: "iotaevm" },
|
|
445
487
|
{ chainId: 8844n, shortName: "THYDRA" },
|
|
@@ -450,7 +492,8 @@ var networks = [
|
|
|
450
492
|
{ chainId: 9369n, shortName: "z" },
|
|
451
493
|
{ chainId: 9700n, shortName: "MainnetDev" },
|
|
452
494
|
{ chainId: 9728n, shortName: "boba-testnet" },
|
|
453
|
-
{ chainId:
|
|
495
|
+
{ chainId: 9745n, shortName: "plasma" },
|
|
496
|
+
{ chainId: 9746n, shortName: "plasma-testnet" },
|
|
454
497
|
{ chainId: 10000n, shortName: "smartbch" },
|
|
455
498
|
{ chainId: 10001n, shortName: "smartbchtest" },
|
|
456
499
|
{ chainId: 10081n, shortName: "joct" },
|
|
@@ -464,6 +507,7 @@ var networks = [
|
|
|
464
507
|
{ chainId: 11111n, shortName: "WAGMI" },
|
|
465
508
|
{ chainId: 11124n, shortName: "abstract-sepolia" },
|
|
466
509
|
{ chainId: 11235n, shortName: "islm" },
|
|
510
|
+
{ chainId: 11417n, shortName: "anq-testnet" },
|
|
467
511
|
{ chainId: 11437n, shortName: "shyftt" },
|
|
468
512
|
{ chainId: 11501n, shortName: "bevm" },
|
|
469
513
|
{ chainId: 11503n, shortName: "bevm-test" },
|
|
@@ -475,33 +519,44 @@ var networks = [
|
|
|
475
519
|
{ chainId: 12553n, shortName: "rss3" },
|
|
476
520
|
{ chainId: 13337n, shortName: "beam-testnet" },
|
|
477
521
|
{ chainId: 13371n, shortName: "imx" },
|
|
522
|
+
{ chainId: 13441n, shortName: "bridgeless" },
|
|
478
523
|
{ chainId: 13473n, shortName: "imx-testnet" },
|
|
479
524
|
{ chainId: 13505n, shortName: "gravitysep" },
|
|
480
525
|
{ chainId: 13746n, shortName: "g7t" },
|
|
526
|
+
{ chainId: 14601n, shortName: "sonic-testnet" },
|
|
481
527
|
{ chainId: 14800n, shortName: "vana-moksha" },
|
|
528
|
+
{ chainId: 16661n, shortName: "0g" },
|
|
482
529
|
{ chainId: 17000n, shortName: "holesky" },
|
|
483
530
|
{ chainId: 17069n, shortName: "garnet" },
|
|
484
531
|
{ chainId: 17172n, shortName: "eclipse" },
|
|
485
532
|
{ chainId: 18231n, shortName: "unreal-old" },
|
|
486
533
|
{ chainId: 18233n, shortName: "unreal" },
|
|
487
534
|
{ chainId: 18880n, shortName: "expchain" },
|
|
535
|
+
{ chainId: 20994n, shortName: "fluent-testnet" },
|
|
488
536
|
{ chainId: 22776n, shortName: "mapo" },
|
|
489
537
|
{ chainId: 23294n, shortName: "sapphire" },
|
|
490
538
|
{ chainId: 23295n, shortName: "sapphire-testnet" },
|
|
539
|
+
{ chainId: 24101n, shortName: "incentiv" },
|
|
491
540
|
{ chainId: 25327n, shortName: "Everclear" },
|
|
541
|
+
{ chainId: 26888n, shortName: "tABCore" },
|
|
542
|
+
{ chainId: 28802n, shortName: "tcent" },
|
|
492
543
|
{ chainId: 28882n, shortName: "BobaSepolia" },
|
|
493
544
|
{ chainId: 28979n, shortName: "kimbonet-testnet" },
|
|
545
|
+
{ chainId: 30303n, shortName: "Ethiq" },
|
|
494
546
|
{ chainId: 31611n, shortName: "mezo" },
|
|
495
547
|
{ chainId: 32323n, shortName: "basedai" },
|
|
496
548
|
{ chainId: 32380n, shortName: "paix" },
|
|
497
549
|
{ chainId: 32769n, shortName: "zil" },
|
|
498
550
|
{ chainId: 32770n, shortName: "zq2-proto-mainnet" },
|
|
499
551
|
{ chainId: 33101n, shortName: "zil-testnet" },
|
|
552
|
+
{ chainId: 33111n, shortName: "curtis" },
|
|
500
553
|
{ chainId: 33139n, shortName: "apechain" },
|
|
501
554
|
{ chainId: 33401n, shortName: "slingshot" },
|
|
502
555
|
{ chainId: 34443n, shortName: "mode" },
|
|
503
556
|
{ chainId: 35441n, shortName: "q" },
|
|
504
557
|
{ chainId: 35443n, shortName: "q-testnet" },
|
|
558
|
+
{ chainId: 36888n, shortName: "abcore" },
|
|
559
|
+
{ chainId: 36900n, shortName: "adi" },
|
|
505
560
|
{ chainId: 37111n, shortName: "lens-sepolia" },
|
|
506
561
|
{ chainId: 41455n, shortName: "aleph-zero" },
|
|
507
562
|
{ chainId: 41923n, shortName: "edu-chain" },
|
|
@@ -509,6 +564,7 @@ var networks = [
|
|
|
509
564
|
{ chainId: 42170n, shortName: "arb-nova" },
|
|
510
565
|
{ chainId: 42220n, shortName: "celo" },
|
|
511
566
|
{ chainId: 42421n, shortName: "rwa" },
|
|
567
|
+
{ chainId: 42431n, shortName: "tempo-moderato" },
|
|
512
568
|
{ chainId: 42793n, shortName: "etlk" },
|
|
513
569
|
{ chainId: 43111n, shortName: "hemi" },
|
|
514
570
|
{ chainId: 43113n, shortName: "fuji" },
|
|
@@ -526,6 +582,7 @@ var networks = [
|
|
|
526
582
|
{ chainId: 49321n, shortName: "Stork" },
|
|
527
583
|
{ chainId: 50104n, shortName: "sophon" },
|
|
528
584
|
{ chainId: 50312n, shortName: "SomniaTestnet" },
|
|
585
|
+
{ chainId: 52924n, shortName: "lazai" },
|
|
529
586
|
{ chainId: 53302n, shortName: "seedsep" },
|
|
530
587
|
{ chainId: 53456n, shortName: "birdlayer" },
|
|
531
588
|
{ chainId: 53457n, shortName: "dodochain" },
|
|
@@ -560,35 +617,49 @@ var networks = [
|
|
|
560
617
|
{ chainId: 84532n, shortName: "basesep" },
|
|
561
618
|
{ chainId: 88811n, shortName: "unit0-mainnet" },
|
|
562
619
|
{ chainId: 88817n, shortName: "unit0-testnet" },
|
|
620
|
+
{ chainId: 88882n, shortName: "chzspicy" },
|
|
621
|
+
{ chainId: 88888n, shortName: "chiliz" },
|
|
563
622
|
{ chainId: 90001n, shortName: "dhobyghaut" },
|
|
623
|
+
{ chainId: 91342n, shortName: "giwasepolia" },
|
|
564
624
|
{ chainId: 97435n, shortName: "sling" },
|
|
565
625
|
{ chainId: 98864n, shortName: "plume-devnet" },
|
|
566
626
|
{ chainId: 98865n, shortName: "plume" },
|
|
627
|
+
{ chainId: 98866n, shortName: "plume-mainnet" },
|
|
567
628
|
{ chainId: 98867n, shortName: "plume-testnet" },
|
|
629
|
+
{ chainId: 98985n, shortName: "superposition-testnet" },
|
|
630
|
+
{ chainId: 102030n, shortName: "ctc" },
|
|
568
631
|
{ chainId: 103454n, shortName: "masatest" },
|
|
569
632
|
{ chainId: 105105n, shortName: "stratis" },
|
|
570
633
|
{ chainId: 111188n, shortName: "re-al" },
|
|
634
|
+
{ chainId: 127823n, shortName: "etls" },
|
|
571
635
|
{ chainId: 128123n, shortName: "etlt" },
|
|
572
636
|
{ chainId: 167000n, shortName: "tko-mainnet" },
|
|
573
637
|
{ chainId: 167008n, shortName: "tko-katla" },
|
|
574
638
|
{ chainId: 167009n, shortName: "tko-hekla" },
|
|
639
|
+
{ chainId: 167013n, shortName: "tko-hoodi" },
|
|
575
640
|
{ chainId: 175188n, shortName: "lpy" },
|
|
641
|
+
{ chainId: 181228n, shortName: "hpp-sepolia" },
|
|
642
|
+
{ chainId: 190415n, shortName: "hpp-mainnet" },
|
|
576
643
|
{ chainId: 200101n, shortName: "milktada" },
|
|
577
644
|
{ chainId: 200202n, shortName: "milktalgo" },
|
|
578
645
|
{ chainId: 200810n, shortName: "btrt" },
|
|
579
646
|
{ chainId: 200901n, shortName: "btr" },
|
|
580
647
|
{ chainId: 205205n, shortName: "auroria" },
|
|
581
648
|
{ chainId: 210425n, shortName: "platon" },
|
|
649
|
+
{ chainId: 222888n, shortName: "mocat" },
|
|
650
|
+
{ chainId: 278701n, shortName: "creator-chain-testnet" },
|
|
582
651
|
{ chainId: 314159n, shortName: "filecoin-calibration" },
|
|
583
652
|
{ chainId: 325000n, shortName: "CampV2" },
|
|
584
653
|
{ chainId: 328527n, shortName: "nal" },
|
|
585
654
|
{ chainId: 333999n, shortName: "olympus" },
|
|
655
|
+
{ chainId: 369369n, shortName: "den-mainnet" },
|
|
586
656
|
{ chainId: 381931n, shortName: "metal" },
|
|
587
657
|
{ chainId: 421611n, shortName: "arb-rinkeby" },
|
|
588
658
|
{ chainId: 421613n, shortName: "arb-goerli" },
|
|
589
659
|
{ chainId: 421614n, shortName: "arb-sep" },
|
|
590
660
|
{ chainId: 444444n, shortName: "syndr" },
|
|
591
661
|
{ chainId: 490000n, shortName: "ATN" },
|
|
662
|
+
{ chainId: 511111n, shortName: "alpha-testnet" },
|
|
592
663
|
{ chainId: 534351n, shortName: "scr-sepolia" },
|
|
593
664
|
{ chainId: 534352n, shortName: "scr" },
|
|
594
665
|
{ chainId: 534353n, shortName: "scr-alpha" },
|
|
@@ -601,37 +672,51 @@ var networks = [
|
|
|
601
672
|
{ chainId: 660279n, shortName: "xai" },
|
|
602
673
|
{ chainId: 668668n, shortName: "cnw" },
|
|
603
674
|
{ chainId: 688688n, shortName: "pharos-testnet" },
|
|
675
|
+
{ chainId: 688689n, shortName: "pharos-atlantic" },
|
|
604
676
|
{ chainId: 695569n, shortName: "pyrope" },
|
|
605
677
|
{ chainId: 713715n, shortName: "sei-devnet" },
|
|
606
678
|
{ chainId: 743111n, shortName: "hemi-sep" },
|
|
607
679
|
{ chainId: 747474n, shortName: "katana" },
|
|
608
680
|
{ chainId: 763373n, shortName: "inksepolia" },
|
|
681
|
+
{ chainId: 763375n, shortName: "surge-testnet" },
|
|
609
682
|
{ chainId: 764984n, shortName: "lamina1test" },
|
|
610
683
|
{ chainId: 808813n, shortName: "bob-sepolia" },
|
|
611
684
|
{ chainId: 810180n, shortName: "zklink-nova" },
|
|
612
685
|
{ chainId: 839999n, shortName: "txsat" },
|
|
686
|
+
{ chainId: 853211n, shortName: "haqq-testethiq" },
|
|
613
687
|
{ chainId: 978657n, shortName: "treasure-ruby" },
|
|
614
688
|
{ chainId: 984122n, shortName: "forma" },
|
|
689
|
+
{ chainId: 1000101n, shortName: "xo" },
|
|
690
|
+
{ chainId: 1440000n, shortName: "xrplevm" },
|
|
691
|
+
{ chainId: 1449000n, shortName: "xrplevmtestnet" },
|
|
615
692
|
{ chainId: 1501869n, shortName: "water9" },
|
|
616
693
|
{ chainId: 2206132n, shortName: "platondev2" },
|
|
617
694
|
{ chainId: 2632500n, shortName: "coti" },
|
|
618
695
|
{ chainId: 3441006n, shortName: "mantaSepoliaTestnet" },
|
|
619
696
|
{ chainId: 4457845n, shortName: "zero-sepolia" },
|
|
697
|
+
{ chainId: 5042002n, shortName: "arc-testnet" },
|
|
698
|
+
{ chainId: 5064014n, shortName: "ethereal" },
|
|
620
699
|
{ chainId: 6038361n, shortName: "azkyt" },
|
|
700
|
+
{ chainId: 6281971n, shortName: "dogeos-chykyu" },
|
|
701
|
+
{ chainId: 6985385n, shortName: "hp" },
|
|
621
702
|
{ chainId: 7225878n, shortName: "saakuru" },
|
|
622
703
|
{ chainId: 7777777n, shortName: "zora" },
|
|
623
704
|
{ chainId: 9999999n, shortName: "fluence" },
|
|
705
|
+
{ chainId: 11142220n, shortName: "celo-sep" },
|
|
624
706
|
{ chainId: 11155111n, shortName: "sep" },
|
|
625
707
|
{ chainId: 11155420n, shortName: "opsep" },
|
|
626
708
|
{ chainId: 11155931n, shortName: "rise-testnet" },
|
|
627
709
|
{ chainId: 12227332n, shortName: "neox-t4" },
|
|
710
|
+
{ chainId: 13374202n, shortName: "ethereal-testnet-0" },
|
|
711
|
+
{ chainId: 13863860n, shortName: "sis" },
|
|
712
|
+
{ chainId: 20250407n, shortName: "platondev3" },
|
|
628
713
|
{ chainId: 21000000n, shortName: "corn" },
|
|
629
714
|
{ chainId: 52164803n, shortName: "fluence-testnet" },
|
|
630
715
|
{ chainId: 65100004n, shortName: "piccadilly-04" },
|
|
631
716
|
{ chainId: 94204209n, shortName: "polygon-blackberry" },
|
|
632
717
|
{ chainId: 111557560n, shortName: "cysep" },
|
|
633
718
|
{ chainId: 123420111n, shortName: "opcelestia-raspberry" },
|
|
634
|
-
{ chainId: 161221135n, shortName: "plume-testnet" },
|
|
719
|
+
{ chainId: 161221135n, shortName: "plume-testnet-legacy" },
|
|
635
720
|
{ chainId: 168587773n, shortName: "blastsepolia" },
|
|
636
721
|
{ chainId: 222000222n, shortName: "kanazawa" },
|
|
637
722
|
{ chainId: 245022926n, shortName: "neonevm-devnet" },
|
|
@@ -641,6 +726,7 @@ var networks = [
|
|
|
641
726
|
{ chainId: 333000333n, shortName: "meld" },
|
|
642
727
|
{ chainId: 476462898n, shortName: "Skopje" },
|
|
643
728
|
{ chainId: 531050104n, shortName: "sophon-testnet" },
|
|
729
|
+
{ chainId: 531050204n, shortName: "sophon-os-testnet" },
|
|
644
730
|
{ chainId: 666666666n, shortName: "degen-chain" },
|
|
645
731
|
{ chainId: 888888888n, shortName: "ancient8" },
|
|
646
732
|
{ chainId: 994873017n, shortName: "lumia-mainnet" },
|
|
@@ -654,8 +740,11 @@ var networks = [
|
|
|
654
740
|
{ chainId: 1666600000n, shortName: "hmy-s0" },
|
|
655
741
|
{ chainId: 1666700000n, shortName: "hmy-b-s0" },
|
|
656
742
|
{ chainId: 1952959480n, shortName: "lumiatestnet" },
|
|
743
|
+
{ chainId: 2030232745n, shortName: "lumia-beam-testnet" },
|
|
744
|
+
{ chainId: 3735928814n, shortName: "edent" },
|
|
657
745
|
{ chainId: 11297108099n, shortName: "tpalm" },
|
|
658
746
|
{ chainId: 11297108109n, shortName: "palm" },
|
|
747
|
+
{ chainId: 30143370385n, shortName: "BUB" },
|
|
659
748
|
{ chainId: 37714555429n, shortName: "xaitestnet" },
|
|
660
749
|
{ chainId: 88153591557n, shortName: "arb-blueberry" },
|
|
661
750
|
{ chainId: 123420000220n, shortName: "fluence-stage" },
|
|
@@ -1004,7 +1093,8 @@ var SAFE_FEATURES_BY_VERSION = {
|
|
|
1004
1093
|
["REQUIRED_TXGAS" /* REQUIRED_TXGAS */]: "<=1.2.0",
|
|
1005
1094
|
["SIMULATE_AND_REVERT" /* SIMULATE_AND_REVERT */]: ">=1.3.0",
|
|
1006
1095
|
["PASSKEY_SIGNER" /* PASSKEY_SIGNER */]: ">=1.3.0",
|
|
1007
|
-
["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0"
|
|
1096
|
+
["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0",
|
|
1097
|
+
["SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */]: ">=1.5.0"
|
|
1008
1098
|
};
|
|
1009
1099
|
var hasSafeFeature = (feature, version) => {
|
|
1010
1100
|
if (!(feature in SAFE_FEATURES_BY_VERSION)) {
|
|
@@ -1469,6 +1559,58 @@ var CreateCallContract_v1_4_1 = class extends CreateCallBaseContract_default {
|
|
|
1469
1559
|
};
|
|
1470
1560
|
var CreateCallContract_v1_4_1_default = CreateCallContract_v1_4_1;
|
|
1471
1561
|
|
|
1562
|
+
// src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.ts
|
|
1563
|
+
import {
|
|
1564
|
+
createCall_1_5_0_ContractArtifacts
|
|
1565
|
+
} from "@safe-global/types-kit";
|
|
1566
|
+
var CreateCallContract_v1_5_0 = class extends CreateCallBaseContract_default {
|
|
1567
|
+
/**
|
|
1568
|
+
* Constructs an instance of CreateCallContract_v1_5_0
|
|
1569
|
+
*
|
|
1570
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1571
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1572
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CreateCall deployments based on the chainId and safeVersion.
|
|
1573
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1574
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1575
|
+
*/
|
|
1576
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1577
|
+
const safeVersion = "1.5.0";
|
|
1578
|
+
const defaultAbi = createCall_1_5_0_ContractArtifacts.abi;
|
|
1579
|
+
super(
|
|
1580
|
+
chainId,
|
|
1581
|
+
safeProvider,
|
|
1582
|
+
defaultAbi,
|
|
1583
|
+
safeVersion,
|
|
1584
|
+
customContractAddress,
|
|
1585
|
+
customContractAbi,
|
|
1586
|
+
deploymentType
|
|
1587
|
+
);
|
|
1588
|
+
/**
|
|
1589
|
+
* @param args - Array[value, deploymentData]
|
|
1590
|
+
* @param options - TransactionOptions
|
|
1591
|
+
* @returns Promise<TransactionResult>
|
|
1592
|
+
*/
|
|
1593
|
+
this.performCreate = async (args, options) => {
|
|
1594
|
+
if (options && !options.gasLimit) {
|
|
1595
|
+
options.gasLimit = (await this.estimateGas("performCreate", args, options)).toString();
|
|
1596
|
+
}
|
|
1597
|
+
return toTxResult(this.runner, await this.write("performCreate", args, options), options);
|
|
1598
|
+
};
|
|
1599
|
+
/**
|
|
1600
|
+
* @param args - Array[value, deploymentData, salt]
|
|
1601
|
+
* @param options - TransactionOptions
|
|
1602
|
+
* @returns Promise<TransactionResult>
|
|
1603
|
+
*/
|
|
1604
|
+
this.performCreate2 = async (args, options) => {
|
|
1605
|
+
if (options && !options.gasLimit) {
|
|
1606
|
+
options.gasLimit = (await this.estimateGas("performCreate2", [...args], { ...options })).toString();
|
|
1607
|
+
}
|
|
1608
|
+
return toTxResult(this.runner, await this.write("performCreate2", args, options), options);
|
|
1609
|
+
};
|
|
1610
|
+
}
|
|
1611
|
+
};
|
|
1612
|
+
var CreateCallContract_v1_5_0_default = CreateCallContract_v1_5_0;
|
|
1613
|
+
|
|
1472
1614
|
// src/contracts/MultiSend/MultiSendBaseContract.ts
|
|
1473
1615
|
var MultiSendBaseContract = class extends BaseContract_default {
|
|
1474
1616
|
/**
|
|
@@ -1590,6 +1732,36 @@ var MultiSendContract_v1_4_1 = class extends MultiSendBaseContract_default {
|
|
|
1590
1732
|
};
|
|
1591
1733
|
var MultiSendContract_v1_4_1_default = MultiSendContract_v1_4_1;
|
|
1592
1734
|
|
|
1735
|
+
// src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.ts
|
|
1736
|
+
import {
|
|
1737
|
+
multisend_1_5_0_ContractArtifacts
|
|
1738
|
+
} from "@safe-global/types-kit";
|
|
1739
|
+
var MultiSendContract_v1_5_0 = class extends MultiSendBaseContract_default {
|
|
1740
|
+
/**
|
|
1741
|
+
* Constructs an instance of MultiSendContract_v1_5_0
|
|
1742
|
+
*
|
|
1743
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1744
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1745
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the MultiSend deployments based on the chainId and safeVersion.
|
|
1746
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1747
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1748
|
+
*/
|
|
1749
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1750
|
+
const safeVersion = "1.5.0";
|
|
1751
|
+
const defaultAbi = multisend_1_5_0_ContractArtifacts.abi;
|
|
1752
|
+
super(
|
|
1753
|
+
chainId,
|
|
1754
|
+
safeProvider,
|
|
1755
|
+
defaultAbi,
|
|
1756
|
+
safeVersion,
|
|
1757
|
+
customContractAddress,
|
|
1758
|
+
customContractAbi,
|
|
1759
|
+
deploymentType
|
|
1760
|
+
);
|
|
1761
|
+
}
|
|
1762
|
+
};
|
|
1763
|
+
var MultiSendContract_v1_5_0_default = MultiSendContract_v1_5_0;
|
|
1764
|
+
|
|
1593
1765
|
// src/contracts/MultiSend/MultiSendCallOnlyBaseContract.ts
|
|
1594
1766
|
var MultiSendCallOnlyBaseContract = class extends BaseContract_default {
|
|
1595
1767
|
/**
|
|
@@ -1681,6 +1853,36 @@ var MultiSendCallOnlyContract_v1_4_1 = class extends MultiSendCallOnlyBaseContra
|
|
|
1681
1853
|
};
|
|
1682
1854
|
var MultiSendCallOnlyContract_v1_4_1_default = MultiSendCallOnlyContract_v1_4_1;
|
|
1683
1855
|
|
|
1856
|
+
// src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.ts
|
|
1857
|
+
import {
|
|
1858
|
+
multiSendCallOnly_1_5_0_ContractArtifacts
|
|
1859
|
+
} from "@safe-global/types-kit";
|
|
1860
|
+
var MultiSendCallOnlyContract_v1_5_0 = class extends MultiSendCallOnlyBaseContract_default {
|
|
1861
|
+
/**
|
|
1862
|
+
* Constructs an instance of MultiSendCallOnlyContract_v1_5_0
|
|
1863
|
+
*
|
|
1864
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1865
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1866
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the MultiSendCallOnly deployments based on the chainId and safeVersion.
|
|
1867
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1868
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1869
|
+
*/
|
|
1870
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1871
|
+
const safeVersion = "1.5.0";
|
|
1872
|
+
const defaultAbi = multiSendCallOnly_1_5_0_ContractArtifacts.abi;
|
|
1873
|
+
super(
|
|
1874
|
+
chainId,
|
|
1875
|
+
safeProvider,
|
|
1876
|
+
defaultAbi,
|
|
1877
|
+
safeVersion,
|
|
1878
|
+
customContractAddress,
|
|
1879
|
+
customContractAbi,
|
|
1880
|
+
deploymentType
|
|
1881
|
+
);
|
|
1882
|
+
}
|
|
1883
|
+
};
|
|
1884
|
+
var MultiSendCallOnlyContract_v1_5_0_default = MultiSendCallOnlyContract_v1_5_0;
|
|
1885
|
+
|
|
1684
1886
|
// src/contracts/SignMessageLib/SignMessageLibBaseContract.ts
|
|
1685
1887
|
var SignMessageLibBaseContract = class extends BaseContract_default {
|
|
1686
1888
|
/**
|
|
@@ -1802,6 +2004,51 @@ var SignMessageLibContract_v1_4_1 = class extends SignMessageLibBaseContract_def
|
|
|
1802
2004
|
};
|
|
1803
2005
|
var SignMessageLibContract_v1_4_1_default = SignMessageLibContract_v1_4_1;
|
|
1804
2006
|
|
|
2007
|
+
// src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.ts
|
|
2008
|
+
import {
|
|
2009
|
+
signMessageLib_1_5_0_ContractArtifacts
|
|
2010
|
+
} from "@safe-global/types-kit";
|
|
2011
|
+
var SignMessageLibContract_v1_5_0 = class extends SignMessageLibBaseContract_default {
|
|
2012
|
+
/**
|
|
2013
|
+
* Constructs an instance of SignMessageLibContract_v1_5_0
|
|
2014
|
+
*
|
|
2015
|
+
* @param chainId - The chain ID where the contract resides.
|
|
2016
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
2017
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the SignMessageLib deployments based on the chainId and safeVersion.
|
|
2018
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
2019
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
2020
|
+
*/
|
|
2021
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
2022
|
+
const safeVersion = "1.5.0";
|
|
2023
|
+
const defaultAbi = signMessageLib_1_5_0_ContractArtifacts.abi;
|
|
2024
|
+
super(
|
|
2025
|
+
chainId,
|
|
2026
|
+
safeProvider,
|
|
2027
|
+
defaultAbi,
|
|
2028
|
+
safeVersion,
|
|
2029
|
+
customContractAddress,
|
|
2030
|
+
customContractAbi,
|
|
2031
|
+
deploymentType
|
|
2032
|
+
);
|
|
2033
|
+
/**
|
|
2034
|
+
* @param args - Array[message]
|
|
2035
|
+
*/
|
|
2036
|
+
this.getMessageHash = async (args) => {
|
|
2037
|
+
return [await this.read("getMessageHash", args)];
|
|
2038
|
+
};
|
|
2039
|
+
/**
|
|
2040
|
+
* @param args - Array[data]
|
|
2041
|
+
*/
|
|
2042
|
+
this.signMessage = async (data, options) => {
|
|
2043
|
+
if (options && !options.gasLimit) {
|
|
2044
|
+
options.gasLimit = Number(await this.estimateGas("signMessage", data, { ...options }));
|
|
2045
|
+
}
|
|
2046
|
+
return toTxResult(this.runner, await this.write("signMessage", data, options), options);
|
|
2047
|
+
};
|
|
2048
|
+
}
|
|
2049
|
+
};
|
|
2050
|
+
var SignMessageLibContract_v1_5_0_default = SignMessageLibContract_v1_5_0;
|
|
2051
|
+
|
|
1805
2052
|
// src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.ts
|
|
1806
2053
|
import { simulateContract } from "viem/actions";
|
|
1807
2054
|
|
|
@@ -3007,7 +3254,7 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
3007
3254
|
return [await this.read("getOwners")];
|
|
3008
3255
|
};
|
|
3009
3256
|
/**
|
|
3010
|
-
* Reads `length` bytes of storage in the
|
|
3257
|
+
* Reads `length` bytes of storage in the current contract
|
|
3011
3258
|
* @param args - Array[offset, length]
|
|
3012
3259
|
* @returns Array[storage]
|
|
3013
3260
|
*/
|
|
@@ -3190,135 +3437,459 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
3190
3437
|
};
|
|
3191
3438
|
var SafeContract_v1_4_1_default = SafeContract_v1_4_1;
|
|
3192
3439
|
|
|
3193
|
-
// src/contracts/
|
|
3194
|
-
|
|
3195
|
-
/**
|
|
3196
|
-
* @constructor
|
|
3197
|
-
* Constructs an instance of SafeProxyFactoryBaseContract.
|
|
3198
|
-
*
|
|
3199
|
-
* @param chainId - The chain ID of the contract.
|
|
3200
|
-
* @param safeProvider - An instance of SafeProvider.
|
|
3201
|
-
* @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
|
|
3202
|
-
* @param safeVersion - The version of the Safe contract.
|
|
3203
|
-
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3204
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
3205
|
-
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3206
|
-
*/
|
|
3207
|
-
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3208
|
-
const contractName3 = "safeProxyFactoryVersion";
|
|
3209
|
-
super(
|
|
3210
|
-
contractName3,
|
|
3211
|
-
chainId,
|
|
3212
|
-
safeProvider,
|
|
3213
|
-
defaultAbi,
|
|
3214
|
-
safeVersion,
|
|
3215
|
-
customContractAddress,
|
|
3216
|
-
customContractAbi,
|
|
3217
|
-
deploymentType
|
|
3218
|
-
);
|
|
3219
|
-
this.contractName = contractName3;
|
|
3220
|
-
}
|
|
3221
|
-
};
|
|
3222
|
-
var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
|
|
3223
|
-
|
|
3224
|
-
// src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
|
|
3440
|
+
// src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.ts
|
|
3441
|
+
import { readContract, simulateContract as simulateContract6 } from "viem/actions";
|
|
3225
3442
|
import {
|
|
3226
|
-
|
|
3443
|
+
safe_1_5_0_ContractArtifacts
|
|
3227
3444
|
} from "@safe-global/types-kit";
|
|
3228
|
-
var
|
|
3445
|
+
var SafeContract_v1_5_0 = class extends SafeBaseContract_default {
|
|
3229
3446
|
/**
|
|
3230
|
-
* Constructs an instance of
|
|
3447
|
+
* Constructs an instance of SafeContract_v1_5_0
|
|
3231
3448
|
*
|
|
3232
3449
|
* @param chainId - The chain ID where the contract resides.
|
|
3233
3450
|
* @param safeProvider - An instance of SafeProvider.
|
|
3451
|
+
* @param isL1SafeSingleton - A flag indicating if the contract is a L1 Safe Singleton.
|
|
3234
3452
|
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3235
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.
|
|
3453
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
3236
3454
|
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3237
3455
|
*/
|
|
3238
|
-
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3239
|
-
const safeVersion = "1.
|
|
3240
|
-
const defaultAbi =
|
|
3456
|
+
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
3457
|
+
const safeVersion = "1.5.0";
|
|
3458
|
+
const defaultAbi = safe_1_5_0_ContractArtifacts.abi;
|
|
3241
3459
|
super(
|
|
3242
3460
|
chainId,
|
|
3243
3461
|
safeProvider,
|
|
3244
3462
|
defaultAbi,
|
|
3245
3463
|
safeVersion,
|
|
3464
|
+
isL1SafeSingleton,
|
|
3246
3465
|
customContractAddress,
|
|
3247
3466
|
customContractAbi,
|
|
3248
3467
|
deploymentType
|
|
3249
3468
|
);
|
|
3250
3469
|
/**
|
|
3251
|
-
*
|
|
3252
|
-
* @returns Array[creationCode]
|
|
3470
|
+
* @returns Array[safeContractVersion]
|
|
3253
3471
|
*/
|
|
3254
|
-
this.
|
|
3255
|
-
return [await this.read("
|
|
3472
|
+
this.VERSION = async () => {
|
|
3473
|
+
return [await this.read("VERSION")];
|
|
3256
3474
|
};
|
|
3257
3475
|
/**
|
|
3258
|
-
*
|
|
3259
|
-
* @returns Array[
|
|
3476
|
+
* @param args - Array[owner, txHash]
|
|
3477
|
+
* @returns Array[approvedHashes]
|
|
3260
3478
|
*/
|
|
3261
|
-
this.
|
|
3262
|
-
return [await this.read("
|
|
3479
|
+
this.approvedHashes = async (args) => {
|
|
3480
|
+
return [await this.read("approvedHashes", args)];
|
|
3263
3481
|
};
|
|
3264
3482
|
/**
|
|
3265
|
-
*
|
|
3266
|
-
*
|
|
3267
|
-
* @
|
|
3483
|
+
* Checks whether the signature provided is valid for the provided data, hash and number of required signatures.
|
|
3484
|
+
* Will revert otherwise.
|
|
3485
|
+
* @param args - Array[dataHash, data, signatures, requiredSignatures]
|
|
3486
|
+
* @returns Empty array
|
|
3268
3487
|
*/
|
|
3269
|
-
this.
|
|
3270
|
-
|
|
3488
|
+
this.checkNSignatures = async (args) => {
|
|
3489
|
+
await this.read("checkNSignatures", args);
|
|
3490
|
+
return [];
|
|
3271
3491
|
};
|
|
3272
3492
|
/**
|
|
3273
|
-
*
|
|
3274
|
-
*
|
|
3275
|
-
*
|
|
3493
|
+
* New in v1.5.0: overload of checkNSignatures that accepts an explicit executor address.
|
|
3494
|
+
* Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
|
|
3495
|
+
* Will revert otherwise.
|
|
3496
|
+
* @param args - Array[executor, dataHash, signatures, requiredSignatures]
|
|
3497
|
+
* @returns Empty array
|
|
3276
3498
|
*/
|
|
3277
|
-
this.
|
|
3278
|
-
|
|
3499
|
+
this.checkNSignaturesWithExecutor = async (args) => {
|
|
3500
|
+
await readContract(this.runner, {
|
|
3501
|
+
address: this.contractAddress,
|
|
3502
|
+
functionName: "checkNSignatures",
|
|
3503
|
+
abi: [
|
|
3504
|
+
{
|
|
3505
|
+
inputs: [
|
|
3506
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
3507
|
+
{ internalType: "bytes32", name: "dataHash", type: "bytes32" },
|
|
3508
|
+
{ internalType: "bytes", name: "signatures", type: "bytes" },
|
|
3509
|
+
{ internalType: "uint256", name: "requiredSignatures", type: "uint256" }
|
|
3510
|
+
],
|
|
3511
|
+
name: "checkNSignatures",
|
|
3512
|
+
outputs: [],
|
|
3513
|
+
stateMutability: "view",
|
|
3514
|
+
type: "function"
|
|
3515
|
+
}
|
|
3516
|
+
],
|
|
3517
|
+
args
|
|
3518
|
+
});
|
|
3519
|
+
return [];
|
|
3279
3520
|
};
|
|
3280
|
-
}
|
|
3281
|
-
};
|
|
3282
|
-
var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
|
|
3283
|
-
|
|
3284
|
-
// src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
|
|
3285
|
-
import {
|
|
3286
|
-
safeProxyFactory_1_1_1_ContractArtifacts
|
|
3287
|
-
} from "@safe-global/types-kit";
|
|
3288
|
-
var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
|
|
3289
|
-
/**
|
|
3290
|
-
* Constructs an instance of SafeProxyFactoryContract_v1_1_1
|
|
3291
|
-
*
|
|
3292
|
-
* @param chainId - The chain ID where the contract resides.
|
|
3293
|
-
* @param safeProvider - An instance of SafeProvider.
|
|
3294
|
-
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3295
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
|
|
3296
|
-
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3297
|
-
*/
|
|
3298
|
-
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3299
|
-
const safeVersion = "1.1.1";
|
|
3300
|
-
const defaultAbi = safeProxyFactory_1_1_1_ContractArtifacts.abi;
|
|
3301
|
-
super(
|
|
3302
|
-
chainId,
|
|
3303
|
-
safeProvider,
|
|
3304
|
-
defaultAbi,
|
|
3305
|
-
safeVersion,
|
|
3306
|
-
customContractAddress,
|
|
3307
|
-
customContractAbi,
|
|
3308
|
-
deploymentType
|
|
3309
|
-
);
|
|
3310
3521
|
/**
|
|
3311
|
-
*
|
|
3312
|
-
* @
|
|
3522
|
+
* Checks whether the signature provided is valid for the provided data and hash. Will revert otherwise.
|
|
3523
|
+
* @param args - Array[dataHash, data, signatures]
|
|
3524
|
+
* @returns Empty array
|
|
3313
3525
|
*/
|
|
3314
|
-
this.
|
|
3315
|
-
|
|
3526
|
+
this.checkSignatures = async (args) => {
|
|
3527
|
+
await this.read("checkSignatures", args);
|
|
3528
|
+
return [];
|
|
3316
3529
|
};
|
|
3317
3530
|
/**
|
|
3318
|
-
*
|
|
3319
|
-
*
|
|
3531
|
+
* New in v1.5.0: overload of checkSignatures that accepts an explicit executor address.
|
|
3532
|
+
* Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
|
|
3533
|
+
* Will revert otherwise.
|
|
3534
|
+
* @param args - Array[executor, dataHash, signatures]
|
|
3535
|
+
* @returns Empty array
|
|
3320
3536
|
*/
|
|
3321
|
-
this.
|
|
3537
|
+
this.checkSignaturesWithExecutor = async (args) => {
|
|
3538
|
+
await readContract(this.runner, {
|
|
3539
|
+
address: this.contractAddress,
|
|
3540
|
+
functionName: "checkSignatures",
|
|
3541
|
+
abi: [
|
|
3542
|
+
{
|
|
3543
|
+
inputs: [
|
|
3544
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
3545
|
+
{ internalType: "bytes32", name: "dataHash", type: "bytes32" },
|
|
3546
|
+
{ internalType: "bytes", name: "signatures", type: "bytes" }
|
|
3547
|
+
],
|
|
3548
|
+
name: "checkSignatures",
|
|
3549
|
+
outputs: [],
|
|
3550
|
+
stateMutability: "view",
|
|
3551
|
+
type: "function"
|
|
3552
|
+
}
|
|
3553
|
+
],
|
|
3554
|
+
args
|
|
3555
|
+
});
|
|
3556
|
+
return [];
|
|
3557
|
+
};
|
|
3558
|
+
/**
|
|
3559
|
+
* @returns Array[domainSeparator]
|
|
3560
|
+
*/
|
|
3561
|
+
this.domainSeparator = async () => {
|
|
3562
|
+
return [await this.read("domainSeparator")];
|
|
3563
|
+
};
|
|
3564
|
+
/**
|
|
3565
|
+
* Returns array of modules.
|
|
3566
|
+
* @param args - Array[start, pageSize]
|
|
3567
|
+
* @returns Array[Array[modules], next]
|
|
3568
|
+
*/
|
|
3569
|
+
this.getModulesPaginated = async (args) => {
|
|
3570
|
+
const [array, next] = await this.read("getModulesPaginated", args);
|
|
3571
|
+
return [array, next];
|
|
3572
|
+
};
|
|
3573
|
+
/**
|
|
3574
|
+
* Returns the list of Safe owner accounts.
|
|
3575
|
+
* @returns Array[Array[owners]]
|
|
3576
|
+
*/
|
|
3577
|
+
this.getOwners = async () => {
|
|
3578
|
+
return [await this.read("getOwners")];
|
|
3579
|
+
};
|
|
3580
|
+
/**
|
|
3581
|
+
* Reads `length` bytes of storage in the current contract
|
|
3582
|
+
* @param args - Array[offset, length]
|
|
3583
|
+
* @returns Array[storage]
|
|
3584
|
+
*/
|
|
3585
|
+
this.getStorageAt = async (args) => {
|
|
3586
|
+
return [await this.read("getStorageAt", args)];
|
|
3587
|
+
};
|
|
3588
|
+
/**
|
|
3589
|
+
* Returns the Safe threshold.
|
|
3590
|
+
* @returns Array[threshold]
|
|
3591
|
+
*/
|
|
3592
|
+
this.getThreshold = async () => {
|
|
3593
|
+
return [await this.read("getThreshold")];
|
|
3594
|
+
};
|
|
3595
|
+
/**
|
|
3596
|
+
* Returns hash to be signed by owners.
|
|
3597
|
+
* @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce]
|
|
3598
|
+
* @returns Array[transactionHash]
|
|
3599
|
+
*/
|
|
3600
|
+
this.getTransactionHash = async (args) => {
|
|
3601
|
+
return [await this.read("getTransactionHash", args)];
|
|
3602
|
+
};
|
|
3603
|
+
/**
|
|
3604
|
+
* Checks if a specific Safe module is enabled for the current Safe.
|
|
3605
|
+
* @param args - Array[moduleAddress]
|
|
3606
|
+
* @returns Array[isEnabled]
|
|
3607
|
+
*/
|
|
3608
|
+
this.isModuleEnabled = async (args) => {
|
|
3609
|
+
return [await this.read("isModuleEnabled", args)];
|
|
3610
|
+
};
|
|
3611
|
+
/**
|
|
3612
|
+
* Checks if a specific address is an owner of the current Safe.
|
|
3613
|
+
* @param args - Array[address]
|
|
3614
|
+
* @returns Array[isOwner]
|
|
3615
|
+
*/
|
|
3616
|
+
this.isOwner = async (args) => {
|
|
3617
|
+
return [await this.read("isOwner", args)];
|
|
3618
|
+
};
|
|
3619
|
+
/**
|
|
3620
|
+
* Returns the Safe nonce.
|
|
3621
|
+
* @returns Array[nonce]
|
|
3622
|
+
*/
|
|
3623
|
+
this.nonce = async () => {
|
|
3624
|
+
return [await this.read("nonce")];
|
|
3625
|
+
};
|
|
3626
|
+
/**
|
|
3627
|
+
* @param args - Array[messageHash]
|
|
3628
|
+
* @returns Array[signedMessages]
|
|
3629
|
+
*/
|
|
3630
|
+
this.signedMessages = async (args) => {
|
|
3631
|
+
return [await this.read("signedMessages", args)];
|
|
3632
|
+
};
|
|
3633
|
+
}
|
|
3634
|
+
/**
|
|
3635
|
+
* Checks whether a given Safe transaction can be executed successfully with no errors.
|
|
3636
|
+
* @param safeTransaction - The Safe transaction to check.
|
|
3637
|
+
* @param options - Optional transaction options.
|
|
3638
|
+
* @returns True, if the given transactions is valid.
|
|
3639
|
+
*/
|
|
3640
|
+
async isValidTransaction(safeTransaction, options = {}) {
|
|
3641
|
+
try {
|
|
3642
|
+
const gasLimit = options?.gasLimit || await this.estimateGas(
|
|
3643
|
+
"execTransaction",
|
|
3644
|
+
[
|
|
3645
|
+
safeTransaction.data.to,
|
|
3646
|
+
BigInt(safeTransaction.data.value),
|
|
3647
|
+
asHex(safeTransaction.data.data),
|
|
3648
|
+
safeTransaction.data.operation,
|
|
3649
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3650
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3651
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3652
|
+
safeTransaction.data.gasToken,
|
|
3653
|
+
safeTransaction.data.refundReceiver,
|
|
3654
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3655
|
+
],
|
|
3656
|
+
options
|
|
3657
|
+
);
|
|
3658
|
+
const converted = this.convertOptions({ ...options, gasLimit });
|
|
3659
|
+
const txResult = await simulateContract6(this.runner, {
|
|
3660
|
+
address: this.contractAddress,
|
|
3661
|
+
functionName: "execTransaction",
|
|
3662
|
+
abi: this.contractAbi,
|
|
3663
|
+
args: [
|
|
3664
|
+
safeTransaction.data.to,
|
|
3665
|
+
BigInt(safeTransaction.data.value),
|
|
3666
|
+
asHex(safeTransaction.data.data),
|
|
3667
|
+
safeTransaction.data.operation,
|
|
3668
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3669
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3670
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3671
|
+
safeTransaction.data.gasToken,
|
|
3672
|
+
safeTransaction.data.refundReceiver,
|
|
3673
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3674
|
+
],
|
|
3675
|
+
...converted
|
|
3676
|
+
});
|
|
3677
|
+
return txResult.result;
|
|
3678
|
+
} catch (error) {
|
|
3679
|
+
return false;
|
|
3680
|
+
}
|
|
3681
|
+
}
|
|
3682
|
+
/**
|
|
3683
|
+
* Executes a transaction.
|
|
3684
|
+
* @param safeTransaction - The Safe transaction to execute.
|
|
3685
|
+
* @param options - Transaction options.
|
|
3686
|
+
* @returns Transaction result.
|
|
3687
|
+
*/
|
|
3688
|
+
async execTransaction(safeTransaction, options) {
|
|
3689
|
+
const gasLimit = options?.gasLimit || await this.estimateGas(
|
|
3690
|
+
"execTransaction",
|
|
3691
|
+
[
|
|
3692
|
+
safeTransaction.data.to,
|
|
3693
|
+
BigInt(safeTransaction.data.value),
|
|
3694
|
+
asHex(safeTransaction.data.data),
|
|
3695
|
+
safeTransaction.data.operation,
|
|
3696
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3697
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3698
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3699
|
+
safeTransaction.data.gasToken,
|
|
3700
|
+
safeTransaction.data.refundReceiver,
|
|
3701
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3702
|
+
],
|
|
3703
|
+
options
|
|
3704
|
+
);
|
|
3705
|
+
const args = [
|
|
3706
|
+
safeTransaction.data.to,
|
|
3707
|
+
BigInt(safeTransaction.data.value),
|
|
3708
|
+
asHex(safeTransaction.data.data),
|
|
3709
|
+
safeTransaction.data.operation,
|
|
3710
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3711
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3712
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3713
|
+
safeTransaction.data.gasToken,
|
|
3714
|
+
safeTransaction.data.refundReceiver,
|
|
3715
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3716
|
+
];
|
|
3717
|
+
return toTxResult(
|
|
3718
|
+
this.runner,
|
|
3719
|
+
await this.write("execTransaction", args, { ...options, gasLimit }),
|
|
3720
|
+
options
|
|
3721
|
+
);
|
|
3722
|
+
}
|
|
3723
|
+
/**
|
|
3724
|
+
* Returns array of first 10 modules.
|
|
3725
|
+
* @returns Array[modules]
|
|
3726
|
+
*/
|
|
3727
|
+
async getModules() {
|
|
3728
|
+
const [modules] = await this.getModulesPaginated([SENTINEL_ADDRESS, BigInt(10)]);
|
|
3729
|
+
return [modules.map((module) => module)];
|
|
3730
|
+
}
|
|
3731
|
+
/**
|
|
3732
|
+
* Marks a hash as approved. This can be used to validate a hash that is used by a signature.
|
|
3733
|
+
* @param hash - The hash that should be marked as approved for signatures that are verified by this contract.
|
|
3734
|
+
* @param options - Optional transaction options.
|
|
3735
|
+
* @returns Transaction result.
|
|
3736
|
+
*/
|
|
3737
|
+
async approveHash(hash, options) {
|
|
3738
|
+
const gasLimit = options?.gasLimit || await this.estimateGas("approveHash", [asHash(hash)], options);
|
|
3739
|
+
return toTxResult(
|
|
3740
|
+
this.runner,
|
|
3741
|
+
await this.write("approveHash", [asHash(hash)], { ...options, gasLimit }),
|
|
3742
|
+
options
|
|
3743
|
+
);
|
|
3744
|
+
}
|
|
3745
|
+
/**
|
|
3746
|
+
* Returns the chain id of the Safe contract. (Custom method - not defined in the Safe Contract)
|
|
3747
|
+
* @returns Array[chainId]
|
|
3748
|
+
*/
|
|
3749
|
+
async getChainId() {
|
|
3750
|
+
return [await Promise.resolve(this.chainId)];
|
|
3751
|
+
}
|
|
3752
|
+
/**
|
|
3753
|
+
* returns the nonce of the Safe contract.
|
|
3754
|
+
*
|
|
3755
|
+
* @returns {Promise<bigint>} A promise that resolves to the nonce of the Safe contract.
|
|
3756
|
+
*/
|
|
3757
|
+
async getNonce() {
|
|
3758
|
+
const [nonce] = await this.nonce();
|
|
3759
|
+
return nonce;
|
|
3760
|
+
}
|
|
3761
|
+
};
|
|
3762
|
+
var SafeContract_v1_5_0_default = SafeContract_v1_5_0;
|
|
3763
|
+
|
|
3764
|
+
// src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts
|
|
3765
|
+
var SafeProxyFactoryBaseContract = class extends BaseContract_default {
|
|
3766
|
+
/**
|
|
3767
|
+
* @constructor
|
|
3768
|
+
* Constructs an instance of SafeProxyFactoryBaseContract.
|
|
3769
|
+
*
|
|
3770
|
+
* @param chainId - The chain ID of the contract.
|
|
3771
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3772
|
+
* @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
|
|
3773
|
+
* @param safeVersion - The version of the Safe contract.
|
|
3774
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3775
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
3776
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3777
|
+
*/
|
|
3778
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3779
|
+
const contractName3 = "safeProxyFactoryVersion";
|
|
3780
|
+
super(
|
|
3781
|
+
contractName3,
|
|
3782
|
+
chainId,
|
|
3783
|
+
safeProvider,
|
|
3784
|
+
defaultAbi,
|
|
3785
|
+
safeVersion,
|
|
3786
|
+
customContractAddress,
|
|
3787
|
+
customContractAbi,
|
|
3788
|
+
deploymentType
|
|
3789
|
+
);
|
|
3790
|
+
this.contractName = contractName3;
|
|
3791
|
+
}
|
|
3792
|
+
};
|
|
3793
|
+
var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
|
|
3794
|
+
|
|
3795
|
+
// src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
|
|
3796
|
+
import {
|
|
3797
|
+
safeProxyFactory_1_0_0_ContractArtifacts
|
|
3798
|
+
} from "@safe-global/types-kit";
|
|
3799
|
+
var SafeProxyFactoryContract_v1_0_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
3800
|
+
/**
|
|
3801
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_0_0
|
|
3802
|
+
*
|
|
3803
|
+
* @param chainId - The chain ID where the contract resides.
|
|
3804
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3805
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3806
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
|
|
3807
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3808
|
+
*/
|
|
3809
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3810
|
+
const safeVersion = "1.0.0";
|
|
3811
|
+
const defaultAbi = safeProxyFactory_1_0_0_ContractArtifacts.abi;
|
|
3812
|
+
super(
|
|
3813
|
+
chainId,
|
|
3814
|
+
safeProvider,
|
|
3815
|
+
defaultAbi,
|
|
3816
|
+
safeVersion,
|
|
3817
|
+
customContractAddress,
|
|
3818
|
+
customContractAbi,
|
|
3819
|
+
deploymentType
|
|
3820
|
+
);
|
|
3821
|
+
/**
|
|
3822
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
3823
|
+
* @returns Array[creationCode]
|
|
3824
|
+
*/
|
|
3825
|
+
this.proxyCreationCode = async () => {
|
|
3826
|
+
return [await this.read("proxyCreationCode")];
|
|
3827
|
+
};
|
|
3828
|
+
/**
|
|
3829
|
+
* Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
|
|
3830
|
+
* @returns Array[runtimeCode]
|
|
3831
|
+
*/
|
|
3832
|
+
this.proxyRuntimeCode = async () => {
|
|
3833
|
+
return [await this.read("proxyRuntimeCode")];
|
|
3834
|
+
};
|
|
3835
|
+
/**
|
|
3836
|
+
* Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
|
|
3837
|
+
* @param args - Array[masterCopy, data]
|
|
3838
|
+
* @returns Array[proxyAddress]
|
|
3839
|
+
*/
|
|
3840
|
+
this.createProxy = async (args) => {
|
|
3841
|
+
return [await this.write("createProxy", args)];
|
|
3842
|
+
};
|
|
3843
|
+
/**
|
|
3844
|
+
* Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
|
|
3845
|
+
* @param args - Array[masterCopy, initializer, saltNonce]
|
|
3846
|
+
* @returns Array[proxyAddress]
|
|
3847
|
+
*/
|
|
3848
|
+
this.createProxyWithNonce = async (args) => {
|
|
3849
|
+
return [await this.write("createProxyWithNonce", args)];
|
|
3850
|
+
};
|
|
3851
|
+
}
|
|
3852
|
+
};
|
|
3853
|
+
var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
|
|
3854
|
+
|
|
3855
|
+
// src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
|
|
3856
|
+
import {
|
|
3857
|
+
safeProxyFactory_1_1_1_ContractArtifacts
|
|
3858
|
+
} from "@safe-global/types-kit";
|
|
3859
|
+
var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
|
|
3860
|
+
/**
|
|
3861
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_1_1
|
|
3862
|
+
*
|
|
3863
|
+
* @param chainId - The chain ID where the contract resides.
|
|
3864
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3865
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3866
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
|
|
3867
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3868
|
+
*/
|
|
3869
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3870
|
+
const safeVersion = "1.1.1";
|
|
3871
|
+
const defaultAbi = safeProxyFactory_1_1_1_ContractArtifacts.abi;
|
|
3872
|
+
super(
|
|
3873
|
+
chainId,
|
|
3874
|
+
safeProvider,
|
|
3875
|
+
defaultAbi,
|
|
3876
|
+
safeVersion,
|
|
3877
|
+
customContractAddress,
|
|
3878
|
+
customContractAbi,
|
|
3879
|
+
deploymentType
|
|
3880
|
+
);
|
|
3881
|
+
/**
|
|
3882
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
3883
|
+
* @returns Array[creationCode]
|
|
3884
|
+
*/
|
|
3885
|
+
this.proxyCreationCode = async () => {
|
|
3886
|
+
return [await this.read("proxyCreationCode")];
|
|
3887
|
+
};
|
|
3888
|
+
/**
|
|
3889
|
+
* Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
|
|
3890
|
+
* @returns Array[runtimeCode]
|
|
3891
|
+
*/
|
|
3892
|
+
this.proxyRuntimeCode = async () => {
|
|
3322
3893
|
return [await this.read("proxyRuntimeCode")];
|
|
3323
3894
|
};
|
|
3324
3895
|
/**
|
|
@@ -3502,6 +4073,82 @@ var SafeProxyFactoryContract_v1_4_1 = class extends SafeProxyFactoryBaseContract
|
|
|
3502
4073
|
};
|
|
3503
4074
|
var SafeProxyFactoryContract_v1_4_1_default = SafeProxyFactoryContract_v1_4_1;
|
|
3504
4075
|
|
|
4076
|
+
// src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.ts
|
|
4077
|
+
import {
|
|
4078
|
+
safeProxyFactory_1_5_0_ContractArtifacts
|
|
4079
|
+
} from "@safe-global/types-kit";
|
|
4080
|
+
var SafeProxyFactoryContract_v1_5_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
4081
|
+
/**
|
|
4082
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_5_0
|
|
4083
|
+
*
|
|
4084
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4085
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4086
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
4087
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4088
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4089
|
+
*/
|
|
4090
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4091
|
+
const safeVersion = "1.5.0";
|
|
4092
|
+
const defaultAbi = safeProxyFactory_1_5_0_ContractArtifacts.abi;
|
|
4093
|
+
super(
|
|
4094
|
+
chainId,
|
|
4095
|
+
safeProvider,
|
|
4096
|
+
defaultAbi,
|
|
4097
|
+
safeVersion,
|
|
4098
|
+
customContractAddress,
|
|
4099
|
+
customContractAbi,
|
|
4100
|
+
deploymentType
|
|
4101
|
+
);
|
|
4102
|
+
/**
|
|
4103
|
+
* Returns the ID of the chain the contract is currently deployed on.
|
|
4104
|
+
* @returns Array[chainId]
|
|
4105
|
+
*/
|
|
4106
|
+
this.getChainId = async () => {
|
|
4107
|
+
return [await this.read("getChainId")];
|
|
4108
|
+
};
|
|
4109
|
+
/**
|
|
4110
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
4111
|
+
* @returns Array[creationCode]
|
|
4112
|
+
*/
|
|
4113
|
+
this.proxyCreationCode = async () => {
|
|
4114
|
+
return [await this.read("proxyCreationCode")];
|
|
4115
|
+
};
|
|
4116
|
+
/**
|
|
4117
|
+
* Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4118
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4119
|
+
* @returns Array[proxy]
|
|
4120
|
+
*/
|
|
4121
|
+
this.createChainSpecificProxyWithNonce = async (args) => {
|
|
4122
|
+
return [await this.write("createChainSpecificProxyWithNonce", args)];
|
|
4123
|
+
};
|
|
4124
|
+
/**
|
|
4125
|
+
* Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4126
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4127
|
+
* @returns Array[proxy]
|
|
4128
|
+
*/
|
|
4129
|
+
this.createChainSpecificProxyWithNonceL2 = async (args) => {
|
|
4130
|
+
return [await this.write("createChainSpecificProxyWithNonceL2", args)];
|
|
4131
|
+
};
|
|
4132
|
+
/**
|
|
4133
|
+
* Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4134
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4135
|
+
* @returns Array[proxy]
|
|
4136
|
+
*/
|
|
4137
|
+
this.createProxyWithNonce = async (args) => {
|
|
4138
|
+
return [await this.write("createProxyWithNonce", args)];
|
|
4139
|
+
};
|
|
4140
|
+
/**
|
|
4141
|
+
* Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4142
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4143
|
+
* @returns Array[proxy]
|
|
4144
|
+
*/
|
|
4145
|
+
this.createProxyWithNonceL2 = async (args) => {
|
|
4146
|
+
return [await this.write("createProxyWithNonceL2", args)];
|
|
4147
|
+
};
|
|
4148
|
+
}
|
|
4149
|
+
};
|
|
4150
|
+
var SafeProxyFactoryContract_v1_5_0_default = SafeProxyFactoryContract_v1_5_0;
|
|
4151
|
+
|
|
3505
4152
|
// src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.ts
|
|
3506
4153
|
var SimulateTxAccessorBaseContract = class extends BaseContract_default {
|
|
3507
4154
|
/**
|
|
@@ -3609,6 +4256,44 @@ var SimulateTxAccessorContract_v1_4_1 = class extends SimulateTxAccessorBaseCont
|
|
|
3609
4256
|
};
|
|
3610
4257
|
var SimulateTxAccessorContract_v1_4_1_default = SimulateTxAccessorContract_v1_4_1;
|
|
3611
4258
|
|
|
4259
|
+
// src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.ts
|
|
4260
|
+
import {
|
|
4261
|
+
simulateTxAccessor_1_5_0_ContractArtifacts
|
|
4262
|
+
} from "@safe-global/types-kit";
|
|
4263
|
+
var SimulateTxAccessorContract_v1_5_0 = class extends SimulateTxAccessorBaseContract_default {
|
|
4264
|
+
/**
|
|
4265
|
+
* Constructs an instance of SimulateTxAccessorContract_v1_5_0
|
|
4266
|
+
*
|
|
4267
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4268
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4269
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the SimulateTxAccessor deployments based on the chainId and safeVersion.
|
|
4270
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4271
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4272
|
+
*/
|
|
4273
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4274
|
+
const safeVersion = "1.5.0";
|
|
4275
|
+
const defaultAbi = simulateTxAccessor_1_5_0_ContractArtifacts.abi;
|
|
4276
|
+
super(
|
|
4277
|
+
chainId,
|
|
4278
|
+
safeProvider,
|
|
4279
|
+
defaultAbi,
|
|
4280
|
+
safeVersion,
|
|
4281
|
+
customContractAddress,
|
|
4282
|
+
customContractAbi,
|
|
4283
|
+
deploymentType
|
|
4284
|
+
);
|
|
4285
|
+
/**
|
|
4286
|
+
* @param args - Array[to, value, data, operation]
|
|
4287
|
+
* @returns Array[estimate, success, returnData]
|
|
4288
|
+
*/
|
|
4289
|
+
this.simulate = async (args) => {
|
|
4290
|
+
const [estimate, success, returnData] = await this.write("simulate", args);
|
|
4291
|
+
return [BigInt(estimate), !!success, asHex(returnData)];
|
|
4292
|
+
};
|
|
4293
|
+
}
|
|
4294
|
+
};
|
|
4295
|
+
var SimulateTxAccessorContract_v1_5_0_default = SimulateTxAccessorContract_v1_5_0;
|
|
4296
|
+
|
|
3612
4297
|
// src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.ts
|
|
3613
4298
|
var CompatibilityFallbackHandlerBaseContract = class extends BaseContract_default {
|
|
3614
4299
|
/**
|
|
@@ -3698,7 +4383,228 @@ var CompatibilityFallbackHandlerContract_v1_4_1 = class extends CompatibilityFal
|
|
|
3698
4383
|
);
|
|
3699
4384
|
}
|
|
3700
4385
|
};
|
|
3701
|
-
var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
|
|
4386
|
+
var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
|
|
4387
|
+
|
|
4388
|
+
// src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.ts
|
|
4389
|
+
import {
|
|
4390
|
+
compatibilityFallbackHandler_1_5_0_ContractArtifacts
|
|
4391
|
+
} from "@safe-global/types-kit";
|
|
4392
|
+
var CompatibilityFallbackHandlerContract_v1_5_0 = class extends CompatibilityFallbackHandlerBaseContract_default {
|
|
4393
|
+
/**
|
|
4394
|
+
* Constructs an instance of CompatibilityFallbackHandlerContract_v1_5_0
|
|
4395
|
+
*
|
|
4396
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4397
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4398
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CompatibilityFallbackHandler deployments based on the chainId and safeVersion.
|
|
4399
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4400
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4401
|
+
*/
|
|
4402
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4403
|
+
const safeVersion = "1.5.0";
|
|
4404
|
+
const defaultAbi = compatibilityFallbackHandler_1_5_0_ContractArtifacts.abi;
|
|
4405
|
+
super(
|
|
4406
|
+
chainId,
|
|
4407
|
+
safeProvider,
|
|
4408
|
+
defaultAbi,
|
|
4409
|
+
safeVersion,
|
|
4410
|
+
customContractAddress,
|
|
4411
|
+
customContractAbi,
|
|
4412
|
+
deploymentType
|
|
4413
|
+
);
|
|
4414
|
+
/**
|
|
4415
|
+
* New in v1.5.0: encodeTransactionData was moved from the Safe contract to CompatibilityFallbackHandler
|
|
4416
|
+
* to preserve backwards compatibility for existing integrations.
|
|
4417
|
+
* @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, nonce]
|
|
4418
|
+
* @returns Array[encodedData]
|
|
4419
|
+
*/
|
|
4420
|
+
this.encodeTransactionData = async (args) => {
|
|
4421
|
+
return [await this.read("encodeTransactionData", args)];
|
|
4422
|
+
};
|
|
4423
|
+
}
|
|
4424
|
+
};
|
|
4425
|
+
var CompatibilityFallbackHandlerContract_v1_5_0_default = CompatibilityFallbackHandlerContract_v1_5_0;
|
|
4426
|
+
|
|
4427
|
+
// src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.ts
|
|
4428
|
+
var ExtensibleFallbackHandlerBaseContract = class extends BaseContract_default {
|
|
4429
|
+
/**
|
|
4430
|
+
* @constructor
|
|
4431
|
+
* Constructs an instance of ExtensibleFallbackHandlerBaseContract.
|
|
4432
|
+
*
|
|
4433
|
+
* @param chainId - The chain ID of the contract.
|
|
4434
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4435
|
+
* @param defaultAbi - The default ABI for the ExtensibleFallbackHandler contract. It should be compatible with the specific version of the contract.
|
|
4436
|
+
* @param safeVersion - The version of the Safe contract.
|
|
4437
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
4438
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
4439
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4440
|
+
*/
|
|
4441
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
4442
|
+
const contractName3 = "extensibleFallbackHandler";
|
|
4443
|
+
super(
|
|
4444
|
+
contractName3,
|
|
4445
|
+
chainId,
|
|
4446
|
+
safeProvider,
|
|
4447
|
+
defaultAbi,
|
|
4448
|
+
safeVersion,
|
|
4449
|
+
customContractAddress,
|
|
4450
|
+
customContractAbi,
|
|
4451
|
+
deploymentType
|
|
4452
|
+
);
|
|
4453
|
+
this.contractName = contractName3;
|
|
4454
|
+
}
|
|
4455
|
+
};
|
|
4456
|
+
var ExtensibleFallbackHandlerBaseContract_default = ExtensibleFallbackHandlerBaseContract;
|
|
4457
|
+
|
|
4458
|
+
// src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.ts
|
|
4459
|
+
import {
|
|
4460
|
+
extensibleFallbackHandler_1_5_0_ContractArtifacts
|
|
4461
|
+
} from "@safe-global/types-kit";
|
|
4462
|
+
var ExtensibleFallbackHandlerContract_v1_5_0 = class extends ExtensibleFallbackHandlerBaseContract_default {
|
|
4463
|
+
/**
|
|
4464
|
+
* Constructs an instance of ExtensibleFallbackHandlerContract_v1_5_0
|
|
4465
|
+
*
|
|
4466
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4467
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4468
|
+
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the ExtensibleFallbackHandler deployments based on the chainId and safeVersion.
|
|
4469
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4470
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4471
|
+
*/
|
|
4472
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4473
|
+
const safeVersion = "1.5.0";
|
|
4474
|
+
const defaultAbi = extensibleFallbackHandler_1_5_0_ContractArtifacts.abi;
|
|
4475
|
+
super(
|
|
4476
|
+
chainId,
|
|
4477
|
+
safeProvider,
|
|
4478
|
+
defaultAbi,
|
|
4479
|
+
safeVersion,
|
|
4480
|
+
customContractAddress,
|
|
4481
|
+
customContractAbi,
|
|
4482
|
+
deploymentType
|
|
4483
|
+
);
|
|
4484
|
+
// Read methods
|
|
4485
|
+
/**
|
|
4486
|
+
* @param args - Array[safe, domainSeparator]
|
|
4487
|
+
* @returns Array[verifier]
|
|
4488
|
+
*/
|
|
4489
|
+
this.domainVerifiers = async (args) => {
|
|
4490
|
+
return [await this.read("domainVerifiers", args)];
|
|
4491
|
+
};
|
|
4492
|
+
/**
|
|
4493
|
+
* @param args - Array[_hash, signature]
|
|
4494
|
+
* @returns Array[magic]
|
|
4495
|
+
*/
|
|
4496
|
+
this.isValidSignature = async (args) => {
|
|
4497
|
+
return [await this.read("isValidSignature", args)];
|
|
4498
|
+
};
|
|
4499
|
+
/**
|
|
4500
|
+
* @param args - Array[safe, interfaceId]
|
|
4501
|
+
* @returns Array[isSupported]
|
|
4502
|
+
*/
|
|
4503
|
+
this.safeInterfaces = async (args) => {
|
|
4504
|
+
return [await this.read("safeInterfaces", args)];
|
|
4505
|
+
};
|
|
4506
|
+
/**
|
|
4507
|
+
* @param args - Array[safe, selector]
|
|
4508
|
+
* @returns Array[handler]
|
|
4509
|
+
*/
|
|
4510
|
+
this.safeMethods = async (args) => {
|
|
4511
|
+
return [await this.read("safeMethods", args)];
|
|
4512
|
+
};
|
|
4513
|
+
/**
|
|
4514
|
+
* @param args - Array[interfaceId]
|
|
4515
|
+
* @returns Array[isSupported]
|
|
4516
|
+
*/
|
|
4517
|
+
this.supportsInterface = async (args) => {
|
|
4518
|
+
return [await this.read("supportsInterface", args)];
|
|
4519
|
+
};
|
|
4520
|
+
/**
|
|
4521
|
+
* @param args - Array[operator, from, tokenId, data]
|
|
4522
|
+
* @returns Array[bytes4]
|
|
4523
|
+
*/
|
|
4524
|
+
this.onERC721Received = async (args) => {
|
|
4525
|
+
return [await this.read("onERC721Received", args)];
|
|
4526
|
+
};
|
|
4527
|
+
/**
|
|
4528
|
+
* @param args - Array[operator, from, id, value, data]
|
|
4529
|
+
* @returns Array[bytes4]
|
|
4530
|
+
*/
|
|
4531
|
+
this.onERC1155Received = async (args) => {
|
|
4532
|
+
return [await this.read("onERC1155Received", args)];
|
|
4533
|
+
};
|
|
4534
|
+
/**
|
|
4535
|
+
* @param args - Array[operator, from, ids, values, data]
|
|
4536
|
+
* @returns Array[bytes4]
|
|
4537
|
+
*/
|
|
4538
|
+
this.onERC1155BatchReceived = async (args) => {
|
|
4539
|
+
return [await this.read("onERC1155BatchReceived", args)];
|
|
4540
|
+
};
|
|
4541
|
+
// Write methods (must be called via Safe transactions since msg.sender = Safe address)
|
|
4542
|
+
/**
|
|
4543
|
+
* @param args - Array[_interfaceId, handlerWithSelectors]
|
|
4544
|
+
*/
|
|
4545
|
+
this.addSupportedInterfaceBatch = async (args, options) => {
|
|
4546
|
+
if (options && !options.gasLimit) {
|
|
4547
|
+
options.gasLimit = Number(
|
|
4548
|
+
await this.estimateGas("addSupportedInterfaceBatch", args, { ...options })
|
|
4549
|
+
);
|
|
4550
|
+
}
|
|
4551
|
+
return toTxResult(
|
|
4552
|
+
this.runner,
|
|
4553
|
+
await this.write("addSupportedInterfaceBatch", args, options),
|
|
4554
|
+
options
|
|
4555
|
+
);
|
|
4556
|
+
};
|
|
4557
|
+
/**
|
|
4558
|
+
* @param args - Array[_interfaceId, selectors]
|
|
4559
|
+
*/
|
|
4560
|
+
this.removeSupportedInterfaceBatch = async (args, options) => {
|
|
4561
|
+
if (options && !options.gasLimit) {
|
|
4562
|
+
options.gasLimit = Number(
|
|
4563
|
+
await this.estimateGas("removeSupportedInterfaceBatch", args, { ...options })
|
|
4564
|
+
);
|
|
4565
|
+
}
|
|
4566
|
+
return toTxResult(
|
|
4567
|
+
this.runner,
|
|
4568
|
+
await this.write("removeSupportedInterfaceBatch", args, options),
|
|
4569
|
+
options
|
|
4570
|
+
);
|
|
4571
|
+
};
|
|
4572
|
+
/**
|
|
4573
|
+
* @param args - Array[domainSeparator, newVerifier]
|
|
4574
|
+
*/
|
|
4575
|
+
this.setDomainVerifier = async (args, options) => {
|
|
4576
|
+
if (options && !options.gasLimit) {
|
|
4577
|
+
options.gasLimit = Number(await this.estimateGas("setDomainVerifier", args, { ...options }));
|
|
4578
|
+
}
|
|
4579
|
+
return toTxResult(this.runner, await this.write("setDomainVerifier", args, options), options);
|
|
4580
|
+
};
|
|
4581
|
+
/**
|
|
4582
|
+
* @param args - Array[selector, newMethod]
|
|
4583
|
+
*/
|
|
4584
|
+
this.setSafeMethod = async (args, options) => {
|
|
4585
|
+
if (options && !options.gasLimit) {
|
|
4586
|
+
options.gasLimit = Number(await this.estimateGas("setSafeMethod", args, { ...options }));
|
|
4587
|
+
}
|
|
4588
|
+
return toTxResult(this.runner, await this.write("setSafeMethod", args, options), options);
|
|
4589
|
+
};
|
|
4590
|
+
/**
|
|
4591
|
+
* @param args - Array[interfaceId, supported]
|
|
4592
|
+
*/
|
|
4593
|
+
this.setSupportedInterface = async (args, options) => {
|
|
4594
|
+
if (options && !options.gasLimit) {
|
|
4595
|
+
options.gasLimit = Number(
|
|
4596
|
+
await this.estimateGas("setSupportedInterface", args, { ...options })
|
|
4597
|
+
);
|
|
4598
|
+
}
|
|
4599
|
+
return toTxResult(
|
|
4600
|
+
this.runner,
|
|
4601
|
+
await this.write("setSupportedInterface", args, options),
|
|
4602
|
+
options
|
|
4603
|
+
);
|
|
4604
|
+
};
|
|
4605
|
+
}
|
|
4606
|
+
};
|
|
4607
|
+
var ExtensibleFallbackHandlerContract_v1_5_0_default = ExtensibleFallbackHandlerContract_v1_5_0;
|
|
3702
4608
|
|
|
3703
4609
|
// src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.ts
|
|
3704
4610
|
var SafeWebAuthnSignerFactoryBaseContract = class extends BaseContract_default {
|
|
@@ -3872,6 +4778,16 @@ async function getSafeContractInstance(safeVersion, safeProvider, contractAddres
|
|
|
3872
4778
|
const chainId = await safeProvider.getChainId();
|
|
3873
4779
|
let safeContractInstance;
|
|
3874
4780
|
switch (safeVersion) {
|
|
4781
|
+
case "1.5.0":
|
|
4782
|
+
safeContractInstance = new SafeContract_v1_5_0_default(
|
|
4783
|
+
chainId,
|
|
4784
|
+
safeProvider,
|
|
4785
|
+
isL1SafeSingleton,
|
|
4786
|
+
contractAddress,
|
|
4787
|
+
customContractAbi,
|
|
4788
|
+
deploymentType
|
|
4789
|
+
);
|
|
4790
|
+
break;
|
|
3875
4791
|
case "1.4.1":
|
|
3876
4792
|
safeContractInstance = new SafeContract_v1_4_1_default(
|
|
3877
4793
|
chainId,
|
|
@@ -3932,6 +4848,15 @@ async function getCompatibilityFallbackHandlerContractInstance(safeVersion, safe
|
|
|
3932
4848
|
const chainId = await safeProvider.getChainId();
|
|
3933
4849
|
let compatibilityFallbackHandlerInstance;
|
|
3934
4850
|
switch (safeVersion) {
|
|
4851
|
+
case "1.5.0":
|
|
4852
|
+
compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_5_0_default(
|
|
4853
|
+
chainId,
|
|
4854
|
+
safeProvider,
|
|
4855
|
+
contractAddress,
|
|
4856
|
+
customContractAbi,
|
|
4857
|
+
deploymentType
|
|
4858
|
+
);
|
|
4859
|
+
break;
|
|
3935
4860
|
case "1.4.1":
|
|
3936
4861
|
compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_4_1_default(
|
|
3937
4862
|
chainId,
|
|
@@ -3962,6 +4887,15 @@ async function getMultiSendContractInstance(safeVersion, safeProvider, contractA
|
|
|
3962
4887
|
const chainId = await safeProvider.getChainId();
|
|
3963
4888
|
let multiSendContractInstance;
|
|
3964
4889
|
switch (safeVersion) {
|
|
4890
|
+
case "1.5.0":
|
|
4891
|
+
multiSendContractInstance = new MultiSendContract_v1_5_0_default(
|
|
4892
|
+
chainId,
|
|
4893
|
+
safeProvider,
|
|
4894
|
+
contractAddress,
|
|
4895
|
+
customContractAbi,
|
|
4896
|
+
deploymentType
|
|
4897
|
+
);
|
|
4898
|
+
break;
|
|
3965
4899
|
case "1.4.1":
|
|
3966
4900
|
multiSendContractInstance = new MultiSendContract_v1_4_1_default(
|
|
3967
4901
|
chainId,
|
|
@@ -4001,6 +4935,15 @@ async function getMultiSendCallOnlyContractInstance(safeVersion, safeProvider, c
|
|
|
4001
4935
|
const chainId = await safeProvider.getChainId();
|
|
4002
4936
|
let multiSendCallOnlyContractInstance;
|
|
4003
4937
|
switch (safeVersion) {
|
|
4938
|
+
case "1.5.0":
|
|
4939
|
+
multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_5_0_default(
|
|
4940
|
+
chainId,
|
|
4941
|
+
safeProvider,
|
|
4942
|
+
contractAddress,
|
|
4943
|
+
customContractAbi,
|
|
4944
|
+
deploymentType
|
|
4945
|
+
);
|
|
4946
|
+
break;
|
|
4004
4947
|
case "1.4.1":
|
|
4005
4948
|
multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_4_1_default(
|
|
4006
4949
|
chainId,
|
|
@@ -4032,6 +4975,15 @@ async function getSafeProxyFactoryContractInstance(safeVersion, safeProvider, co
|
|
|
4032
4975
|
const chainId = await safeProvider.getChainId();
|
|
4033
4976
|
let safeProxyFactoryContractInstance;
|
|
4034
4977
|
switch (safeVersion) {
|
|
4978
|
+
case "1.5.0":
|
|
4979
|
+
safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_5_0_default(
|
|
4980
|
+
chainId,
|
|
4981
|
+
safeProvider,
|
|
4982
|
+
contractAddress,
|
|
4983
|
+
customContractAbi,
|
|
4984
|
+
deploymentType
|
|
4985
|
+
);
|
|
4986
|
+
break;
|
|
4035
4987
|
case "1.4.1":
|
|
4036
4988
|
safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_4_1_default(
|
|
4037
4989
|
chainId,
|
|
@@ -4079,6 +5031,15 @@ async function getSignMessageLibContractInstance(safeVersion, safeProvider, cont
|
|
|
4079
5031
|
const chainId = await safeProvider.getChainId();
|
|
4080
5032
|
let signMessageLibContractInstance;
|
|
4081
5033
|
switch (safeVersion) {
|
|
5034
|
+
case "1.5.0":
|
|
5035
|
+
signMessageLibContractInstance = new SignMessageLibContract_v1_5_0_default(
|
|
5036
|
+
chainId,
|
|
5037
|
+
safeProvider,
|
|
5038
|
+
contractAddress,
|
|
5039
|
+
customContractAbi,
|
|
5040
|
+
deploymentType
|
|
5041
|
+
);
|
|
5042
|
+
break;
|
|
4082
5043
|
case "1.4.1":
|
|
4083
5044
|
signMessageLibContractInstance = new SignMessageLibContract_v1_4_1_default(
|
|
4084
5045
|
chainId,
|
|
@@ -4107,6 +5068,15 @@ async function getCreateCallContractInstance(safeVersion, safeProvider, contract
|
|
|
4107
5068
|
const chainId = await safeProvider.getChainId();
|
|
4108
5069
|
let createCallContractInstance;
|
|
4109
5070
|
switch (safeVersion) {
|
|
5071
|
+
case "1.5.0":
|
|
5072
|
+
createCallContractInstance = new CreateCallContract_v1_5_0_default(
|
|
5073
|
+
chainId,
|
|
5074
|
+
safeProvider,
|
|
5075
|
+
contractAddress,
|
|
5076
|
+
customContractAbi,
|
|
5077
|
+
deploymentType
|
|
5078
|
+
);
|
|
5079
|
+
break;
|
|
4110
5080
|
case "1.4.1":
|
|
4111
5081
|
createCallContractInstance = new CreateCallContract_v1_4_1_default(
|
|
4112
5082
|
chainId,
|
|
@@ -4138,6 +5108,15 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
|
|
|
4138
5108
|
const chainId = await safeProvider.getChainId();
|
|
4139
5109
|
let simulateTxAccessorContractInstance;
|
|
4140
5110
|
switch (safeVersion) {
|
|
5111
|
+
case "1.5.0":
|
|
5112
|
+
simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_5_0_default(
|
|
5113
|
+
chainId,
|
|
5114
|
+
safeProvider,
|
|
5115
|
+
contractAddress,
|
|
5116
|
+
customContractAbi,
|
|
5117
|
+
deploymentType
|
|
5118
|
+
);
|
|
5119
|
+
break;
|
|
4141
5120
|
case "1.4.1":
|
|
4142
5121
|
simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_4_1_default(
|
|
4143
5122
|
chainId,
|
|
@@ -4165,6 +5144,7 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
|
|
|
4165
5144
|
async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
4166
5145
|
const chainId = await safeProvider.getChainId();
|
|
4167
5146
|
switch (safeVersion) {
|
|
5147
|
+
case "1.5.0":
|
|
4168
5148
|
case "1.4.1":
|
|
4169
5149
|
case "1.3.0":
|
|
4170
5150
|
const safeWebAuthnSignerFactoryContractInstance = new SafeWebAuthnSignerFactoryContract_v0_2_1_default(
|
|
@@ -4184,6 +5164,7 @@ async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safePro
|
|
|
4184
5164
|
async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
4185
5165
|
const chainId = await safeProvider.getChainId();
|
|
4186
5166
|
switch (safeVersion) {
|
|
5167
|
+
case "1.5.0":
|
|
4187
5168
|
case "1.4.1":
|
|
4188
5169
|
case "1.3.0":
|
|
4189
5170
|
const safeWebAuthnSharedSignerContractInstance = new SafeWebAuthnSharedSignerContract_v0_2_1_default(
|
|
@@ -4200,6 +5181,23 @@ async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProv
|
|
|
4200
5181
|
throw new Error("Invalid Safe version");
|
|
4201
5182
|
}
|
|
4202
5183
|
}
|
|
5184
|
+
async function getExtensibleFallbackHandlerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
5185
|
+
const chainId = await safeProvider.getChainId();
|
|
5186
|
+
switch (safeVersion) {
|
|
5187
|
+
case "1.5.0":
|
|
5188
|
+
const extensibleFallbackHandlerContractInstance = new ExtensibleFallbackHandlerContract_v1_5_0_default(
|
|
5189
|
+
chainId,
|
|
5190
|
+
safeProvider,
|
|
5191
|
+
contractAddress,
|
|
5192
|
+
customContractAbi,
|
|
5193
|
+
deploymentType
|
|
5194
|
+
);
|
|
5195
|
+
await extensibleFallbackHandlerContractInstance.init();
|
|
5196
|
+
return extensibleFallbackHandlerContractInstance;
|
|
5197
|
+
default:
|
|
5198
|
+
throw new Error("Invalid Safe version");
|
|
5199
|
+
}
|
|
5200
|
+
}
|
|
4203
5201
|
|
|
4204
5202
|
// src/contracts/safeDeploymentContracts.ts
|
|
4205
5203
|
async function getSafeContract({
|
|
@@ -4409,6 +5407,27 @@ async function getSafeWebAuthnSharedSignerContract({
|
|
|
4409
5407
|
}
|
|
4410
5408
|
return safeWebAuthnSharedSignerContract;
|
|
4411
5409
|
}
|
|
5410
|
+
async function getExtensibleFallbackHandlerContract({
|
|
5411
|
+
safeProvider,
|
|
5412
|
+
safeVersion,
|
|
5413
|
+
customContracts,
|
|
5414
|
+
deploymentType
|
|
5415
|
+
}) {
|
|
5416
|
+
const extensibleFallbackHandlerContract = await getExtensibleFallbackHandlerContractInstance(
|
|
5417
|
+
safeVersion,
|
|
5418
|
+
safeProvider,
|
|
5419
|
+
customContracts?.extensibleFallbackHandlerAddress,
|
|
5420
|
+
customContracts?.extensibleFallbackHandlerAbi,
|
|
5421
|
+
deploymentType
|
|
5422
|
+
);
|
|
5423
|
+
const isContractDeployed = await safeProvider.isContractDeployed(
|
|
5424
|
+
extensibleFallbackHandlerContract.getAddress()
|
|
5425
|
+
);
|
|
5426
|
+
if (!isContractDeployed) {
|
|
5427
|
+
throw new Error("ExtensibleFallbackHandler contract is not deployed on the current network");
|
|
5428
|
+
}
|
|
5429
|
+
return extensibleFallbackHandlerContract;
|
|
5430
|
+
}
|
|
4412
5431
|
|
|
4413
5432
|
// src/utils/transactions/gas.ts
|
|
4414
5433
|
var CALL_DATA_ZERO_BYTE_GAS_COST = 4;
|
|
@@ -4806,6 +5825,32 @@ function encodeMetaTransaction(tx) {
|
|
|
4806
5825
|
function encodeMultiSendData(txs) {
|
|
4807
5826
|
return `0x${txs.map((tx) => encodeMetaTransaction(tx)).join("")}`;
|
|
4808
5827
|
}
|
|
5828
|
+
function decodeMultiSendData(encodedData) {
|
|
5829
|
+
const decodedData = decodeFunctionData({
|
|
5830
|
+
abi: parseAbi(["function multiSend(bytes memory transactions) public payable"]),
|
|
5831
|
+
data: asHex(encodedData)
|
|
5832
|
+
});
|
|
5833
|
+
const args = decodedData.args;
|
|
5834
|
+
const txs = [];
|
|
5835
|
+
let index = 2;
|
|
5836
|
+
if (args) {
|
|
5837
|
+
const [transactionBytes] = args;
|
|
5838
|
+
while (index < transactionBytes.length) {
|
|
5839
|
+
const operation = `0x${transactionBytes.slice(index, index += 2)}`;
|
|
5840
|
+
const to = `0x${transactionBytes.slice(index, index += 40)}`;
|
|
5841
|
+
const value = `0x${transactionBytes.slice(index, index += 64)}`;
|
|
5842
|
+
const dataLength = parseInt(`${transactionBytes.slice(index, index += 64)}`, 16) * 2;
|
|
5843
|
+
const data = `0x${transactionBytes.slice(index, index += dataLength)}`;
|
|
5844
|
+
txs.push({
|
|
5845
|
+
operation: Number(operation),
|
|
5846
|
+
to: getAddress(to),
|
|
5847
|
+
value: BigInt(value).toString(),
|
|
5848
|
+
data
|
|
5849
|
+
});
|
|
5850
|
+
}
|
|
5851
|
+
}
|
|
5852
|
+
return txs;
|
|
5853
|
+
}
|
|
4809
5854
|
function isSafeMultisigTransactionResponse(safeTransaction) {
|
|
4810
5855
|
return safeTransaction.isExecuted !== void 0;
|
|
4811
5856
|
}
|
|
@@ -4890,7 +5935,7 @@ function hasDelegateCalls(transactions) {
|
|
|
4890
5935
|
|
|
4891
5936
|
// src/utils/passkeys/extractPasskeyData.ts
|
|
4892
5937
|
import { Buffer as Buffer2 } from "buffer";
|
|
4893
|
-
import {
|
|
5938
|
+
import { getDaimoP256VerifierDeployment } from "@safe-global/safe-modules-deployments";
|
|
4894
5939
|
function base64ToUint8Array(base64) {
|
|
4895
5940
|
const base64Fixed = base64.replace(/-/g, "+").replace(/_/g, "/");
|
|
4896
5941
|
const binaryBuffer = Buffer2.from(base64Fixed, "base64");
|
|
@@ -5000,18 +6045,18 @@ async function extractPasskeyData(passkeyCredential) {
|
|
|
5000
6045
|
coordinates
|
|
5001
6046
|
};
|
|
5002
6047
|
}
|
|
5003
|
-
function
|
|
5004
|
-
const
|
|
6048
|
+
function getP256VerifierAddress(chainId) {
|
|
6049
|
+
const deployment = getDaimoP256VerifierDeployment({
|
|
5005
6050
|
version: "0.2.1",
|
|
5006
6051
|
released: true,
|
|
5007
6052
|
network: chainId
|
|
5008
6053
|
});
|
|
5009
|
-
if (!
|
|
5010
|
-
throw new Error(`Failed to load
|
|
6054
|
+
if (!deployment) {
|
|
6055
|
+
throw new Error(`Failed to load DaimoP256Verifier deployment for chain ID ${chainId}`);
|
|
5011
6056
|
}
|
|
5012
|
-
const verifierAddress =
|
|
6057
|
+
const verifierAddress = deployment.networkAddresses[chainId];
|
|
5013
6058
|
if (!verifierAddress) {
|
|
5014
|
-
throw new Error(`
|
|
6059
|
+
throw new Error(`DaimoP256Verifier address not found for chain ID ${chainId}`);
|
|
5015
6060
|
}
|
|
5016
6061
|
return verifierAddress;
|
|
5017
6062
|
}
|
|
@@ -5036,15 +6081,14 @@ import {
|
|
|
5036
6081
|
} from "viem";
|
|
5037
6082
|
|
|
5038
6083
|
// src/utils/passkeys/isSharedSigner.ts
|
|
5039
|
-
async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners
|
|
6084
|
+
async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners) {
|
|
5040
6085
|
const sharedSignerContractAddress = safeWebAuthnSharedSignerContract.contractAddress;
|
|
5041
6086
|
if (safeAddress && owners.includes(sharedSignerContractAddress)) {
|
|
5042
6087
|
const [sharedSignerSlot] = await safeWebAuthnSharedSignerContract.getConfiguration([
|
|
5043
6088
|
asHex(safeAddress)
|
|
5044
6089
|
]);
|
|
5045
6090
|
const { x, y, verifiers } = sharedSignerSlot;
|
|
5046
|
-
const
|
|
5047
|
-
const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(verifierAddress) === verifiers;
|
|
6091
|
+
const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(passkey.verifierAddress) === verifiers;
|
|
5048
6092
|
return isSharedSigner2;
|
|
5049
6093
|
}
|
|
5050
6094
|
return false;
|
|
@@ -5080,16 +6124,14 @@ var signTransaction = () => {
|
|
|
5080
6124
|
var signTypedData = () => {
|
|
5081
6125
|
throw new Error("Passkey Signers cannot sign signTypedData, they can only sign data.");
|
|
5082
6126
|
};
|
|
5083
|
-
var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners
|
|
5084
|
-
const { rawId, coordinates,
|
|
6127
|
+
var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners) => {
|
|
6128
|
+
const { rawId, coordinates, verifierAddress } = passkey;
|
|
5085
6129
|
const passkeyRawId = hexToBytes(asHex(rawId));
|
|
5086
|
-
const verifierAddress = customVerifierAddress || getDefaultFCLP256VerifierAddress(chainId);
|
|
5087
6130
|
const isPasskeySharedSigner = await isSharedSigner_default(
|
|
5088
6131
|
passkey,
|
|
5089
6132
|
safeWebAuthnSharedSignerContract,
|
|
5090
6133
|
safeAddress,
|
|
5091
|
-
owners
|
|
5092
|
-
chainId
|
|
6134
|
+
owners
|
|
5093
6135
|
);
|
|
5094
6136
|
let signerAddress;
|
|
5095
6137
|
if (isPasskeySharedSigner) {
|
|
@@ -5252,7 +6294,7 @@ import {
|
|
|
5252
6294
|
getTransaction,
|
|
5253
6295
|
getTransactionCount,
|
|
5254
6296
|
getStorageAt,
|
|
5255
|
-
readContract
|
|
6297
|
+
readContract as readContract2
|
|
5256
6298
|
} from "viem/actions";
|
|
5257
6299
|
|
|
5258
6300
|
// src/utils/provider.ts
|
|
@@ -5317,8 +6359,7 @@ var SafeProvider = class _SafeProvider {
|
|
|
5317
6359
|
safeWebAuthnSharedSignerContract,
|
|
5318
6360
|
safeProvider.getExternalProvider(),
|
|
5319
6361
|
safeAddress || "",
|
|
5320
|
-
owners || []
|
|
5321
|
-
chainId.toString()
|
|
6362
|
+
owners || []
|
|
5322
6363
|
);
|
|
5323
6364
|
} else {
|
|
5324
6365
|
passkeySigner = signer;
|
|
@@ -5483,7 +6524,7 @@ var SafeProvider = class _SafeProvider {
|
|
|
5483
6524
|
return data ?? "0x";
|
|
5484
6525
|
}
|
|
5485
6526
|
async readContract(args) {
|
|
5486
|
-
return
|
|
6527
|
+
return readContract2(this.#externalProvider, args);
|
|
5487
6528
|
}
|
|
5488
6529
|
// TODO: fix anys
|
|
5489
6530
|
encodeParameters(types, values) {
|
|
@@ -5766,7 +6807,7 @@ async function predictSafeAddress({
|
|
|
5766
6807
|
const salt = keccak2562(concat2([initializerHash, encodedNonce]));
|
|
5767
6808
|
const input = safeProvider.encodeParameters("address", [safeContract.getAddress()]);
|
|
5768
6809
|
const from = safeProxyFactoryContract.getAddress();
|
|
5769
|
-
const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId);
|
|
6810
|
+
const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId) && semverSatisfies6(safeVersion, "<=1.4.1");
|
|
5770
6811
|
if (isZkSyncChain) {
|
|
5771
6812
|
const proxyAddress2 = zkSyncCreate2Address(from, safeVersion, salt, asHex(input));
|
|
5772
6813
|
return safeProvider.getChecksummedAddress(proxyAddress2);
|
|
@@ -5944,6 +6985,10 @@ var FallbackHandlerManager = class {
|
|
|
5944
6985
|
}
|
|
5945
6986
|
return this.#safeContract;
|
|
5946
6987
|
}
|
|
6988
|
+
encodeSetFallbackHandler(safeContract, handler) {
|
|
6989
|
+
const encode = safeContract.encode;
|
|
6990
|
+
return encode("setFallbackHandler", [asHex(handler)]);
|
|
6991
|
+
}
|
|
5947
6992
|
async getFallbackHandler() {
|
|
5948
6993
|
const safeContract = await this.isFallbackHandlerCompatible();
|
|
5949
6994
|
return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#slot);
|
|
@@ -5953,13 +6998,13 @@ var FallbackHandlerManager = class {
|
|
|
5953
6998
|
this.validateFallbackHandlerAddress(fallbackHandlerAddress);
|
|
5954
6999
|
const currentFallbackHandler = await this.getFallbackHandler();
|
|
5955
7000
|
this.validateFallbackHandlerIsNotEnabled(currentFallbackHandler, fallbackHandlerAddress);
|
|
5956
|
-
return
|
|
7001
|
+
return this.encodeSetFallbackHandler(safeContract, fallbackHandlerAddress);
|
|
5957
7002
|
}
|
|
5958
7003
|
async encodeDisableFallbackHandlerData() {
|
|
5959
7004
|
const safeContract = await this.isFallbackHandlerCompatible();
|
|
5960
7005
|
const currentFallbackHandler = await this.getFallbackHandler();
|
|
5961
7006
|
this.validateFallbackHandlerIsEnabled(currentFallbackHandler);
|
|
5962
|
-
return
|
|
7007
|
+
return this.encodeSetFallbackHandler(safeContract, ZERO_ADDRESS);
|
|
5963
7008
|
}
|
|
5964
7009
|
};
|
|
5965
7010
|
var fallbackHandlerManager_default = FallbackHandlerManager;
|
|
@@ -6026,6 +7071,8 @@ var guardManager_default = GuardManager;
|
|
|
6026
7071
|
var ModuleManager = class {
|
|
6027
7072
|
#safeProvider;
|
|
6028
7073
|
#safeContract;
|
|
7074
|
+
// keccak256("module_manager.module_guard.address")
|
|
7075
|
+
#moduleGuardSlot = "0xb104e0b93118902c651344349b610029d694cfdec91c589c91ebafbcd0289947";
|
|
6029
7076
|
constructor(safeProvider, safeContract) {
|
|
6030
7077
|
this.#safeProvider = safeProvider;
|
|
6031
7078
|
this.#safeContract = safeContract;
|
|
@@ -6091,6 +7138,49 @@ var ModuleManager = class {
|
|
|
6091
7138
|
const prevModuleAddress = moduleIndex === 0 ? SENTINEL_ADDRESS : modules[moduleIndex - 1];
|
|
6092
7139
|
return this.#safeContract.encode("disableModule", [prevModuleAddress, moduleAddress]);
|
|
6093
7140
|
}
|
|
7141
|
+
validateModuleGuardAddress(moduleGuardAddress) {
|
|
7142
|
+
const isValidAddress = this.#safeProvider.isAddress(moduleGuardAddress);
|
|
7143
|
+
if (!isValidAddress || isZeroAddress(moduleGuardAddress)) {
|
|
7144
|
+
throw new Error("Invalid module guard address provided");
|
|
7145
|
+
}
|
|
7146
|
+
}
|
|
7147
|
+
validateModuleGuardIsNotEnabled(currentModuleGuard, newModuleGuardAddress) {
|
|
7148
|
+
if (sameString(currentModuleGuard, newModuleGuardAddress)) {
|
|
7149
|
+
throw new Error("Module guard provided is already enabled");
|
|
7150
|
+
}
|
|
7151
|
+
}
|
|
7152
|
+
validateModuleGuardIsEnabled(moduleGuardAddress) {
|
|
7153
|
+
if (isZeroAddress(moduleGuardAddress)) {
|
|
7154
|
+
throw new Error("There is no module guard enabled yet");
|
|
7155
|
+
}
|
|
7156
|
+
}
|
|
7157
|
+
async isModuleGuardCompatible() {
|
|
7158
|
+
if (!this.#safeContract) {
|
|
7159
|
+
throw new Error("Safe is not deployed");
|
|
7160
|
+
}
|
|
7161
|
+
const safeVersion = this.#safeContract.safeVersion;
|
|
7162
|
+
if (!hasSafeFeature("SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */, safeVersion)) {
|
|
7163
|
+
throw new Error("Current version of the Safe does not support module guard functionality");
|
|
7164
|
+
}
|
|
7165
|
+
return this.#safeContract;
|
|
7166
|
+
}
|
|
7167
|
+
async getModuleGuard() {
|
|
7168
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7169
|
+
return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#moduleGuardSlot);
|
|
7170
|
+
}
|
|
7171
|
+
async encodeEnableModuleGuardData(moduleGuardAddress) {
|
|
7172
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7173
|
+
this.validateModuleGuardAddress(moduleGuardAddress);
|
|
7174
|
+
const currentModuleGuard = await this.getModuleGuard();
|
|
7175
|
+
this.validateModuleGuardIsNotEnabled(currentModuleGuard, moduleGuardAddress);
|
|
7176
|
+
return safeContract.encode("setModuleGuard", [asHex(moduleGuardAddress)]);
|
|
7177
|
+
}
|
|
7178
|
+
async encodeDisableModuleGuardData() {
|
|
7179
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7180
|
+
const currentModuleGuard = await this.getModuleGuard();
|
|
7181
|
+
this.validateModuleGuardIsEnabled(currentModuleGuard);
|
|
7182
|
+
return safeContract.encode("setModuleGuard", [asHex(ZERO_ADDRESS)]);
|
|
7183
|
+
}
|
|
6094
7184
|
};
|
|
6095
7185
|
var moduleManager_default = ModuleManager;
|
|
6096
7186
|
|
|
@@ -6277,9 +7367,10 @@ function generateOnChainIdentifier({
|
|
|
6277
7367
|
var generateOnChainIdentifier_default = generateOnChainIdentifier;
|
|
6278
7368
|
|
|
6279
7369
|
// src/utils/getProtocolKitVersion.ts
|
|
6280
|
-
var getProtocolKitVersion = () => "
|
|
7370
|
+
var getProtocolKitVersion = () => "7.0.0";
|
|
6281
7371
|
|
|
6282
7372
|
// src/Safe.ts
|
|
7373
|
+
var EQ_OR_GT_1_5_0 = ">=1.5.0";
|
|
6283
7374
|
var EQ_OR_GT_1_4_1 = ">=1.4.1";
|
|
6284
7375
|
var EQ_OR_GT_1_3_03 = ">=1.3.0";
|
|
6285
7376
|
var Safe = class _Safe {
|
|
@@ -6315,31 +7406,27 @@ var Safe = class _Safe {
|
|
|
6315
7406
|
this.isValidSignature = async (messageHash, signature = "0x") => {
|
|
6316
7407
|
const safeAddress = await this.getAddress();
|
|
6317
7408
|
const fallbackHandler = await this.#getFallbackHandlerContract();
|
|
7409
|
+
const safeVersion = this.getContractVersion();
|
|
6318
7410
|
const signatureToCheck = signature && Array.isArray(signature) ? buildSignatureBytes(signature) : signature;
|
|
6319
7411
|
const bytes32Tuple = [
|
|
6320
7412
|
asHash(messageHash),
|
|
6321
7413
|
asHex(signatureToCheck)
|
|
6322
7414
|
];
|
|
6323
7415
|
const data = fallbackHandler.encode("isValidSignature", bytes32Tuple);
|
|
6324
|
-
const
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
|
|
6328
|
-
|
|
7416
|
+
const callParams = { from: safeAddress, to: safeAddress };
|
|
7417
|
+
const calls = [this.#safeProvider.call({ ...callParams, data })];
|
|
7418
|
+
if (!semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
7419
|
+
const bytesTuple = [
|
|
7420
|
+
asHash(messageHash),
|
|
7421
|
+
asHex(signatureToCheck)
|
|
7422
|
+
];
|
|
7423
|
+
const bytesData = fallbackHandler.encode("isValidSignature", bytesTuple);
|
|
7424
|
+
calls.push(this.#safeProvider.call({ ...callParams, data: bytesData }));
|
|
7425
|
+
}
|
|
6329
7426
|
try {
|
|
6330
|
-
const
|
|
6331
|
-
|
|
6332
|
-
|
|
6333
|
-
to: safeAddress,
|
|
6334
|
-
data
|
|
6335
|
-
}),
|
|
6336
|
-
this.#safeProvider.call({
|
|
6337
|
-
from: safeAddress,
|
|
6338
|
-
to: safeAddress,
|
|
6339
|
-
data: bytesData
|
|
6340
|
-
})
|
|
6341
|
-
]);
|
|
6342
|
-
return !!isValidSignatureResponse.length && (isValidSignatureResponse[0].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE || isValidSignatureResponse[1].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE_BYTES);
|
|
7427
|
+
const responses = await Promise.all(calls);
|
|
7428
|
+
const magicValues = [this.#MAGIC_VALUE, this.#MAGIC_VALUE_BYTES];
|
|
7429
|
+
return responses.some((response, i) => response.slice(0, 10).toLowerCase() === magicValues[i]);
|
|
6343
7430
|
} catch (error) {
|
|
6344
7431
|
return false;
|
|
6345
7432
|
}
|
|
@@ -6698,6 +7785,15 @@ var Safe = class _Safe {
|
|
|
6698
7785
|
async isModuleEnabled(moduleAddress) {
|
|
6699
7786
|
return this.#moduleManager.isModuleEnabled(moduleAddress);
|
|
6700
7787
|
}
|
|
7788
|
+
/**
|
|
7789
|
+
* Returns the enabled Safe module guard or 0x address if no module guard is enabled.
|
|
7790
|
+
*
|
|
7791
|
+
* @returns The address of the enabled Safe module guard
|
|
7792
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
7793
|
+
*/
|
|
7794
|
+
async getModuleGuard() {
|
|
7795
|
+
return this.#moduleManager.getModuleGuard();
|
|
7796
|
+
}
|
|
6701
7797
|
/**
|
|
6702
7798
|
* Checks if a specific address is an owner of the current Safe.
|
|
6703
7799
|
*
|
|
@@ -6899,7 +7995,15 @@ var Safe = class _Safe {
|
|
|
6899
7995
|
throw new Error("eth_sign is only supported by Safes >= v1.1.0");
|
|
6900
7996
|
}
|
|
6901
7997
|
let safeMessageHash;
|
|
6902
|
-
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion,
|
|
7998
|
+
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
7999
|
+
const parentSafeMessageHash = calculateSafeMessageHash(
|
|
8000
|
+
preimageSafeAddress,
|
|
8001
|
+
hashSafeMessage(message.data),
|
|
8002
|
+
safeVersion,
|
|
8003
|
+
chainId
|
|
8004
|
+
);
|
|
8005
|
+
safeMessageHash = await this.getSafeMessageHash(parentSafeMessageHash);
|
|
8006
|
+
} else if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_4_1)) {
|
|
6903
8007
|
const messageHashData = preimageSafeMessageHash(
|
|
6904
8008
|
preimageSafeAddress,
|
|
6905
8009
|
hashSafeMessage(message.data),
|
|
@@ -6979,7 +8083,15 @@ var Safe = class _Safe {
|
|
|
6979
8083
|
throw new Error("eth_sign is only supported by Safes >= v1.1.0");
|
|
6980
8084
|
}
|
|
6981
8085
|
let txHash;
|
|
6982
|
-
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2,
|
|
8086
|
+
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_5_0) && preimageSafeAddress) {
|
|
8087
|
+
const txHashData = calculateSafeTransactionHash(
|
|
8088
|
+
preimageSafeAddress,
|
|
8089
|
+
transaction.data,
|
|
8090
|
+
safeVersion2,
|
|
8091
|
+
chainId
|
|
8092
|
+
);
|
|
8093
|
+
txHash = await this.getSafeMessageHash(txHashData);
|
|
8094
|
+
} else if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_3_03) && preimageSafeAddress) {
|
|
6983
8095
|
const txHashData = preimageSafeTransactionHash(
|
|
6984
8096
|
preimageSafeAddress,
|
|
6985
8097
|
safeTransaction.data,
|
|
@@ -7101,6 +8213,203 @@ var Safe = class _Safe {
|
|
|
7101
8213
|
});
|
|
7102
8214
|
return safeTransaction;
|
|
7103
8215
|
}
|
|
8216
|
+
// ---------------------------------------------------------------------------
|
|
8217
|
+
// ExtensibleFallbackHandler helpers
|
|
8218
|
+
// ---------------------------------------------------------------------------
|
|
8219
|
+
/**
|
|
8220
|
+
* Returns an instance of the ExtensibleFallbackHandler contract for the current chain.
|
|
8221
|
+
* Used internally to compose read queries and Safe transactions against the EFH.
|
|
8222
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8223
|
+
*/
|
|
8224
|
+
async #getExtensibleFallbackHandlerContract() {
|
|
8225
|
+
const safeVersion = this.getContractVersion();
|
|
8226
|
+
if (!semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
8227
|
+
throw new Error("ExtensibleFallbackHandler is only available for Safe >= v1.5.0");
|
|
8228
|
+
}
|
|
8229
|
+
const chainId = await this.getChainId();
|
|
8230
|
+
const customContracts = this.#contractManager.contractNetworks?.[chainId.toString()];
|
|
8231
|
+
return getExtensibleFallbackHandlerContract({
|
|
8232
|
+
safeProvider: this.#safeProvider,
|
|
8233
|
+
safeVersion,
|
|
8234
|
+
customContracts
|
|
8235
|
+
});
|
|
8236
|
+
}
|
|
8237
|
+
// ----- Read helpers -----
|
|
8238
|
+
/**
|
|
8239
|
+
* Returns the bytes32-encoded handler registered for the given 4-byte selector on
|
|
8240
|
+
* the ExtensibleFallbackHandler for this Safe.
|
|
8241
|
+
* Only available for Safe >= v1.5.0.
|
|
8242
|
+
*
|
|
8243
|
+
* @param selector - The 4-byte function selector (e.g. '0xaabbccdd')
|
|
8244
|
+
* @returns The bytes32 handler entry, or the zero bytes32 if unregistered
|
|
8245
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8246
|
+
*/
|
|
8247
|
+
async getSafeMethod(selector) {
|
|
8248
|
+
const safeAddress = await this.getAddress();
|
|
8249
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8250
|
+
const [method] = await efhContract.safeMethods([
|
|
8251
|
+
safeAddress,
|
|
8252
|
+
selector
|
|
8253
|
+
]);
|
|
8254
|
+
return method;
|
|
8255
|
+
}
|
|
8256
|
+
/**
|
|
8257
|
+
* Returns the ISafeSignatureVerifier address registered for the given domain separator
|
|
8258
|
+
* on the ExtensibleFallbackHandler for this Safe.
|
|
8259
|
+
* Only available for Safe >= v1.5.0.
|
|
8260
|
+
*
|
|
8261
|
+
* @param domainSeparator - 32-byte domain separator
|
|
8262
|
+
* @returns The verifier address, or the zero address if unregistered
|
|
8263
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8264
|
+
*/
|
|
8265
|
+
async getDomainVerifier(domainSeparator) {
|
|
8266
|
+
const safeAddress = await this.getAddress();
|
|
8267
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8268
|
+
const [verifier] = await efhContract.domainVerifiers([
|
|
8269
|
+
safeAddress,
|
|
8270
|
+
domainSeparator
|
|
8271
|
+
]);
|
|
8272
|
+
return verifier;
|
|
8273
|
+
}
|
|
8274
|
+
/**
|
|
8275
|
+
* Returns whether the given ERC-165 interface ID is marked as supported for this Safe
|
|
8276
|
+
* on the ExtensibleFallbackHandler.
|
|
8277
|
+
* Only available for Safe >= v1.5.0.
|
|
8278
|
+
*
|
|
8279
|
+
* @param interfaceId - 4-byte ERC-165 interface ID
|
|
8280
|
+
* @returns true if supported, false otherwise
|
|
8281
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8282
|
+
*/
|
|
8283
|
+
async isSafeInterfaceSupported(interfaceId) {
|
|
8284
|
+
const safeAddress = await this.getAddress();
|
|
8285
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8286
|
+
const [isSupported] = await efhContract.safeInterfaces([
|
|
8287
|
+
safeAddress,
|
|
8288
|
+
interfaceId
|
|
8289
|
+
]);
|
|
8290
|
+
return isSupported;
|
|
8291
|
+
}
|
|
8292
|
+
// ----- Write transaction builders -----
|
|
8293
|
+
/**
|
|
8294
|
+
* Returns a Safe transaction that calls setSafeMethod on the ExtensibleFallbackHandler.
|
|
8295
|
+
* Because the EFH uses msg.sender as the Safe address, this must be executed through
|
|
8296
|
+
* the Safe itself.
|
|
8297
|
+
* Only available for Safe >= v1.5.0.
|
|
8298
|
+
*
|
|
8299
|
+
* @param selector - The 4-byte function selector to handle
|
|
8300
|
+
* @param newMethod - bytes32-packed handler address (address right-aligned, 12 leading zero bytes)
|
|
8301
|
+
* @param options - Optional Safe transaction properties
|
|
8302
|
+
* @returns The Safe transaction ready to be signed
|
|
8303
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8304
|
+
*/
|
|
8305
|
+
async createSetSafeMethodTx(selector, newMethod, options) {
|
|
8306
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8307
|
+
const safeAddress = await this.getAddress();
|
|
8308
|
+
const data = efhContract.encode("setSafeMethod", [
|
|
8309
|
+
selector,
|
|
8310
|
+
newMethod
|
|
8311
|
+
]);
|
|
8312
|
+
return this.createTransaction({
|
|
8313
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8314
|
+
options
|
|
8315
|
+
});
|
|
8316
|
+
}
|
|
8317
|
+
/**
|
|
8318
|
+
* Returns a Safe transaction that calls setDomainVerifier on the ExtensibleFallbackHandler.
|
|
8319
|
+
* Registers an ISafeSignatureVerifier for EIP-712 domain-based signature validation.
|
|
8320
|
+
* Only available for Safe >= v1.5.0.
|
|
8321
|
+
*
|
|
8322
|
+
* @param domainSeparator - 32-byte EIP-712 domain separator
|
|
8323
|
+
* @param verifier - Address of the ISafeSignatureVerifier contract
|
|
8324
|
+
* @param options - Optional Safe transaction properties
|
|
8325
|
+
* @returns The Safe transaction ready to be signed
|
|
8326
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8327
|
+
*/
|
|
8328
|
+
async createSetDomainVerifierTx(domainSeparator, verifier, options) {
|
|
8329
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8330
|
+
const safeAddress = await this.getAddress();
|
|
8331
|
+
const data = efhContract.encode("setDomainVerifier", [
|
|
8332
|
+
domainSeparator,
|
|
8333
|
+
verifier
|
|
8334
|
+
]);
|
|
8335
|
+
return this.createTransaction({
|
|
8336
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8337
|
+
options
|
|
8338
|
+
});
|
|
8339
|
+
}
|
|
8340
|
+
/**
|
|
8341
|
+
* Returns a Safe transaction that calls setSupportedInterface on the ExtensibleFallbackHandler.
|
|
8342
|
+
* Marks (or un-marks) an ERC-165 interface as supported for this Safe.
|
|
8343
|
+
* Only available for Safe >= v1.5.0.
|
|
8344
|
+
*
|
|
8345
|
+
* @param interfaceId - 4-byte ERC-165 interface ID
|
|
8346
|
+
* @param supported - true to add support, false to remove it
|
|
8347
|
+
* @param options - Optional Safe transaction properties
|
|
8348
|
+
* @returns The Safe transaction ready to be signed
|
|
8349
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8350
|
+
*/
|
|
8351
|
+
async createSetSupportedInterfaceTx(interfaceId, supported, options) {
|
|
8352
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8353
|
+
const safeAddress = await this.getAddress();
|
|
8354
|
+
const data = efhContract.encode("setSupportedInterface", [
|
|
8355
|
+
interfaceId,
|
|
8356
|
+
supported
|
|
8357
|
+
]);
|
|
8358
|
+
return this.createTransaction({
|
|
8359
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8360
|
+
options
|
|
8361
|
+
});
|
|
8362
|
+
}
|
|
8363
|
+
/**
|
|
8364
|
+
* Returns a Safe transaction that calls addSupportedInterfaceBatch on the ExtensibleFallbackHandler.
|
|
8365
|
+
* Atomically registers an interface and multiple method handlers in a single call.
|
|
8366
|
+
* Only available for Safe >= v1.5.0.
|
|
8367
|
+
*
|
|
8368
|
+
* Each entry in handlerWithSelectors is a bytes32 value encoding both the handler address
|
|
8369
|
+
* and the 4-byte method selector: first 4 bytes = selector, next 8 bytes = zero padding,
|
|
8370
|
+
* last 20 bytes = handler address.
|
|
8371
|
+
*
|
|
8372
|
+
* @param interfaceId - 4-byte ERC-165 interface ID to mark as supported
|
|
8373
|
+
* @param handlerWithSelectors - Array of packed selector+handler bytes32 values
|
|
8374
|
+
* @param options - Optional Safe transaction properties
|
|
8375
|
+
* @returns The Safe transaction ready to be signed
|
|
8376
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8377
|
+
*/
|
|
8378
|
+
async createAddSupportedInterfaceBatchTx(interfaceId, handlerWithSelectors, options) {
|
|
8379
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8380
|
+
const safeAddress = await this.getAddress();
|
|
8381
|
+
const data = efhContract.encode("addSupportedInterfaceBatch", [
|
|
8382
|
+
interfaceId,
|
|
8383
|
+
handlerWithSelectors
|
|
8384
|
+
]);
|
|
8385
|
+
return this.createTransaction({
|
|
8386
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8387
|
+
options
|
|
8388
|
+
});
|
|
8389
|
+
}
|
|
8390
|
+
/**
|
|
8391
|
+
* Returns a Safe transaction that calls removeSupportedInterfaceBatch on the ExtensibleFallbackHandler.
|
|
8392
|
+
* Atomically un-registers an interface and removes the given method handlers in a single call.
|
|
8393
|
+
* Only available for Safe >= v1.5.0.
|
|
8394
|
+
*
|
|
8395
|
+
* @param interfaceId - 4-byte ERC-165 interface ID to remove
|
|
8396
|
+
* @param selectors - Array of 4-byte function selectors to un-register
|
|
8397
|
+
* @param options - Optional Safe transaction properties
|
|
8398
|
+
* @returns The Safe transaction ready to be signed
|
|
8399
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8400
|
+
*/
|
|
8401
|
+
async createRemoveSupportedInterfaceBatchTx(interfaceId, selectors, options) {
|
|
8402
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8403
|
+
const safeAddress = await this.getAddress();
|
|
8404
|
+
const data = efhContract.encode("removeSupportedInterfaceBatch", [
|
|
8405
|
+
interfaceId,
|
|
8406
|
+
selectors
|
|
8407
|
+
]);
|
|
8408
|
+
return this.createTransaction({
|
|
8409
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8410
|
+
options
|
|
8411
|
+
});
|
|
8412
|
+
}
|
|
7104
8413
|
/**
|
|
7105
8414
|
* Returns the Safe transaction to enable a Safe guard.
|
|
7106
8415
|
*
|
|
@@ -7143,6 +8452,48 @@ var Safe = class _Safe {
|
|
|
7143
8452
|
});
|
|
7144
8453
|
return safeTransaction;
|
|
7145
8454
|
}
|
|
8455
|
+
/**
|
|
8456
|
+
* Returns the Safe transaction to enable a Safe module guard.
|
|
8457
|
+
*
|
|
8458
|
+
* @param moduleGuardAddress - The desired module guard address
|
|
8459
|
+
* @param options - The transaction optional properties
|
|
8460
|
+
* @returns The Safe transaction ready to be signed
|
|
8461
|
+
* @throws "Invalid module guard address provided"
|
|
8462
|
+
* @throws "Module guard provided is already enabled"
|
|
8463
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
8464
|
+
*/
|
|
8465
|
+
async createEnableModuleGuardTx(moduleGuardAddress, options) {
|
|
8466
|
+
const safeTransactionData = {
|
|
8467
|
+
to: await this.getAddress(),
|
|
8468
|
+
value: "0",
|
|
8469
|
+
data: await this.#moduleManager.encodeEnableModuleGuardData(moduleGuardAddress)
|
|
8470
|
+
};
|
|
8471
|
+
const safeTransaction = await this.createTransaction({
|
|
8472
|
+
transactions: [safeTransactionData],
|
|
8473
|
+
options
|
|
8474
|
+
});
|
|
8475
|
+
return safeTransaction;
|
|
8476
|
+
}
|
|
8477
|
+
/**
|
|
8478
|
+
* Returns the Safe transaction to disable a Safe module guard.
|
|
8479
|
+
*
|
|
8480
|
+
* @param options - The transaction optional properties
|
|
8481
|
+
* @returns The Safe transaction ready to be signed
|
|
8482
|
+
* @throws "There is no module guard enabled yet"
|
|
8483
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
8484
|
+
*/
|
|
8485
|
+
async createDisableModuleGuardTx(options) {
|
|
8486
|
+
const safeTransactionData = {
|
|
8487
|
+
to: await this.getAddress(),
|
|
8488
|
+
value: "0",
|
|
8489
|
+
data: await this.#moduleManager.encodeDisableModuleGuardData()
|
|
8490
|
+
};
|
|
8491
|
+
const safeTransaction = await this.createTransaction({
|
|
8492
|
+
transactions: [safeTransactionData],
|
|
8493
|
+
options
|
|
8494
|
+
});
|
|
8495
|
+
return safeTransaction;
|
|
8496
|
+
}
|
|
7146
8497
|
/**
|
|
7147
8498
|
* Returns the Safe transaction to enable a Safe module.
|
|
7148
8499
|
*
|
|
@@ -7655,7 +9006,7 @@ var Safe = class _Safe {
|
|
|
7655
9006
|
/**
|
|
7656
9007
|
* This method creates a signer to be used with the init method
|
|
7657
9008
|
* @param {Credential} credential - The credential to be used to create the signer. Can be generated in the web with navigator.credentials.create
|
|
7658
|
-
* @returns {
|
|
9009
|
+
* @returns {ExtractedPasskeyData} - The extracted passkey data. Combine with a verifierAddress to build a PasskeyArgType.
|
|
7659
9010
|
*/
|
|
7660
9011
|
this.createPasskeySigner = async (credential) => {
|
|
7661
9012
|
return extractPasskeyData(credential);
|
|
@@ -7733,6 +9084,7 @@ export {
|
|
|
7733
9084
|
buildSignatureBytes,
|
|
7734
9085
|
createERC20TokenTransferTransaction,
|
|
7735
9086
|
createPasskeyClient,
|
|
9087
|
+
decodeMultiSendData,
|
|
7736
9088
|
src_default as default,
|
|
7737
9089
|
encodeCreateProxyWithNonce,
|
|
7738
9090
|
encodeMultiSendData,
|
|
@@ -7751,8 +9103,10 @@ export {
|
|
|
7751
9103
|
getERC20Decimals,
|
|
7752
9104
|
getEip712MessageTypes,
|
|
7753
9105
|
getEip712TxTypes,
|
|
9106
|
+
getExtensibleFallbackHandlerContract,
|
|
7754
9107
|
getMultiSendCallOnlyContract,
|
|
7755
9108
|
getMultiSendContract,
|
|
9109
|
+
getP256VerifierAddress,
|
|
7756
9110
|
getPasskeyOwnerAddress_default as getPasskeyOwnerAddress,
|
|
7757
9111
|
getPredictedSafeAddressInitCode,
|
|
7758
9112
|
getSafeAddressFromDeploymentTx,
|