@safe-global/protocol-kit 6.1.2 → 7.1.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 +1498 -198
- package/dist/cjs/test-utils/index.cjs +584 -73
- package/dist/esm/src/index.mjs +1462 -143
- package/dist/esm/test-utils/index.mjs +566 -36
- 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 +6 -4
- 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/eip-3770/index.d.ts +1 -0
- package/dist/src/utils/eip-3770/index.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 +10 -7
- 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,
|
|
@@ -268,7 +284,7 @@ var networks = [
|
|
|
268
284
|
{ chainId: 255n, shortName: "kroma" },
|
|
269
285
|
{ chainId: 274n, shortName: "lachain" },
|
|
270
286
|
{ chainId: 280n, shortName: "zksync-goerli" },
|
|
271
|
-
{ chainId: 282n, shortName: "zkTCRO" },
|
|
287
|
+
{ chainId: 282n, shortName: "deprecated-zkTCRO" },
|
|
272
288
|
{ chainId: 288n, shortName: "boba" },
|
|
273
289
|
{ chainId: 291n, shortName: "orderly" },
|
|
274
290
|
{ chainId: 295n, shortName: "hedera-mainnet" },
|
|
@@ -301,6 +317,8 @@ var networks = [
|
|
|
301
317
|
{ chainId: 690n, shortName: "redstone" },
|
|
302
318
|
{ chainId: 698n, shortName: "Matchain" },
|
|
303
319
|
{ chainId: 747n, shortName: "flow-mainnet" },
|
|
320
|
+
{ chainId: 756n, shortName: "capx-testnet" },
|
|
321
|
+
{ chainId: 757n, shortName: "capx" },
|
|
304
322
|
{ chainId: 787n, shortName: "aca" },
|
|
305
323
|
{ chainId: 841n, shortName: "tara" },
|
|
306
324
|
{ chainId: 842n, shortName: "taratest" },
|
|
@@ -346,6 +364,7 @@ var networks = [
|
|
|
346
364
|
{ chainId: 1559n, shortName: "tenet" },
|
|
347
365
|
{ chainId: 1625n, shortName: "gravity" },
|
|
348
366
|
{ chainId: 1663n, shortName: "Gobi" },
|
|
367
|
+
{ chainId: 1672n, shortName: "pharos" },
|
|
349
368
|
{ chainId: 1729n, shortName: "reya" },
|
|
350
369
|
{ chainId: 1740n, shortName: "metall2-testnet" },
|
|
351
370
|
{ chainId: 1750n, shortName: "metall2" },
|
|
@@ -383,9 +402,12 @@ var networks = [
|
|
|
383
402
|
{ chainId: 2442n, shortName: "zkevm-testnet-cardona" },
|
|
384
403
|
{ chainId: 2522n, shortName: "fraxtal-testnet" },
|
|
385
404
|
{ chainId: 2741n, shortName: "abstract" },
|
|
405
|
+
{ chainId: 2787n, shortName: "creator-chain-mainnet" },
|
|
386
406
|
{ chainId: 2810n, shortName: "hmorph" },
|
|
387
407
|
{ chainId: 2818n, shortName: "morph" },
|
|
408
|
+
{ chainId: 2910n, shortName: "morph-hoodi-testnet" },
|
|
388
409
|
{ chainId: 3068n, shortName: "bfc" },
|
|
410
|
+
{ chainId: 3111n, shortName: "alpha" },
|
|
389
411
|
{ chainId: 3338n, shortName: "PEAQ" },
|
|
390
412
|
{ chainId: 3501n, shortName: "JFIN" },
|
|
391
413
|
{ chainId: 3636n, shortName: "BTNXt" },
|
|
@@ -396,14 +418,17 @@ var networks = [
|
|
|
396
418
|
{ chainId: 4061n, shortName: "Nahmii3Mainnet" },
|
|
397
419
|
{ chainId: 4062n, shortName: "Nahmii3Testnet" },
|
|
398
420
|
{ chainId: 4078n, shortName: "muster" },
|
|
421
|
+
{ chainId: 4153n, shortName: "rise" },
|
|
399
422
|
{ chainId: 4157n, shortName: "crossfi-testnet" },
|
|
400
423
|
{ chainId: 4158n, shortName: "crossfi" },
|
|
401
424
|
{ chainId: 4162n, shortName: "SXR" },
|
|
402
425
|
{ chainId: 4202n, shortName: "lisksep" },
|
|
426
|
+
{ chainId: 4217n, shortName: "tempo" },
|
|
403
427
|
{ chainId: 4326n, shortName: "megaeth" },
|
|
404
428
|
{ chainId: 4337n, shortName: "beam" },
|
|
405
429
|
{ chainId: 4460n, shortName: "orderlyl2" },
|
|
406
430
|
{ chainId: 4488n, shortName: "HYDRA" },
|
|
431
|
+
{ chainId: 4509n, shortName: "SC" },
|
|
407
432
|
{ chainId: 4653n, shortName: "gold" },
|
|
408
433
|
{ chainId: 4661n, shortName: "appchaintestnet" },
|
|
409
434
|
{ chainId: 4689n, shortName: "iotex-mainnet" },
|
|
@@ -439,13 +464,18 @@ var networks = [
|
|
|
439
464
|
{ chainId: 7070n, shortName: "planq" },
|
|
440
465
|
{ chainId: 7171n, shortName: "bitrock" },
|
|
441
466
|
{ chainId: 7200n, shortName: "xsat" },
|
|
467
|
+
{ chainId: 7208n, shortName: "nxra-mainnet" },
|
|
442
468
|
{ chainId: 7332n, shortName: "EON" },
|
|
469
|
+
{ chainId: 7336n, shortName: "pruvtestnet" },
|
|
470
|
+
{ chainId: 7337n, shortName: "pruvmainnet" },
|
|
443
471
|
{ chainId: 7341n, shortName: "shyft" },
|
|
444
472
|
{ chainId: 7560n, shortName: "cyeth" },
|
|
445
473
|
{ chainId: 7700n, shortName: "canto" },
|
|
446
474
|
{ chainId: 7771n, shortName: "tbitrock" },
|
|
447
475
|
{ chainId: 7897n, shortName: "arena-z" },
|
|
476
|
+
{ chainId: 7979n, shortName: "dos" },
|
|
448
477
|
{ chainId: 8008n, shortName: "polynomial" },
|
|
478
|
+
{ chainId: 8150n, shortName: "alpen" },
|
|
449
479
|
{ chainId: 8192n, shortName: "tqf" },
|
|
450
480
|
{ chainId: 8194n, shortName: "ttqf" },
|
|
451
481
|
{ chainId: 8217n, shortName: "kaia-mainnet" },
|
|
@@ -454,6 +484,7 @@ var networks = [
|
|
|
454
484
|
{ chainId: 8408n, shortName: "zentest" },
|
|
455
485
|
{ chainId: 8453n, shortName: "base" },
|
|
456
486
|
{ chainId: 8700n, shortName: "ACN" },
|
|
487
|
+
{ chainId: 8765n, shortName: "ward" },
|
|
457
488
|
{ chainId: 8801n, shortName: "okto-testnet" },
|
|
458
489
|
{ chainId: 8822n, shortName: "iotaevm" },
|
|
459
490
|
{ chainId: 8844n, shortName: "THYDRA" },
|
|
@@ -479,6 +510,7 @@ var networks = [
|
|
|
479
510
|
{ chainId: 11111n, shortName: "WAGMI" },
|
|
480
511
|
{ chainId: 11124n, shortName: "abstract-sepolia" },
|
|
481
512
|
{ chainId: 11235n, shortName: "islm" },
|
|
513
|
+
{ chainId: 11417n, shortName: "anq-testnet" },
|
|
482
514
|
{ chainId: 11437n, shortName: "shyftt" },
|
|
483
515
|
{ chainId: 11501n, shortName: "bevm" },
|
|
484
516
|
{ chainId: 11503n, shortName: "bevm-test" },
|
|
@@ -490,6 +522,7 @@ var networks = [
|
|
|
490
522
|
{ chainId: 12553n, shortName: "rss3" },
|
|
491
523
|
{ chainId: 13337n, shortName: "beam-testnet" },
|
|
492
524
|
{ chainId: 13371n, shortName: "imx" },
|
|
525
|
+
{ chainId: 13441n, shortName: "bridgeless" },
|
|
493
526
|
{ chainId: 13473n, shortName: "imx-testnet" },
|
|
494
527
|
{ chainId: 13505n, shortName: "gravitysep" },
|
|
495
528
|
{ chainId: 13746n, shortName: "g7t" },
|
|
@@ -508,11 +541,14 @@ var networks = [
|
|
|
508
541
|
{ chainId: 23295n, shortName: "sapphire-testnet" },
|
|
509
542
|
{ chainId: 24101n, shortName: "incentiv" },
|
|
510
543
|
{ chainId: 25327n, shortName: "Everclear" },
|
|
544
|
+
{ chainId: 25363n, shortName: "fluent" },
|
|
511
545
|
{ chainId: 26888n, shortName: "tABCore" },
|
|
512
546
|
{ chainId: 28802n, shortName: "tcent" },
|
|
513
547
|
{ chainId: 28882n, shortName: "BobaSepolia" },
|
|
514
548
|
{ chainId: 28979n, shortName: "kimbonet-testnet" },
|
|
515
|
-
{ chainId:
|
|
549
|
+
{ chainId: 30303n, shortName: "Ethiq" },
|
|
550
|
+
{ chainId: 31611n, shortName: "mezo-testnet" },
|
|
551
|
+
{ chainId: 31612n, shortName: "mezo" },
|
|
516
552
|
{ chainId: 32323n, shortName: "basedai" },
|
|
517
553
|
{ chainId: 32380n, shortName: "paix" },
|
|
518
554
|
{ chainId: 32769n, shortName: "zil" },
|
|
@@ -525,6 +561,7 @@ var networks = [
|
|
|
525
561
|
{ chainId: 35441n, shortName: "q" },
|
|
526
562
|
{ chainId: 35443n, shortName: "q-testnet" },
|
|
527
563
|
{ chainId: 36888n, shortName: "abcore" },
|
|
564
|
+
{ chainId: 36900n, shortName: "adi" },
|
|
528
565
|
{ chainId: 37111n, shortName: "lens-sepolia" },
|
|
529
566
|
{ chainId: 41455n, shortName: "aleph-zero" },
|
|
530
567
|
{ chainId: 41923n, shortName: "edu-chain" },
|
|
@@ -532,6 +569,7 @@ var networks = [
|
|
|
532
569
|
{ chainId: 42170n, shortName: "arb-nova" },
|
|
533
570
|
{ chainId: 42220n, shortName: "celo" },
|
|
534
571
|
{ chainId: 42421n, shortName: "rwa" },
|
|
572
|
+
{ chainId: 42431n, shortName: "tempo-moderato" },
|
|
535
573
|
{ chainId: 42793n, shortName: "etlk" },
|
|
536
574
|
{ chainId: 43111n, shortName: "hemi" },
|
|
537
575
|
{ chainId: 43113n, shortName: "fuji" },
|
|
@@ -549,6 +587,7 @@ var networks = [
|
|
|
549
587
|
{ chainId: 49321n, shortName: "Stork" },
|
|
550
588
|
{ chainId: 50104n, shortName: "sophon" },
|
|
551
589
|
{ chainId: 50312n, shortName: "SomniaTestnet" },
|
|
590
|
+
{ chainId: 52924n, shortName: "lazai" },
|
|
552
591
|
{ chainId: 53302n, shortName: "seedsep" },
|
|
553
592
|
{ chainId: 53456n, shortName: "birdlayer" },
|
|
554
593
|
{ chainId: 53457n, shortName: "dodochain" },
|
|
@@ -583,6 +622,8 @@ var networks = [
|
|
|
583
622
|
{ chainId: 84532n, shortName: "basesep" },
|
|
584
623
|
{ chainId: 88811n, shortName: "unit0-mainnet" },
|
|
585
624
|
{ chainId: 88817n, shortName: "unit0-testnet" },
|
|
625
|
+
{ chainId: 88882n, shortName: "chzspicy" },
|
|
626
|
+
{ chainId: 88888n, shortName: "chiliz" },
|
|
586
627
|
{ chainId: 90001n, shortName: "dhobyghaut" },
|
|
587
628
|
{ chainId: 91342n, shortName: "giwasepolia" },
|
|
588
629
|
{ chainId: 97435n, shortName: "sling" },
|
|
@@ -590,7 +631,9 @@ var networks = [
|
|
|
590
631
|
{ chainId: 98865n, shortName: "plume" },
|
|
591
632
|
{ chainId: 98866n, shortName: "plume-mainnet" },
|
|
592
633
|
{ chainId: 98867n, shortName: "plume-testnet" },
|
|
634
|
+
{ chainId: 98875n, shortName: "nil" },
|
|
593
635
|
{ chainId: 98985n, shortName: "superposition-testnet" },
|
|
636
|
+
{ chainId: 102030n, shortName: "ctc" },
|
|
594
637
|
{ chainId: 103454n, shortName: "masatest" },
|
|
595
638
|
{ chainId: 105105n, shortName: "stratis" },
|
|
596
639
|
{ chainId: 111188n, shortName: "re-al" },
|
|
@@ -599,6 +642,7 @@ var networks = [
|
|
|
599
642
|
{ chainId: 167000n, shortName: "tko-mainnet" },
|
|
600
643
|
{ chainId: 167008n, shortName: "tko-katla" },
|
|
601
644
|
{ chainId: 167009n, shortName: "tko-hekla" },
|
|
645
|
+
{ chainId: 167013n, shortName: "tko-hoodi" },
|
|
602
646
|
{ chainId: 175188n, shortName: "lpy" },
|
|
603
647
|
{ chainId: 181228n, shortName: "hpp-sepolia" },
|
|
604
648
|
{ chainId: 190415n, shortName: "hpp-mainnet" },
|
|
@@ -609,16 +653,19 @@ var networks = [
|
|
|
609
653
|
{ chainId: 205205n, shortName: "auroria" },
|
|
610
654
|
{ chainId: 210425n, shortName: "platon" },
|
|
611
655
|
{ chainId: 222888n, shortName: "mocat" },
|
|
656
|
+
{ chainId: 278701n, shortName: "creator-chain-testnet" },
|
|
612
657
|
{ chainId: 314159n, shortName: "filecoin-calibration" },
|
|
613
658
|
{ chainId: 325000n, shortName: "CampV2" },
|
|
614
659
|
{ chainId: 328527n, shortName: "nal" },
|
|
615
660
|
{ chainId: 333999n, shortName: "olympus" },
|
|
661
|
+
{ chainId: 369369n, shortName: "den-mainnet" },
|
|
616
662
|
{ chainId: 381931n, shortName: "metal" },
|
|
617
663
|
{ chainId: 421611n, shortName: "arb-rinkeby" },
|
|
618
664
|
{ chainId: 421613n, shortName: "arb-goerli" },
|
|
619
665
|
{ chainId: 421614n, shortName: "arb-sep" },
|
|
620
666
|
{ chainId: 444444n, shortName: "syndr" },
|
|
621
667
|
{ chainId: 490000n, shortName: "ATN" },
|
|
668
|
+
{ chainId: 511111n, shortName: "alpha-testnet" },
|
|
622
669
|
{ chainId: 534351n, shortName: "scr-sepolia" },
|
|
623
670
|
{ chainId: 534352n, shortName: "scr" },
|
|
624
671
|
{ chainId: 534353n, shortName: "scr-alpha" },
|
|
@@ -642,6 +689,7 @@ var networks = [
|
|
|
642
689
|
{ chainId: 808813n, shortName: "bob-sepolia" },
|
|
643
690
|
{ chainId: 810180n, shortName: "zklink-nova" },
|
|
644
691
|
{ chainId: 839999n, shortName: "txsat" },
|
|
692
|
+
{ chainId: 853211n, shortName: "haqq-testethiq" },
|
|
645
693
|
{ chainId: 978657n, shortName: "treasure-ruby" },
|
|
646
694
|
{ chainId: 984122n, shortName: "forma" },
|
|
647
695
|
{ chainId: 1000101n, shortName: "xo" },
|
|
@@ -652,8 +700,10 @@ var networks = [
|
|
|
652
700
|
{ chainId: 2632500n, shortName: "coti" },
|
|
653
701
|
{ chainId: 3441006n, shortName: "mantaSepoliaTestnet" },
|
|
654
702
|
{ chainId: 4457845n, shortName: "zero-sepolia" },
|
|
703
|
+
{ chainId: 5042002n, shortName: "arc-testnet" },
|
|
655
704
|
{ chainId: 5064014n, shortName: "ethereal" },
|
|
656
705
|
{ chainId: 6038361n, shortName: "azkyt" },
|
|
706
|
+
{ chainId: 6281971n, shortName: "dogeos-chykyu" },
|
|
657
707
|
{ chainId: 6985385n, shortName: "hp" },
|
|
658
708
|
{ chainId: 7225878n, shortName: "saakuru" },
|
|
659
709
|
{ chainId: 7777777n, shortName: "zora" },
|
|
@@ -665,6 +715,7 @@ var networks = [
|
|
|
665
715
|
{ chainId: 12227332n, shortName: "neox-t4" },
|
|
666
716
|
{ chainId: 13374202n, shortName: "ethereal-testnet-0" },
|
|
667
717
|
{ chainId: 13863860n, shortName: "sis" },
|
|
718
|
+
{ chainId: 20250407n, shortName: "platondev3" },
|
|
668
719
|
{ chainId: 21000000n, shortName: "corn" },
|
|
669
720
|
{ chainId: 52164803n, shortName: "fluence-testnet" },
|
|
670
721
|
{ chainId: 65100004n, shortName: "piccadilly-04" },
|
|
@@ -696,8 +747,10 @@ var networks = [
|
|
|
696
747
|
{ chainId: 1666700000n, shortName: "hmy-b-s0" },
|
|
697
748
|
{ chainId: 1952959480n, shortName: "lumiatestnet" },
|
|
698
749
|
{ chainId: 2030232745n, shortName: "lumia-beam-testnet" },
|
|
750
|
+
{ chainId: 3735928814n, shortName: "edent" },
|
|
699
751
|
{ chainId: 11297108099n, shortName: "tpalm" },
|
|
700
752
|
{ chainId: 11297108109n, shortName: "palm" },
|
|
753
|
+
{ chainId: 30143370385n, shortName: "BUB" },
|
|
701
754
|
{ chainId: 37714555429n, shortName: "xaitestnet" },
|
|
702
755
|
{ chainId: 88153591557n, shortName: "arb-blueberry" },
|
|
703
756
|
{ chainId: 123420000220n, shortName: "fluence-stage" },
|
|
@@ -724,6 +777,13 @@ function getEip3770NetworkPrefixFromChainId(chainId) {
|
|
|
724
777
|
}
|
|
725
778
|
return network.shortName;
|
|
726
779
|
}
|
|
780
|
+
function getChainIdFromEip3770NetworkPrefix(prefix) {
|
|
781
|
+
const network = networks.find(({ shortName }) => shortName === prefix);
|
|
782
|
+
if (!network) {
|
|
783
|
+
throw new Error("No chainId found for the given network prefix");
|
|
784
|
+
}
|
|
785
|
+
return network.chainId;
|
|
786
|
+
}
|
|
727
787
|
function isValidEip3770NetworkPrefix(prefix) {
|
|
728
788
|
return networks.some(({ shortName }) => shortName === prefix);
|
|
729
789
|
}
|
|
@@ -1037,6 +1097,19 @@ function generateTypedData({
|
|
|
1037
1097
|
|
|
1038
1098
|
// src/utils/safeVersions.ts
|
|
1039
1099
|
import semverSatisfies2 from "semver/functions/satisfies.js";
|
|
1100
|
+
var SafeFeature = /* @__PURE__ */ ((SafeFeature2) => {
|
|
1101
|
+
SafeFeature2["SAFE_TX_GAS_OPTIONAL"] = "SAFE_TX_GAS_OPTIONAL";
|
|
1102
|
+
SafeFeature2["SAFE_TX_GUARDS"] = "SAFE_TX_GUARDS";
|
|
1103
|
+
SafeFeature2["SAFE_FALLBACK_HANDLER"] = "SAFE_FALLBACK_HANDLER";
|
|
1104
|
+
SafeFeature2["ETH_SIGN"] = "ETH_SIGN";
|
|
1105
|
+
SafeFeature2["ACCOUNT_ABSTRACTION"] = "ACCOUNT_ABSTRACTION";
|
|
1106
|
+
SafeFeature2["REQUIRED_TXGAS"] = "REQUIRED_TXGAS";
|
|
1107
|
+
SafeFeature2["SIMULATE_AND_REVERT"] = "SIMULATE_AND_REVERT";
|
|
1108
|
+
SafeFeature2["PASSKEY_SIGNER"] = "PASSKEY_SIGNER";
|
|
1109
|
+
SafeFeature2["SAFE_L2_CONTRACTS"] = "SAFE_L2_CONTRACTS";
|
|
1110
|
+
SafeFeature2["SAFE_MODULE_GUARD"] = "SAFE_MODULE_GUARD";
|
|
1111
|
+
return SafeFeature2;
|
|
1112
|
+
})(SafeFeature || {});
|
|
1040
1113
|
var SAFE_FEATURES_BY_VERSION = {
|
|
1041
1114
|
["SAFE_TX_GAS_OPTIONAL" /* SAFE_TX_GAS_OPTIONAL */]: ">=1.3.0",
|
|
1042
1115
|
["SAFE_TX_GUARDS" /* SAFE_TX_GUARDS */]: ">=1.3.0",
|
|
@@ -1046,7 +1119,8 @@ var SAFE_FEATURES_BY_VERSION = {
|
|
|
1046
1119
|
["REQUIRED_TXGAS" /* REQUIRED_TXGAS */]: "<=1.2.0",
|
|
1047
1120
|
["SIMULATE_AND_REVERT" /* SIMULATE_AND_REVERT */]: ">=1.3.0",
|
|
1048
1121
|
["PASSKEY_SIGNER" /* PASSKEY_SIGNER */]: ">=1.3.0",
|
|
1049
|
-
["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0"
|
|
1122
|
+
["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0",
|
|
1123
|
+
["SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */]: ">=1.5.0"
|
|
1050
1124
|
};
|
|
1051
1125
|
var hasSafeFeature = (feature, version) => {
|
|
1052
1126
|
if (!(feature in SAFE_FEATURES_BY_VERSION)) {
|
|
@@ -1511,6 +1585,58 @@ var CreateCallContract_v1_4_1 = class extends CreateCallBaseContract_default {
|
|
|
1511
1585
|
};
|
|
1512
1586
|
var CreateCallContract_v1_4_1_default = CreateCallContract_v1_4_1;
|
|
1513
1587
|
|
|
1588
|
+
// src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.ts
|
|
1589
|
+
import {
|
|
1590
|
+
createCall_1_5_0_ContractArtifacts
|
|
1591
|
+
} from "@safe-global/types-kit";
|
|
1592
|
+
var CreateCallContract_v1_5_0 = class extends CreateCallBaseContract_default {
|
|
1593
|
+
/**
|
|
1594
|
+
* Constructs an instance of CreateCallContract_v1_5_0
|
|
1595
|
+
*
|
|
1596
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1597
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1598
|
+
* @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.
|
|
1599
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1600
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1601
|
+
*/
|
|
1602
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1603
|
+
const safeVersion = "1.5.0";
|
|
1604
|
+
const defaultAbi = createCall_1_5_0_ContractArtifacts.abi;
|
|
1605
|
+
super(
|
|
1606
|
+
chainId,
|
|
1607
|
+
safeProvider,
|
|
1608
|
+
defaultAbi,
|
|
1609
|
+
safeVersion,
|
|
1610
|
+
customContractAddress,
|
|
1611
|
+
customContractAbi,
|
|
1612
|
+
deploymentType
|
|
1613
|
+
);
|
|
1614
|
+
/**
|
|
1615
|
+
* @param args - Array[value, deploymentData]
|
|
1616
|
+
* @param options - TransactionOptions
|
|
1617
|
+
* @returns Promise<TransactionResult>
|
|
1618
|
+
*/
|
|
1619
|
+
this.performCreate = async (args, options) => {
|
|
1620
|
+
if (options && !options.gasLimit) {
|
|
1621
|
+
options.gasLimit = (await this.estimateGas("performCreate", args, options)).toString();
|
|
1622
|
+
}
|
|
1623
|
+
return toTxResult(this.runner, await this.write("performCreate", args, options), options);
|
|
1624
|
+
};
|
|
1625
|
+
/**
|
|
1626
|
+
* @param args - Array[value, deploymentData, salt]
|
|
1627
|
+
* @param options - TransactionOptions
|
|
1628
|
+
* @returns Promise<TransactionResult>
|
|
1629
|
+
*/
|
|
1630
|
+
this.performCreate2 = async (args, options) => {
|
|
1631
|
+
if (options && !options.gasLimit) {
|
|
1632
|
+
options.gasLimit = (await this.estimateGas("performCreate2", [...args], { ...options })).toString();
|
|
1633
|
+
}
|
|
1634
|
+
return toTxResult(this.runner, await this.write("performCreate2", args, options), options);
|
|
1635
|
+
};
|
|
1636
|
+
}
|
|
1637
|
+
};
|
|
1638
|
+
var CreateCallContract_v1_5_0_default = CreateCallContract_v1_5_0;
|
|
1639
|
+
|
|
1514
1640
|
// src/contracts/MultiSend/MultiSendBaseContract.ts
|
|
1515
1641
|
var MultiSendBaseContract = class extends BaseContract_default {
|
|
1516
1642
|
/**
|
|
@@ -1632,6 +1758,36 @@ var MultiSendContract_v1_4_1 = class extends MultiSendBaseContract_default {
|
|
|
1632
1758
|
};
|
|
1633
1759
|
var MultiSendContract_v1_4_1_default = MultiSendContract_v1_4_1;
|
|
1634
1760
|
|
|
1761
|
+
// src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.ts
|
|
1762
|
+
import {
|
|
1763
|
+
multisend_1_5_0_ContractArtifacts
|
|
1764
|
+
} from "@safe-global/types-kit";
|
|
1765
|
+
var MultiSendContract_v1_5_0 = class extends MultiSendBaseContract_default {
|
|
1766
|
+
/**
|
|
1767
|
+
* Constructs an instance of MultiSendContract_v1_5_0
|
|
1768
|
+
*
|
|
1769
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1770
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1771
|
+
* @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.
|
|
1772
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1773
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1774
|
+
*/
|
|
1775
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1776
|
+
const safeVersion = "1.5.0";
|
|
1777
|
+
const defaultAbi = multisend_1_5_0_ContractArtifacts.abi;
|
|
1778
|
+
super(
|
|
1779
|
+
chainId,
|
|
1780
|
+
safeProvider,
|
|
1781
|
+
defaultAbi,
|
|
1782
|
+
safeVersion,
|
|
1783
|
+
customContractAddress,
|
|
1784
|
+
customContractAbi,
|
|
1785
|
+
deploymentType
|
|
1786
|
+
);
|
|
1787
|
+
}
|
|
1788
|
+
};
|
|
1789
|
+
var MultiSendContract_v1_5_0_default = MultiSendContract_v1_5_0;
|
|
1790
|
+
|
|
1635
1791
|
// src/contracts/MultiSend/MultiSendCallOnlyBaseContract.ts
|
|
1636
1792
|
var MultiSendCallOnlyBaseContract = class extends BaseContract_default {
|
|
1637
1793
|
/**
|
|
@@ -1723,6 +1879,36 @@ var MultiSendCallOnlyContract_v1_4_1 = class extends MultiSendCallOnlyBaseContra
|
|
|
1723
1879
|
};
|
|
1724
1880
|
var MultiSendCallOnlyContract_v1_4_1_default = MultiSendCallOnlyContract_v1_4_1;
|
|
1725
1881
|
|
|
1882
|
+
// src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.ts
|
|
1883
|
+
import {
|
|
1884
|
+
multiSendCallOnly_1_5_0_ContractArtifacts
|
|
1885
|
+
} from "@safe-global/types-kit";
|
|
1886
|
+
var MultiSendCallOnlyContract_v1_5_0 = class extends MultiSendCallOnlyBaseContract_default {
|
|
1887
|
+
/**
|
|
1888
|
+
* Constructs an instance of MultiSendCallOnlyContract_v1_5_0
|
|
1889
|
+
*
|
|
1890
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1891
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1892
|
+
* @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.
|
|
1893
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1894
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1895
|
+
*/
|
|
1896
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1897
|
+
const safeVersion = "1.5.0";
|
|
1898
|
+
const defaultAbi = multiSendCallOnly_1_5_0_ContractArtifacts.abi;
|
|
1899
|
+
super(
|
|
1900
|
+
chainId,
|
|
1901
|
+
safeProvider,
|
|
1902
|
+
defaultAbi,
|
|
1903
|
+
safeVersion,
|
|
1904
|
+
customContractAddress,
|
|
1905
|
+
customContractAbi,
|
|
1906
|
+
deploymentType
|
|
1907
|
+
);
|
|
1908
|
+
}
|
|
1909
|
+
};
|
|
1910
|
+
var MultiSendCallOnlyContract_v1_5_0_default = MultiSendCallOnlyContract_v1_5_0;
|
|
1911
|
+
|
|
1726
1912
|
// src/contracts/SignMessageLib/SignMessageLibBaseContract.ts
|
|
1727
1913
|
var SignMessageLibBaseContract = class extends BaseContract_default {
|
|
1728
1914
|
/**
|
|
@@ -1844,6 +2030,51 @@ var SignMessageLibContract_v1_4_1 = class extends SignMessageLibBaseContract_def
|
|
|
1844
2030
|
};
|
|
1845
2031
|
var SignMessageLibContract_v1_4_1_default = SignMessageLibContract_v1_4_1;
|
|
1846
2032
|
|
|
2033
|
+
// src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.ts
|
|
2034
|
+
import {
|
|
2035
|
+
signMessageLib_1_5_0_ContractArtifacts
|
|
2036
|
+
} from "@safe-global/types-kit";
|
|
2037
|
+
var SignMessageLibContract_v1_5_0 = class extends SignMessageLibBaseContract_default {
|
|
2038
|
+
/**
|
|
2039
|
+
* Constructs an instance of SignMessageLibContract_v1_5_0
|
|
2040
|
+
*
|
|
2041
|
+
* @param chainId - The chain ID where the contract resides.
|
|
2042
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
2043
|
+
* @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.
|
|
2044
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
2045
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
2046
|
+
*/
|
|
2047
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
2048
|
+
const safeVersion = "1.5.0";
|
|
2049
|
+
const defaultAbi = signMessageLib_1_5_0_ContractArtifacts.abi;
|
|
2050
|
+
super(
|
|
2051
|
+
chainId,
|
|
2052
|
+
safeProvider,
|
|
2053
|
+
defaultAbi,
|
|
2054
|
+
safeVersion,
|
|
2055
|
+
customContractAddress,
|
|
2056
|
+
customContractAbi,
|
|
2057
|
+
deploymentType
|
|
2058
|
+
);
|
|
2059
|
+
/**
|
|
2060
|
+
* @param args - Array[message]
|
|
2061
|
+
*/
|
|
2062
|
+
this.getMessageHash = async (args) => {
|
|
2063
|
+
return [await this.read("getMessageHash", args)];
|
|
2064
|
+
};
|
|
2065
|
+
/**
|
|
2066
|
+
* @param args - Array[data]
|
|
2067
|
+
*/
|
|
2068
|
+
this.signMessage = async (data, options) => {
|
|
2069
|
+
if (options && !options.gasLimit) {
|
|
2070
|
+
options.gasLimit = Number(await this.estimateGas("signMessage", data, { ...options }));
|
|
2071
|
+
}
|
|
2072
|
+
return toTxResult(this.runner, await this.write("signMessage", data, options), options);
|
|
2073
|
+
};
|
|
2074
|
+
}
|
|
2075
|
+
};
|
|
2076
|
+
var SignMessageLibContract_v1_5_0_default = SignMessageLibContract_v1_5_0;
|
|
2077
|
+
|
|
1847
2078
|
// src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.ts
|
|
1848
2079
|
import { simulateContract } from "viem/actions";
|
|
1849
2080
|
|
|
@@ -3049,7 +3280,7 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
3049
3280
|
return [await this.read("getOwners")];
|
|
3050
3281
|
};
|
|
3051
3282
|
/**
|
|
3052
|
-
* Reads `length` bytes of storage in the
|
|
3283
|
+
* Reads `length` bytes of storage in the current contract
|
|
3053
3284
|
* @param args - Array[offset, length]
|
|
3054
3285
|
* @returns Array[storage]
|
|
3055
3286
|
*/
|
|
@@ -3232,133 +3463,457 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
3232
3463
|
};
|
|
3233
3464
|
var SafeContract_v1_4_1_default = SafeContract_v1_4_1;
|
|
3234
3465
|
|
|
3235
|
-
// src/contracts/
|
|
3236
|
-
|
|
3237
|
-
/**
|
|
3238
|
-
* @constructor
|
|
3239
|
-
* Constructs an instance of SafeProxyFactoryBaseContract.
|
|
3240
|
-
*
|
|
3241
|
-
* @param chainId - The chain ID of the contract.
|
|
3242
|
-
* @param safeProvider - An instance of SafeProvider.
|
|
3243
|
-
* @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
|
|
3244
|
-
* @param safeVersion - The version of the Safe contract.
|
|
3245
|
-
* @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.
|
|
3246
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
3247
|
-
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3248
|
-
*/
|
|
3249
|
-
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3250
|
-
const contractName3 = "safeProxyFactoryVersion";
|
|
3251
|
-
super(
|
|
3252
|
-
contractName3,
|
|
3253
|
-
chainId,
|
|
3254
|
-
safeProvider,
|
|
3255
|
-
defaultAbi,
|
|
3256
|
-
safeVersion,
|
|
3257
|
-
customContractAddress,
|
|
3258
|
-
customContractAbi,
|
|
3259
|
-
deploymentType
|
|
3260
|
-
);
|
|
3261
|
-
this.contractName = contractName3;
|
|
3262
|
-
}
|
|
3263
|
-
};
|
|
3264
|
-
var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
|
|
3265
|
-
|
|
3266
|
-
// src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
|
|
3466
|
+
// src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.ts
|
|
3467
|
+
import { readContract, simulateContract as simulateContract6 } from "viem/actions";
|
|
3267
3468
|
import {
|
|
3268
|
-
|
|
3469
|
+
safe_1_5_0_ContractArtifacts
|
|
3269
3470
|
} from "@safe-global/types-kit";
|
|
3270
|
-
var
|
|
3471
|
+
var SafeContract_v1_5_0 = class extends SafeBaseContract_default {
|
|
3271
3472
|
/**
|
|
3272
|
-
* Constructs an instance of
|
|
3473
|
+
* Constructs an instance of SafeContract_v1_5_0
|
|
3273
3474
|
*
|
|
3274
3475
|
* @param chainId - The chain ID where the contract resides.
|
|
3275
3476
|
* @param safeProvider - An instance of SafeProvider.
|
|
3477
|
+
* @param isL1SafeSingleton - A flag indicating if the contract is a L1 Safe Singleton.
|
|
3276
3478
|
* @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.
|
|
3277
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.
|
|
3479
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
3278
3480
|
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3279
3481
|
*/
|
|
3280
|
-
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3281
|
-
const safeVersion = "1.
|
|
3282
|
-
const defaultAbi =
|
|
3482
|
+
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
3483
|
+
const safeVersion = "1.5.0";
|
|
3484
|
+
const defaultAbi = safe_1_5_0_ContractArtifacts.abi;
|
|
3283
3485
|
super(
|
|
3284
3486
|
chainId,
|
|
3285
3487
|
safeProvider,
|
|
3286
3488
|
defaultAbi,
|
|
3287
3489
|
safeVersion,
|
|
3490
|
+
isL1SafeSingleton,
|
|
3288
3491
|
customContractAddress,
|
|
3289
3492
|
customContractAbi,
|
|
3290
3493
|
deploymentType
|
|
3291
3494
|
);
|
|
3292
3495
|
/**
|
|
3293
|
-
*
|
|
3294
|
-
* @returns Array[creationCode]
|
|
3496
|
+
* @returns Array[safeContractVersion]
|
|
3295
3497
|
*/
|
|
3296
|
-
this.
|
|
3297
|
-
return [await this.read("
|
|
3498
|
+
this.VERSION = async () => {
|
|
3499
|
+
return [await this.read("VERSION")];
|
|
3298
3500
|
};
|
|
3299
3501
|
/**
|
|
3300
|
-
*
|
|
3301
|
-
* @returns Array[
|
|
3502
|
+
* @param args - Array[owner, txHash]
|
|
3503
|
+
* @returns Array[approvedHashes]
|
|
3302
3504
|
*/
|
|
3303
|
-
this.
|
|
3304
|
-
return [await this.read("
|
|
3505
|
+
this.approvedHashes = async (args) => {
|
|
3506
|
+
return [await this.read("approvedHashes", args)];
|
|
3305
3507
|
};
|
|
3306
3508
|
/**
|
|
3307
|
-
*
|
|
3308
|
-
*
|
|
3309
|
-
* @
|
|
3509
|
+
* Checks whether the signature provided is valid for the provided data, hash and number of required signatures.
|
|
3510
|
+
* Will revert otherwise.
|
|
3511
|
+
* @param args - Array[dataHash, data, signatures, requiredSignatures]
|
|
3512
|
+
* @returns Empty array
|
|
3310
3513
|
*/
|
|
3311
|
-
this.
|
|
3312
|
-
|
|
3514
|
+
this.checkNSignatures = async (args) => {
|
|
3515
|
+
await this.read("checkNSignatures", args);
|
|
3516
|
+
return [];
|
|
3313
3517
|
};
|
|
3314
3518
|
/**
|
|
3315
|
-
*
|
|
3316
|
-
*
|
|
3317
|
-
*
|
|
3519
|
+
* New in v1.5.0: overload of checkNSignatures that accepts an explicit executor address.
|
|
3520
|
+
* Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
|
|
3521
|
+
* Will revert otherwise.
|
|
3522
|
+
* @param args - Array[executor, dataHash, signatures, requiredSignatures]
|
|
3523
|
+
* @returns Empty array
|
|
3318
3524
|
*/
|
|
3319
|
-
this.
|
|
3320
|
-
|
|
3525
|
+
this.checkNSignaturesWithExecutor = async (args) => {
|
|
3526
|
+
await readContract(this.runner, {
|
|
3527
|
+
address: this.contractAddress,
|
|
3528
|
+
functionName: "checkNSignatures",
|
|
3529
|
+
abi: [
|
|
3530
|
+
{
|
|
3531
|
+
inputs: [
|
|
3532
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
3533
|
+
{ internalType: "bytes32", name: "dataHash", type: "bytes32" },
|
|
3534
|
+
{ internalType: "bytes", name: "signatures", type: "bytes" },
|
|
3535
|
+
{ internalType: "uint256", name: "requiredSignatures", type: "uint256" }
|
|
3536
|
+
],
|
|
3537
|
+
name: "checkNSignatures",
|
|
3538
|
+
outputs: [],
|
|
3539
|
+
stateMutability: "view",
|
|
3540
|
+
type: "function"
|
|
3541
|
+
}
|
|
3542
|
+
],
|
|
3543
|
+
args
|
|
3544
|
+
});
|
|
3545
|
+
return [];
|
|
3321
3546
|
};
|
|
3322
|
-
}
|
|
3323
|
-
};
|
|
3324
|
-
var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
|
|
3325
|
-
|
|
3326
|
-
// src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
|
|
3327
|
-
import {
|
|
3328
|
-
safeProxyFactory_1_1_1_ContractArtifacts
|
|
3329
|
-
} from "@safe-global/types-kit";
|
|
3330
|
-
var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
|
|
3331
|
-
/**
|
|
3332
|
-
* Constructs an instance of SafeProxyFactoryContract_v1_1_1
|
|
3333
|
-
*
|
|
3334
|
-
* @param chainId - The chain ID where the contract resides.
|
|
3335
|
-
* @param safeProvider - An instance of SafeProvider.
|
|
3336
|
-
* @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.
|
|
3337
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
|
|
3338
|
-
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3339
|
-
*/
|
|
3340
|
-
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3341
|
-
const safeVersion = "1.1.1";
|
|
3342
|
-
const defaultAbi = safeProxyFactory_1_1_1_ContractArtifacts.abi;
|
|
3343
|
-
super(
|
|
3344
|
-
chainId,
|
|
3345
|
-
safeProvider,
|
|
3346
|
-
defaultAbi,
|
|
3347
|
-
safeVersion,
|
|
3348
|
-
customContractAddress,
|
|
3349
|
-
customContractAbi,
|
|
3350
|
-
deploymentType
|
|
3351
|
-
);
|
|
3352
3547
|
/**
|
|
3353
|
-
*
|
|
3354
|
-
* @
|
|
3548
|
+
* Checks whether the signature provided is valid for the provided data and hash. Will revert otherwise.
|
|
3549
|
+
* @param args - Array[dataHash, data, signatures]
|
|
3550
|
+
* @returns Empty array
|
|
3355
3551
|
*/
|
|
3356
|
-
this.
|
|
3357
|
-
|
|
3552
|
+
this.checkSignatures = async (args) => {
|
|
3553
|
+
await this.read("checkSignatures", args);
|
|
3554
|
+
return [];
|
|
3358
3555
|
};
|
|
3359
3556
|
/**
|
|
3360
|
-
*
|
|
3361
|
-
*
|
|
3557
|
+
* New in v1.5.0: overload of checkSignatures that accepts an explicit executor address.
|
|
3558
|
+
* Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
|
|
3559
|
+
* Will revert otherwise.
|
|
3560
|
+
* @param args - Array[executor, dataHash, signatures]
|
|
3561
|
+
* @returns Empty array
|
|
3562
|
+
*/
|
|
3563
|
+
this.checkSignaturesWithExecutor = async (args) => {
|
|
3564
|
+
await readContract(this.runner, {
|
|
3565
|
+
address: this.contractAddress,
|
|
3566
|
+
functionName: "checkSignatures",
|
|
3567
|
+
abi: [
|
|
3568
|
+
{
|
|
3569
|
+
inputs: [
|
|
3570
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
3571
|
+
{ internalType: "bytes32", name: "dataHash", type: "bytes32" },
|
|
3572
|
+
{ internalType: "bytes", name: "signatures", type: "bytes" }
|
|
3573
|
+
],
|
|
3574
|
+
name: "checkSignatures",
|
|
3575
|
+
outputs: [],
|
|
3576
|
+
stateMutability: "view",
|
|
3577
|
+
type: "function"
|
|
3578
|
+
}
|
|
3579
|
+
],
|
|
3580
|
+
args
|
|
3581
|
+
});
|
|
3582
|
+
return [];
|
|
3583
|
+
};
|
|
3584
|
+
/**
|
|
3585
|
+
* @returns Array[domainSeparator]
|
|
3586
|
+
*/
|
|
3587
|
+
this.domainSeparator = async () => {
|
|
3588
|
+
return [await this.read("domainSeparator")];
|
|
3589
|
+
};
|
|
3590
|
+
/**
|
|
3591
|
+
* Returns array of modules.
|
|
3592
|
+
* @param args - Array[start, pageSize]
|
|
3593
|
+
* @returns Array[Array[modules], next]
|
|
3594
|
+
*/
|
|
3595
|
+
this.getModulesPaginated = async (args) => {
|
|
3596
|
+
const [array, next] = await this.read("getModulesPaginated", args);
|
|
3597
|
+
return [array, next];
|
|
3598
|
+
};
|
|
3599
|
+
/**
|
|
3600
|
+
* Returns the list of Safe owner accounts.
|
|
3601
|
+
* @returns Array[Array[owners]]
|
|
3602
|
+
*/
|
|
3603
|
+
this.getOwners = async () => {
|
|
3604
|
+
return [await this.read("getOwners")];
|
|
3605
|
+
};
|
|
3606
|
+
/**
|
|
3607
|
+
* Reads `length` bytes of storage in the current contract
|
|
3608
|
+
* @param args - Array[offset, length]
|
|
3609
|
+
* @returns Array[storage]
|
|
3610
|
+
*/
|
|
3611
|
+
this.getStorageAt = async (args) => {
|
|
3612
|
+
return [await this.read("getStorageAt", args)];
|
|
3613
|
+
};
|
|
3614
|
+
/**
|
|
3615
|
+
* Returns the Safe threshold.
|
|
3616
|
+
* @returns Array[threshold]
|
|
3617
|
+
*/
|
|
3618
|
+
this.getThreshold = async () => {
|
|
3619
|
+
return [await this.read("getThreshold")];
|
|
3620
|
+
};
|
|
3621
|
+
/**
|
|
3622
|
+
* Returns hash to be signed by owners.
|
|
3623
|
+
* @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce]
|
|
3624
|
+
* @returns Array[transactionHash]
|
|
3625
|
+
*/
|
|
3626
|
+
this.getTransactionHash = async (args) => {
|
|
3627
|
+
return [await this.read("getTransactionHash", args)];
|
|
3628
|
+
};
|
|
3629
|
+
/**
|
|
3630
|
+
* Checks if a specific Safe module is enabled for the current Safe.
|
|
3631
|
+
* @param args - Array[moduleAddress]
|
|
3632
|
+
* @returns Array[isEnabled]
|
|
3633
|
+
*/
|
|
3634
|
+
this.isModuleEnabled = async (args) => {
|
|
3635
|
+
return [await this.read("isModuleEnabled", args)];
|
|
3636
|
+
};
|
|
3637
|
+
/**
|
|
3638
|
+
* Checks if a specific address is an owner of the current Safe.
|
|
3639
|
+
* @param args - Array[address]
|
|
3640
|
+
* @returns Array[isOwner]
|
|
3641
|
+
*/
|
|
3642
|
+
this.isOwner = async (args) => {
|
|
3643
|
+
return [await this.read("isOwner", args)];
|
|
3644
|
+
};
|
|
3645
|
+
/**
|
|
3646
|
+
* Returns the Safe nonce.
|
|
3647
|
+
* @returns Array[nonce]
|
|
3648
|
+
*/
|
|
3649
|
+
this.nonce = async () => {
|
|
3650
|
+
return [await this.read("nonce")];
|
|
3651
|
+
};
|
|
3652
|
+
/**
|
|
3653
|
+
* @param args - Array[messageHash]
|
|
3654
|
+
* @returns Array[signedMessages]
|
|
3655
|
+
*/
|
|
3656
|
+
this.signedMessages = async (args) => {
|
|
3657
|
+
return [await this.read("signedMessages", args)];
|
|
3658
|
+
};
|
|
3659
|
+
}
|
|
3660
|
+
/**
|
|
3661
|
+
* Checks whether a given Safe transaction can be executed successfully with no errors.
|
|
3662
|
+
* @param safeTransaction - The Safe transaction to check.
|
|
3663
|
+
* @param options - Optional transaction options.
|
|
3664
|
+
* @returns True, if the given transactions is valid.
|
|
3665
|
+
*/
|
|
3666
|
+
async isValidTransaction(safeTransaction, options = {}) {
|
|
3667
|
+
try {
|
|
3668
|
+
const gasLimit = options?.gasLimit || await this.estimateGas(
|
|
3669
|
+
"execTransaction",
|
|
3670
|
+
[
|
|
3671
|
+
safeTransaction.data.to,
|
|
3672
|
+
BigInt(safeTransaction.data.value),
|
|
3673
|
+
asHex(safeTransaction.data.data),
|
|
3674
|
+
safeTransaction.data.operation,
|
|
3675
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3676
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3677
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3678
|
+
safeTransaction.data.gasToken,
|
|
3679
|
+
safeTransaction.data.refundReceiver,
|
|
3680
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3681
|
+
],
|
|
3682
|
+
options
|
|
3683
|
+
);
|
|
3684
|
+
const converted = this.convertOptions({ ...options, gasLimit });
|
|
3685
|
+
const txResult = await simulateContract6(this.runner, {
|
|
3686
|
+
address: this.contractAddress,
|
|
3687
|
+
functionName: "execTransaction",
|
|
3688
|
+
abi: this.contractAbi,
|
|
3689
|
+
args: [
|
|
3690
|
+
safeTransaction.data.to,
|
|
3691
|
+
BigInt(safeTransaction.data.value),
|
|
3692
|
+
asHex(safeTransaction.data.data),
|
|
3693
|
+
safeTransaction.data.operation,
|
|
3694
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3695
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3696
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3697
|
+
safeTransaction.data.gasToken,
|
|
3698
|
+
safeTransaction.data.refundReceiver,
|
|
3699
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3700
|
+
],
|
|
3701
|
+
...converted
|
|
3702
|
+
});
|
|
3703
|
+
return txResult.result;
|
|
3704
|
+
} catch (error) {
|
|
3705
|
+
return false;
|
|
3706
|
+
}
|
|
3707
|
+
}
|
|
3708
|
+
/**
|
|
3709
|
+
* Executes a transaction.
|
|
3710
|
+
* @param safeTransaction - The Safe transaction to execute.
|
|
3711
|
+
* @param options - Transaction options.
|
|
3712
|
+
* @returns Transaction result.
|
|
3713
|
+
*/
|
|
3714
|
+
async execTransaction(safeTransaction, options) {
|
|
3715
|
+
const gasLimit = options?.gasLimit || await this.estimateGas(
|
|
3716
|
+
"execTransaction",
|
|
3717
|
+
[
|
|
3718
|
+
safeTransaction.data.to,
|
|
3719
|
+
BigInt(safeTransaction.data.value),
|
|
3720
|
+
asHex(safeTransaction.data.data),
|
|
3721
|
+
safeTransaction.data.operation,
|
|
3722
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3723
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3724
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3725
|
+
safeTransaction.data.gasToken,
|
|
3726
|
+
safeTransaction.data.refundReceiver,
|
|
3727
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3728
|
+
],
|
|
3729
|
+
options
|
|
3730
|
+
);
|
|
3731
|
+
const args = [
|
|
3732
|
+
safeTransaction.data.to,
|
|
3733
|
+
BigInt(safeTransaction.data.value),
|
|
3734
|
+
asHex(safeTransaction.data.data),
|
|
3735
|
+
safeTransaction.data.operation,
|
|
3736
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3737
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3738
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3739
|
+
safeTransaction.data.gasToken,
|
|
3740
|
+
safeTransaction.data.refundReceiver,
|
|
3741
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3742
|
+
];
|
|
3743
|
+
return toTxResult(
|
|
3744
|
+
this.runner,
|
|
3745
|
+
await this.write("execTransaction", args, { ...options, gasLimit }),
|
|
3746
|
+
options
|
|
3747
|
+
);
|
|
3748
|
+
}
|
|
3749
|
+
/**
|
|
3750
|
+
* Returns array of first 10 modules.
|
|
3751
|
+
* @returns Array[modules]
|
|
3752
|
+
*/
|
|
3753
|
+
async getModules() {
|
|
3754
|
+
const [modules] = await this.getModulesPaginated([SENTINEL_ADDRESS, BigInt(10)]);
|
|
3755
|
+
return [modules.map((module) => module)];
|
|
3756
|
+
}
|
|
3757
|
+
/**
|
|
3758
|
+
* Marks a hash as approved. This can be used to validate a hash that is used by a signature.
|
|
3759
|
+
* @param hash - The hash that should be marked as approved for signatures that are verified by this contract.
|
|
3760
|
+
* @param options - Optional transaction options.
|
|
3761
|
+
* @returns Transaction result.
|
|
3762
|
+
*/
|
|
3763
|
+
async approveHash(hash, options) {
|
|
3764
|
+
const gasLimit = options?.gasLimit || await this.estimateGas("approveHash", [asHash(hash)], options);
|
|
3765
|
+
return toTxResult(
|
|
3766
|
+
this.runner,
|
|
3767
|
+
await this.write("approveHash", [asHash(hash)], { ...options, gasLimit }),
|
|
3768
|
+
options
|
|
3769
|
+
);
|
|
3770
|
+
}
|
|
3771
|
+
/**
|
|
3772
|
+
* Returns the chain id of the Safe contract. (Custom method - not defined in the Safe Contract)
|
|
3773
|
+
* @returns Array[chainId]
|
|
3774
|
+
*/
|
|
3775
|
+
async getChainId() {
|
|
3776
|
+
return [await Promise.resolve(this.chainId)];
|
|
3777
|
+
}
|
|
3778
|
+
/**
|
|
3779
|
+
* returns the nonce of the Safe contract.
|
|
3780
|
+
*
|
|
3781
|
+
* @returns {Promise<bigint>} A promise that resolves to the nonce of the Safe contract.
|
|
3782
|
+
*/
|
|
3783
|
+
async getNonce() {
|
|
3784
|
+
const [nonce] = await this.nonce();
|
|
3785
|
+
return nonce;
|
|
3786
|
+
}
|
|
3787
|
+
};
|
|
3788
|
+
var SafeContract_v1_5_0_default = SafeContract_v1_5_0;
|
|
3789
|
+
|
|
3790
|
+
// src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts
|
|
3791
|
+
var SafeProxyFactoryBaseContract = class extends BaseContract_default {
|
|
3792
|
+
/**
|
|
3793
|
+
* @constructor
|
|
3794
|
+
* Constructs an instance of SafeProxyFactoryBaseContract.
|
|
3795
|
+
*
|
|
3796
|
+
* @param chainId - The chain ID of the contract.
|
|
3797
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3798
|
+
* @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
|
|
3799
|
+
* @param safeVersion - The version of the Safe contract.
|
|
3800
|
+
* @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.
|
|
3801
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
3802
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3803
|
+
*/
|
|
3804
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3805
|
+
const contractName3 = "safeProxyFactoryVersion";
|
|
3806
|
+
super(
|
|
3807
|
+
contractName3,
|
|
3808
|
+
chainId,
|
|
3809
|
+
safeProvider,
|
|
3810
|
+
defaultAbi,
|
|
3811
|
+
safeVersion,
|
|
3812
|
+
customContractAddress,
|
|
3813
|
+
customContractAbi,
|
|
3814
|
+
deploymentType
|
|
3815
|
+
);
|
|
3816
|
+
this.contractName = contractName3;
|
|
3817
|
+
}
|
|
3818
|
+
};
|
|
3819
|
+
var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
|
|
3820
|
+
|
|
3821
|
+
// src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
|
|
3822
|
+
import {
|
|
3823
|
+
safeProxyFactory_1_0_0_ContractArtifacts
|
|
3824
|
+
} from "@safe-global/types-kit";
|
|
3825
|
+
var SafeProxyFactoryContract_v1_0_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
3826
|
+
/**
|
|
3827
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_0_0
|
|
3828
|
+
*
|
|
3829
|
+
* @param chainId - The chain ID where the contract resides.
|
|
3830
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3831
|
+
* @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.
|
|
3832
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
|
|
3833
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3834
|
+
*/
|
|
3835
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3836
|
+
const safeVersion = "1.0.0";
|
|
3837
|
+
const defaultAbi = safeProxyFactory_1_0_0_ContractArtifacts.abi;
|
|
3838
|
+
super(
|
|
3839
|
+
chainId,
|
|
3840
|
+
safeProvider,
|
|
3841
|
+
defaultAbi,
|
|
3842
|
+
safeVersion,
|
|
3843
|
+
customContractAddress,
|
|
3844
|
+
customContractAbi,
|
|
3845
|
+
deploymentType
|
|
3846
|
+
);
|
|
3847
|
+
/**
|
|
3848
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
3849
|
+
* @returns Array[creationCode]
|
|
3850
|
+
*/
|
|
3851
|
+
this.proxyCreationCode = async () => {
|
|
3852
|
+
return [await this.read("proxyCreationCode")];
|
|
3853
|
+
};
|
|
3854
|
+
/**
|
|
3855
|
+
* Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
|
|
3856
|
+
* @returns Array[runtimeCode]
|
|
3857
|
+
*/
|
|
3858
|
+
this.proxyRuntimeCode = async () => {
|
|
3859
|
+
return [await this.read("proxyRuntimeCode")];
|
|
3860
|
+
};
|
|
3861
|
+
/**
|
|
3862
|
+
* Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
|
|
3863
|
+
* @param args - Array[masterCopy, data]
|
|
3864
|
+
* @returns Array[proxyAddress]
|
|
3865
|
+
*/
|
|
3866
|
+
this.createProxy = async (args) => {
|
|
3867
|
+
return [await this.write("createProxy", args)];
|
|
3868
|
+
};
|
|
3869
|
+
/**
|
|
3870
|
+
* Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
|
|
3871
|
+
* @param args - Array[masterCopy, initializer, saltNonce]
|
|
3872
|
+
* @returns Array[proxyAddress]
|
|
3873
|
+
*/
|
|
3874
|
+
this.createProxyWithNonce = async (args) => {
|
|
3875
|
+
return [await this.write("createProxyWithNonce", args)];
|
|
3876
|
+
};
|
|
3877
|
+
}
|
|
3878
|
+
};
|
|
3879
|
+
var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
|
|
3880
|
+
|
|
3881
|
+
// src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
|
|
3882
|
+
import {
|
|
3883
|
+
safeProxyFactory_1_1_1_ContractArtifacts
|
|
3884
|
+
} from "@safe-global/types-kit";
|
|
3885
|
+
var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
|
|
3886
|
+
/**
|
|
3887
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_1_1
|
|
3888
|
+
*
|
|
3889
|
+
* @param chainId - The chain ID where the contract resides.
|
|
3890
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3891
|
+
* @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.
|
|
3892
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
|
|
3893
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3894
|
+
*/
|
|
3895
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3896
|
+
const safeVersion = "1.1.1";
|
|
3897
|
+
const defaultAbi = safeProxyFactory_1_1_1_ContractArtifacts.abi;
|
|
3898
|
+
super(
|
|
3899
|
+
chainId,
|
|
3900
|
+
safeProvider,
|
|
3901
|
+
defaultAbi,
|
|
3902
|
+
safeVersion,
|
|
3903
|
+
customContractAddress,
|
|
3904
|
+
customContractAbi,
|
|
3905
|
+
deploymentType
|
|
3906
|
+
);
|
|
3907
|
+
/**
|
|
3908
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
3909
|
+
* @returns Array[creationCode]
|
|
3910
|
+
*/
|
|
3911
|
+
this.proxyCreationCode = async () => {
|
|
3912
|
+
return [await this.read("proxyCreationCode")];
|
|
3913
|
+
};
|
|
3914
|
+
/**
|
|
3915
|
+
* Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
|
|
3916
|
+
* @returns Array[runtimeCode]
|
|
3362
3917
|
*/
|
|
3363
3918
|
this.proxyRuntimeCode = async () => {
|
|
3364
3919
|
return [await this.read("proxyRuntimeCode")];
|
|
@@ -3544,6 +4099,82 @@ var SafeProxyFactoryContract_v1_4_1 = class extends SafeProxyFactoryBaseContract
|
|
|
3544
4099
|
};
|
|
3545
4100
|
var SafeProxyFactoryContract_v1_4_1_default = SafeProxyFactoryContract_v1_4_1;
|
|
3546
4101
|
|
|
4102
|
+
// src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.ts
|
|
4103
|
+
import {
|
|
4104
|
+
safeProxyFactory_1_5_0_ContractArtifacts
|
|
4105
|
+
} from "@safe-global/types-kit";
|
|
4106
|
+
var SafeProxyFactoryContract_v1_5_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
4107
|
+
/**
|
|
4108
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_5_0
|
|
4109
|
+
*
|
|
4110
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4111
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4112
|
+
* @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.
|
|
4113
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4114
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4115
|
+
*/
|
|
4116
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4117
|
+
const safeVersion = "1.5.0";
|
|
4118
|
+
const defaultAbi = safeProxyFactory_1_5_0_ContractArtifacts.abi;
|
|
4119
|
+
super(
|
|
4120
|
+
chainId,
|
|
4121
|
+
safeProvider,
|
|
4122
|
+
defaultAbi,
|
|
4123
|
+
safeVersion,
|
|
4124
|
+
customContractAddress,
|
|
4125
|
+
customContractAbi,
|
|
4126
|
+
deploymentType
|
|
4127
|
+
);
|
|
4128
|
+
/**
|
|
4129
|
+
* Returns the ID of the chain the contract is currently deployed on.
|
|
4130
|
+
* @returns Array[chainId]
|
|
4131
|
+
*/
|
|
4132
|
+
this.getChainId = async () => {
|
|
4133
|
+
return [await this.read("getChainId")];
|
|
4134
|
+
};
|
|
4135
|
+
/**
|
|
4136
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
4137
|
+
* @returns Array[creationCode]
|
|
4138
|
+
*/
|
|
4139
|
+
this.proxyCreationCode = async () => {
|
|
4140
|
+
return [await this.read("proxyCreationCode")];
|
|
4141
|
+
};
|
|
4142
|
+
/**
|
|
4143
|
+
* Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4144
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4145
|
+
* @returns Array[proxy]
|
|
4146
|
+
*/
|
|
4147
|
+
this.createChainSpecificProxyWithNonce = async (args) => {
|
|
4148
|
+
return [await this.write("createChainSpecificProxyWithNonce", args)];
|
|
4149
|
+
};
|
|
4150
|
+
/**
|
|
4151
|
+
* Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4152
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4153
|
+
* @returns Array[proxy]
|
|
4154
|
+
*/
|
|
4155
|
+
this.createChainSpecificProxyWithNonceL2 = async (args) => {
|
|
4156
|
+
return [await this.write("createChainSpecificProxyWithNonceL2", args)];
|
|
4157
|
+
};
|
|
4158
|
+
/**
|
|
4159
|
+
* Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4160
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4161
|
+
* @returns Array[proxy]
|
|
4162
|
+
*/
|
|
4163
|
+
this.createProxyWithNonce = async (args) => {
|
|
4164
|
+
return [await this.write("createProxyWithNonce", args)];
|
|
4165
|
+
};
|
|
4166
|
+
/**
|
|
4167
|
+
* Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4168
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4169
|
+
* @returns Array[proxy]
|
|
4170
|
+
*/
|
|
4171
|
+
this.createProxyWithNonceL2 = async (args) => {
|
|
4172
|
+
return [await this.write("createProxyWithNonceL2", args)];
|
|
4173
|
+
};
|
|
4174
|
+
}
|
|
4175
|
+
};
|
|
4176
|
+
var SafeProxyFactoryContract_v1_5_0_default = SafeProxyFactoryContract_v1_5_0;
|
|
4177
|
+
|
|
3547
4178
|
// src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.ts
|
|
3548
4179
|
var SimulateTxAccessorBaseContract = class extends BaseContract_default {
|
|
3549
4180
|
/**
|
|
@@ -3651,6 +4282,44 @@ var SimulateTxAccessorContract_v1_4_1 = class extends SimulateTxAccessorBaseCont
|
|
|
3651
4282
|
};
|
|
3652
4283
|
var SimulateTxAccessorContract_v1_4_1_default = SimulateTxAccessorContract_v1_4_1;
|
|
3653
4284
|
|
|
4285
|
+
// src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.ts
|
|
4286
|
+
import {
|
|
4287
|
+
simulateTxAccessor_1_5_0_ContractArtifacts
|
|
4288
|
+
} from "@safe-global/types-kit";
|
|
4289
|
+
var SimulateTxAccessorContract_v1_5_0 = class extends SimulateTxAccessorBaseContract_default {
|
|
4290
|
+
/**
|
|
4291
|
+
* Constructs an instance of SimulateTxAccessorContract_v1_5_0
|
|
4292
|
+
*
|
|
4293
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4294
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4295
|
+
* @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.
|
|
4296
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4297
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4298
|
+
*/
|
|
4299
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4300
|
+
const safeVersion = "1.5.0";
|
|
4301
|
+
const defaultAbi = simulateTxAccessor_1_5_0_ContractArtifacts.abi;
|
|
4302
|
+
super(
|
|
4303
|
+
chainId,
|
|
4304
|
+
safeProvider,
|
|
4305
|
+
defaultAbi,
|
|
4306
|
+
safeVersion,
|
|
4307
|
+
customContractAddress,
|
|
4308
|
+
customContractAbi,
|
|
4309
|
+
deploymentType
|
|
4310
|
+
);
|
|
4311
|
+
/**
|
|
4312
|
+
* @param args - Array[to, value, data, operation]
|
|
4313
|
+
* @returns Array[estimate, success, returnData]
|
|
4314
|
+
*/
|
|
4315
|
+
this.simulate = async (args) => {
|
|
4316
|
+
const [estimate, success, returnData] = await this.write("simulate", args);
|
|
4317
|
+
return [BigInt(estimate), !!success, asHex(returnData)];
|
|
4318
|
+
};
|
|
4319
|
+
}
|
|
4320
|
+
};
|
|
4321
|
+
var SimulateTxAccessorContract_v1_5_0_default = SimulateTxAccessorContract_v1_5_0;
|
|
4322
|
+
|
|
3654
4323
|
// src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.ts
|
|
3655
4324
|
var CompatibilityFallbackHandlerBaseContract = class extends BaseContract_default {
|
|
3656
4325
|
/**
|
|
@@ -3740,7 +4409,228 @@ var CompatibilityFallbackHandlerContract_v1_4_1 = class extends CompatibilityFal
|
|
|
3740
4409
|
);
|
|
3741
4410
|
}
|
|
3742
4411
|
};
|
|
3743
|
-
var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
|
|
4412
|
+
var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
|
|
4413
|
+
|
|
4414
|
+
// src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.ts
|
|
4415
|
+
import {
|
|
4416
|
+
compatibilityFallbackHandler_1_5_0_ContractArtifacts
|
|
4417
|
+
} from "@safe-global/types-kit";
|
|
4418
|
+
var CompatibilityFallbackHandlerContract_v1_5_0 = class extends CompatibilityFallbackHandlerBaseContract_default {
|
|
4419
|
+
/**
|
|
4420
|
+
* Constructs an instance of CompatibilityFallbackHandlerContract_v1_5_0
|
|
4421
|
+
*
|
|
4422
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4423
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4424
|
+
* @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.
|
|
4425
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4426
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4427
|
+
*/
|
|
4428
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4429
|
+
const safeVersion = "1.5.0";
|
|
4430
|
+
const defaultAbi = compatibilityFallbackHandler_1_5_0_ContractArtifacts.abi;
|
|
4431
|
+
super(
|
|
4432
|
+
chainId,
|
|
4433
|
+
safeProvider,
|
|
4434
|
+
defaultAbi,
|
|
4435
|
+
safeVersion,
|
|
4436
|
+
customContractAddress,
|
|
4437
|
+
customContractAbi,
|
|
4438
|
+
deploymentType
|
|
4439
|
+
);
|
|
4440
|
+
/**
|
|
4441
|
+
* New in v1.5.0: encodeTransactionData was moved from the Safe contract to CompatibilityFallbackHandler
|
|
4442
|
+
* to preserve backwards compatibility for existing integrations.
|
|
4443
|
+
* @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, nonce]
|
|
4444
|
+
* @returns Array[encodedData]
|
|
4445
|
+
*/
|
|
4446
|
+
this.encodeTransactionData = async (args) => {
|
|
4447
|
+
return [await this.read("encodeTransactionData", args)];
|
|
4448
|
+
};
|
|
4449
|
+
}
|
|
4450
|
+
};
|
|
4451
|
+
var CompatibilityFallbackHandlerContract_v1_5_0_default = CompatibilityFallbackHandlerContract_v1_5_0;
|
|
4452
|
+
|
|
4453
|
+
// src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.ts
|
|
4454
|
+
var ExtensibleFallbackHandlerBaseContract = class extends BaseContract_default {
|
|
4455
|
+
/**
|
|
4456
|
+
* @constructor
|
|
4457
|
+
* Constructs an instance of ExtensibleFallbackHandlerBaseContract.
|
|
4458
|
+
*
|
|
4459
|
+
* @param chainId - The chain ID of the contract.
|
|
4460
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4461
|
+
* @param defaultAbi - The default ABI for the ExtensibleFallbackHandler contract. It should be compatible with the specific version of the contract.
|
|
4462
|
+
* @param safeVersion - The version of the Safe contract.
|
|
4463
|
+
* @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.
|
|
4464
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
4465
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4466
|
+
*/
|
|
4467
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
4468
|
+
const contractName3 = "extensibleFallbackHandler";
|
|
4469
|
+
super(
|
|
4470
|
+
contractName3,
|
|
4471
|
+
chainId,
|
|
4472
|
+
safeProvider,
|
|
4473
|
+
defaultAbi,
|
|
4474
|
+
safeVersion,
|
|
4475
|
+
customContractAddress,
|
|
4476
|
+
customContractAbi,
|
|
4477
|
+
deploymentType
|
|
4478
|
+
);
|
|
4479
|
+
this.contractName = contractName3;
|
|
4480
|
+
}
|
|
4481
|
+
};
|
|
4482
|
+
var ExtensibleFallbackHandlerBaseContract_default = ExtensibleFallbackHandlerBaseContract;
|
|
4483
|
+
|
|
4484
|
+
// src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.ts
|
|
4485
|
+
import {
|
|
4486
|
+
extensibleFallbackHandler_1_5_0_ContractArtifacts
|
|
4487
|
+
} from "@safe-global/types-kit";
|
|
4488
|
+
var ExtensibleFallbackHandlerContract_v1_5_0 = class extends ExtensibleFallbackHandlerBaseContract_default {
|
|
4489
|
+
/**
|
|
4490
|
+
* Constructs an instance of ExtensibleFallbackHandlerContract_v1_5_0
|
|
4491
|
+
*
|
|
4492
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4493
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4494
|
+
* @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.
|
|
4495
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4496
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4497
|
+
*/
|
|
4498
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4499
|
+
const safeVersion = "1.5.0";
|
|
4500
|
+
const defaultAbi = extensibleFallbackHandler_1_5_0_ContractArtifacts.abi;
|
|
4501
|
+
super(
|
|
4502
|
+
chainId,
|
|
4503
|
+
safeProvider,
|
|
4504
|
+
defaultAbi,
|
|
4505
|
+
safeVersion,
|
|
4506
|
+
customContractAddress,
|
|
4507
|
+
customContractAbi,
|
|
4508
|
+
deploymentType
|
|
4509
|
+
);
|
|
4510
|
+
// Read methods
|
|
4511
|
+
/**
|
|
4512
|
+
* @param args - Array[safe, domainSeparator]
|
|
4513
|
+
* @returns Array[verifier]
|
|
4514
|
+
*/
|
|
4515
|
+
this.domainVerifiers = async (args) => {
|
|
4516
|
+
return [await this.read("domainVerifiers", args)];
|
|
4517
|
+
};
|
|
4518
|
+
/**
|
|
4519
|
+
* @param args - Array[_hash, signature]
|
|
4520
|
+
* @returns Array[magic]
|
|
4521
|
+
*/
|
|
4522
|
+
this.isValidSignature = async (args) => {
|
|
4523
|
+
return [await this.read("isValidSignature", args)];
|
|
4524
|
+
};
|
|
4525
|
+
/**
|
|
4526
|
+
* @param args - Array[safe, interfaceId]
|
|
4527
|
+
* @returns Array[isSupported]
|
|
4528
|
+
*/
|
|
4529
|
+
this.safeInterfaces = async (args) => {
|
|
4530
|
+
return [await this.read("safeInterfaces", args)];
|
|
4531
|
+
};
|
|
4532
|
+
/**
|
|
4533
|
+
* @param args - Array[safe, selector]
|
|
4534
|
+
* @returns Array[handler]
|
|
4535
|
+
*/
|
|
4536
|
+
this.safeMethods = async (args) => {
|
|
4537
|
+
return [await this.read("safeMethods", args)];
|
|
4538
|
+
};
|
|
4539
|
+
/**
|
|
4540
|
+
* @param args - Array[interfaceId]
|
|
4541
|
+
* @returns Array[isSupported]
|
|
4542
|
+
*/
|
|
4543
|
+
this.supportsInterface = async (args) => {
|
|
4544
|
+
return [await this.read("supportsInterface", args)];
|
|
4545
|
+
};
|
|
4546
|
+
/**
|
|
4547
|
+
* @param args - Array[operator, from, tokenId, data]
|
|
4548
|
+
* @returns Array[bytes4]
|
|
4549
|
+
*/
|
|
4550
|
+
this.onERC721Received = async (args) => {
|
|
4551
|
+
return [await this.read("onERC721Received", args)];
|
|
4552
|
+
};
|
|
4553
|
+
/**
|
|
4554
|
+
* @param args - Array[operator, from, id, value, data]
|
|
4555
|
+
* @returns Array[bytes4]
|
|
4556
|
+
*/
|
|
4557
|
+
this.onERC1155Received = async (args) => {
|
|
4558
|
+
return [await this.read("onERC1155Received", args)];
|
|
4559
|
+
};
|
|
4560
|
+
/**
|
|
4561
|
+
* @param args - Array[operator, from, ids, values, data]
|
|
4562
|
+
* @returns Array[bytes4]
|
|
4563
|
+
*/
|
|
4564
|
+
this.onERC1155BatchReceived = async (args) => {
|
|
4565
|
+
return [await this.read("onERC1155BatchReceived", args)];
|
|
4566
|
+
};
|
|
4567
|
+
// Write methods (must be called via Safe transactions since msg.sender = Safe address)
|
|
4568
|
+
/**
|
|
4569
|
+
* @param args - Array[_interfaceId, handlerWithSelectors]
|
|
4570
|
+
*/
|
|
4571
|
+
this.addSupportedInterfaceBatch = async (args, options) => {
|
|
4572
|
+
if (options && !options.gasLimit) {
|
|
4573
|
+
options.gasLimit = Number(
|
|
4574
|
+
await this.estimateGas("addSupportedInterfaceBatch", args, { ...options })
|
|
4575
|
+
);
|
|
4576
|
+
}
|
|
4577
|
+
return toTxResult(
|
|
4578
|
+
this.runner,
|
|
4579
|
+
await this.write("addSupportedInterfaceBatch", args, options),
|
|
4580
|
+
options
|
|
4581
|
+
);
|
|
4582
|
+
};
|
|
4583
|
+
/**
|
|
4584
|
+
* @param args - Array[_interfaceId, selectors]
|
|
4585
|
+
*/
|
|
4586
|
+
this.removeSupportedInterfaceBatch = async (args, options) => {
|
|
4587
|
+
if (options && !options.gasLimit) {
|
|
4588
|
+
options.gasLimit = Number(
|
|
4589
|
+
await this.estimateGas("removeSupportedInterfaceBatch", args, { ...options })
|
|
4590
|
+
);
|
|
4591
|
+
}
|
|
4592
|
+
return toTxResult(
|
|
4593
|
+
this.runner,
|
|
4594
|
+
await this.write("removeSupportedInterfaceBatch", args, options),
|
|
4595
|
+
options
|
|
4596
|
+
);
|
|
4597
|
+
};
|
|
4598
|
+
/**
|
|
4599
|
+
* @param args - Array[domainSeparator, newVerifier]
|
|
4600
|
+
*/
|
|
4601
|
+
this.setDomainVerifier = async (args, options) => {
|
|
4602
|
+
if (options && !options.gasLimit) {
|
|
4603
|
+
options.gasLimit = Number(await this.estimateGas("setDomainVerifier", args, { ...options }));
|
|
4604
|
+
}
|
|
4605
|
+
return toTxResult(this.runner, await this.write("setDomainVerifier", args, options), options);
|
|
4606
|
+
};
|
|
4607
|
+
/**
|
|
4608
|
+
* @param args - Array[selector, newMethod]
|
|
4609
|
+
*/
|
|
4610
|
+
this.setSafeMethod = async (args, options) => {
|
|
4611
|
+
if (options && !options.gasLimit) {
|
|
4612
|
+
options.gasLimit = Number(await this.estimateGas("setSafeMethod", args, { ...options }));
|
|
4613
|
+
}
|
|
4614
|
+
return toTxResult(this.runner, await this.write("setSafeMethod", args, options), options);
|
|
4615
|
+
};
|
|
4616
|
+
/**
|
|
4617
|
+
* @param args - Array[interfaceId, supported]
|
|
4618
|
+
*/
|
|
4619
|
+
this.setSupportedInterface = async (args, options) => {
|
|
4620
|
+
if (options && !options.gasLimit) {
|
|
4621
|
+
options.gasLimit = Number(
|
|
4622
|
+
await this.estimateGas("setSupportedInterface", args, { ...options })
|
|
4623
|
+
);
|
|
4624
|
+
}
|
|
4625
|
+
return toTxResult(
|
|
4626
|
+
this.runner,
|
|
4627
|
+
await this.write("setSupportedInterface", args, options),
|
|
4628
|
+
options
|
|
4629
|
+
);
|
|
4630
|
+
};
|
|
4631
|
+
}
|
|
4632
|
+
};
|
|
4633
|
+
var ExtensibleFallbackHandlerContract_v1_5_0_default = ExtensibleFallbackHandlerContract_v1_5_0;
|
|
3744
4634
|
|
|
3745
4635
|
// src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.ts
|
|
3746
4636
|
var SafeWebAuthnSignerFactoryBaseContract = class extends BaseContract_default {
|
|
@@ -3914,6 +4804,16 @@ async function getSafeContractInstance(safeVersion, safeProvider, contractAddres
|
|
|
3914
4804
|
const chainId = await safeProvider.getChainId();
|
|
3915
4805
|
let safeContractInstance;
|
|
3916
4806
|
switch (safeVersion) {
|
|
4807
|
+
case "1.5.0":
|
|
4808
|
+
safeContractInstance = new SafeContract_v1_5_0_default(
|
|
4809
|
+
chainId,
|
|
4810
|
+
safeProvider,
|
|
4811
|
+
isL1SafeSingleton,
|
|
4812
|
+
contractAddress,
|
|
4813
|
+
customContractAbi,
|
|
4814
|
+
deploymentType
|
|
4815
|
+
);
|
|
4816
|
+
break;
|
|
3917
4817
|
case "1.4.1":
|
|
3918
4818
|
safeContractInstance = new SafeContract_v1_4_1_default(
|
|
3919
4819
|
chainId,
|
|
@@ -3974,6 +4874,15 @@ async function getCompatibilityFallbackHandlerContractInstance(safeVersion, safe
|
|
|
3974
4874
|
const chainId = await safeProvider.getChainId();
|
|
3975
4875
|
let compatibilityFallbackHandlerInstance;
|
|
3976
4876
|
switch (safeVersion) {
|
|
4877
|
+
case "1.5.0":
|
|
4878
|
+
compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_5_0_default(
|
|
4879
|
+
chainId,
|
|
4880
|
+
safeProvider,
|
|
4881
|
+
contractAddress,
|
|
4882
|
+
customContractAbi,
|
|
4883
|
+
deploymentType
|
|
4884
|
+
);
|
|
4885
|
+
break;
|
|
3977
4886
|
case "1.4.1":
|
|
3978
4887
|
compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_4_1_default(
|
|
3979
4888
|
chainId,
|
|
@@ -4004,6 +4913,15 @@ async function getMultiSendContractInstance(safeVersion, safeProvider, contractA
|
|
|
4004
4913
|
const chainId = await safeProvider.getChainId();
|
|
4005
4914
|
let multiSendContractInstance;
|
|
4006
4915
|
switch (safeVersion) {
|
|
4916
|
+
case "1.5.0":
|
|
4917
|
+
multiSendContractInstance = new MultiSendContract_v1_5_0_default(
|
|
4918
|
+
chainId,
|
|
4919
|
+
safeProvider,
|
|
4920
|
+
contractAddress,
|
|
4921
|
+
customContractAbi,
|
|
4922
|
+
deploymentType
|
|
4923
|
+
);
|
|
4924
|
+
break;
|
|
4007
4925
|
case "1.4.1":
|
|
4008
4926
|
multiSendContractInstance = new MultiSendContract_v1_4_1_default(
|
|
4009
4927
|
chainId,
|
|
@@ -4043,6 +4961,15 @@ async function getMultiSendCallOnlyContractInstance(safeVersion, safeProvider, c
|
|
|
4043
4961
|
const chainId = await safeProvider.getChainId();
|
|
4044
4962
|
let multiSendCallOnlyContractInstance;
|
|
4045
4963
|
switch (safeVersion) {
|
|
4964
|
+
case "1.5.0":
|
|
4965
|
+
multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_5_0_default(
|
|
4966
|
+
chainId,
|
|
4967
|
+
safeProvider,
|
|
4968
|
+
contractAddress,
|
|
4969
|
+
customContractAbi,
|
|
4970
|
+
deploymentType
|
|
4971
|
+
);
|
|
4972
|
+
break;
|
|
4046
4973
|
case "1.4.1":
|
|
4047
4974
|
multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_4_1_default(
|
|
4048
4975
|
chainId,
|
|
@@ -4074,6 +5001,15 @@ async function getSafeProxyFactoryContractInstance(safeVersion, safeProvider, co
|
|
|
4074
5001
|
const chainId = await safeProvider.getChainId();
|
|
4075
5002
|
let safeProxyFactoryContractInstance;
|
|
4076
5003
|
switch (safeVersion) {
|
|
5004
|
+
case "1.5.0":
|
|
5005
|
+
safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_5_0_default(
|
|
5006
|
+
chainId,
|
|
5007
|
+
safeProvider,
|
|
5008
|
+
contractAddress,
|
|
5009
|
+
customContractAbi,
|
|
5010
|
+
deploymentType
|
|
5011
|
+
);
|
|
5012
|
+
break;
|
|
4077
5013
|
case "1.4.1":
|
|
4078
5014
|
safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_4_1_default(
|
|
4079
5015
|
chainId,
|
|
@@ -4121,6 +5057,15 @@ async function getSignMessageLibContractInstance(safeVersion, safeProvider, cont
|
|
|
4121
5057
|
const chainId = await safeProvider.getChainId();
|
|
4122
5058
|
let signMessageLibContractInstance;
|
|
4123
5059
|
switch (safeVersion) {
|
|
5060
|
+
case "1.5.0":
|
|
5061
|
+
signMessageLibContractInstance = new SignMessageLibContract_v1_5_0_default(
|
|
5062
|
+
chainId,
|
|
5063
|
+
safeProvider,
|
|
5064
|
+
contractAddress,
|
|
5065
|
+
customContractAbi,
|
|
5066
|
+
deploymentType
|
|
5067
|
+
);
|
|
5068
|
+
break;
|
|
4124
5069
|
case "1.4.1":
|
|
4125
5070
|
signMessageLibContractInstance = new SignMessageLibContract_v1_4_1_default(
|
|
4126
5071
|
chainId,
|
|
@@ -4149,6 +5094,15 @@ async function getCreateCallContractInstance(safeVersion, safeProvider, contract
|
|
|
4149
5094
|
const chainId = await safeProvider.getChainId();
|
|
4150
5095
|
let createCallContractInstance;
|
|
4151
5096
|
switch (safeVersion) {
|
|
5097
|
+
case "1.5.0":
|
|
5098
|
+
createCallContractInstance = new CreateCallContract_v1_5_0_default(
|
|
5099
|
+
chainId,
|
|
5100
|
+
safeProvider,
|
|
5101
|
+
contractAddress,
|
|
5102
|
+
customContractAbi,
|
|
5103
|
+
deploymentType
|
|
5104
|
+
);
|
|
5105
|
+
break;
|
|
4152
5106
|
case "1.4.1":
|
|
4153
5107
|
createCallContractInstance = new CreateCallContract_v1_4_1_default(
|
|
4154
5108
|
chainId,
|
|
@@ -4180,6 +5134,15 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
|
|
|
4180
5134
|
const chainId = await safeProvider.getChainId();
|
|
4181
5135
|
let simulateTxAccessorContractInstance;
|
|
4182
5136
|
switch (safeVersion) {
|
|
5137
|
+
case "1.5.0":
|
|
5138
|
+
simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_5_0_default(
|
|
5139
|
+
chainId,
|
|
5140
|
+
safeProvider,
|
|
5141
|
+
contractAddress,
|
|
5142
|
+
customContractAbi,
|
|
5143
|
+
deploymentType
|
|
5144
|
+
);
|
|
5145
|
+
break;
|
|
4183
5146
|
case "1.4.1":
|
|
4184
5147
|
simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_4_1_default(
|
|
4185
5148
|
chainId,
|
|
@@ -4207,6 +5170,7 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
|
|
|
4207
5170
|
async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
4208
5171
|
const chainId = await safeProvider.getChainId();
|
|
4209
5172
|
switch (safeVersion) {
|
|
5173
|
+
case "1.5.0":
|
|
4210
5174
|
case "1.4.1":
|
|
4211
5175
|
case "1.3.0":
|
|
4212
5176
|
const safeWebAuthnSignerFactoryContractInstance = new SafeWebAuthnSignerFactoryContract_v0_2_1_default(
|
|
@@ -4226,6 +5190,7 @@ async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safePro
|
|
|
4226
5190
|
async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
4227
5191
|
const chainId = await safeProvider.getChainId();
|
|
4228
5192
|
switch (safeVersion) {
|
|
5193
|
+
case "1.5.0":
|
|
4229
5194
|
case "1.4.1":
|
|
4230
5195
|
case "1.3.0":
|
|
4231
5196
|
const safeWebAuthnSharedSignerContractInstance = new SafeWebAuthnSharedSignerContract_v0_2_1_default(
|
|
@@ -4242,6 +5207,23 @@ async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProv
|
|
|
4242
5207
|
throw new Error("Invalid Safe version");
|
|
4243
5208
|
}
|
|
4244
5209
|
}
|
|
5210
|
+
async function getExtensibleFallbackHandlerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
5211
|
+
const chainId = await safeProvider.getChainId();
|
|
5212
|
+
switch (safeVersion) {
|
|
5213
|
+
case "1.5.0":
|
|
5214
|
+
const extensibleFallbackHandlerContractInstance = new ExtensibleFallbackHandlerContract_v1_5_0_default(
|
|
5215
|
+
chainId,
|
|
5216
|
+
safeProvider,
|
|
5217
|
+
contractAddress,
|
|
5218
|
+
customContractAbi,
|
|
5219
|
+
deploymentType
|
|
5220
|
+
);
|
|
5221
|
+
await extensibleFallbackHandlerContractInstance.init();
|
|
5222
|
+
return extensibleFallbackHandlerContractInstance;
|
|
5223
|
+
default:
|
|
5224
|
+
throw new Error("Invalid Safe version");
|
|
5225
|
+
}
|
|
5226
|
+
}
|
|
4245
5227
|
|
|
4246
5228
|
// src/contracts/safeDeploymentContracts.ts
|
|
4247
5229
|
async function getSafeContract({
|
|
@@ -4451,6 +5433,27 @@ async function getSafeWebAuthnSharedSignerContract({
|
|
|
4451
5433
|
}
|
|
4452
5434
|
return safeWebAuthnSharedSignerContract;
|
|
4453
5435
|
}
|
|
5436
|
+
async function getExtensibleFallbackHandlerContract({
|
|
5437
|
+
safeProvider,
|
|
5438
|
+
safeVersion,
|
|
5439
|
+
customContracts,
|
|
5440
|
+
deploymentType
|
|
5441
|
+
}) {
|
|
5442
|
+
const extensibleFallbackHandlerContract = await getExtensibleFallbackHandlerContractInstance(
|
|
5443
|
+
safeVersion,
|
|
5444
|
+
safeProvider,
|
|
5445
|
+
customContracts?.extensibleFallbackHandlerAddress,
|
|
5446
|
+
customContracts?.extensibleFallbackHandlerAbi,
|
|
5447
|
+
deploymentType
|
|
5448
|
+
);
|
|
5449
|
+
const isContractDeployed = await safeProvider.isContractDeployed(
|
|
5450
|
+
extensibleFallbackHandlerContract.getAddress()
|
|
5451
|
+
);
|
|
5452
|
+
if (!isContractDeployed) {
|
|
5453
|
+
throw new Error("ExtensibleFallbackHandler contract is not deployed on the current network");
|
|
5454
|
+
}
|
|
5455
|
+
return extensibleFallbackHandlerContract;
|
|
5456
|
+
}
|
|
4454
5457
|
|
|
4455
5458
|
// src/utils/transactions/gas.ts
|
|
4456
5459
|
var CALL_DATA_ZERO_BYTE_GAS_COST = 4;
|
|
@@ -4958,7 +5961,7 @@ function hasDelegateCalls(transactions) {
|
|
|
4958
5961
|
|
|
4959
5962
|
// src/utils/passkeys/extractPasskeyData.ts
|
|
4960
5963
|
import { Buffer as Buffer2 } from "buffer";
|
|
4961
|
-
import {
|
|
5964
|
+
import { getDaimoP256VerifierDeployment } from "@safe-global/safe-modules-deployments";
|
|
4962
5965
|
function base64ToUint8Array(base64) {
|
|
4963
5966
|
const base64Fixed = base64.replace(/-/g, "+").replace(/_/g, "/");
|
|
4964
5967
|
const binaryBuffer = Buffer2.from(base64Fixed, "base64");
|
|
@@ -5068,18 +6071,18 @@ async function extractPasskeyData(passkeyCredential) {
|
|
|
5068
6071
|
coordinates
|
|
5069
6072
|
};
|
|
5070
6073
|
}
|
|
5071
|
-
function
|
|
5072
|
-
const
|
|
6074
|
+
function getP256VerifierAddress(chainId) {
|
|
6075
|
+
const deployment = getDaimoP256VerifierDeployment({
|
|
5073
6076
|
version: "0.2.1",
|
|
5074
6077
|
released: true,
|
|
5075
6078
|
network: chainId
|
|
5076
6079
|
});
|
|
5077
|
-
if (!
|
|
5078
|
-
throw new Error(`Failed to load
|
|
6080
|
+
if (!deployment) {
|
|
6081
|
+
throw new Error(`Failed to load DaimoP256Verifier deployment for chain ID ${chainId}`);
|
|
5079
6082
|
}
|
|
5080
|
-
const verifierAddress =
|
|
6083
|
+
const verifierAddress = deployment.networkAddresses[chainId];
|
|
5081
6084
|
if (!verifierAddress) {
|
|
5082
|
-
throw new Error(`
|
|
6085
|
+
throw new Error(`DaimoP256Verifier address not found for chain ID ${chainId}`);
|
|
5083
6086
|
}
|
|
5084
6087
|
return verifierAddress;
|
|
5085
6088
|
}
|
|
@@ -5104,15 +6107,14 @@ import {
|
|
|
5104
6107
|
} from "viem";
|
|
5105
6108
|
|
|
5106
6109
|
// src/utils/passkeys/isSharedSigner.ts
|
|
5107
|
-
async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners
|
|
6110
|
+
async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners) {
|
|
5108
6111
|
const sharedSignerContractAddress = safeWebAuthnSharedSignerContract.contractAddress;
|
|
5109
6112
|
if (safeAddress && owners.includes(sharedSignerContractAddress)) {
|
|
5110
6113
|
const [sharedSignerSlot] = await safeWebAuthnSharedSignerContract.getConfiguration([
|
|
5111
6114
|
asHex(safeAddress)
|
|
5112
6115
|
]);
|
|
5113
6116
|
const { x, y, verifiers } = sharedSignerSlot;
|
|
5114
|
-
const
|
|
5115
|
-
const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(verifierAddress) === verifiers;
|
|
6117
|
+
const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(passkey.verifierAddress) === verifiers;
|
|
5116
6118
|
return isSharedSigner2;
|
|
5117
6119
|
}
|
|
5118
6120
|
return false;
|
|
@@ -5148,16 +6150,14 @@ var signTransaction = () => {
|
|
|
5148
6150
|
var signTypedData = () => {
|
|
5149
6151
|
throw new Error("Passkey Signers cannot sign signTypedData, they can only sign data.");
|
|
5150
6152
|
};
|
|
5151
|
-
var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners
|
|
5152
|
-
const { rawId, coordinates,
|
|
6153
|
+
var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners) => {
|
|
6154
|
+
const { rawId, coordinates, verifierAddress } = passkey;
|
|
5153
6155
|
const passkeyRawId = hexToBytes(asHex(rawId));
|
|
5154
|
-
const verifierAddress = customVerifierAddress || getDefaultFCLP256VerifierAddress(chainId);
|
|
5155
6156
|
const isPasskeySharedSigner = await isSharedSigner_default(
|
|
5156
6157
|
passkey,
|
|
5157
6158
|
safeWebAuthnSharedSignerContract,
|
|
5158
6159
|
safeAddress,
|
|
5159
|
-
owners
|
|
5160
|
-
chainId
|
|
6160
|
+
owners
|
|
5161
6161
|
);
|
|
5162
6162
|
let signerAddress;
|
|
5163
6163
|
if (isPasskeySharedSigner) {
|
|
@@ -5320,7 +6320,7 @@ import {
|
|
|
5320
6320
|
getTransaction,
|
|
5321
6321
|
getTransactionCount,
|
|
5322
6322
|
getStorageAt,
|
|
5323
|
-
readContract
|
|
6323
|
+
readContract as readContract2
|
|
5324
6324
|
} from "viem/actions";
|
|
5325
6325
|
|
|
5326
6326
|
// src/utils/provider.ts
|
|
@@ -5385,8 +6385,7 @@ var SafeProvider = class _SafeProvider {
|
|
|
5385
6385
|
safeWebAuthnSharedSignerContract,
|
|
5386
6386
|
safeProvider.getExternalProvider(),
|
|
5387
6387
|
safeAddress || "",
|
|
5388
|
-
owners || []
|
|
5389
|
-
chainId.toString()
|
|
6388
|
+
owners || []
|
|
5390
6389
|
);
|
|
5391
6390
|
} else {
|
|
5392
6391
|
passkeySigner = signer;
|
|
@@ -5551,7 +6550,7 @@ var SafeProvider = class _SafeProvider {
|
|
|
5551
6550
|
return data ?? "0x";
|
|
5552
6551
|
}
|
|
5553
6552
|
async readContract(args) {
|
|
5554
|
-
return
|
|
6553
|
+
return readContract2(this.#externalProvider, args);
|
|
5555
6554
|
}
|
|
5556
6555
|
// TODO: fix anys
|
|
5557
6556
|
encodeParameters(types, values) {
|
|
@@ -5834,7 +6833,7 @@ async function predictSafeAddress({
|
|
|
5834
6833
|
const salt = keccak2562(concat2([initializerHash, encodedNonce]));
|
|
5835
6834
|
const input = safeProvider.encodeParameters("address", [safeContract.getAddress()]);
|
|
5836
6835
|
const from = safeProxyFactoryContract.getAddress();
|
|
5837
|
-
const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId);
|
|
6836
|
+
const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId) && semverSatisfies6(safeVersion, "<=1.4.1");
|
|
5838
6837
|
if (isZkSyncChain) {
|
|
5839
6838
|
const proxyAddress2 = zkSyncCreate2Address(from, safeVersion, salt, asHex(input));
|
|
5840
6839
|
return safeProvider.getChecksummedAddress(proxyAddress2);
|
|
@@ -6012,6 +7011,10 @@ var FallbackHandlerManager = class {
|
|
|
6012
7011
|
}
|
|
6013
7012
|
return this.#safeContract;
|
|
6014
7013
|
}
|
|
7014
|
+
encodeSetFallbackHandler(safeContract, handler) {
|
|
7015
|
+
const encode = safeContract.encode;
|
|
7016
|
+
return encode("setFallbackHandler", [asHex(handler)]);
|
|
7017
|
+
}
|
|
6015
7018
|
async getFallbackHandler() {
|
|
6016
7019
|
const safeContract = await this.isFallbackHandlerCompatible();
|
|
6017
7020
|
return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#slot);
|
|
@@ -6021,13 +7024,13 @@ var FallbackHandlerManager = class {
|
|
|
6021
7024
|
this.validateFallbackHandlerAddress(fallbackHandlerAddress);
|
|
6022
7025
|
const currentFallbackHandler = await this.getFallbackHandler();
|
|
6023
7026
|
this.validateFallbackHandlerIsNotEnabled(currentFallbackHandler, fallbackHandlerAddress);
|
|
6024
|
-
return
|
|
7027
|
+
return this.encodeSetFallbackHandler(safeContract, fallbackHandlerAddress);
|
|
6025
7028
|
}
|
|
6026
7029
|
async encodeDisableFallbackHandlerData() {
|
|
6027
7030
|
const safeContract = await this.isFallbackHandlerCompatible();
|
|
6028
7031
|
const currentFallbackHandler = await this.getFallbackHandler();
|
|
6029
7032
|
this.validateFallbackHandlerIsEnabled(currentFallbackHandler);
|
|
6030
|
-
return
|
|
7033
|
+
return this.encodeSetFallbackHandler(safeContract, ZERO_ADDRESS);
|
|
6031
7034
|
}
|
|
6032
7035
|
};
|
|
6033
7036
|
var fallbackHandlerManager_default = FallbackHandlerManager;
|
|
@@ -6094,6 +7097,8 @@ var guardManager_default = GuardManager;
|
|
|
6094
7097
|
var ModuleManager = class {
|
|
6095
7098
|
#safeProvider;
|
|
6096
7099
|
#safeContract;
|
|
7100
|
+
// keccak256("module_manager.module_guard.address")
|
|
7101
|
+
#moduleGuardSlot = "0xb104e0b93118902c651344349b610029d694cfdec91c589c91ebafbcd0289947";
|
|
6097
7102
|
constructor(safeProvider, safeContract) {
|
|
6098
7103
|
this.#safeProvider = safeProvider;
|
|
6099
7104
|
this.#safeContract = safeContract;
|
|
@@ -6159,6 +7164,49 @@ var ModuleManager = class {
|
|
|
6159
7164
|
const prevModuleAddress = moduleIndex === 0 ? SENTINEL_ADDRESS : modules[moduleIndex - 1];
|
|
6160
7165
|
return this.#safeContract.encode("disableModule", [prevModuleAddress, moduleAddress]);
|
|
6161
7166
|
}
|
|
7167
|
+
validateModuleGuardAddress(moduleGuardAddress) {
|
|
7168
|
+
const isValidAddress = this.#safeProvider.isAddress(moduleGuardAddress);
|
|
7169
|
+
if (!isValidAddress || isZeroAddress(moduleGuardAddress)) {
|
|
7170
|
+
throw new Error("Invalid module guard address provided");
|
|
7171
|
+
}
|
|
7172
|
+
}
|
|
7173
|
+
validateModuleGuardIsNotEnabled(currentModuleGuard, newModuleGuardAddress) {
|
|
7174
|
+
if (sameString(currentModuleGuard, newModuleGuardAddress)) {
|
|
7175
|
+
throw new Error("Module guard provided is already enabled");
|
|
7176
|
+
}
|
|
7177
|
+
}
|
|
7178
|
+
validateModuleGuardIsEnabled(moduleGuardAddress) {
|
|
7179
|
+
if (isZeroAddress(moduleGuardAddress)) {
|
|
7180
|
+
throw new Error("There is no module guard enabled yet");
|
|
7181
|
+
}
|
|
7182
|
+
}
|
|
7183
|
+
async isModuleGuardCompatible() {
|
|
7184
|
+
if (!this.#safeContract) {
|
|
7185
|
+
throw new Error("Safe is not deployed");
|
|
7186
|
+
}
|
|
7187
|
+
const safeVersion = this.#safeContract.safeVersion;
|
|
7188
|
+
if (!hasSafeFeature("SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */, safeVersion)) {
|
|
7189
|
+
throw new Error("Current version of the Safe does not support module guard functionality");
|
|
7190
|
+
}
|
|
7191
|
+
return this.#safeContract;
|
|
7192
|
+
}
|
|
7193
|
+
async getModuleGuard() {
|
|
7194
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7195
|
+
return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#moduleGuardSlot);
|
|
7196
|
+
}
|
|
7197
|
+
async encodeEnableModuleGuardData(moduleGuardAddress) {
|
|
7198
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7199
|
+
this.validateModuleGuardAddress(moduleGuardAddress);
|
|
7200
|
+
const currentModuleGuard = await this.getModuleGuard();
|
|
7201
|
+
this.validateModuleGuardIsNotEnabled(currentModuleGuard, moduleGuardAddress);
|
|
7202
|
+
return safeContract.encode("setModuleGuard", [asHex(moduleGuardAddress)]);
|
|
7203
|
+
}
|
|
7204
|
+
async encodeDisableModuleGuardData() {
|
|
7205
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7206
|
+
const currentModuleGuard = await this.getModuleGuard();
|
|
7207
|
+
this.validateModuleGuardIsEnabled(currentModuleGuard);
|
|
7208
|
+
return safeContract.encode("setModuleGuard", [asHex(ZERO_ADDRESS)]);
|
|
7209
|
+
}
|
|
6162
7210
|
};
|
|
6163
7211
|
var moduleManager_default = ModuleManager;
|
|
6164
7212
|
|
|
@@ -6345,9 +7393,10 @@ function generateOnChainIdentifier({
|
|
|
6345
7393
|
var generateOnChainIdentifier_default = generateOnChainIdentifier;
|
|
6346
7394
|
|
|
6347
7395
|
// src/utils/getProtocolKitVersion.ts
|
|
6348
|
-
var getProtocolKitVersion = () => "
|
|
7396
|
+
var getProtocolKitVersion = () => "7.1.0";
|
|
6349
7397
|
|
|
6350
7398
|
// src/Safe.ts
|
|
7399
|
+
var EQ_OR_GT_1_5_0 = ">=1.5.0";
|
|
6351
7400
|
var EQ_OR_GT_1_4_1 = ">=1.4.1";
|
|
6352
7401
|
var EQ_OR_GT_1_3_03 = ">=1.3.0";
|
|
6353
7402
|
var Safe = class _Safe {
|
|
@@ -6383,31 +7432,27 @@ var Safe = class _Safe {
|
|
|
6383
7432
|
this.isValidSignature = async (messageHash, signature = "0x") => {
|
|
6384
7433
|
const safeAddress = await this.getAddress();
|
|
6385
7434
|
const fallbackHandler = await this.#getFallbackHandlerContract();
|
|
7435
|
+
const safeVersion = this.getContractVersion();
|
|
6386
7436
|
const signatureToCheck = signature && Array.isArray(signature) ? buildSignatureBytes(signature) : signature;
|
|
6387
7437
|
const bytes32Tuple = [
|
|
6388
7438
|
asHash(messageHash),
|
|
6389
7439
|
asHex(signatureToCheck)
|
|
6390
7440
|
];
|
|
6391
7441
|
const data = fallbackHandler.encode("isValidSignature", bytes32Tuple);
|
|
6392
|
-
const
|
|
6393
|
-
|
|
6394
|
-
|
|
6395
|
-
|
|
6396
|
-
|
|
7442
|
+
const callParams = { from: safeAddress, to: safeAddress };
|
|
7443
|
+
const calls = [this.#safeProvider.call({ ...callParams, data })];
|
|
7444
|
+
if (!semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
7445
|
+
const bytesTuple = [
|
|
7446
|
+
asHash(messageHash),
|
|
7447
|
+
asHex(signatureToCheck)
|
|
7448
|
+
];
|
|
7449
|
+
const bytesData = fallbackHandler.encode("isValidSignature", bytesTuple);
|
|
7450
|
+
calls.push(this.#safeProvider.call({ ...callParams, data: bytesData }));
|
|
7451
|
+
}
|
|
6397
7452
|
try {
|
|
6398
|
-
const
|
|
6399
|
-
|
|
6400
|
-
|
|
6401
|
-
to: safeAddress,
|
|
6402
|
-
data
|
|
6403
|
-
}),
|
|
6404
|
-
this.#safeProvider.call({
|
|
6405
|
-
from: safeAddress,
|
|
6406
|
-
to: safeAddress,
|
|
6407
|
-
data: bytesData
|
|
6408
|
-
})
|
|
6409
|
-
]);
|
|
6410
|
-
return !!isValidSignatureResponse.length && (isValidSignatureResponse[0].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE || isValidSignatureResponse[1].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE_BYTES);
|
|
7453
|
+
const responses = await Promise.all(calls);
|
|
7454
|
+
const magicValues = [this.#MAGIC_VALUE, this.#MAGIC_VALUE_BYTES];
|
|
7455
|
+
return responses.some((response, i) => response.slice(0, 10).toLowerCase() === magicValues[i]);
|
|
6411
7456
|
} catch (error) {
|
|
6412
7457
|
return false;
|
|
6413
7458
|
}
|
|
@@ -6766,6 +7811,15 @@ var Safe = class _Safe {
|
|
|
6766
7811
|
async isModuleEnabled(moduleAddress) {
|
|
6767
7812
|
return this.#moduleManager.isModuleEnabled(moduleAddress);
|
|
6768
7813
|
}
|
|
7814
|
+
/**
|
|
7815
|
+
* Returns the enabled Safe module guard or 0x address if no module guard is enabled.
|
|
7816
|
+
*
|
|
7817
|
+
* @returns The address of the enabled Safe module guard
|
|
7818
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
7819
|
+
*/
|
|
7820
|
+
async getModuleGuard() {
|
|
7821
|
+
return this.#moduleManager.getModuleGuard();
|
|
7822
|
+
}
|
|
6769
7823
|
/**
|
|
6770
7824
|
* Checks if a specific address is an owner of the current Safe.
|
|
6771
7825
|
*
|
|
@@ -6967,7 +8021,15 @@ var Safe = class _Safe {
|
|
|
6967
8021
|
throw new Error("eth_sign is only supported by Safes >= v1.1.0");
|
|
6968
8022
|
}
|
|
6969
8023
|
let safeMessageHash;
|
|
6970
|
-
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion,
|
|
8024
|
+
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
8025
|
+
const parentSafeMessageHash = calculateSafeMessageHash(
|
|
8026
|
+
preimageSafeAddress,
|
|
8027
|
+
hashSafeMessage(message.data),
|
|
8028
|
+
safeVersion,
|
|
8029
|
+
chainId
|
|
8030
|
+
);
|
|
8031
|
+
safeMessageHash = await this.getSafeMessageHash(parentSafeMessageHash);
|
|
8032
|
+
} else if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_4_1)) {
|
|
6971
8033
|
const messageHashData = preimageSafeMessageHash(
|
|
6972
8034
|
preimageSafeAddress,
|
|
6973
8035
|
hashSafeMessage(message.data),
|
|
@@ -7047,7 +8109,15 @@ var Safe = class _Safe {
|
|
|
7047
8109
|
throw new Error("eth_sign is only supported by Safes >= v1.1.0");
|
|
7048
8110
|
}
|
|
7049
8111
|
let txHash;
|
|
7050
|
-
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2,
|
|
8112
|
+
if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_5_0) && preimageSafeAddress) {
|
|
8113
|
+
const txHashData = calculateSafeTransactionHash(
|
|
8114
|
+
preimageSafeAddress,
|
|
8115
|
+
transaction.data,
|
|
8116
|
+
safeVersion2,
|
|
8117
|
+
chainId
|
|
8118
|
+
);
|
|
8119
|
+
txHash = await this.getSafeMessageHash(txHashData);
|
|
8120
|
+
} else if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_3_03) && preimageSafeAddress) {
|
|
7051
8121
|
const txHashData = preimageSafeTransactionHash(
|
|
7052
8122
|
preimageSafeAddress,
|
|
7053
8123
|
safeTransaction.data,
|
|
@@ -7169,6 +8239,203 @@ var Safe = class _Safe {
|
|
|
7169
8239
|
});
|
|
7170
8240
|
return safeTransaction;
|
|
7171
8241
|
}
|
|
8242
|
+
// ---------------------------------------------------------------------------
|
|
8243
|
+
// ExtensibleFallbackHandler helpers
|
|
8244
|
+
// ---------------------------------------------------------------------------
|
|
8245
|
+
/**
|
|
8246
|
+
* Returns an instance of the ExtensibleFallbackHandler contract for the current chain.
|
|
8247
|
+
* Used internally to compose read queries and Safe transactions against the EFH.
|
|
8248
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8249
|
+
*/
|
|
8250
|
+
async #getExtensibleFallbackHandlerContract() {
|
|
8251
|
+
const safeVersion = this.getContractVersion();
|
|
8252
|
+
if (!semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
8253
|
+
throw new Error("ExtensibleFallbackHandler is only available for Safe >= v1.5.0");
|
|
8254
|
+
}
|
|
8255
|
+
const chainId = await this.getChainId();
|
|
8256
|
+
const customContracts = this.#contractManager.contractNetworks?.[chainId.toString()];
|
|
8257
|
+
return getExtensibleFallbackHandlerContract({
|
|
8258
|
+
safeProvider: this.#safeProvider,
|
|
8259
|
+
safeVersion,
|
|
8260
|
+
customContracts
|
|
8261
|
+
});
|
|
8262
|
+
}
|
|
8263
|
+
// ----- Read helpers -----
|
|
8264
|
+
/**
|
|
8265
|
+
* Returns the bytes32-encoded handler registered for the given 4-byte selector on
|
|
8266
|
+
* the ExtensibleFallbackHandler for this Safe.
|
|
8267
|
+
* Only available for Safe >= v1.5.0.
|
|
8268
|
+
*
|
|
8269
|
+
* @param selector - The 4-byte function selector (e.g. '0xaabbccdd')
|
|
8270
|
+
* @returns The bytes32 handler entry, or the zero bytes32 if unregistered
|
|
8271
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8272
|
+
*/
|
|
8273
|
+
async getSafeMethod(selector) {
|
|
8274
|
+
const safeAddress = await this.getAddress();
|
|
8275
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8276
|
+
const [method] = await efhContract.safeMethods([
|
|
8277
|
+
safeAddress,
|
|
8278
|
+
selector
|
|
8279
|
+
]);
|
|
8280
|
+
return method;
|
|
8281
|
+
}
|
|
8282
|
+
/**
|
|
8283
|
+
* Returns the ISafeSignatureVerifier address registered for the given domain separator
|
|
8284
|
+
* on the ExtensibleFallbackHandler for this Safe.
|
|
8285
|
+
* Only available for Safe >= v1.5.0.
|
|
8286
|
+
*
|
|
8287
|
+
* @param domainSeparator - 32-byte domain separator
|
|
8288
|
+
* @returns The verifier address, or the zero address if unregistered
|
|
8289
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8290
|
+
*/
|
|
8291
|
+
async getDomainVerifier(domainSeparator) {
|
|
8292
|
+
const safeAddress = await this.getAddress();
|
|
8293
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8294
|
+
const [verifier] = await efhContract.domainVerifiers([
|
|
8295
|
+
safeAddress,
|
|
8296
|
+
domainSeparator
|
|
8297
|
+
]);
|
|
8298
|
+
return verifier;
|
|
8299
|
+
}
|
|
8300
|
+
/**
|
|
8301
|
+
* Returns whether the given ERC-165 interface ID is marked as supported for this Safe
|
|
8302
|
+
* on the ExtensibleFallbackHandler.
|
|
8303
|
+
* Only available for Safe >= v1.5.0.
|
|
8304
|
+
*
|
|
8305
|
+
* @param interfaceId - 4-byte ERC-165 interface ID
|
|
8306
|
+
* @returns true if supported, false otherwise
|
|
8307
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8308
|
+
*/
|
|
8309
|
+
async isSafeInterfaceSupported(interfaceId) {
|
|
8310
|
+
const safeAddress = await this.getAddress();
|
|
8311
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8312
|
+
const [isSupported] = await efhContract.safeInterfaces([
|
|
8313
|
+
safeAddress,
|
|
8314
|
+
interfaceId
|
|
8315
|
+
]);
|
|
8316
|
+
return isSupported;
|
|
8317
|
+
}
|
|
8318
|
+
// ----- Write transaction builders -----
|
|
8319
|
+
/**
|
|
8320
|
+
* Returns a Safe transaction that calls setSafeMethod on the ExtensibleFallbackHandler.
|
|
8321
|
+
* Because the EFH uses msg.sender as the Safe address, this must be executed through
|
|
8322
|
+
* the Safe itself.
|
|
8323
|
+
* Only available for Safe >= v1.5.0.
|
|
8324
|
+
*
|
|
8325
|
+
* @param selector - The 4-byte function selector to handle
|
|
8326
|
+
* @param newMethod - bytes32-packed handler address (address right-aligned, 12 leading zero bytes)
|
|
8327
|
+
* @param options - Optional Safe transaction properties
|
|
8328
|
+
* @returns The Safe transaction ready to be signed
|
|
8329
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8330
|
+
*/
|
|
8331
|
+
async createSetSafeMethodTx(selector, newMethod, options) {
|
|
8332
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8333
|
+
const safeAddress = await this.getAddress();
|
|
8334
|
+
const data = efhContract.encode("setSafeMethod", [
|
|
8335
|
+
selector,
|
|
8336
|
+
newMethod
|
|
8337
|
+
]);
|
|
8338
|
+
return this.createTransaction({
|
|
8339
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8340
|
+
options
|
|
8341
|
+
});
|
|
8342
|
+
}
|
|
8343
|
+
/**
|
|
8344
|
+
* Returns a Safe transaction that calls setDomainVerifier on the ExtensibleFallbackHandler.
|
|
8345
|
+
* Registers an ISafeSignatureVerifier for EIP-712 domain-based signature validation.
|
|
8346
|
+
* Only available for Safe >= v1.5.0.
|
|
8347
|
+
*
|
|
8348
|
+
* @param domainSeparator - 32-byte EIP-712 domain separator
|
|
8349
|
+
* @param verifier - Address of the ISafeSignatureVerifier contract
|
|
8350
|
+
* @param options - Optional Safe transaction properties
|
|
8351
|
+
* @returns The Safe transaction ready to be signed
|
|
8352
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8353
|
+
*/
|
|
8354
|
+
async createSetDomainVerifierTx(domainSeparator, verifier, options) {
|
|
8355
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8356
|
+
const safeAddress = await this.getAddress();
|
|
8357
|
+
const data = efhContract.encode("setDomainVerifier", [
|
|
8358
|
+
domainSeparator,
|
|
8359
|
+
verifier
|
|
8360
|
+
]);
|
|
8361
|
+
return this.createTransaction({
|
|
8362
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8363
|
+
options
|
|
8364
|
+
});
|
|
8365
|
+
}
|
|
8366
|
+
/**
|
|
8367
|
+
* Returns a Safe transaction that calls setSupportedInterface on the ExtensibleFallbackHandler.
|
|
8368
|
+
* Marks (or un-marks) an ERC-165 interface as supported for this Safe.
|
|
8369
|
+
* Only available for Safe >= v1.5.0.
|
|
8370
|
+
*
|
|
8371
|
+
* @param interfaceId - 4-byte ERC-165 interface ID
|
|
8372
|
+
* @param supported - true to add support, false to remove it
|
|
8373
|
+
* @param options - Optional Safe transaction properties
|
|
8374
|
+
* @returns The Safe transaction ready to be signed
|
|
8375
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8376
|
+
*/
|
|
8377
|
+
async createSetSupportedInterfaceTx(interfaceId, supported, options) {
|
|
8378
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8379
|
+
const safeAddress = await this.getAddress();
|
|
8380
|
+
const data = efhContract.encode("setSupportedInterface", [
|
|
8381
|
+
interfaceId,
|
|
8382
|
+
supported
|
|
8383
|
+
]);
|
|
8384
|
+
return this.createTransaction({
|
|
8385
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8386
|
+
options
|
|
8387
|
+
});
|
|
8388
|
+
}
|
|
8389
|
+
/**
|
|
8390
|
+
* Returns a Safe transaction that calls addSupportedInterfaceBatch on the ExtensibleFallbackHandler.
|
|
8391
|
+
* Atomically registers an interface and multiple method handlers in a single call.
|
|
8392
|
+
* Only available for Safe >= v1.5.0.
|
|
8393
|
+
*
|
|
8394
|
+
* Each entry in handlerWithSelectors is a bytes32 value encoding both the handler address
|
|
8395
|
+
* and the 4-byte method selector: first 4 bytes = selector, next 8 bytes = zero padding,
|
|
8396
|
+
* last 20 bytes = handler address.
|
|
8397
|
+
*
|
|
8398
|
+
* @param interfaceId - 4-byte ERC-165 interface ID to mark as supported
|
|
8399
|
+
* @param handlerWithSelectors - Array of packed selector+handler bytes32 values
|
|
8400
|
+
* @param options - Optional Safe transaction properties
|
|
8401
|
+
* @returns The Safe transaction ready to be signed
|
|
8402
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8403
|
+
*/
|
|
8404
|
+
async createAddSupportedInterfaceBatchTx(interfaceId, handlerWithSelectors, options) {
|
|
8405
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8406
|
+
const safeAddress = await this.getAddress();
|
|
8407
|
+
const data = efhContract.encode("addSupportedInterfaceBatch", [
|
|
8408
|
+
interfaceId,
|
|
8409
|
+
handlerWithSelectors
|
|
8410
|
+
]);
|
|
8411
|
+
return this.createTransaction({
|
|
8412
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8413
|
+
options
|
|
8414
|
+
});
|
|
8415
|
+
}
|
|
8416
|
+
/**
|
|
8417
|
+
* Returns a Safe transaction that calls removeSupportedInterfaceBatch on the ExtensibleFallbackHandler.
|
|
8418
|
+
* Atomically un-registers an interface and removes the given method handlers in a single call.
|
|
8419
|
+
* Only available for Safe >= v1.5.0.
|
|
8420
|
+
*
|
|
8421
|
+
* @param interfaceId - 4-byte ERC-165 interface ID to remove
|
|
8422
|
+
* @param selectors - Array of 4-byte function selectors to un-register
|
|
8423
|
+
* @param options - Optional Safe transaction properties
|
|
8424
|
+
* @returns The Safe transaction ready to be signed
|
|
8425
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8426
|
+
*/
|
|
8427
|
+
async createRemoveSupportedInterfaceBatchTx(interfaceId, selectors, options) {
|
|
8428
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8429
|
+
const safeAddress = await this.getAddress();
|
|
8430
|
+
const data = efhContract.encode("removeSupportedInterfaceBatch", [
|
|
8431
|
+
interfaceId,
|
|
8432
|
+
selectors
|
|
8433
|
+
]);
|
|
8434
|
+
return this.createTransaction({
|
|
8435
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8436
|
+
options
|
|
8437
|
+
});
|
|
8438
|
+
}
|
|
7172
8439
|
/**
|
|
7173
8440
|
* Returns the Safe transaction to enable a Safe guard.
|
|
7174
8441
|
*
|
|
@@ -7211,6 +8478,48 @@ var Safe = class _Safe {
|
|
|
7211
8478
|
});
|
|
7212
8479
|
return safeTransaction;
|
|
7213
8480
|
}
|
|
8481
|
+
/**
|
|
8482
|
+
* Returns the Safe transaction to enable a Safe module guard.
|
|
8483
|
+
*
|
|
8484
|
+
* @param moduleGuardAddress - The desired module guard address
|
|
8485
|
+
* @param options - The transaction optional properties
|
|
8486
|
+
* @returns The Safe transaction ready to be signed
|
|
8487
|
+
* @throws "Invalid module guard address provided"
|
|
8488
|
+
* @throws "Module guard provided is already enabled"
|
|
8489
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
8490
|
+
*/
|
|
8491
|
+
async createEnableModuleGuardTx(moduleGuardAddress, options) {
|
|
8492
|
+
const safeTransactionData = {
|
|
8493
|
+
to: await this.getAddress(),
|
|
8494
|
+
value: "0",
|
|
8495
|
+
data: await this.#moduleManager.encodeEnableModuleGuardData(moduleGuardAddress)
|
|
8496
|
+
};
|
|
8497
|
+
const safeTransaction = await this.createTransaction({
|
|
8498
|
+
transactions: [safeTransactionData],
|
|
8499
|
+
options
|
|
8500
|
+
});
|
|
8501
|
+
return safeTransaction;
|
|
8502
|
+
}
|
|
8503
|
+
/**
|
|
8504
|
+
* Returns the Safe transaction to disable a Safe module guard.
|
|
8505
|
+
*
|
|
8506
|
+
* @param options - The transaction optional properties
|
|
8507
|
+
* @returns The Safe transaction ready to be signed
|
|
8508
|
+
* @throws "There is no module guard enabled yet"
|
|
8509
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
8510
|
+
*/
|
|
8511
|
+
async createDisableModuleGuardTx(options) {
|
|
8512
|
+
const safeTransactionData = {
|
|
8513
|
+
to: await this.getAddress(),
|
|
8514
|
+
value: "0",
|
|
8515
|
+
data: await this.#moduleManager.encodeDisableModuleGuardData()
|
|
8516
|
+
};
|
|
8517
|
+
const safeTransaction = await this.createTransaction({
|
|
8518
|
+
transactions: [safeTransactionData],
|
|
8519
|
+
options
|
|
8520
|
+
});
|
|
8521
|
+
return safeTransaction;
|
|
8522
|
+
}
|
|
7214
8523
|
/**
|
|
7215
8524
|
* Returns the Safe transaction to enable a Safe module.
|
|
7216
8525
|
*
|
|
@@ -7723,7 +9032,7 @@ var Safe = class _Safe {
|
|
|
7723
9032
|
/**
|
|
7724
9033
|
* This method creates a signer to be used with the init method
|
|
7725
9034
|
* @param {Credential} credential - The credential to be used to create the signer. Can be generated in the web with navigator.credentials.create
|
|
7726
|
-
* @returns {
|
|
9035
|
+
* @returns {ExtractedPasskeyData} - The extracted passkey data. Combine with a verifierAddress to build a PasskeyArgType.
|
|
7727
9036
|
*/
|
|
7728
9037
|
this.createPasskeySigner = async (credential) => {
|
|
7729
9038
|
return extractPasskeyData(credential);
|
|
@@ -7794,11 +9103,15 @@ export {
|
|
|
7794
9103
|
MultiSendCallOnlyBaseContract_default as MultiSendCallOnlyBaseContract,
|
|
7795
9104
|
PREDETERMINED_SALT_NONCE,
|
|
7796
9105
|
SafeBaseContract_default as SafeBaseContract,
|
|
9106
|
+
SafeFeature,
|
|
7797
9107
|
SafeProvider_default as SafeProvider,
|
|
7798
9108
|
SafeProxyFactoryBaseContract_default as SafeProxyFactoryBaseContract,
|
|
7799
9109
|
SignMessageLibBaseContract_default as SignMessageLibBaseContract,
|
|
9110
|
+
adjustVInSignature,
|
|
7800
9111
|
buildContractSignature,
|
|
7801
9112
|
buildSignatureBytes,
|
|
9113
|
+
calculateSafeMessageHash,
|
|
9114
|
+
calculateSafeTransactionHash,
|
|
7802
9115
|
createERC20TokenTransferTransaction,
|
|
7803
9116
|
createPasskeyClient,
|
|
7804
9117
|
decodeMultiSendData,
|
|
@@ -7813,15 +9126,20 @@ export {
|
|
|
7813
9126
|
extractPasskeyData,
|
|
7814
9127
|
generateEIP712Signature,
|
|
7815
9128
|
generateOnChainIdentifier_default as generateOnChainIdentifier,
|
|
9129
|
+
generatePreValidatedSignature,
|
|
7816
9130
|
generateSignature,
|
|
7817
9131
|
generateTypedData,
|
|
9132
|
+
getChainIdFromEip3770NetworkPrefix,
|
|
7818
9133
|
getCompatibilityFallbackHandlerContract,
|
|
7819
9134
|
getCreateCallContract,
|
|
7820
9135
|
getERC20Decimals,
|
|
9136
|
+
getEip3770NetworkPrefixFromChainId,
|
|
7821
9137
|
getEip712MessageTypes,
|
|
7822
9138
|
getEip712TxTypes,
|
|
9139
|
+
getExtensibleFallbackHandlerContract,
|
|
7823
9140
|
getMultiSendCallOnlyContract,
|
|
7824
9141
|
getMultiSendContract,
|
|
9142
|
+
getP256VerifierAddress,
|
|
7825
9143
|
getPasskeyOwnerAddress_default as getPasskeyOwnerAddress,
|
|
7826
9144
|
getPredictedSafeAddressInitCode,
|
|
7827
9145
|
getSafeAddressFromDeploymentTx,
|
|
@@ -7830,6 +9148,7 @@ export {
|
|
|
7830
9148
|
getSafeWebAuthnSharedSignerContract,
|
|
7831
9149
|
getSafeWebAuthnSignerFactoryContract,
|
|
7832
9150
|
getSignMessageLibContract,
|
|
9151
|
+
hasSafeFeature,
|
|
7833
9152
|
hashSafeMessage,
|
|
7834
9153
|
isGasTokenCompatibleWithHandlePayment,
|
|
7835
9154
|
predictSafeAddress,
|