@safe-global/protocol-kit 6.1.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/src/index.cjs +1466 -200
- package/dist/cjs/test-utils/index.cjs +577 -72
- package/dist/esm/src/index.mjs +1428 -143
- package/dist/esm/test-utils/index.mjs +559 -35
- 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 +3 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/managers/fallbackHandlerManager.d.ts +1 -0
- package/dist/src/managers/fallbackHandlerManager.d.ts.map +1 -1
- package/dist/src/managers/moduleManager.d.ts +7 -0
- package/dist/src/managers/moduleManager.d.ts.map +1 -1
- package/dist/src/types/contracts.d.ts +22 -8
- package/dist/src/types/contracts.d.ts.map +1 -1
- package/dist/src/types/passkeys.d.ts +13 -2
- package/dist/src/types/passkeys.d.ts.map +1 -1
- package/dist/src/utils/eip-3770/config.d.ts.map +1 -1
- package/dist/src/utils/passkeys/PasskeyClient.d.ts +1 -1
- package/dist/src/utils/passkeys/PasskeyClient.d.ts.map +1 -1
- package/dist/src/utils/passkeys/extractPasskeyData.d.ts +8 -11
- package/dist/src/utils/passkeys/extractPasskeyData.d.ts.map +1 -1
- package/dist/src/utils/passkeys/isSharedSigner.d.ts +1 -1
- package/dist/src/utils/passkeys/isSharedSigner.d.ts.map +1 -1
- package/dist/src/utils/safeVersions.d.ts +8 -5
- package/dist/src/utils/safeVersions.d.ts.map +1 -1
- package/dist/test-utils/passkeys.d.ts +2 -2
- package/dist/test-utils/passkeys.d.ts.map +1 -1
- package/package.json +7 -5
package/dist/cjs/src/index.cjs
CHANGED
|
@@ -74,8 +74,10 @@ __export(src_exports, {
|
|
|
74
74
|
getERC20Decimals: () => getERC20Decimals,
|
|
75
75
|
getEip712MessageTypes: () => getEip712MessageTypes,
|
|
76
76
|
getEip712TxTypes: () => getEip712TxTypes,
|
|
77
|
+
getExtensibleFallbackHandlerContract: () => getExtensibleFallbackHandlerContract,
|
|
77
78
|
getMultiSendCallOnlyContract: () => getMultiSendCallOnlyContract,
|
|
78
79
|
getMultiSendContract: () => getMultiSendContract,
|
|
80
|
+
getP256VerifierAddress: () => getP256VerifierAddress,
|
|
79
81
|
getPasskeyOwnerAddress: () => getPasskeyOwnerAddress_default,
|
|
80
82
|
getPredictedSafeAddressInitCode: () => getPredictedSafeAddressInitCode,
|
|
81
83
|
getSafeAddressFromDeploymentTx: () => getSafeAddressFromDeploymentTx,
|
|
@@ -96,17 +98,31 @@ __export(src_exports, {
|
|
|
96
98
|
module.exports = __toCommonJS(src_exports);
|
|
97
99
|
|
|
98
100
|
// src/Safe.ts
|
|
99
|
-
var
|
|
101
|
+
var import_types_kit37 = require("@safe-global/types-kit");
|
|
100
102
|
|
|
101
103
|
// src/contracts/utils.ts
|
|
102
104
|
var import_viem13 = require("viem");
|
|
103
|
-
var
|
|
105
|
+
var import_actions10 = require("viem/actions");
|
|
104
106
|
|
|
105
107
|
// src/contracts/config.ts
|
|
106
108
|
var import_safe_deployments = require("@safe-global/safe-deployments");
|
|
107
109
|
var import_safe_modules_deployments = require("@safe-global/safe-modules-deployments");
|
|
108
|
-
var DEFAULT_SAFE_VERSION = "1.
|
|
110
|
+
var DEFAULT_SAFE_VERSION = "1.4.1";
|
|
109
111
|
var safeDeploymentsVersions = {
|
|
112
|
+
"1.5.0": {
|
|
113
|
+
safeSingletonVersion: "1.5.0",
|
|
114
|
+
safeSingletonL2Version: "1.5.0",
|
|
115
|
+
safeProxyFactoryVersion: "1.5.0",
|
|
116
|
+
compatibilityFallbackHandler: "1.5.0",
|
|
117
|
+
extensibleFallbackHandler: "1.5.0",
|
|
118
|
+
multiSendVersion: "1.5.0",
|
|
119
|
+
multiSendCallOnlyVersion: "1.5.0",
|
|
120
|
+
signMessageLibVersion: "1.5.0",
|
|
121
|
+
createCallVersion: "1.5.0",
|
|
122
|
+
simulateTxAccessorVersion: "1.5.0",
|
|
123
|
+
safeWebAuthnSignerFactoryVersion: "0.2.1",
|
|
124
|
+
safeWebAuthnSharedSignerVersion: "0.2.1"
|
|
125
|
+
},
|
|
110
126
|
"1.4.1": {
|
|
111
127
|
safeSingletonVersion: "1.4.1",
|
|
112
128
|
safeSingletonL2Version: "1.4.1",
|
|
@@ -179,6 +195,7 @@ var contractFunctions = {
|
|
|
179
195
|
safeSingletonL2Version: import_safe_deployments.getSafeL2SingletonDeployments,
|
|
180
196
|
safeProxyFactoryVersion: import_safe_deployments.getProxyFactoryDeployments,
|
|
181
197
|
compatibilityFallbackHandler: import_safe_deployments.getCompatibilityFallbackHandlerDeployments,
|
|
198
|
+
extensibleFallbackHandler: import_safe_deployments.getExtensibleFallbackHandlerDeployments,
|
|
182
199
|
multiSendVersion: import_safe_deployments.getMultiSendDeployments,
|
|
183
200
|
multiSendCallOnlyVersion: import_safe_deployments.getMultiSendCallOnlyDeployments,
|
|
184
201
|
signMessageLibVersion: import_safe_deployments.getSignMessageLibDeployments,
|
|
@@ -328,7 +345,7 @@ var networks = [
|
|
|
328
345
|
{ chainId: 255n, shortName: "kroma" },
|
|
329
346
|
{ chainId: 274n, shortName: "lachain" },
|
|
330
347
|
{ chainId: 280n, shortName: "zksync-goerli" },
|
|
331
|
-
{ chainId: 282n, shortName: "zkTCRO" },
|
|
348
|
+
{ chainId: 282n, shortName: "deprecated-zkTCRO" },
|
|
332
349
|
{ chainId: 288n, shortName: "boba" },
|
|
333
350
|
{ chainId: 291n, shortName: "orderly" },
|
|
334
351
|
{ chainId: 295n, shortName: "hedera-mainnet" },
|
|
@@ -361,6 +378,8 @@ var networks = [
|
|
|
361
378
|
{ chainId: 690n, shortName: "redstone" },
|
|
362
379
|
{ chainId: 698n, shortName: "Matchain" },
|
|
363
380
|
{ chainId: 747n, shortName: "flow-mainnet" },
|
|
381
|
+
{ chainId: 756n, shortName: "capx-testnet" },
|
|
382
|
+
{ chainId: 757n, shortName: "capx" },
|
|
364
383
|
{ chainId: 787n, shortName: "aca" },
|
|
365
384
|
{ chainId: 841n, shortName: "tara" },
|
|
366
385
|
{ chainId: 842n, shortName: "taratest" },
|
|
@@ -406,6 +425,7 @@ var networks = [
|
|
|
406
425
|
{ chainId: 1559n, shortName: "tenet" },
|
|
407
426
|
{ chainId: 1625n, shortName: "gravity" },
|
|
408
427
|
{ chainId: 1663n, shortName: "Gobi" },
|
|
428
|
+
{ chainId: 1672n, shortName: "pharos" },
|
|
409
429
|
{ chainId: 1729n, shortName: "reya" },
|
|
410
430
|
{ chainId: 1740n, shortName: "metall2-testnet" },
|
|
411
431
|
{ chainId: 1750n, shortName: "metall2" },
|
|
@@ -443,9 +463,12 @@ var networks = [
|
|
|
443
463
|
{ chainId: 2442n, shortName: "zkevm-testnet-cardona" },
|
|
444
464
|
{ chainId: 2522n, shortName: "fraxtal-testnet" },
|
|
445
465
|
{ chainId: 2741n, shortName: "abstract" },
|
|
466
|
+
{ chainId: 2787n, shortName: "creator-chain-mainnet" },
|
|
446
467
|
{ chainId: 2810n, shortName: "hmorph" },
|
|
447
468
|
{ chainId: 2818n, shortName: "morph" },
|
|
469
|
+
{ chainId: 2910n, shortName: "morph-hoodi-testnet" },
|
|
448
470
|
{ chainId: 3068n, shortName: "bfc" },
|
|
471
|
+
{ chainId: 3111n, shortName: "alpha" },
|
|
449
472
|
{ chainId: 3338n, shortName: "PEAQ" },
|
|
450
473
|
{ chainId: 3501n, shortName: "JFIN" },
|
|
451
474
|
{ chainId: 3636n, shortName: "BTNXt" },
|
|
@@ -464,6 +487,7 @@ var networks = [
|
|
|
464
487
|
{ chainId: 4337n, shortName: "beam" },
|
|
465
488
|
{ chainId: 4460n, shortName: "orderlyl2" },
|
|
466
489
|
{ chainId: 4488n, shortName: "HYDRA" },
|
|
490
|
+
{ chainId: 4509n, shortName: "SC" },
|
|
467
491
|
{ chainId: 4653n, shortName: "gold" },
|
|
468
492
|
{ chainId: 4661n, shortName: "appchaintestnet" },
|
|
469
493
|
{ chainId: 4689n, shortName: "iotex-mainnet" },
|
|
@@ -499,13 +523,17 @@ var networks = [
|
|
|
499
523
|
{ chainId: 7070n, shortName: "planq" },
|
|
500
524
|
{ chainId: 7171n, shortName: "bitrock" },
|
|
501
525
|
{ chainId: 7200n, shortName: "xsat" },
|
|
526
|
+
{ chainId: 7208n, shortName: "nxra-mainnet" },
|
|
502
527
|
{ chainId: 7332n, shortName: "EON" },
|
|
528
|
+
{ chainId: 7336n, shortName: "pruvtestnet" },
|
|
529
|
+
{ chainId: 7337n, shortName: "pruvmainnet" },
|
|
503
530
|
{ chainId: 7341n, shortName: "shyft" },
|
|
504
531
|
{ chainId: 7560n, shortName: "cyeth" },
|
|
505
532
|
{ chainId: 7700n, shortName: "canto" },
|
|
506
533
|
{ chainId: 7771n, shortName: "tbitrock" },
|
|
507
534
|
{ chainId: 7897n, shortName: "arena-z" },
|
|
508
535
|
{ chainId: 8008n, shortName: "polynomial" },
|
|
536
|
+
{ chainId: 8150n, shortName: "alpen" },
|
|
509
537
|
{ chainId: 8192n, shortName: "tqf" },
|
|
510
538
|
{ chainId: 8194n, shortName: "ttqf" },
|
|
511
539
|
{ chainId: 8217n, shortName: "kaia-mainnet" },
|
|
@@ -514,6 +542,7 @@ var networks = [
|
|
|
514
542
|
{ chainId: 8408n, shortName: "zentest" },
|
|
515
543
|
{ chainId: 8453n, shortName: "base" },
|
|
516
544
|
{ chainId: 8700n, shortName: "ACN" },
|
|
545
|
+
{ chainId: 8765n, shortName: "ward" },
|
|
517
546
|
{ chainId: 8801n, shortName: "okto-testnet" },
|
|
518
547
|
{ chainId: 8822n, shortName: "iotaevm" },
|
|
519
548
|
{ chainId: 8844n, shortName: "THYDRA" },
|
|
@@ -539,6 +568,7 @@ var networks = [
|
|
|
539
568
|
{ chainId: 11111n, shortName: "WAGMI" },
|
|
540
569
|
{ chainId: 11124n, shortName: "abstract-sepolia" },
|
|
541
570
|
{ chainId: 11235n, shortName: "islm" },
|
|
571
|
+
{ chainId: 11417n, shortName: "anq-testnet" },
|
|
542
572
|
{ chainId: 11437n, shortName: "shyftt" },
|
|
543
573
|
{ chainId: 11501n, shortName: "bevm" },
|
|
544
574
|
{ chainId: 11503n, shortName: "bevm-test" },
|
|
@@ -550,6 +580,7 @@ var networks = [
|
|
|
550
580
|
{ chainId: 12553n, shortName: "rss3" },
|
|
551
581
|
{ chainId: 13337n, shortName: "beam-testnet" },
|
|
552
582
|
{ chainId: 13371n, shortName: "imx" },
|
|
583
|
+
{ chainId: 13441n, shortName: "bridgeless" },
|
|
553
584
|
{ chainId: 13473n, shortName: "imx-testnet" },
|
|
554
585
|
{ chainId: 13505n, shortName: "gravitysep" },
|
|
555
586
|
{ chainId: 13746n, shortName: "g7t" },
|
|
@@ -572,6 +603,7 @@ var networks = [
|
|
|
572
603
|
{ chainId: 28802n, shortName: "tcent" },
|
|
573
604
|
{ chainId: 28882n, shortName: "BobaSepolia" },
|
|
574
605
|
{ chainId: 28979n, shortName: "kimbonet-testnet" },
|
|
606
|
+
{ chainId: 30303n, shortName: "Ethiq" },
|
|
575
607
|
{ chainId: 31611n, shortName: "mezo" },
|
|
576
608
|
{ chainId: 32323n, shortName: "basedai" },
|
|
577
609
|
{ chainId: 32380n, shortName: "paix" },
|
|
@@ -585,6 +617,7 @@ var networks = [
|
|
|
585
617
|
{ chainId: 35441n, shortName: "q" },
|
|
586
618
|
{ chainId: 35443n, shortName: "q-testnet" },
|
|
587
619
|
{ chainId: 36888n, shortName: "abcore" },
|
|
620
|
+
{ chainId: 36900n, shortName: "adi" },
|
|
588
621
|
{ chainId: 37111n, shortName: "lens-sepolia" },
|
|
589
622
|
{ chainId: 41455n, shortName: "aleph-zero" },
|
|
590
623
|
{ chainId: 41923n, shortName: "edu-chain" },
|
|
@@ -592,6 +625,7 @@ var networks = [
|
|
|
592
625
|
{ chainId: 42170n, shortName: "arb-nova" },
|
|
593
626
|
{ chainId: 42220n, shortName: "celo" },
|
|
594
627
|
{ chainId: 42421n, shortName: "rwa" },
|
|
628
|
+
{ chainId: 42431n, shortName: "tempo-moderato" },
|
|
595
629
|
{ chainId: 42793n, shortName: "etlk" },
|
|
596
630
|
{ chainId: 43111n, shortName: "hemi" },
|
|
597
631
|
{ chainId: 43113n, shortName: "fuji" },
|
|
@@ -609,6 +643,7 @@ var networks = [
|
|
|
609
643
|
{ chainId: 49321n, shortName: "Stork" },
|
|
610
644
|
{ chainId: 50104n, shortName: "sophon" },
|
|
611
645
|
{ chainId: 50312n, shortName: "SomniaTestnet" },
|
|
646
|
+
{ chainId: 52924n, shortName: "lazai" },
|
|
612
647
|
{ chainId: 53302n, shortName: "seedsep" },
|
|
613
648
|
{ chainId: 53456n, shortName: "birdlayer" },
|
|
614
649
|
{ chainId: 53457n, shortName: "dodochain" },
|
|
@@ -643,6 +678,8 @@ var networks = [
|
|
|
643
678
|
{ chainId: 84532n, shortName: "basesep" },
|
|
644
679
|
{ chainId: 88811n, shortName: "unit0-mainnet" },
|
|
645
680
|
{ chainId: 88817n, shortName: "unit0-testnet" },
|
|
681
|
+
{ chainId: 88882n, shortName: "chzspicy" },
|
|
682
|
+
{ chainId: 88888n, shortName: "chiliz" },
|
|
646
683
|
{ chainId: 90001n, shortName: "dhobyghaut" },
|
|
647
684
|
{ chainId: 91342n, shortName: "giwasepolia" },
|
|
648
685
|
{ chainId: 97435n, shortName: "sling" },
|
|
@@ -651,6 +688,7 @@ var networks = [
|
|
|
651
688
|
{ chainId: 98866n, shortName: "plume-mainnet" },
|
|
652
689
|
{ chainId: 98867n, shortName: "plume-testnet" },
|
|
653
690
|
{ chainId: 98985n, shortName: "superposition-testnet" },
|
|
691
|
+
{ chainId: 102030n, shortName: "ctc" },
|
|
654
692
|
{ chainId: 103454n, shortName: "masatest" },
|
|
655
693
|
{ chainId: 105105n, shortName: "stratis" },
|
|
656
694
|
{ chainId: 111188n, shortName: "re-al" },
|
|
@@ -659,6 +697,7 @@ var networks = [
|
|
|
659
697
|
{ chainId: 167000n, shortName: "tko-mainnet" },
|
|
660
698
|
{ chainId: 167008n, shortName: "tko-katla" },
|
|
661
699
|
{ chainId: 167009n, shortName: "tko-hekla" },
|
|
700
|
+
{ chainId: 167013n, shortName: "tko-hoodi" },
|
|
662
701
|
{ chainId: 175188n, shortName: "lpy" },
|
|
663
702
|
{ chainId: 181228n, shortName: "hpp-sepolia" },
|
|
664
703
|
{ chainId: 190415n, shortName: "hpp-mainnet" },
|
|
@@ -669,16 +708,19 @@ var networks = [
|
|
|
669
708
|
{ chainId: 205205n, shortName: "auroria" },
|
|
670
709
|
{ chainId: 210425n, shortName: "platon" },
|
|
671
710
|
{ chainId: 222888n, shortName: "mocat" },
|
|
711
|
+
{ chainId: 278701n, shortName: "creator-chain-testnet" },
|
|
672
712
|
{ chainId: 314159n, shortName: "filecoin-calibration" },
|
|
673
713
|
{ chainId: 325000n, shortName: "CampV2" },
|
|
674
714
|
{ chainId: 328527n, shortName: "nal" },
|
|
675
715
|
{ chainId: 333999n, shortName: "olympus" },
|
|
716
|
+
{ chainId: 369369n, shortName: "den-mainnet" },
|
|
676
717
|
{ chainId: 381931n, shortName: "metal" },
|
|
677
718
|
{ chainId: 421611n, shortName: "arb-rinkeby" },
|
|
678
719
|
{ chainId: 421613n, shortName: "arb-goerli" },
|
|
679
720
|
{ chainId: 421614n, shortName: "arb-sep" },
|
|
680
721
|
{ chainId: 444444n, shortName: "syndr" },
|
|
681
722
|
{ chainId: 490000n, shortName: "ATN" },
|
|
723
|
+
{ chainId: 511111n, shortName: "alpha-testnet" },
|
|
682
724
|
{ chainId: 534351n, shortName: "scr-sepolia" },
|
|
683
725
|
{ chainId: 534352n, shortName: "scr" },
|
|
684
726
|
{ chainId: 534353n, shortName: "scr-alpha" },
|
|
@@ -702,6 +744,7 @@ var networks = [
|
|
|
702
744
|
{ chainId: 808813n, shortName: "bob-sepolia" },
|
|
703
745
|
{ chainId: 810180n, shortName: "zklink-nova" },
|
|
704
746
|
{ chainId: 839999n, shortName: "txsat" },
|
|
747
|
+
{ chainId: 853211n, shortName: "haqq-testethiq" },
|
|
705
748
|
{ chainId: 978657n, shortName: "treasure-ruby" },
|
|
706
749
|
{ chainId: 984122n, shortName: "forma" },
|
|
707
750
|
{ chainId: 1000101n, shortName: "xo" },
|
|
@@ -712,8 +755,10 @@ var networks = [
|
|
|
712
755
|
{ chainId: 2632500n, shortName: "coti" },
|
|
713
756
|
{ chainId: 3441006n, shortName: "mantaSepoliaTestnet" },
|
|
714
757
|
{ chainId: 4457845n, shortName: "zero-sepolia" },
|
|
758
|
+
{ chainId: 5042002n, shortName: "arc-testnet" },
|
|
715
759
|
{ chainId: 5064014n, shortName: "ethereal" },
|
|
716
760
|
{ chainId: 6038361n, shortName: "azkyt" },
|
|
761
|
+
{ chainId: 6281971n, shortName: "dogeos-chykyu" },
|
|
717
762
|
{ chainId: 6985385n, shortName: "hp" },
|
|
718
763
|
{ chainId: 7225878n, shortName: "saakuru" },
|
|
719
764
|
{ chainId: 7777777n, shortName: "zora" },
|
|
@@ -725,6 +770,7 @@ var networks = [
|
|
|
725
770
|
{ chainId: 12227332n, shortName: "neox-t4" },
|
|
726
771
|
{ chainId: 13374202n, shortName: "ethereal-testnet-0" },
|
|
727
772
|
{ chainId: 13863860n, shortName: "sis" },
|
|
773
|
+
{ chainId: 20250407n, shortName: "platondev3" },
|
|
728
774
|
{ chainId: 21000000n, shortName: "corn" },
|
|
729
775
|
{ chainId: 52164803n, shortName: "fluence-testnet" },
|
|
730
776
|
{ chainId: 65100004n, shortName: "piccadilly-04" },
|
|
@@ -756,8 +802,10 @@ var networks = [
|
|
|
756
802
|
{ chainId: 1666700000n, shortName: "hmy-b-s0" },
|
|
757
803
|
{ chainId: 1952959480n, shortName: "lumiatestnet" },
|
|
758
804
|
{ chainId: 2030232745n, shortName: "lumia-beam-testnet" },
|
|
805
|
+
{ chainId: 3735928814n, shortName: "edent" },
|
|
759
806
|
{ chainId: 11297108099n, shortName: "tpalm" },
|
|
760
807
|
{ chainId: 11297108109n, shortName: "palm" },
|
|
808
|
+
{ chainId: 30143370385n, shortName: "BUB" },
|
|
761
809
|
{ chainId: 37714555429n, shortName: "xaitestnet" },
|
|
762
810
|
{ chainId: 88153591557n, shortName: "arb-blueberry" },
|
|
763
811
|
{ chainId: 123420000220n, shortName: "fluence-stage" },
|
|
@@ -1098,7 +1146,8 @@ var SAFE_FEATURES_BY_VERSION = {
|
|
|
1098
1146
|
["REQUIRED_TXGAS" /* REQUIRED_TXGAS */]: "<=1.2.0",
|
|
1099
1147
|
["SIMULATE_AND_REVERT" /* SIMULATE_AND_REVERT */]: ">=1.3.0",
|
|
1100
1148
|
["PASSKEY_SIGNER" /* PASSKEY_SIGNER */]: ">=1.3.0",
|
|
1101
|
-
["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0"
|
|
1149
|
+
["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0",
|
|
1150
|
+
["SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */]: ">=1.5.0"
|
|
1102
1151
|
};
|
|
1103
1152
|
var hasSafeFeature = (feature, version) => {
|
|
1104
1153
|
if (!(feature in SAFE_FEATURES_BY_VERSION)) {
|
|
@@ -1294,7 +1343,7 @@ var calculateSafeMessageHash = (safeAddress, message, safeVersion, chainId) => {
|
|
|
1294
1343
|
|
|
1295
1344
|
// src/utils/transactions/gas.ts
|
|
1296
1345
|
var import_viem8 = require("viem");
|
|
1297
|
-
var
|
|
1346
|
+
var import_types_kit35 = require("@safe-global/types-kit");
|
|
1298
1347
|
var import_satisfies4 = __toESM(require("semver/functions/satisfies.js"));
|
|
1299
1348
|
|
|
1300
1349
|
// src/contracts/BaseContract.ts
|
|
@@ -1555,6 +1604,56 @@ var CreateCallContract_v1_4_1 = class extends CreateCallBaseContract_default {
|
|
|
1555
1604
|
};
|
|
1556
1605
|
var CreateCallContract_v1_4_1_default = CreateCallContract_v1_4_1;
|
|
1557
1606
|
|
|
1607
|
+
// src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.ts
|
|
1608
|
+
var import_types_kit4 = require("@safe-global/types-kit");
|
|
1609
|
+
var CreateCallContract_v1_5_0 = class extends CreateCallBaseContract_default {
|
|
1610
|
+
/**
|
|
1611
|
+
* Constructs an instance of CreateCallContract_v1_5_0
|
|
1612
|
+
*
|
|
1613
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1614
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1615
|
+
* @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.
|
|
1616
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1617
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1618
|
+
*/
|
|
1619
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1620
|
+
const safeVersion = "1.5.0";
|
|
1621
|
+
const defaultAbi = import_types_kit4.createCall_1_5_0_ContractArtifacts.abi;
|
|
1622
|
+
super(
|
|
1623
|
+
chainId,
|
|
1624
|
+
safeProvider,
|
|
1625
|
+
defaultAbi,
|
|
1626
|
+
safeVersion,
|
|
1627
|
+
customContractAddress,
|
|
1628
|
+
customContractAbi,
|
|
1629
|
+
deploymentType
|
|
1630
|
+
);
|
|
1631
|
+
/**
|
|
1632
|
+
* @param args - Array[value, deploymentData]
|
|
1633
|
+
* @param options - TransactionOptions
|
|
1634
|
+
* @returns Promise<TransactionResult>
|
|
1635
|
+
*/
|
|
1636
|
+
this.performCreate = async (args, options) => {
|
|
1637
|
+
if (options && !options.gasLimit) {
|
|
1638
|
+
options.gasLimit = (await this.estimateGas("performCreate", args, options)).toString();
|
|
1639
|
+
}
|
|
1640
|
+
return toTxResult(this.runner, await this.write("performCreate", args, options), options);
|
|
1641
|
+
};
|
|
1642
|
+
/**
|
|
1643
|
+
* @param args - Array[value, deploymentData, salt]
|
|
1644
|
+
* @param options - TransactionOptions
|
|
1645
|
+
* @returns Promise<TransactionResult>
|
|
1646
|
+
*/
|
|
1647
|
+
this.performCreate2 = async (args, options) => {
|
|
1648
|
+
if (options && !options.gasLimit) {
|
|
1649
|
+
options.gasLimit = (await this.estimateGas("performCreate2", [...args], { ...options })).toString();
|
|
1650
|
+
}
|
|
1651
|
+
return toTxResult(this.runner, await this.write("performCreate2", args, options), options);
|
|
1652
|
+
};
|
|
1653
|
+
}
|
|
1654
|
+
};
|
|
1655
|
+
var CreateCallContract_v1_5_0_default = CreateCallContract_v1_5_0;
|
|
1656
|
+
|
|
1558
1657
|
// src/contracts/MultiSend/MultiSendBaseContract.ts
|
|
1559
1658
|
var MultiSendBaseContract = class extends BaseContract_default {
|
|
1560
1659
|
/**
|
|
@@ -1587,7 +1686,7 @@ var MultiSendBaseContract = class extends BaseContract_default {
|
|
|
1587
1686
|
var MultiSendBaseContract_default = MultiSendBaseContract;
|
|
1588
1687
|
|
|
1589
1688
|
// src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.ts
|
|
1590
|
-
var
|
|
1689
|
+
var import_types_kit5 = require("@safe-global/types-kit");
|
|
1591
1690
|
var MultiSendContract_v1_1_1 = class extends MultiSendBaseContract_default {
|
|
1592
1691
|
/**
|
|
1593
1692
|
* Constructs an instance of MultiSendContract_v1_1_1
|
|
@@ -1600,7 +1699,7 @@ var MultiSendContract_v1_1_1 = class extends MultiSendBaseContract_default {
|
|
|
1600
1699
|
*/
|
|
1601
1700
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1602
1701
|
const safeVersion = "1.1.1";
|
|
1603
|
-
const defaultAbi =
|
|
1702
|
+
const defaultAbi = import_types_kit5.multisend_1_1_1_ContractArtifacts.abi;
|
|
1604
1703
|
super(
|
|
1605
1704
|
chainId,
|
|
1606
1705
|
safeProvider,
|
|
@@ -1615,7 +1714,7 @@ var MultiSendContract_v1_1_1 = class extends MultiSendBaseContract_default {
|
|
|
1615
1714
|
var MultiSendContract_v1_1_1_default = MultiSendContract_v1_1_1;
|
|
1616
1715
|
|
|
1617
1716
|
// src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.ts
|
|
1618
|
-
var
|
|
1717
|
+
var import_types_kit6 = require("@safe-global/types-kit");
|
|
1619
1718
|
var MultiSendContract_v1_3_0 = class extends MultiSendBaseContract_default {
|
|
1620
1719
|
/**
|
|
1621
1720
|
* Constructs an instance of MultiSendContract_v1_3_0
|
|
@@ -1628,7 +1727,7 @@ var MultiSendContract_v1_3_0 = class extends MultiSendBaseContract_default {
|
|
|
1628
1727
|
*/
|
|
1629
1728
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1630
1729
|
const safeVersion = "1.3.0";
|
|
1631
|
-
const defaultAbi =
|
|
1730
|
+
const defaultAbi = import_types_kit6.multisend_1_3_0_ContractArtifacts.abi;
|
|
1632
1731
|
super(
|
|
1633
1732
|
chainId,
|
|
1634
1733
|
safeProvider,
|
|
@@ -1643,7 +1742,7 @@ var MultiSendContract_v1_3_0 = class extends MultiSendBaseContract_default {
|
|
|
1643
1742
|
var MultiSendContract_v1_3_0_default = MultiSendContract_v1_3_0;
|
|
1644
1743
|
|
|
1645
1744
|
// src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.ts
|
|
1646
|
-
var
|
|
1745
|
+
var import_types_kit7 = require("@safe-global/types-kit");
|
|
1647
1746
|
var MultiSendContract_v1_4_1 = class extends MultiSendBaseContract_default {
|
|
1648
1747
|
/**
|
|
1649
1748
|
* Constructs an instance of MultiSendContract_v1_4_1
|
|
@@ -1656,7 +1755,7 @@ var MultiSendContract_v1_4_1 = class extends MultiSendBaseContract_default {
|
|
|
1656
1755
|
*/
|
|
1657
1756
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1658
1757
|
const safeVersion = "1.4.1";
|
|
1659
|
-
const defaultAbi =
|
|
1758
|
+
const defaultAbi = import_types_kit7.multisend_1_4_1_ContractArtifacts.abi;
|
|
1660
1759
|
super(
|
|
1661
1760
|
chainId,
|
|
1662
1761
|
safeProvider,
|
|
@@ -1670,6 +1769,34 @@ var MultiSendContract_v1_4_1 = class extends MultiSendBaseContract_default {
|
|
|
1670
1769
|
};
|
|
1671
1770
|
var MultiSendContract_v1_4_1_default = MultiSendContract_v1_4_1;
|
|
1672
1771
|
|
|
1772
|
+
// src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.ts
|
|
1773
|
+
var import_types_kit8 = require("@safe-global/types-kit");
|
|
1774
|
+
var MultiSendContract_v1_5_0 = class extends MultiSendBaseContract_default {
|
|
1775
|
+
/**
|
|
1776
|
+
* Constructs an instance of MultiSendContract_v1_5_0
|
|
1777
|
+
*
|
|
1778
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1779
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1780
|
+
* @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.
|
|
1781
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1782
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1783
|
+
*/
|
|
1784
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1785
|
+
const safeVersion = "1.5.0";
|
|
1786
|
+
const defaultAbi = import_types_kit8.multisend_1_5_0_ContractArtifacts.abi;
|
|
1787
|
+
super(
|
|
1788
|
+
chainId,
|
|
1789
|
+
safeProvider,
|
|
1790
|
+
defaultAbi,
|
|
1791
|
+
safeVersion,
|
|
1792
|
+
customContractAddress,
|
|
1793
|
+
customContractAbi,
|
|
1794
|
+
deploymentType
|
|
1795
|
+
);
|
|
1796
|
+
}
|
|
1797
|
+
};
|
|
1798
|
+
var MultiSendContract_v1_5_0_default = MultiSendContract_v1_5_0;
|
|
1799
|
+
|
|
1673
1800
|
// src/contracts/MultiSend/MultiSendCallOnlyBaseContract.ts
|
|
1674
1801
|
var MultiSendCallOnlyBaseContract = class extends BaseContract_default {
|
|
1675
1802
|
/**
|
|
@@ -1702,7 +1829,7 @@ var MultiSendCallOnlyBaseContract = class extends BaseContract_default {
|
|
|
1702
1829
|
var MultiSendCallOnlyBaseContract_default = MultiSendCallOnlyBaseContract;
|
|
1703
1830
|
|
|
1704
1831
|
// src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.ts
|
|
1705
|
-
var
|
|
1832
|
+
var import_types_kit9 = require("@safe-global/types-kit");
|
|
1706
1833
|
var MultiSendCallOnlyContract_v1_3_0 = class extends MultiSendCallOnlyBaseContract_default {
|
|
1707
1834
|
/**
|
|
1708
1835
|
* Constructs an instance of MultiSendCallOnlyContract_v1_3_0
|
|
@@ -1715,7 +1842,7 @@ var MultiSendCallOnlyContract_v1_3_0 = class extends MultiSendCallOnlyBaseContra
|
|
|
1715
1842
|
*/
|
|
1716
1843
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1717
1844
|
const safeVersion = "1.3.0";
|
|
1718
|
-
const defaultAbi =
|
|
1845
|
+
const defaultAbi = import_types_kit9.multiSendCallOnly_1_3_0_ContractArtifacts.abi;
|
|
1719
1846
|
super(
|
|
1720
1847
|
chainId,
|
|
1721
1848
|
safeProvider,
|
|
@@ -1730,7 +1857,7 @@ var MultiSendCallOnlyContract_v1_3_0 = class extends MultiSendCallOnlyBaseContra
|
|
|
1730
1857
|
var MultiSendCallOnlyContract_v1_3_0_default = MultiSendCallOnlyContract_v1_3_0;
|
|
1731
1858
|
|
|
1732
1859
|
// src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.ts
|
|
1733
|
-
var
|
|
1860
|
+
var import_types_kit10 = require("@safe-global/types-kit");
|
|
1734
1861
|
var MultiSendCallOnlyContract_v1_4_1 = class extends MultiSendCallOnlyBaseContract_default {
|
|
1735
1862
|
/**
|
|
1736
1863
|
* Constructs an instance of MultiSendCallOnlyContract_v1_4_1
|
|
@@ -1743,7 +1870,7 @@ var MultiSendCallOnlyContract_v1_4_1 = class extends MultiSendCallOnlyBaseContra
|
|
|
1743
1870
|
*/
|
|
1744
1871
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1745
1872
|
const safeVersion = "1.4.1";
|
|
1746
|
-
const defaultAbi =
|
|
1873
|
+
const defaultAbi = import_types_kit10.multiSendCallOnly_1_4_1_ContractArtifacts.abi;
|
|
1747
1874
|
super(
|
|
1748
1875
|
chainId,
|
|
1749
1876
|
safeProvider,
|
|
@@ -1757,6 +1884,34 @@ var MultiSendCallOnlyContract_v1_4_1 = class extends MultiSendCallOnlyBaseContra
|
|
|
1757
1884
|
};
|
|
1758
1885
|
var MultiSendCallOnlyContract_v1_4_1_default = MultiSendCallOnlyContract_v1_4_1;
|
|
1759
1886
|
|
|
1887
|
+
// src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.ts
|
|
1888
|
+
var import_types_kit11 = require("@safe-global/types-kit");
|
|
1889
|
+
var MultiSendCallOnlyContract_v1_5_0 = class extends MultiSendCallOnlyBaseContract_default {
|
|
1890
|
+
/**
|
|
1891
|
+
* Constructs an instance of MultiSendCallOnlyContract_v1_5_0
|
|
1892
|
+
*
|
|
1893
|
+
* @param chainId - The chain ID where the contract resides.
|
|
1894
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
1895
|
+
* @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.
|
|
1896
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
1897
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
1898
|
+
*/
|
|
1899
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1900
|
+
const safeVersion = "1.5.0";
|
|
1901
|
+
const defaultAbi = import_types_kit11.multiSendCallOnly_1_5_0_ContractArtifacts.abi;
|
|
1902
|
+
super(
|
|
1903
|
+
chainId,
|
|
1904
|
+
safeProvider,
|
|
1905
|
+
defaultAbi,
|
|
1906
|
+
safeVersion,
|
|
1907
|
+
customContractAddress,
|
|
1908
|
+
customContractAbi,
|
|
1909
|
+
deploymentType
|
|
1910
|
+
);
|
|
1911
|
+
}
|
|
1912
|
+
};
|
|
1913
|
+
var MultiSendCallOnlyContract_v1_5_0_default = MultiSendCallOnlyContract_v1_5_0;
|
|
1914
|
+
|
|
1760
1915
|
// src/contracts/SignMessageLib/SignMessageLibBaseContract.ts
|
|
1761
1916
|
var SignMessageLibBaseContract = class extends BaseContract_default {
|
|
1762
1917
|
/**
|
|
@@ -1789,7 +1944,7 @@ var SignMessageLibBaseContract = class extends BaseContract_default {
|
|
|
1789
1944
|
var SignMessageLibBaseContract_default = SignMessageLibBaseContract;
|
|
1790
1945
|
|
|
1791
1946
|
// src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.ts
|
|
1792
|
-
var
|
|
1947
|
+
var import_types_kit12 = require("@safe-global/types-kit");
|
|
1793
1948
|
var SignMessageLibContract_v1_3_0 = class extends SignMessageLibBaseContract_default {
|
|
1794
1949
|
/**
|
|
1795
1950
|
* Constructs an instance of SignMessageLibContract_v1_3_0
|
|
@@ -1802,7 +1957,7 @@ var SignMessageLibContract_v1_3_0 = class extends SignMessageLibBaseContract_def
|
|
|
1802
1957
|
*/
|
|
1803
1958
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1804
1959
|
const safeVersion = "1.3.0";
|
|
1805
|
-
const defaultAbi =
|
|
1960
|
+
const defaultAbi = import_types_kit12.signMessageLib_1_3_0_ContractArtifacts.abi;
|
|
1806
1961
|
super(
|
|
1807
1962
|
chainId,
|
|
1808
1963
|
safeProvider,
|
|
@@ -1832,7 +1987,7 @@ var SignMessageLibContract_v1_3_0 = class extends SignMessageLibBaseContract_def
|
|
|
1832
1987
|
var SignMessageLibContract_v1_3_0_default = SignMessageLibContract_v1_3_0;
|
|
1833
1988
|
|
|
1834
1989
|
// src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.ts
|
|
1835
|
-
var
|
|
1990
|
+
var import_types_kit13 = require("@safe-global/types-kit");
|
|
1836
1991
|
var SignMessageLibContract_v1_4_1 = class extends SignMessageLibBaseContract_default {
|
|
1837
1992
|
/**
|
|
1838
1993
|
* Constructs an instance of SignMessageLibContract_v1_4_1
|
|
@@ -1845,7 +2000,7 @@ var SignMessageLibContract_v1_4_1 = class extends SignMessageLibBaseContract_def
|
|
|
1845
2000
|
*/
|
|
1846
2001
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
1847
2002
|
const safeVersion = "1.4.1";
|
|
1848
|
-
const defaultAbi =
|
|
2003
|
+
const defaultAbi = import_types_kit13.signMessageLib_1_4_1_ContractArtifacts.abi;
|
|
1849
2004
|
super(
|
|
1850
2005
|
chainId,
|
|
1851
2006
|
safeProvider,
|
|
@@ -1874,6 +2029,49 @@ var SignMessageLibContract_v1_4_1 = class extends SignMessageLibBaseContract_def
|
|
|
1874
2029
|
};
|
|
1875
2030
|
var SignMessageLibContract_v1_4_1_default = SignMessageLibContract_v1_4_1;
|
|
1876
2031
|
|
|
2032
|
+
// src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.ts
|
|
2033
|
+
var import_types_kit14 = require("@safe-global/types-kit");
|
|
2034
|
+
var SignMessageLibContract_v1_5_0 = class extends SignMessageLibBaseContract_default {
|
|
2035
|
+
/**
|
|
2036
|
+
* Constructs an instance of SignMessageLibContract_v1_5_0
|
|
2037
|
+
*
|
|
2038
|
+
* @param chainId - The chain ID where the contract resides.
|
|
2039
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
2040
|
+
* @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.
|
|
2041
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
2042
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
2043
|
+
*/
|
|
2044
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
2045
|
+
const safeVersion = "1.5.0";
|
|
2046
|
+
const defaultAbi = import_types_kit14.signMessageLib_1_5_0_ContractArtifacts.abi;
|
|
2047
|
+
super(
|
|
2048
|
+
chainId,
|
|
2049
|
+
safeProvider,
|
|
2050
|
+
defaultAbi,
|
|
2051
|
+
safeVersion,
|
|
2052
|
+
customContractAddress,
|
|
2053
|
+
customContractAbi,
|
|
2054
|
+
deploymentType
|
|
2055
|
+
);
|
|
2056
|
+
/**
|
|
2057
|
+
* @param args - Array[message]
|
|
2058
|
+
*/
|
|
2059
|
+
this.getMessageHash = async (args) => {
|
|
2060
|
+
return [await this.read("getMessageHash", args)];
|
|
2061
|
+
};
|
|
2062
|
+
/**
|
|
2063
|
+
* @param args - Array[data]
|
|
2064
|
+
*/
|
|
2065
|
+
this.signMessage = async (data, options) => {
|
|
2066
|
+
if (options && !options.gasLimit) {
|
|
2067
|
+
options.gasLimit = Number(await this.estimateGas("signMessage", data, { ...options }));
|
|
2068
|
+
}
|
|
2069
|
+
return toTxResult(this.runner, await this.write("signMessage", data, options), options);
|
|
2070
|
+
};
|
|
2071
|
+
}
|
|
2072
|
+
};
|
|
2073
|
+
var SignMessageLibContract_v1_5_0_default = SignMessageLibContract_v1_5_0;
|
|
2074
|
+
|
|
1877
2075
|
// src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.ts
|
|
1878
2076
|
var import_actions2 = require("viem/actions");
|
|
1879
2077
|
|
|
@@ -1911,7 +2109,7 @@ var SafeBaseContract = class extends BaseContract_default {
|
|
|
1911
2109
|
var SafeBaseContract_default = SafeBaseContract;
|
|
1912
2110
|
|
|
1913
2111
|
// src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.ts
|
|
1914
|
-
var
|
|
2112
|
+
var import_types_kit15 = require("@safe-global/types-kit");
|
|
1915
2113
|
var SafeContract_v1_0_0 = class extends SafeBaseContract_default {
|
|
1916
2114
|
/**
|
|
1917
2115
|
* Constructs an instance of SafeContract_v1_0_0
|
|
@@ -1925,7 +2123,7 @@ var SafeContract_v1_0_0 = class extends SafeBaseContract_default {
|
|
|
1925
2123
|
*/
|
|
1926
2124
|
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
1927
2125
|
const safeVersion = "1.0.0";
|
|
1928
|
-
const defaultAbi =
|
|
2126
|
+
const defaultAbi = import_types_kit15.safe_1_0_0_ContractArtifacts.abi;
|
|
1929
2127
|
super(
|
|
1930
2128
|
chainId,
|
|
1931
2129
|
safeProvider,
|
|
@@ -2192,7 +2390,7 @@ var SafeContract_v1_0_0_default = SafeContract_v1_0_0;
|
|
|
2192
2390
|
|
|
2193
2391
|
// src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.ts
|
|
2194
2392
|
var import_actions3 = require("viem/actions");
|
|
2195
|
-
var
|
|
2393
|
+
var import_types_kit16 = require("@safe-global/types-kit");
|
|
2196
2394
|
var SafeContract_v1_1_1 = class extends SafeBaseContract_default {
|
|
2197
2395
|
/**
|
|
2198
2396
|
* Constructs an instance of SafeContract_v1_1_1
|
|
@@ -2206,7 +2404,7 @@ var SafeContract_v1_1_1 = class extends SafeBaseContract_default {
|
|
|
2206
2404
|
*/
|
|
2207
2405
|
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
2208
2406
|
const safeVersion = "1.1.1";
|
|
2209
|
-
const defaultAbi =
|
|
2407
|
+
const defaultAbi = import_types_kit16.safe_1_1_1_ContractArtifacts.abi;
|
|
2210
2408
|
super(
|
|
2211
2409
|
chainId,
|
|
2212
2410
|
safeProvider,
|
|
@@ -2448,7 +2646,7 @@ var SafeContract_v1_1_1_default = SafeContract_v1_1_1;
|
|
|
2448
2646
|
|
|
2449
2647
|
// src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.ts
|
|
2450
2648
|
var import_actions4 = require("viem/actions");
|
|
2451
|
-
var
|
|
2649
|
+
var import_types_kit17 = require("@safe-global/types-kit");
|
|
2452
2650
|
var SafeContract_v1_2_0 = class extends SafeBaseContract_default {
|
|
2453
2651
|
/**
|
|
2454
2652
|
* Constructs an instance of SafeContract_v1_2_0
|
|
@@ -2462,7 +2660,7 @@ var SafeContract_v1_2_0 = class extends SafeBaseContract_default {
|
|
|
2462
2660
|
*/
|
|
2463
2661
|
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
2464
2662
|
const safeVersion = "1.2.0";
|
|
2465
|
-
const defaultAbi =
|
|
2663
|
+
const defaultAbi = import_types_kit17.safe_1_2_0_ContractArtifacts.abi;
|
|
2466
2664
|
super(
|
|
2467
2665
|
chainId,
|
|
2468
2666
|
safeProvider,
|
|
@@ -2708,7 +2906,7 @@ var SafeContract_v1_2_0_default = SafeContract_v1_2_0;
|
|
|
2708
2906
|
|
|
2709
2907
|
// src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.ts
|
|
2710
2908
|
var import_actions5 = require("viem/actions");
|
|
2711
|
-
var
|
|
2909
|
+
var import_types_kit18 = require("@safe-global/types-kit");
|
|
2712
2910
|
var SafeContract_v1_3_0 = class extends SafeBaseContract_default {
|
|
2713
2911
|
/**
|
|
2714
2912
|
* Constructs an instance of SafeContract_v1_3_0
|
|
@@ -2722,7 +2920,7 @@ var SafeContract_v1_3_0 = class extends SafeBaseContract_default {
|
|
|
2722
2920
|
*/
|
|
2723
2921
|
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
2724
2922
|
const safeVersion = "1.3.0";
|
|
2725
|
-
const defaultAbi =
|
|
2923
|
+
const defaultAbi = import_types_kit18.safe_1_3_0_ContractArtifacts.abi;
|
|
2726
2924
|
super(
|
|
2727
2925
|
chainId,
|
|
2728
2926
|
safeProvider,
|
|
@@ -2981,7 +3179,7 @@ var SafeContract_v1_3_0_default = SafeContract_v1_3_0;
|
|
|
2981
3179
|
|
|
2982
3180
|
// src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.ts
|
|
2983
3181
|
var import_actions6 = require("viem/actions");
|
|
2984
|
-
var
|
|
3182
|
+
var import_types_kit19 = require("@safe-global/types-kit");
|
|
2985
3183
|
var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
2986
3184
|
/**
|
|
2987
3185
|
* Constructs an instance of SafeContract_v1_4_1
|
|
@@ -2995,7 +3193,7 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
2995
3193
|
*/
|
|
2996
3194
|
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
2997
3195
|
const safeVersion = "1.4.1";
|
|
2998
|
-
const defaultAbi =
|
|
3196
|
+
const defaultAbi = import_types_kit19.safe_1_4_1_ContractArtifacts.abi;
|
|
2999
3197
|
super(
|
|
3000
3198
|
chainId,
|
|
3001
3199
|
safeProvider,
|
|
@@ -3069,7 +3267,7 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
3069
3267
|
return [await this.read("getOwners")];
|
|
3070
3268
|
};
|
|
3071
3269
|
/**
|
|
3072
|
-
* Reads `length` bytes of storage in the
|
|
3270
|
+
* Reads `length` bytes of storage in the current contract
|
|
3073
3271
|
* @param args - Array[offset, length]
|
|
3074
3272
|
* @returns Array[storage]
|
|
3075
3273
|
*/
|
|
@@ -3252,113 +3450,435 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
|
|
|
3252
3450
|
};
|
|
3253
3451
|
var SafeContract_v1_4_1_default = SafeContract_v1_4_1;
|
|
3254
3452
|
|
|
3255
|
-
// src/contracts/
|
|
3256
|
-
var
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
* Constructs an instance of SafeProxyFactoryBaseContract.
|
|
3260
|
-
*
|
|
3261
|
-
* @param chainId - The chain ID of the contract.
|
|
3262
|
-
* @param safeProvider - An instance of SafeProvider.
|
|
3263
|
-
* @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
|
|
3264
|
-
* @param safeVersion - The version of the Safe contract.
|
|
3265
|
-
* @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.
|
|
3266
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
3267
|
-
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3268
|
-
*/
|
|
3269
|
-
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3270
|
-
const contractName3 = "safeProxyFactoryVersion";
|
|
3271
|
-
super(
|
|
3272
|
-
contractName3,
|
|
3273
|
-
chainId,
|
|
3274
|
-
safeProvider,
|
|
3275
|
-
defaultAbi,
|
|
3276
|
-
safeVersion,
|
|
3277
|
-
customContractAddress,
|
|
3278
|
-
customContractAbi,
|
|
3279
|
-
deploymentType
|
|
3280
|
-
);
|
|
3281
|
-
this.contractName = contractName3;
|
|
3282
|
-
}
|
|
3283
|
-
};
|
|
3284
|
-
var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
|
|
3285
|
-
|
|
3286
|
-
// src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
|
|
3287
|
-
var import_types_kit16 = require("@safe-global/types-kit");
|
|
3288
|
-
var SafeProxyFactoryContract_v1_0_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
3453
|
+
// src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.ts
|
|
3454
|
+
var import_actions7 = require("viem/actions");
|
|
3455
|
+
var import_types_kit20 = require("@safe-global/types-kit");
|
|
3456
|
+
var SafeContract_v1_5_0 = class extends SafeBaseContract_default {
|
|
3289
3457
|
/**
|
|
3290
|
-
* Constructs an instance of
|
|
3458
|
+
* Constructs an instance of SafeContract_v1_5_0
|
|
3291
3459
|
*
|
|
3292
3460
|
* @param chainId - The chain ID where the contract resides.
|
|
3293
3461
|
* @param safeProvider - An instance of SafeProvider.
|
|
3462
|
+
* @param isL1SafeSingleton - A flag indicating if the contract is a L1 Safe Singleton.
|
|
3294
3463
|
* @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
|
|
3295
|
-
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.
|
|
3464
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
3296
3465
|
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3297
3466
|
*/
|
|
3298
|
-
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3299
|
-
const safeVersion = "1.
|
|
3300
|
-
const defaultAbi =
|
|
3467
|
+
constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
|
|
3468
|
+
const safeVersion = "1.5.0";
|
|
3469
|
+
const defaultAbi = import_types_kit20.safe_1_5_0_ContractArtifacts.abi;
|
|
3301
3470
|
super(
|
|
3302
3471
|
chainId,
|
|
3303
3472
|
safeProvider,
|
|
3304
3473
|
defaultAbi,
|
|
3305
3474
|
safeVersion,
|
|
3475
|
+
isL1SafeSingleton,
|
|
3306
3476
|
customContractAddress,
|
|
3307
3477
|
customContractAbi,
|
|
3308
3478
|
deploymentType
|
|
3309
3479
|
);
|
|
3310
3480
|
/**
|
|
3311
|
-
*
|
|
3312
|
-
* @returns Array[creationCode]
|
|
3481
|
+
* @returns Array[safeContractVersion]
|
|
3313
3482
|
*/
|
|
3314
|
-
this.
|
|
3315
|
-
return [await this.read("
|
|
3483
|
+
this.VERSION = async () => {
|
|
3484
|
+
return [await this.read("VERSION")];
|
|
3316
3485
|
};
|
|
3317
3486
|
/**
|
|
3318
|
-
*
|
|
3319
|
-
* @returns Array[
|
|
3487
|
+
* @param args - Array[owner, txHash]
|
|
3488
|
+
* @returns Array[approvedHashes]
|
|
3320
3489
|
*/
|
|
3321
|
-
this.
|
|
3322
|
-
return [await this.read("
|
|
3490
|
+
this.approvedHashes = async (args) => {
|
|
3491
|
+
return [await this.read("approvedHashes", args)];
|
|
3323
3492
|
};
|
|
3324
3493
|
/**
|
|
3325
|
-
*
|
|
3326
|
-
*
|
|
3327
|
-
* @
|
|
3494
|
+
* Checks whether the signature provided is valid for the provided data, hash and number of required signatures.
|
|
3495
|
+
* Will revert otherwise.
|
|
3496
|
+
* @param args - Array[dataHash, data, signatures, requiredSignatures]
|
|
3497
|
+
* @returns Empty array
|
|
3328
3498
|
*/
|
|
3329
|
-
this.
|
|
3330
|
-
|
|
3499
|
+
this.checkNSignatures = async (args) => {
|
|
3500
|
+
await this.read("checkNSignatures", args);
|
|
3501
|
+
return [];
|
|
3331
3502
|
};
|
|
3332
3503
|
/**
|
|
3333
|
-
*
|
|
3334
|
-
*
|
|
3335
|
-
*
|
|
3504
|
+
* New in v1.5.0: overload of checkNSignatures that accepts an explicit executor address.
|
|
3505
|
+
* Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
|
|
3506
|
+
* Will revert otherwise.
|
|
3507
|
+
* @param args - Array[executor, dataHash, signatures, requiredSignatures]
|
|
3508
|
+
* @returns Empty array
|
|
3336
3509
|
*/
|
|
3337
|
-
this.
|
|
3338
|
-
|
|
3510
|
+
this.checkNSignaturesWithExecutor = async (args) => {
|
|
3511
|
+
await (0, import_actions7.readContract)(this.runner, {
|
|
3512
|
+
address: this.contractAddress,
|
|
3513
|
+
functionName: "checkNSignatures",
|
|
3514
|
+
abi: [
|
|
3515
|
+
{
|
|
3516
|
+
inputs: [
|
|
3517
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
3518
|
+
{ internalType: "bytes32", name: "dataHash", type: "bytes32" },
|
|
3519
|
+
{ internalType: "bytes", name: "signatures", type: "bytes" },
|
|
3520
|
+
{ internalType: "uint256", name: "requiredSignatures", type: "uint256" }
|
|
3521
|
+
],
|
|
3522
|
+
name: "checkNSignatures",
|
|
3523
|
+
outputs: [],
|
|
3524
|
+
stateMutability: "view",
|
|
3525
|
+
type: "function"
|
|
3526
|
+
}
|
|
3527
|
+
],
|
|
3528
|
+
args
|
|
3529
|
+
});
|
|
3530
|
+
return [];
|
|
3339
3531
|
};
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3360
|
-
|
|
3361
|
-
|
|
3532
|
+
/**
|
|
3533
|
+
* Checks whether the signature provided is valid for the provided data and hash. Will revert otherwise.
|
|
3534
|
+
* @param args - Array[dataHash, data, signatures]
|
|
3535
|
+
* @returns Empty array
|
|
3536
|
+
*/
|
|
3537
|
+
this.checkSignatures = async (args) => {
|
|
3538
|
+
await this.read("checkSignatures", args);
|
|
3539
|
+
return [];
|
|
3540
|
+
};
|
|
3541
|
+
/**
|
|
3542
|
+
* New in v1.5.0: overload of checkSignatures that accepts an explicit executor address.
|
|
3543
|
+
* Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
|
|
3544
|
+
* Will revert otherwise.
|
|
3545
|
+
* @param args - Array[executor, dataHash, signatures]
|
|
3546
|
+
* @returns Empty array
|
|
3547
|
+
*/
|
|
3548
|
+
this.checkSignaturesWithExecutor = async (args) => {
|
|
3549
|
+
await (0, import_actions7.readContract)(this.runner, {
|
|
3550
|
+
address: this.contractAddress,
|
|
3551
|
+
functionName: "checkSignatures",
|
|
3552
|
+
abi: [
|
|
3553
|
+
{
|
|
3554
|
+
inputs: [
|
|
3555
|
+
{ internalType: "address", name: "executor", type: "address" },
|
|
3556
|
+
{ internalType: "bytes32", name: "dataHash", type: "bytes32" },
|
|
3557
|
+
{ internalType: "bytes", name: "signatures", type: "bytes" }
|
|
3558
|
+
],
|
|
3559
|
+
name: "checkSignatures",
|
|
3560
|
+
outputs: [],
|
|
3561
|
+
stateMutability: "view",
|
|
3562
|
+
type: "function"
|
|
3563
|
+
}
|
|
3564
|
+
],
|
|
3565
|
+
args
|
|
3566
|
+
});
|
|
3567
|
+
return [];
|
|
3568
|
+
};
|
|
3569
|
+
/**
|
|
3570
|
+
* @returns Array[domainSeparator]
|
|
3571
|
+
*/
|
|
3572
|
+
this.domainSeparator = async () => {
|
|
3573
|
+
return [await this.read("domainSeparator")];
|
|
3574
|
+
};
|
|
3575
|
+
/**
|
|
3576
|
+
* Returns array of modules.
|
|
3577
|
+
* @param args - Array[start, pageSize]
|
|
3578
|
+
* @returns Array[Array[modules], next]
|
|
3579
|
+
*/
|
|
3580
|
+
this.getModulesPaginated = async (args) => {
|
|
3581
|
+
const [array, next] = await this.read("getModulesPaginated", args);
|
|
3582
|
+
return [array, next];
|
|
3583
|
+
};
|
|
3584
|
+
/**
|
|
3585
|
+
* Returns the list of Safe owner accounts.
|
|
3586
|
+
* @returns Array[Array[owners]]
|
|
3587
|
+
*/
|
|
3588
|
+
this.getOwners = async () => {
|
|
3589
|
+
return [await this.read("getOwners")];
|
|
3590
|
+
};
|
|
3591
|
+
/**
|
|
3592
|
+
* Reads `length` bytes of storage in the current contract
|
|
3593
|
+
* @param args - Array[offset, length]
|
|
3594
|
+
* @returns Array[storage]
|
|
3595
|
+
*/
|
|
3596
|
+
this.getStorageAt = async (args) => {
|
|
3597
|
+
return [await this.read("getStorageAt", args)];
|
|
3598
|
+
};
|
|
3599
|
+
/**
|
|
3600
|
+
* Returns the Safe threshold.
|
|
3601
|
+
* @returns Array[threshold]
|
|
3602
|
+
*/
|
|
3603
|
+
this.getThreshold = async () => {
|
|
3604
|
+
return [await this.read("getThreshold")];
|
|
3605
|
+
};
|
|
3606
|
+
/**
|
|
3607
|
+
* Returns hash to be signed by owners.
|
|
3608
|
+
* @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce]
|
|
3609
|
+
* @returns Array[transactionHash]
|
|
3610
|
+
*/
|
|
3611
|
+
this.getTransactionHash = async (args) => {
|
|
3612
|
+
return [await this.read("getTransactionHash", args)];
|
|
3613
|
+
};
|
|
3614
|
+
/**
|
|
3615
|
+
* Checks if a specific Safe module is enabled for the current Safe.
|
|
3616
|
+
* @param args - Array[moduleAddress]
|
|
3617
|
+
* @returns Array[isEnabled]
|
|
3618
|
+
*/
|
|
3619
|
+
this.isModuleEnabled = async (args) => {
|
|
3620
|
+
return [await this.read("isModuleEnabled", args)];
|
|
3621
|
+
};
|
|
3622
|
+
/**
|
|
3623
|
+
* Checks if a specific address is an owner of the current Safe.
|
|
3624
|
+
* @param args - Array[address]
|
|
3625
|
+
* @returns Array[isOwner]
|
|
3626
|
+
*/
|
|
3627
|
+
this.isOwner = async (args) => {
|
|
3628
|
+
return [await this.read("isOwner", args)];
|
|
3629
|
+
};
|
|
3630
|
+
/**
|
|
3631
|
+
* Returns the Safe nonce.
|
|
3632
|
+
* @returns Array[nonce]
|
|
3633
|
+
*/
|
|
3634
|
+
this.nonce = async () => {
|
|
3635
|
+
return [await this.read("nonce")];
|
|
3636
|
+
};
|
|
3637
|
+
/**
|
|
3638
|
+
* @param args - Array[messageHash]
|
|
3639
|
+
* @returns Array[signedMessages]
|
|
3640
|
+
*/
|
|
3641
|
+
this.signedMessages = async (args) => {
|
|
3642
|
+
return [await this.read("signedMessages", args)];
|
|
3643
|
+
};
|
|
3644
|
+
}
|
|
3645
|
+
/**
|
|
3646
|
+
* Checks whether a given Safe transaction can be executed successfully with no errors.
|
|
3647
|
+
* @param safeTransaction - The Safe transaction to check.
|
|
3648
|
+
* @param options - Optional transaction options.
|
|
3649
|
+
* @returns True, if the given transactions is valid.
|
|
3650
|
+
*/
|
|
3651
|
+
async isValidTransaction(safeTransaction, options = {}) {
|
|
3652
|
+
try {
|
|
3653
|
+
const gasLimit = options?.gasLimit || await this.estimateGas(
|
|
3654
|
+
"execTransaction",
|
|
3655
|
+
[
|
|
3656
|
+
safeTransaction.data.to,
|
|
3657
|
+
BigInt(safeTransaction.data.value),
|
|
3658
|
+
asHex(safeTransaction.data.data),
|
|
3659
|
+
safeTransaction.data.operation,
|
|
3660
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3661
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3662
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3663
|
+
safeTransaction.data.gasToken,
|
|
3664
|
+
safeTransaction.data.refundReceiver,
|
|
3665
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3666
|
+
],
|
|
3667
|
+
options
|
|
3668
|
+
);
|
|
3669
|
+
const converted = this.convertOptions({ ...options, gasLimit });
|
|
3670
|
+
const txResult = await (0, import_actions7.simulateContract)(this.runner, {
|
|
3671
|
+
address: this.contractAddress,
|
|
3672
|
+
functionName: "execTransaction",
|
|
3673
|
+
abi: this.contractAbi,
|
|
3674
|
+
args: [
|
|
3675
|
+
safeTransaction.data.to,
|
|
3676
|
+
BigInt(safeTransaction.data.value),
|
|
3677
|
+
asHex(safeTransaction.data.data),
|
|
3678
|
+
safeTransaction.data.operation,
|
|
3679
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3680
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3681
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3682
|
+
safeTransaction.data.gasToken,
|
|
3683
|
+
safeTransaction.data.refundReceiver,
|
|
3684
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3685
|
+
],
|
|
3686
|
+
...converted
|
|
3687
|
+
});
|
|
3688
|
+
return txResult.result;
|
|
3689
|
+
} catch (error) {
|
|
3690
|
+
return false;
|
|
3691
|
+
}
|
|
3692
|
+
}
|
|
3693
|
+
/**
|
|
3694
|
+
* Executes a transaction.
|
|
3695
|
+
* @param safeTransaction - The Safe transaction to execute.
|
|
3696
|
+
* @param options - Transaction options.
|
|
3697
|
+
* @returns Transaction result.
|
|
3698
|
+
*/
|
|
3699
|
+
async execTransaction(safeTransaction, options) {
|
|
3700
|
+
const gasLimit = options?.gasLimit || await this.estimateGas(
|
|
3701
|
+
"execTransaction",
|
|
3702
|
+
[
|
|
3703
|
+
safeTransaction.data.to,
|
|
3704
|
+
BigInt(safeTransaction.data.value),
|
|
3705
|
+
asHex(safeTransaction.data.data),
|
|
3706
|
+
safeTransaction.data.operation,
|
|
3707
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3708
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3709
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3710
|
+
safeTransaction.data.gasToken,
|
|
3711
|
+
safeTransaction.data.refundReceiver,
|
|
3712
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3713
|
+
],
|
|
3714
|
+
options
|
|
3715
|
+
);
|
|
3716
|
+
const args = [
|
|
3717
|
+
safeTransaction.data.to,
|
|
3718
|
+
BigInt(safeTransaction.data.value),
|
|
3719
|
+
asHex(safeTransaction.data.data),
|
|
3720
|
+
safeTransaction.data.operation,
|
|
3721
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
3722
|
+
BigInt(safeTransaction.data.baseGas),
|
|
3723
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
3724
|
+
safeTransaction.data.gasToken,
|
|
3725
|
+
safeTransaction.data.refundReceiver,
|
|
3726
|
+
asHex(safeTransaction.encodedSignatures())
|
|
3727
|
+
];
|
|
3728
|
+
return toTxResult(
|
|
3729
|
+
this.runner,
|
|
3730
|
+
await this.write("execTransaction", args, { ...options, gasLimit }),
|
|
3731
|
+
options
|
|
3732
|
+
);
|
|
3733
|
+
}
|
|
3734
|
+
/**
|
|
3735
|
+
* Returns array of first 10 modules.
|
|
3736
|
+
* @returns Array[modules]
|
|
3737
|
+
*/
|
|
3738
|
+
async getModules() {
|
|
3739
|
+
const [modules] = await this.getModulesPaginated([SENTINEL_ADDRESS, BigInt(10)]);
|
|
3740
|
+
return [modules.map((module2) => module2)];
|
|
3741
|
+
}
|
|
3742
|
+
/**
|
|
3743
|
+
* Marks a hash as approved. This can be used to validate a hash that is used by a signature.
|
|
3744
|
+
* @param hash - The hash that should be marked as approved for signatures that are verified by this contract.
|
|
3745
|
+
* @param options - Optional transaction options.
|
|
3746
|
+
* @returns Transaction result.
|
|
3747
|
+
*/
|
|
3748
|
+
async approveHash(hash, options) {
|
|
3749
|
+
const gasLimit = options?.gasLimit || await this.estimateGas("approveHash", [asHash(hash)], options);
|
|
3750
|
+
return toTxResult(
|
|
3751
|
+
this.runner,
|
|
3752
|
+
await this.write("approveHash", [asHash(hash)], { ...options, gasLimit }),
|
|
3753
|
+
options
|
|
3754
|
+
);
|
|
3755
|
+
}
|
|
3756
|
+
/**
|
|
3757
|
+
* Returns the chain id of the Safe contract. (Custom method - not defined in the Safe Contract)
|
|
3758
|
+
* @returns Array[chainId]
|
|
3759
|
+
*/
|
|
3760
|
+
async getChainId() {
|
|
3761
|
+
return [await Promise.resolve(this.chainId)];
|
|
3762
|
+
}
|
|
3763
|
+
/**
|
|
3764
|
+
* returns the nonce of the Safe contract.
|
|
3765
|
+
*
|
|
3766
|
+
* @returns {Promise<bigint>} A promise that resolves to the nonce of the Safe contract.
|
|
3767
|
+
*/
|
|
3768
|
+
async getNonce() {
|
|
3769
|
+
const [nonce] = await this.nonce();
|
|
3770
|
+
return nonce;
|
|
3771
|
+
}
|
|
3772
|
+
};
|
|
3773
|
+
var SafeContract_v1_5_0_default = SafeContract_v1_5_0;
|
|
3774
|
+
|
|
3775
|
+
// src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts
|
|
3776
|
+
var SafeProxyFactoryBaseContract = class extends BaseContract_default {
|
|
3777
|
+
/**
|
|
3778
|
+
* @constructor
|
|
3779
|
+
* Constructs an instance of SafeProxyFactoryBaseContract.
|
|
3780
|
+
*
|
|
3781
|
+
* @param chainId - The chain ID of the contract.
|
|
3782
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3783
|
+
* @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
|
|
3784
|
+
* @param safeVersion - The version of the Safe contract.
|
|
3785
|
+
* @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.
|
|
3786
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
3787
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3788
|
+
*/
|
|
3789
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3790
|
+
const contractName3 = "safeProxyFactoryVersion";
|
|
3791
|
+
super(
|
|
3792
|
+
contractName3,
|
|
3793
|
+
chainId,
|
|
3794
|
+
safeProvider,
|
|
3795
|
+
defaultAbi,
|
|
3796
|
+
safeVersion,
|
|
3797
|
+
customContractAddress,
|
|
3798
|
+
customContractAbi,
|
|
3799
|
+
deploymentType
|
|
3800
|
+
);
|
|
3801
|
+
this.contractName = contractName3;
|
|
3802
|
+
}
|
|
3803
|
+
};
|
|
3804
|
+
var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
|
|
3805
|
+
|
|
3806
|
+
// src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
|
|
3807
|
+
var import_types_kit21 = require("@safe-global/types-kit");
|
|
3808
|
+
var SafeProxyFactoryContract_v1_0_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
3809
|
+
/**
|
|
3810
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_0_0
|
|
3811
|
+
*
|
|
3812
|
+
* @param chainId - The chain ID where the contract resides.
|
|
3813
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3814
|
+
* @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.
|
|
3815
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
|
|
3816
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3817
|
+
*/
|
|
3818
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3819
|
+
const safeVersion = "1.0.0";
|
|
3820
|
+
const defaultAbi = import_types_kit21.safeProxyFactory_1_0_0_ContractArtifacts.abi;
|
|
3821
|
+
super(
|
|
3822
|
+
chainId,
|
|
3823
|
+
safeProvider,
|
|
3824
|
+
defaultAbi,
|
|
3825
|
+
safeVersion,
|
|
3826
|
+
customContractAddress,
|
|
3827
|
+
customContractAbi,
|
|
3828
|
+
deploymentType
|
|
3829
|
+
);
|
|
3830
|
+
/**
|
|
3831
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
3832
|
+
* @returns Array[creationCode]
|
|
3833
|
+
*/
|
|
3834
|
+
this.proxyCreationCode = async () => {
|
|
3835
|
+
return [await this.read("proxyCreationCode")];
|
|
3836
|
+
};
|
|
3837
|
+
/**
|
|
3838
|
+
* Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
|
|
3839
|
+
* @returns Array[runtimeCode]
|
|
3840
|
+
*/
|
|
3841
|
+
this.proxyRuntimeCode = async () => {
|
|
3842
|
+
return [await this.read("proxyRuntimeCode")];
|
|
3843
|
+
};
|
|
3844
|
+
/**
|
|
3845
|
+
* Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
|
|
3846
|
+
* @param args - Array[masterCopy, data]
|
|
3847
|
+
* @returns Array[proxyAddress]
|
|
3848
|
+
*/
|
|
3849
|
+
this.createProxy = async (args) => {
|
|
3850
|
+
return [await this.write("createProxy", args)];
|
|
3851
|
+
};
|
|
3852
|
+
/**
|
|
3853
|
+
* Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
|
|
3854
|
+
* @param args - Array[masterCopy, initializer, saltNonce]
|
|
3855
|
+
* @returns Array[proxyAddress]
|
|
3856
|
+
*/
|
|
3857
|
+
this.createProxyWithNonce = async (args) => {
|
|
3858
|
+
return [await this.write("createProxyWithNonce", args)];
|
|
3859
|
+
};
|
|
3860
|
+
}
|
|
3861
|
+
};
|
|
3862
|
+
var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
|
|
3863
|
+
|
|
3864
|
+
// src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
|
|
3865
|
+
var import_types_kit22 = require("@safe-global/types-kit");
|
|
3866
|
+
var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
|
|
3867
|
+
/**
|
|
3868
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_1_1
|
|
3869
|
+
*
|
|
3870
|
+
* @param chainId - The chain ID where the contract resides.
|
|
3871
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
3872
|
+
* @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.
|
|
3873
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
|
|
3874
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3875
|
+
*/
|
|
3876
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3877
|
+
const safeVersion = "1.1.1";
|
|
3878
|
+
const defaultAbi = import_types_kit22.safeProxyFactory_1_1_1_ContractArtifacts.abi;
|
|
3879
|
+
super(
|
|
3880
|
+
chainId,
|
|
3881
|
+
safeProvider,
|
|
3362
3882
|
defaultAbi,
|
|
3363
3883
|
safeVersion,
|
|
3364
3884
|
customContractAddress,
|
|
@@ -3416,7 +3936,7 @@ var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract
|
|
|
3416
3936
|
var SafeProxyFactoryContract_v1_1_1_default = SafeProxyFactoryContract_v1_1_1;
|
|
3417
3937
|
|
|
3418
3938
|
// src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.ts
|
|
3419
|
-
var
|
|
3939
|
+
var import_types_kit23 = require("@safe-global/types-kit");
|
|
3420
3940
|
var SafeProxyFactoryContract_v1_3_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
3421
3941
|
/**
|
|
3422
3942
|
* Constructs an instance of SafeProxyFactoryContract_v1_3_0
|
|
@@ -3429,7 +3949,7 @@ var SafeProxyFactoryContract_v1_3_0 = class extends SafeProxyFactoryBaseContract
|
|
|
3429
3949
|
*/
|
|
3430
3950
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3431
3951
|
const safeVersion = "1.3.0";
|
|
3432
|
-
const defaultAbi =
|
|
3952
|
+
const defaultAbi = import_types_kit23.safeProxyFactory_1_3_0_ContractArtifacts.abi;
|
|
3433
3953
|
super(
|
|
3434
3954
|
chainId,
|
|
3435
3955
|
safeProvider,
|
|
@@ -3490,7 +4010,7 @@ var SafeProxyFactoryContract_v1_3_0 = class extends SafeProxyFactoryBaseContract
|
|
|
3490
4010
|
var SafeProxyFactoryContract_v1_3_0_default = SafeProxyFactoryContract_v1_3_0;
|
|
3491
4011
|
|
|
3492
4012
|
// src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.ts
|
|
3493
|
-
var
|
|
4013
|
+
var import_types_kit24 = require("@safe-global/types-kit");
|
|
3494
4014
|
var SafeProxyFactoryContract_v1_4_1 = class extends SafeProxyFactoryBaseContract_default {
|
|
3495
4015
|
/**
|
|
3496
4016
|
* Constructs an instance of SafeProxyFactoryContract_v1_4_1
|
|
@@ -3503,7 +4023,7 @@ var SafeProxyFactoryContract_v1_4_1 = class extends SafeProxyFactoryBaseContract
|
|
|
3503
4023
|
*/
|
|
3504
4024
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3505
4025
|
const safeVersion = "1.4.1";
|
|
3506
|
-
const defaultAbi =
|
|
4026
|
+
const defaultAbi = import_types_kit24.safeProxyFactory_1_4_1_ContractArtifacts.abi;
|
|
3507
4027
|
super(
|
|
3508
4028
|
chainId,
|
|
3509
4029
|
safeProvider,
|
|
@@ -3556,6 +4076,80 @@ var SafeProxyFactoryContract_v1_4_1 = class extends SafeProxyFactoryBaseContract
|
|
|
3556
4076
|
};
|
|
3557
4077
|
var SafeProxyFactoryContract_v1_4_1_default = SafeProxyFactoryContract_v1_4_1;
|
|
3558
4078
|
|
|
4079
|
+
// src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.ts
|
|
4080
|
+
var import_types_kit25 = require("@safe-global/types-kit");
|
|
4081
|
+
var SafeProxyFactoryContract_v1_5_0 = class extends SafeProxyFactoryBaseContract_default {
|
|
4082
|
+
/**
|
|
4083
|
+
* Constructs an instance of SafeProxyFactoryContract_v1_5_0
|
|
4084
|
+
*
|
|
4085
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4086
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4087
|
+
* @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.
|
|
4088
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4089
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4090
|
+
*/
|
|
4091
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4092
|
+
const safeVersion = "1.5.0";
|
|
4093
|
+
const defaultAbi = import_types_kit25.safeProxyFactory_1_5_0_ContractArtifacts.abi;
|
|
4094
|
+
super(
|
|
4095
|
+
chainId,
|
|
4096
|
+
safeProvider,
|
|
4097
|
+
defaultAbi,
|
|
4098
|
+
safeVersion,
|
|
4099
|
+
customContractAddress,
|
|
4100
|
+
customContractAbi,
|
|
4101
|
+
deploymentType
|
|
4102
|
+
);
|
|
4103
|
+
/**
|
|
4104
|
+
* Returns the ID of the chain the contract is currently deployed on.
|
|
4105
|
+
* @returns Array[chainId]
|
|
4106
|
+
*/
|
|
4107
|
+
this.getChainId = async () => {
|
|
4108
|
+
return [await this.read("getChainId")];
|
|
4109
|
+
};
|
|
4110
|
+
/**
|
|
4111
|
+
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
4112
|
+
* @returns Array[creationCode]
|
|
4113
|
+
*/
|
|
4114
|
+
this.proxyCreationCode = async () => {
|
|
4115
|
+
return [await this.read("proxyCreationCode")];
|
|
4116
|
+
};
|
|
4117
|
+
/**
|
|
4118
|
+
* Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4119
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4120
|
+
* @returns Array[proxy]
|
|
4121
|
+
*/
|
|
4122
|
+
this.createChainSpecificProxyWithNonce = async (args) => {
|
|
4123
|
+
return [await this.write("createChainSpecificProxyWithNonce", args)];
|
|
4124
|
+
};
|
|
4125
|
+
/**
|
|
4126
|
+
* Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4127
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4128
|
+
* @returns Array[proxy]
|
|
4129
|
+
*/
|
|
4130
|
+
this.createChainSpecificProxyWithNonceL2 = async (args) => {
|
|
4131
|
+
return [await this.write("createChainSpecificProxyWithNonceL2", args)];
|
|
4132
|
+
};
|
|
4133
|
+
/**
|
|
4134
|
+
* Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4135
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4136
|
+
* @returns Array[proxy]
|
|
4137
|
+
*/
|
|
4138
|
+
this.createProxyWithNonce = async (args) => {
|
|
4139
|
+
return [await this.write("createProxyWithNonce", args)];
|
|
4140
|
+
};
|
|
4141
|
+
/**
|
|
4142
|
+
* Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
|
|
4143
|
+
* @param args - Array[singleton, initializer, saltNonce]
|
|
4144
|
+
* @returns Array[proxy]
|
|
4145
|
+
*/
|
|
4146
|
+
this.createProxyWithNonceL2 = async (args) => {
|
|
4147
|
+
return [await this.write("createProxyWithNonceL2", args)];
|
|
4148
|
+
};
|
|
4149
|
+
}
|
|
4150
|
+
};
|
|
4151
|
+
var SafeProxyFactoryContract_v1_5_0_default = SafeProxyFactoryContract_v1_5_0;
|
|
4152
|
+
|
|
3559
4153
|
// src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.ts
|
|
3560
4154
|
var SimulateTxAccessorBaseContract = class extends BaseContract_default {
|
|
3561
4155
|
/**
|
|
@@ -3588,7 +4182,7 @@ var SimulateTxAccessorBaseContract = class extends BaseContract_default {
|
|
|
3588
4182
|
var SimulateTxAccessorBaseContract_default = SimulateTxAccessorBaseContract;
|
|
3589
4183
|
|
|
3590
4184
|
// src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.ts
|
|
3591
|
-
var
|
|
4185
|
+
var import_types_kit26 = require("@safe-global/types-kit");
|
|
3592
4186
|
var SimulateTxAccessorContract_v1_3_0 = class extends SimulateTxAccessorBaseContract_default {
|
|
3593
4187
|
/**
|
|
3594
4188
|
* Constructs an instance of SimulateTxAccessorContract_v1_3_0
|
|
@@ -3601,7 +4195,7 @@ var SimulateTxAccessorContract_v1_3_0 = class extends SimulateTxAccessorBaseCont
|
|
|
3601
4195
|
*/
|
|
3602
4196
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3603
4197
|
const safeVersion = "1.3.0";
|
|
3604
|
-
const defaultAbi =
|
|
4198
|
+
const defaultAbi = import_types_kit26.simulateTxAccessor_1_3_0_ContractArtifacts.abi;
|
|
3605
4199
|
super(
|
|
3606
4200
|
chainId,
|
|
3607
4201
|
safeProvider,
|
|
@@ -3624,7 +4218,7 @@ var SimulateTxAccessorContract_v1_3_0 = class extends SimulateTxAccessorBaseCont
|
|
|
3624
4218
|
var SimulateTxAccessorContract_v1_3_0_default = SimulateTxAccessorContract_v1_3_0;
|
|
3625
4219
|
|
|
3626
4220
|
// src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.ts
|
|
3627
|
-
var
|
|
4221
|
+
var import_types_kit27 = require("@safe-global/types-kit");
|
|
3628
4222
|
var SimulateTxAccessorContract_v1_4_1 = class extends SimulateTxAccessorBaseContract_default {
|
|
3629
4223
|
/**
|
|
3630
4224
|
* Constructs an instance of SimulateTxAccessorContract_v1_4_1
|
|
@@ -3637,7 +4231,7 @@ var SimulateTxAccessorContract_v1_4_1 = class extends SimulateTxAccessorBaseCont
|
|
|
3637
4231
|
*/
|
|
3638
4232
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3639
4233
|
const safeVersion = "1.4.1";
|
|
3640
|
-
const defaultAbi =
|
|
4234
|
+
const defaultAbi = import_types_kit27.simulateTxAccessor_1_4_1_ContractArtifacts.abi;
|
|
3641
4235
|
super(
|
|
3642
4236
|
chainId,
|
|
3643
4237
|
safeProvider,
|
|
@@ -3659,6 +4253,42 @@ var SimulateTxAccessorContract_v1_4_1 = class extends SimulateTxAccessorBaseCont
|
|
|
3659
4253
|
};
|
|
3660
4254
|
var SimulateTxAccessorContract_v1_4_1_default = SimulateTxAccessorContract_v1_4_1;
|
|
3661
4255
|
|
|
4256
|
+
// src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.ts
|
|
4257
|
+
var import_types_kit28 = require("@safe-global/types-kit");
|
|
4258
|
+
var SimulateTxAccessorContract_v1_5_0 = class extends SimulateTxAccessorBaseContract_default {
|
|
4259
|
+
/**
|
|
4260
|
+
* Constructs an instance of SimulateTxAccessorContract_v1_5_0
|
|
4261
|
+
*
|
|
4262
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4263
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4264
|
+
* @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.
|
|
4265
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4266
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4267
|
+
*/
|
|
4268
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4269
|
+
const safeVersion = "1.5.0";
|
|
4270
|
+
const defaultAbi = import_types_kit28.simulateTxAccessor_1_5_0_ContractArtifacts.abi;
|
|
4271
|
+
super(
|
|
4272
|
+
chainId,
|
|
4273
|
+
safeProvider,
|
|
4274
|
+
defaultAbi,
|
|
4275
|
+
safeVersion,
|
|
4276
|
+
customContractAddress,
|
|
4277
|
+
customContractAbi,
|
|
4278
|
+
deploymentType
|
|
4279
|
+
);
|
|
4280
|
+
/**
|
|
4281
|
+
* @param args - Array[to, value, data, operation]
|
|
4282
|
+
* @returns Array[estimate, success, returnData]
|
|
4283
|
+
*/
|
|
4284
|
+
this.simulate = async (args) => {
|
|
4285
|
+
const [estimate, success, returnData] = await this.write("simulate", args);
|
|
4286
|
+
return [BigInt(estimate), !!success, asHex(returnData)];
|
|
4287
|
+
};
|
|
4288
|
+
}
|
|
4289
|
+
};
|
|
4290
|
+
var SimulateTxAccessorContract_v1_5_0_default = SimulateTxAccessorContract_v1_5_0;
|
|
4291
|
+
|
|
3662
4292
|
// src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.ts
|
|
3663
4293
|
var CompatibilityFallbackHandlerBaseContract = class extends BaseContract_default {
|
|
3664
4294
|
/**
|
|
@@ -3691,7 +4321,7 @@ var CompatibilityFallbackHandlerBaseContract = class extends BaseContract_defaul
|
|
|
3691
4321
|
var CompatibilityFallbackHandlerBaseContract_default = CompatibilityFallbackHandlerBaseContract;
|
|
3692
4322
|
|
|
3693
4323
|
// src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.ts
|
|
3694
|
-
var
|
|
4324
|
+
var import_types_kit29 = require("@safe-global/types-kit");
|
|
3695
4325
|
var CompatibilityFallbackHandlerContract_v1_3_0 = class extends CompatibilityFallbackHandlerBaseContract_default {
|
|
3696
4326
|
/**
|
|
3697
4327
|
* Constructs an instance of CompatibilityFallbackHandlerContract_v1_3_0
|
|
@@ -3704,7 +4334,7 @@ var CompatibilityFallbackHandlerContract_v1_3_0 = class extends CompatibilityFal
|
|
|
3704
4334
|
*/
|
|
3705
4335
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3706
4336
|
const safeVersion = "1.3.0";
|
|
3707
|
-
const defaultAbi =
|
|
4337
|
+
const defaultAbi = import_types_kit29.compatibilityFallbackHandler_1_3_0_ContractArtifacts.abi;
|
|
3708
4338
|
super(
|
|
3709
4339
|
chainId,
|
|
3710
4340
|
safeProvider,
|
|
@@ -3719,7 +4349,7 @@ var CompatibilityFallbackHandlerContract_v1_3_0 = class extends CompatibilityFal
|
|
|
3719
4349
|
var CompatibilityFallbackHandlerContract_v1_3_0_default = CompatibilityFallbackHandlerContract_v1_3_0;
|
|
3720
4350
|
|
|
3721
4351
|
// src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.ts
|
|
3722
|
-
var
|
|
4352
|
+
var import_types_kit30 = require("@safe-global/types-kit");
|
|
3723
4353
|
var CompatibilityFallbackHandlerContract_v1_4_1 = class extends CompatibilityFallbackHandlerBaseContract_default {
|
|
3724
4354
|
/**
|
|
3725
4355
|
* Constructs an instance of CompatibilityFallbackHandlerContract_v1_4_1
|
|
@@ -3732,7 +4362,103 @@ var CompatibilityFallbackHandlerContract_v1_4_1 = class extends CompatibilityFal
|
|
|
3732
4362
|
*/
|
|
3733
4363
|
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
3734
4364
|
const safeVersion = "1.4.1";
|
|
3735
|
-
const defaultAbi =
|
|
4365
|
+
const defaultAbi = import_types_kit30.compatibilityFallbackHandler_1_4_1_ContractArtifacts.abi;
|
|
4366
|
+
super(
|
|
4367
|
+
chainId,
|
|
4368
|
+
safeProvider,
|
|
4369
|
+
defaultAbi,
|
|
4370
|
+
safeVersion,
|
|
4371
|
+
customContractAddress,
|
|
4372
|
+
customContractAbi,
|
|
4373
|
+
deploymentType
|
|
4374
|
+
);
|
|
4375
|
+
}
|
|
4376
|
+
};
|
|
4377
|
+
var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
|
|
4378
|
+
|
|
4379
|
+
// src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.ts
|
|
4380
|
+
var import_types_kit31 = require("@safe-global/types-kit");
|
|
4381
|
+
var CompatibilityFallbackHandlerContract_v1_5_0 = class extends CompatibilityFallbackHandlerBaseContract_default {
|
|
4382
|
+
/**
|
|
4383
|
+
* Constructs an instance of CompatibilityFallbackHandlerContract_v1_5_0
|
|
4384
|
+
*
|
|
4385
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4386
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4387
|
+
* @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.
|
|
4388
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4389
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4390
|
+
*/
|
|
4391
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4392
|
+
const safeVersion = "1.5.0";
|
|
4393
|
+
const defaultAbi = import_types_kit31.compatibilityFallbackHandler_1_5_0_ContractArtifacts.abi;
|
|
4394
|
+
super(
|
|
4395
|
+
chainId,
|
|
4396
|
+
safeProvider,
|
|
4397
|
+
defaultAbi,
|
|
4398
|
+
safeVersion,
|
|
4399
|
+
customContractAddress,
|
|
4400
|
+
customContractAbi,
|
|
4401
|
+
deploymentType
|
|
4402
|
+
);
|
|
4403
|
+
/**
|
|
4404
|
+
* New in v1.5.0: encodeTransactionData was moved from the Safe contract to CompatibilityFallbackHandler
|
|
4405
|
+
* to preserve backwards compatibility for existing integrations.
|
|
4406
|
+
* @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, nonce]
|
|
4407
|
+
* @returns Array[encodedData]
|
|
4408
|
+
*/
|
|
4409
|
+
this.encodeTransactionData = async (args) => {
|
|
4410
|
+
return [await this.read("encodeTransactionData", args)];
|
|
4411
|
+
};
|
|
4412
|
+
}
|
|
4413
|
+
};
|
|
4414
|
+
var CompatibilityFallbackHandlerContract_v1_5_0_default = CompatibilityFallbackHandlerContract_v1_5_0;
|
|
4415
|
+
|
|
4416
|
+
// src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.ts
|
|
4417
|
+
var ExtensibleFallbackHandlerBaseContract = class extends BaseContract_default {
|
|
4418
|
+
/**
|
|
4419
|
+
* @constructor
|
|
4420
|
+
* Constructs an instance of ExtensibleFallbackHandlerBaseContract.
|
|
4421
|
+
*
|
|
4422
|
+
* @param chainId - The chain ID of the contract.
|
|
4423
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4424
|
+
* @param defaultAbi - The default ABI for the ExtensibleFallbackHandler contract. It should be compatible with the specific version of the contract.
|
|
4425
|
+
* @param safeVersion - The version of the Safe contract.
|
|
4426
|
+
* @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.
|
|
4427
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
4428
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4429
|
+
*/
|
|
4430
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
4431
|
+
const contractName3 = "extensibleFallbackHandler";
|
|
4432
|
+
super(
|
|
4433
|
+
contractName3,
|
|
4434
|
+
chainId,
|
|
4435
|
+
safeProvider,
|
|
4436
|
+
defaultAbi,
|
|
4437
|
+
safeVersion,
|
|
4438
|
+
customContractAddress,
|
|
4439
|
+
customContractAbi,
|
|
4440
|
+
deploymentType
|
|
4441
|
+
);
|
|
4442
|
+
this.contractName = contractName3;
|
|
4443
|
+
}
|
|
4444
|
+
};
|
|
4445
|
+
var ExtensibleFallbackHandlerBaseContract_default = ExtensibleFallbackHandlerBaseContract;
|
|
4446
|
+
|
|
4447
|
+
// src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.ts
|
|
4448
|
+
var import_types_kit32 = require("@safe-global/types-kit");
|
|
4449
|
+
var ExtensibleFallbackHandlerContract_v1_5_0 = class extends ExtensibleFallbackHandlerBaseContract_default {
|
|
4450
|
+
/**
|
|
4451
|
+
* Constructs an instance of ExtensibleFallbackHandlerContract_v1_5_0
|
|
4452
|
+
*
|
|
4453
|
+
* @param chainId - The chain ID where the contract resides.
|
|
4454
|
+
* @param safeProvider - An instance of SafeProvider.
|
|
4455
|
+
* @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.
|
|
4456
|
+
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
|
|
4457
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
4458
|
+
*/
|
|
4459
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
4460
|
+
const safeVersion = "1.5.0";
|
|
4461
|
+
const defaultAbi = import_types_kit32.extensibleFallbackHandler_1_5_0_ContractArtifacts.abi;
|
|
3736
4462
|
super(
|
|
3737
4463
|
chainId,
|
|
3738
4464
|
safeProvider,
|
|
@@ -3742,9 +4468,130 @@ var CompatibilityFallbackHandlerContract_v1_4_1 = class extends CompatibilityFal
|
|
|
3742
4468
|
customContractAbi,
|
|
3743
4469
|
deploymentType
|
|
3744
4470
|
);
|
|
4471
|
+
// Read methods
|
|
4472
|
+
/**
|
|
4473
|
+
* @param args - Array[safe, domainSeparator]
|
|
4474
|
+
* @returns Array[verifier]
|
|
4475
|
+
*/
|
|
4476
|
+
this.domainVerifiers = async (args) => {
|
|
4477
|
+
return [await this.read("domainVerifiers", args)];
|
|
4478
|
+
};
|
|
4479
|
+
/**
|
|
4480
|
+
* @param args - Array[_hash, signature]
|
|
4481
|
+
* @returns Array[magic]
|
|
4482
|
+
*/
|
|
4483
|
+
this.isValidSignature = async (args) => {
|
|
4484
|
+
return [await this.read("isValidSignature", args)];
|
|
4485
|
+
};
|
|
4486
|
+
/**
|
|
4487
|
+
* @param args - Array[safe, interfaceId]
|
|
4488
|
+
* @returns Array[isSupported]
|
|
4489
|
+
*/
|
|
4490
|
+
this.safeInterfaces = async (args) => {
|
|
4491
|
+
return [await this.read("safeInterfaces", args)];
|
|
4492
|
+
};
|
|
4493
|
+
/**
|
|
4494
|
+
* @param args - Array[safe, selector]
|
|
4495
|
+
* @returns Array[handler]
|
|
4496
|
+
*/
|
|
4497
|
+
this.safeMethods = async (args) => {
|
|
4498
|
+
return [await this.read("safeMethods", args)];
|
|
4499
|
+
};
|
|
4500
|
+
/**
|
|
4501
|
+
* @param args - Array[interfaceId]
|
|
4502
|
+
* @returns Array[isSupported]
|
|
4503
|
+
*/
|
|
4504
|
+
this.supportsInterface = async (args) => {
|
|
4505
|
+
return [await this.read("supportsInterface", args)];
|
|
4506
|
+
};
|
|
4507
|
+
/**
|
|
4508
|
+
* @param args - Array[operator, from, tokenId, data]
|
|
4509
|
+
* @returns Array[bytes4]
|
|
4510
|
+
*/
|
|
4511
|
+
this.onERC721Received = async (args) => {
|
|
4512
|
+
return [await this.read("onERC721Received", args)];
|
|
4513
|
+
};
|
|
4514
|
+
/**
|
|
4515
|
+
* @param args - Array[operator, from, id, value, data]
|
|
4516
|
+
* @returns Array[bytes4]
|
|
4517
|
+
*/
|
|
4518
|
+
this.onERC1155Received = async (args) => {
|
|
4519
|
+
return [await this.read("onERC1155Received", args)];
|
|
4520
|
+
};
|
|
4521
|
+
/**
|
|
4522
|
+
* @param args - Array[operator, from, ids, values, data]
|
|
4523
|
+
* @returns Array[bytes4]
|
|
4524
|
+
*/
|
|
4525
|
+
this.onERC1155BatchReceived = async (args) => {
|
|
4526
|
+
return [await this.read("onERC1155BatchReceived", args)];
|
|
4527
|
+
};
|
|
4528
|
+
// Write methods (must be called via Safe transactions since msg.sender = Safe address)
|
|
4529
|
+
/**
|
|
4530
|
+
* @param args - Array[_interfaceId, handlerWithSelectors]
|
|
4531
|
+
*/
|
|
4532
|
+
this.addSupportedInterfaceBatch = async (args, options) => {
|
|
4533
|
+
if (options && !options.gasLimit) {
|
|
4534
|
+
options.gasLimit = Number(
|
|
4535
|
+
await this.estimateGas("addSupportedInterfaceBatch", args, { ...options })
|
|
4536
|
+
);
|
|
4537
|
+
}
|
|
4538
|
+
return toTxResult(
|
|
4539
|
+
this.runner,
|
|
4540
|
+
await this.write("addSupportedInterfaceBatch", args, options),
|
|
4541
|
+
options
|
|
4542
|
+
);
|
|
4543
|
+
};
|
|
4544
|
+
/**
|
|
4545
|
+
* @param args - Array[_interfaceId, selectors]
|
|
4546
|
+
*/
|
|
4547
|
+
this.removeSupportedInterfaceBatch = async (args, options) => {
|
|
4548
|
+
if (options && !options.gasLimit) {
|
|
4549
|
+
options.gasLimit = Number(
|
|
4550
|
+
await this.estimateGas("removeSupportedInterfaceBatch", args, { ...options })
|
|
4551
|
+
);
|
|
4552
|
+
}
|
|
4553
|
+
return toTxResult(
|
|
4554
|
+
this.runner,
|
|
4555
|
+
await this.write("removeSupportedInterfaceBatch", args, options),
|
|
4556
|
+
options
|
|
4557
|
+
);
|
|
4558
|
+
};
|
|
4559
|
+
/**
|
|
4560
|
+
* @param args - Array[domainSeparator, newVerifier]
|
|
4561
|
+
*/
|
|
4562
|
+
this.setDomainVerifier = async (args, options) => {
|
|
4563
|
+
if (options && !options.gasLimit) {
|
|
4564
|
+
options.gasLimit = Number(await this.estimateGas("setDomainVerifier", args, { ...options }));
|
|
4565
|
+
}
|
|
4566
|
+
return toTxResult(this.runner, await this.write("setDomainVerifier", args, options), options);
|
|
4567
|
+
};
|
|
4568
|
+
/**
|
|
4569
|
+
* @param args - Array[selector, newMethod]
|
|
4570
|
+
*/
|
|
4571
|
+
this.setSafeMethod = async (args, options) => {
|
|
4572
|
+
if (options && !options.gasLimit) {
|
|
4573
|
+
options.gasLimit = Number(await this.estimateGas("setSafeMethod", args, { ...options }));
|
|
4574
|
+
}
|
|
4575
|
+
return toTxResult(this.runner, await this.write("setSafeMethod", args, options), options);
|
|
4576
|
+
};
|
|
4577
|
+
/**
|
|
4578
|
+
* @param args - Array[interfaceId, supported]
|
|
4579
|
+
*/
|
|
4580
|
+
this.setSupportedInterface = async (args, options) => {
|
|
4581
|
+
if (options && !options.gasLimit) {
|
|
4582
|
+
options.gasLimit = Number(
|
|
4583
|
+
await this.estimateGas("setSupportedInterface", args, { ...options })
|
|
4584
|
+
);
|
|
4585
|
+
}
|
|
4586
|
+
return toTxResult(
|
|
4587
|
+
this.runner,
|
|
4588
|
+
await this.write("setSupportedInterface", args, options),
|
|
4589
|
+
options
|
|
4590
|
+
);
|
|
4591
|
+
};
|
|
3745
4592
|
}
|
|
3746
4593
|
};
|
|
3747
|
-
var
|
|
4594
|
+
var ExtensibleFallbackHandlerContract_v1_5_0_default = ExtensibleFallbackHandlerContract_v1_5_0;
|
|
3748
4595
|
|
|
3749
4596
|
// src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.ts
|
|
3750
4597
|
var SafeWebAuthnSignerFactoryBaseContract = class extends BaseContract_default {
|
|
@@ -3778,7 +4625,7 @@ var SafeWebAuthnSignerFactoryBaseContract = class extends BaseContract_default {
|
|
|
3778
4625
|
var SafeWebAuthnSignerFactoryBaseContract_default = SafeWebAuthnSignerFactoryBaseContract;
|
|
3779
4626
|
|
|
3780
4627
|
// src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.ts
|
|
3781
|
-
var
|
|
4628
|
+
var import_types_kit33 = require("@safe-global/types-kit");
|
|
3782
4629
|
var SafeWebAuthnSignerFactoryContract_v0_2_1 = class extends SafeWebAuthnSignerFactoryBaseContract_default {
|
|
3783
4630
|
/**
|
|
3784
4631
|
* Constructs an instance of SafeWebAuthnSignerFactoryContract_v0_2_1
|
|
@@ -3791,7 +4638,7 @@ var SafeWebAuthnSignerFactoryContract_v0_2_1 = class extends SafeWebAuthnSignerF
|
|
|
3791
4638
|
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3792
4639
|
*/
|
|
3793
4640
|
constructor(chainId, safeProvider, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3794
|
-
const defaultAbi =
|
|
4641
|
+
const defaultAbi = import_types_kit33.SafeWebAuthnSignerFactory_0_2_1_ContractArtifacts.abi;
|
|
3795
4642
|
super(
|
|
3796
4643
|
chainId,
|
|
3797
4644
|
safeProvider,
|
|
@@ -3856,7 +4703,7 @@ var SafeWebAuthnSharedSignerBaseContract = class extends BaseContract_default {
|
|
|
3856
4703
|
var SafeWebAuthnSharedSignerBaseContract_default = SafeWebAuthnSharedSignerBaseContract;
|
|
3857
4704
|
|
|
3858
4705
|
// src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.ts
|
|
3859
|
-
var
|
|
4706
|
+
var import_types_kit34 = require("@safe-global/types-kit");
|
|
3860
4707
|
var SafeWebAuthnSharedSignerContract_v0_2_1 = class extends SafeWebAuthnSharedSignerBaseContract_default {
|
|
3861
4708
|
/**
|
|
3862
4709
|
* Constructs an instance of SafeWebAuthnSharedSignerContract_v0_2_1
|
|
@@ -3869,7 +4716,7 @@ var SafeWebAuthnSharedSignerContract_v0_2_1 = class extends SafeWebAuthnSharedSi
|
|
|
3869
4716
|
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
3870
4717
|
*/
|
|
3871
4718
|
constructor(chainId, safeProvider, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
3872
|
-
const defaultAbi =
|
|
4719
|
+
const defaultAbi = import_types_kit34.SafeWebAuthnSharedSigner_0_2_1_ContractArtifacts.abi;
|
|
3873
4720
|
super(
|
|
3874
4721
|
chainId,
|
|
3875
4722
|
safeProvider,
|
|
@@ -3914,6 +4761,16 @@ async function getSafeContractInstance(safeVersion, safeProvider, contractAddres
|
|
|
3914
4761
|
const chainId = await safeProvider.getChainId();
|
|
3915
4762
|
let safeContractInstance;
|
|
3916
4763
|
switch (safeVersion) {
|
|
4764
|
+
case "1.5.0":
|
|
4765
|
+
safeContractInstance = new SafeContract_v1_5_0_default(
|
|
4766
|
+
chainId,
|
|
4767
|
+
safeProvider,
|
|
4768
|
+
isL1SafeSingleton,
|
|
4769
|
+
contractAddress,
|
|
4770
|
+
customContractAbi,
|
|
4771
|
+
deploymentType
|
|
4772
|
+
);
|
|
4773
|
+
break;
|
|
3917
4774
|
case "1.4.1":
|
|
3918
4775
|
safeContractInstance = new SafeContract_v1_4_1_default(
|
|
3919
4776
|
chainId,
|
|
@@ -3974,6 +4831,15 @@ async function getCompatibilityFallbackHandlerContractInstance(safeVersion, safe
|
|
|
3974
4831
|
const chainId = await safeProvider.getChainId();
|
|
3975
4832
|
let compatibilityFallbackHandlerInstance;
|
|
3976
4833
|
switch (safeVersion) {
|
|
4834
|
+
case "1.5.0":
|
|
4835
|
+
compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_5_0_default(
|
|
4836
|
+
chainId,
|
|
4837
|
+
safeProvider,
|
|
4838
|
+
contractAddress,
|
|
4839
|
+
customContractAbi,
|
|
4840
|
+
deploymentType
|
|
4841
|
+
);
|
|
4842
|
+
break;
|
|
3977
4843
|
case "1.4.1":
|
|
3978
4844
|
compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_4_1_default(
|
|
3979
4845
|
chainId,
|
|
@@ -4004,6 +4870,15 @@ async function getMultiSendContractInstance(safeVersion, safeProvider, contractA
|
|
|
4004
4870
|
const chainId = await safeProvider.getChainId();
|
|
4005
4871
|
let multiSendContractInstance;
|
|
4006
4872
|
switch (safeVersion) {
|
|
4873
|
+
case "1.5.0":
|
|
4874
|
+
multiSendContractInstance = new MultiSendContract_v1_5_0_default(
|
|
4875
|
+
chainId,
|
|
4876
|
+
safeProvider,
|
|
4877
|
+
contractAddress,
|
|
4878
|
+
customContractAbi,
|
|
4879
|
+
deploymentType
|
|
4880
|
+
);
|
|
4881
|
+
break;
|
|
4007
4882
|
case "1.4.1":
|
|
4008
4883
|
multiSendContractInstance = new MultiSendContract_v1_4_1_default(
|
|
4009
4884
|
chainId,
|
|
@@ -4043,6 +4918,15 @@ async function getMultiSendCallOnlyContractInstance(safeVersion, safeProvider, c
|
|
|
4043
4918
|
const chainId = await safeProvider.getChainId();
|
|
4044
4919
|
let multiSendCallOnlyContractInstance;
|
|
4045
4920
|
switch (safeVersion) {
|
|
4921
|
+
case "1.5.0":
|
|
4922
|
+
multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_5_0_default(
|
|
4923
|
+
chainId,
|
|
4924
|
+
safeProvider,
|
|
4925
|
+
contractAddress,
|
|
4926
|
+
customContractAbi,
|
|
4927
|
+
deploymentType
|
|
4928
|
+
);
|
|
4929
|
+
break;
|
|
4046
4930
|
case "1.4.1":
|
|
4047
4931
|
multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_4_1_default(
|
|
4048
4932
|
chainId,
|
|
@@ -4074,6 +4958,15 @@ async function getSafeProxyFactoryContractInstance(safeVersion, safeProvider, co
|
|
|
4074
4958
|
const chainId = await safeProvider.getChainId();
|
|
4075
4959
|
let safeProxyFactoryContractInstance;
|
|
4076
4960
|
switch (safeVersion) {
|
|
4961
|
+
case "1.5.0":
|
|
4962
|
+
safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_5_0_default(
|
|
4963
|
+
chainId,
|
|
4964
|
+
safeProvider,
|
|
4965
|
+
contractAddress,
|
|
4966
|
+
customContractAbi,
|
|
4967
|
+
deploymentType
|
|
4968
|
+
);
|
|
4969
|
+
break;
|
|
4077
4970
|
case "1.4.1":
|
|
4078
4971
|
safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_4_1_default(
|
|
4079
4972
|
chainId,
|
|
@@ -4121,6 +5014,15 @@ async function getSignMessageLibContractInstance(safeVersion, safeProvider, cont
|
|
|
4121
5014
|
const chainId = await safeProvider.getChainId();
|
|
4122
5015
|
let signMessageLibContractInstance;
|
|
4123
5016
|
switch (safeVersion) {
|
|
5017
|
+
case "1.5.0":
|
|
5018
|
+
signMessageLibContractInstance = new SignMessageLibContract_v1_5_0_default(
|
|
5019
|
+
chainId,
|
|
5020
|
+
safeProvider,
|
|
5021
|
+
contractAddress,
|
|
5022
|
+
customContractAbi,
|
|
5023
|
+
deploymentType
|
|
5024
|
+
);
|
|
5025
|
+
break;
|
|
4124
5026
|
case "1.4.1":
|
|
4125
5027
|
signMessageLibContractInstance = new SignMessageLibContract_v1_4_1_default(
|
|
4126
5028
|
chainId,
|
|
@@ -4149,6 +5051,15 @@ async function getCreateCallContractInstance(safeVersion, safeProvider, contract
|
|
|
4149
5051
|
const chainId = await safeProvider.getChainId();
|
|
4150
5052
|
let createCallContractInstance;
|
|
4151
5053
|
switch (safeVersion) {
|
|
5054
|
+
case "1.5.0":
|
|
5055
|
+
createCallContractInstance = new CreateCallContract_v1_5_0_default(
|
|
5056
|
+
chainId,
|
|
5057
|
+
safeProvider,
|
|
5058
|
+
contractAddress,
|
|
5059
|
+
customContractAbi,
|
|
5060
|
+
deploymentType
|
|
5061
|
+
);
|
|
5062
|
+
break;
|
|
4152
5063
|
case "1.4.1":
|
|
4153
5064
|
createCallContractInstance = new CreateCallContract_v1_4_1_default(
|
|
4154
5065
|
chainId,
|
|
@@ -4180,6 +5091,15 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
|
|
|
4180
5091
|
const chainId = await safeProvider.getChainId();
|
|
4181
5092
|
let simulateTxAccessorContractInstance;
|
|
4182
5093
|
switch (safeVersion) {
|
|
5094
|
+
case "1.5.0":
|
|
5095
|
+
simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_5_0_default(
|
|
5096
|
+
chainId,
|
|
5097
|
+
safeProvider,
|
|
5098
|
+
contractAddress,
|
|
5099
|
+
customContractAbi,
|
|
5100
|
+
deploymentType
|
|
5101
|
+
);
|
|
5102
|
+
break;
|
|
4183
5103
|
case "1.4.1":
|
|
4184
5104
|
simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_4_1_default(
|
|
4185
5105
|
chainId,
|
|
@@ -4207,6 +5127,7 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
|
|
|
4207
5127
|
async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
4208
5128
|
const chainId = await safeProvider.getChainId();
|
|
4209
5129
|
switch (safeVersion) {
|
|
5130
|
+
case "1.5.0":
|
|
4210
5131
|
case "1.4.1":
|
|
4211
5132
|
case "1.3.0":
|
|
4212
5133
|
const safeWebAuthnSignerFactoryContractInstance = new SafeWebAuthnSignerFactoryContract_v0_2_1_default(
|
|
@@ -4226,6 +5147,7 @@ async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safePro
|
|
|
4226
5147
|
async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
4227
5148
|
const chainId = await safeProvider.getChainId();
|
|
4228
5149
|
switch (safeVersion) {
|
|
5150
|
+
case "1.5.0":
|
|
4229
5151
|
case "1.4.1":
|
|
4230
5152
|
case "1.3.0":
|
|
4231
5153
|
const safeWebAuthnSharedSignerContractInstance = new SafeWebAuthnSharedSignerContract_v0_2_1_default(
|
|
@@ -4242,6 +5164,23 @@ async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProv
|
|
|
4242
5164
|
throw new Error("Invalid Safe version");
|
|
4243
5165
|
}
|
|
4244
5166
|
}
|
|
5167
|
+
async function getExtensibleFallbackHandlerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
|
|
5168
|
+
const chainId = await safeProvider.getChainId();
|
|
5169
|
+
switch (safeVersion) {
|
|
5170
|
+
case "1.5.0":
|
|
5171
|
+
const extensibleFallbackHandlerContractInstance = new ExtensibleFallbackHandlerContract_v1_5_0_default(
|
|
5172
|
+
chainId,
|
|
5173
|
+
safeProvider,
|
|
5174
|
+
contractAddress,
|
|
5175
|
+
customContractAbi,
|
|
5176
|
+
deploymentType
|
|
5177
|
+
);
|
|
5178
|
+
await extensibleFallbackHandlerContractInstance.init();
|
|
5179
|
+
return extensibleFallbackHandlerContractInstance;
|
|
5180
|
+
default:
|
|
5181
|
+
throw new Error("Invalid Safe version");
|
|
5182
|
+
}
|
|
5183
|
+
}
|
|
4245
5184
|
|
|
4246
5185
|
// src/contracts/safeDeploymentContracts.ts
|
|
4247
5186
|
async function getSafeContract({
|
|
@@ -4451,6 +5390,27 @@ async function getSafeWebAuthnSharedSignerContract({
|
|
|
4451
5390
|
}
|
|
4452
5391
|
return safeWebAuthnSharedSignerContract;
|
|
4453
5392
|
}
|
|
5393
|
+
async function getExtensibleFallbackHandlerContract({
|
|
5394
|
+
safeProvider,
|
|
5395
|
+
safeVersion,
|
|
5396
|
+
customContracts,
|
|
5397
|
+
deploymentType
|
|
5398
|
+
}) {
|
|
5399
|
+
const extensibleFallbackHandlerContract = await getExtensibleFallbackHandlerContractInstance(
|
|
5400
|
+
safeVersion,
|
|
5401
|
+
safeProvider,
|
|
5402
|
+
customContracts?.extensibleFallbackHandlerAddress,
|
|
5403
|
+
customContracts?.extensibleFallbackHandlerAbi,
|
|
5404
|
+
deploymentType
|
|
5405
|
+
);
|
|
5406
|
+
const isContractDeployed = await safeProvider.isContractDeployed(
|
|
5407
|
+
extensibleFallbackHandlerContract.getAddress()
|
|
5408
|
+
);
|
|
5409
|
+
if (!isContractDeployed) {
|
|
5410
|
+
throw new Error("ExtensibleFallbackHandler contract is not deployed on the current network");
|
|
5411
|
+
}
|
|
5412
|
+
return extensibleFallbackHandlerContract;
|
|
5413
|
+
}
|
|
4454
5414
|
|
|
4455
5415
|
// src/utils/transactions/gas.ts
|
|
4456
5416
|
var CALL_DATA_ZERO_BYTE_GAS_COST = 4;
|
|
@@ -4516,7 +5476,7 @@ async function estimateTxGas(safeContract, safeProvider, to, valueInWei, data, o
|
|
|
4516
5476
|
});
|
|
4517
5477
|
return estimateGas3;
|
|
4518
5478
|
} catch (error) {
|
|
4519
|
-
if (operation ===
|
|
5479
|
+
if (operation === import_types_kit35.OperationType.DelegateCall) {
|
|
4520
5480
|
return "0";
|
|
4521
5481
|
}
|
|
4522
5482
|
return Promise.reject(error);
|
|
@@ -4740,14 +5700,14 @@ var EthSafeTransaction = class {
|
|
|
4740
5700
|
var SafeTransaction_default = EthSafeTransaction;
|
|
4741
5701
|
|
|
4742
5702
|
// src/utils/transactions/utils.ts
|
|
4743
|
-
var
|
|
5703
|
+
var import_types_kit36 = require("@safe-global/types-kit");
|
|
4744
5704
|
var import_satisfies5 = __toESM(require("semver/functions/satisfies.js"));
|
|
4745
5705
|
var import_viem9 = require("viem");
|
|
4746
|
-
var
|
|
5706
|
+
var import_actions8 = require("viem/actions");
|
|
4747
5707
|
function standardizeMetaTransactionData(tx) {
|
|
4748
5708
|
const standardizedTxs = {
|
|
4749
5709
|
...tx,
|
|
4750
|
-
operation: tx.operation ??
|
|
5710
|
+
operation: tx.operation ?? import_types_kit36.OperationType.Call
|
|
4751
5711
|
};
|
|
4752
5712
|
return standardizedTxs;
|
|
4753
5713
|
}
|
|
@@ -4762,7 +5722,7 @@ async function standardizeSafeTransactionData({
|
|
|
4762
5722
|
to: tx.to,
|
|
4763
5723
|
value: tx.value,
|
|
4764
5724
|
data: tx.data,
|
|
4765
|
-
operation: tx.operation ??
|
|
5725
|
+
operation: tx.operation ?? import_types_kit36.OperationType.Call,
|
|
4766
5726
|
baseGas: tx.baseGas ?? "0",
|
|
4767
5727
|
gasPrice: tx.gasPrice ?? "0",
|
|
4768
5728
|
gasToken: tx.gasToken || ZERO_ADDRESS,
|
|
@@ -4827,7 +5787,7 @@ function encodeMetaTransaction(tx) {
|
|
|
4827
5787
|
const encoded = (0, import_viem9.encodePacked)(
|
|
4828
5788
|
["uint8", "address", "uint256", "uint256", "bytes"],
|
|
4829
5789
|
[
|
|
4830
|
-
tx.operation ??
|
|
5790
|
+
tx.operation ?? import_types_kit36.OperationType.Call,
|
|
4831
5791
|
tx.to,
|
|
4832
5792
|
BigInt(tx.value),
|
|
4833
5793
|
BigInt(data.length),
|
|
@@ -4943,7 +5903,7 @@ function createTxOptions(options) {
|
|
|
4943
5903
|
}
|
|
4944
5904
|
function hasDelegateCalls(transactions) {
|
|
4945
5905
|
return transactions.some(
|
|
4946
|
-
(transaction) => transaction.operation && transaction.operation ===
|
|
5906
|
+
(transaction) => transaction.operation && transaction.operation === import_types_kit36.OperationType.DelegateCall
|
|
4947
5907
|
);
|
|
4948
5908
|
}
|
|
4949
5909
|
|
|
@@ -5059,18 +6019,18 @@ async function extractPasskeyData(passkeyCredential) {
|
|
|
5059
6019
|
coordinates
|
|
5060
6020
|
};
|
|
5061
6021
|
}
|
|
5062
|
-
function
|
|
5063
|
-
const
|
|
6022
|
+
function getP256VerifierAddress(chainId) {
|
|
6023
|
+
const deployment = (0, import_safe_modules_deployments2.getDaimoP256VerifierDeployment)({
|
|
5064
6024
|
version: "0.2.1",
|
|
5065
6025
|
released: true,
|
|
5066
6026
|
network: chainId
|
|
5067
6027
|
});
|
|
5068
|
-
if (!
|
|
5069
|
-
throw new Error(`Failed to load
|
|
6028
|
+
if (!deployment) {
|
|
6029
|
+
throw new Error(`Failed to load DaimoP256Verifier deployment for chain ID ${chainId}`);
|
|
5070
6030
|
}
|
|
5071
|
-
const verifierAddress =
|
|
6031
|
+
const verifierAddress = deployment.networkAddresses[chainId];
|
|
5072
6032
|
if (!verifierAddress) {
|
|
5073
|
-
throw new Error(`
|
|
6033
|
+
throw new Error(`DaimoP256Verifier address not found for chain ID ${chainId}`);
|
|
5074
6034
|
}
|
|
5075
6035
|
return verifierAddress;
|
|
5076
6036
|
}
|
|
@@ -5079,15 +6039,14 @@ function getDefaultFCLP256VerifierAddress(chainId) {
|
|
|
5079
6039
|
var import_viem10 = require("viem");
|
|
5080
6040
|
|
|
5081
6041
|
// src/utils/passkeys/isSharedSigner.ts
|
|
5082
|
-
async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners
|
|
6042
|
+
async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners) {
|
|
5083
6043
|
const sharedSignerContractAddress = safeWebAuthnSharedSignerContract.contractAddress;
|
|
5084
6044
|
if (safeAddress && owners.includes(sharedSignerContractAddress)) {
|
|
5085
6045
|
const [sharedSignerSlot] = await safeWebAuthnSharedSignerContract.getConfiguration([
|
|
5086
6046
|
asHex(safeAddress)
|
|
5087
6047
|
]);
|
|
5088
6048
|
const { x, y, verifiers } = sharedSignerSlot;
|
|
5089
|
-
const
|
|
5090
|
-
const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(verifierAddress) === verifiers;
|
|
6049
|
+
const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(passkey.verifierAddress) === verifiers;
|
|
5091
6050
|
return isSharedSigner2;
|
|
5092
6051
|
}
|
|
5093
6052
|
return false;
|
|
@@ -5123,16 +6082,14 @@ var signTransaction = () => {
|
|
|
5123
6082
|
var signTypedData = () => {
|
|
5124
6083
|
throw new Error("Passkey Signers cannot sign signTypedData, they can only sign data.");
|
|
5125
6084
|
};
|
|
5126
|
-
var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners
|
|
5127
|
-
const { rawId, coordinates,
|
|
6085
|
+
var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners) => {
|
|
6086
|
+
const { rawId, coordinates, verifierAddress } = passkey;
|
|
5128
6087
|
const passkeyRawId = (0, import_viem10.hexToBytes)(asHex(rawId));
|
|
5129
|
-
const verifierAddress = customVerifierAddress || getDefaultFCLP256VerifierAddress(chainId);
|
|
5130
6088
|
const isPasskeySharedSigner = await isSharedSigner_default(
|
|
5131
6089
|
passkey,
|
|
5132
6090
|
safeWebAuthnSharedSignerContract,
|
|
5133
6091
|
safeAddress,
|
|
5134
|
-
owners
|
|
5135
|
-
chainId
|
|
6092
|
+
owners
|
|
5136
6093
|
);
|
|
5137
6094
|
let signerAddress;
|
|
5138
6095
|
if (isPasskeySharedSigner) {
|
|
@@ -5272,7 +6229,7 @@ function blockTag(blockTag2) {
|
|
|
5272
6229
|
// src/SafeProvider.ts
|
|
5273
6230
|
var import_viem12 = require("viem");
|
|
5274
6231
|
var import_accounts = require("viem/accounts");
|
|
5275
|
-
var
|
|
6232
|
+
var import_actions9 = require("viem/actions");
|
|
5276
6233
|
|
|
5277
6234
|
// src/utils/provider.ts
|
|
5278
6235
|
var import_viem11 = require("viem");
|
|
@@ -5336,8 +6293,7 @@ var SafeProvider = class _SafeProvider {
|
|
|
5336
6293
|
safeWebAuthnSharedSignerContract,
|
|
5337
6294
|
safeProvider.getExternalProvider(),
|
|
5338
6295
|
safeAddress || "",
|
|
5339
|
-
owners || []
|
|
5340
|
-
chainId.toString()
|
|
6296
|
+
owners || []
|
|
5341
6297
|
);
|
|
5342
6298
|
} else {
|
|
5343
6299
|
passkeySigner = signer;
|
|
@@ -5403,13 +6359,13 @@ var SafeProvider = class _SafeProvider {
|
|
|
5403
6359
|
return validateEip3770Address(fullAddress, chainId);
|
|
5404
6360
|
}
|
|
5405
6361
|
async getBalance(address, blockTag2) {
|
|
5406
|
-
return (0,
|
|
6362
|
+
return (0, import_actions9.getBalance)(this.#externalProvider, {
|
|
5407
6363
|
address,
|
|
5408
6364
|
...asBlockId(blockTag2)
|
|
5409
6365
|
});
|
|
5410
6366
|
}
|
|
5411
6367
|
async getNonce(address, blockTag2) {
|
|
5412
|
-
return (0,
|
|
6368
|
+
return (0, import_actions9.getTransactionCount)(this.#externalProvider, {
|
|
5413
6369
|
address,
|
|
5414
6370
|
...asBlockId(blockTag2)
|
|
5415
6371
|
});
|
|
@@ -5422,21 +6378,21 @@ var SafeProvider = class _SafeProvider {
|
|
|
5422
6378
|
return (0, import_viem12.getAddress)(address);
|
|
5423
6379
|
}
|
|
5424
6380
|
async getContractCode(address, blockTag2) {
|
|
5425
|
-
const res = await (0,
|
|
6381
|
+
const res = await (0, import_actions9.getCode)(this.#externalProvider, {
|
|
5426
6382
|
address,
|
|
5427
6383
|
...asBlockId(blockTag2)
|
|
5428
6384
|
});
|
|
5429
6385
|
return res ?? "0x";
|
|
5430
6386
|
}
|
|
5431
6387
|
async isContractDeployed(address, blockTag2) {
|
|
5432
|
-
const contractCode = await (0,
|
|
6388
|
+
const contractCode = await (0, import_actions9.getCode)(this.#externalProvider, {
|
|
5433
6389
|
address,
|
|
5434
6390
|
...asBlockId(blockTag2)
|
|
5435
6391
|
});
|
|
5436
6392
|
return !!contractCode;
|
|
5437
6393
|
}
|
|
5438
6394
|
async getStorageAt(address, position) {
|
|
5439
|
-
const content = await (0,
|
|
6395
|
+
const content = await (0, import_actions9.getStorageAt)(this.#externalProvider, {
|
|
5440
6396
|
address,
|
|
5441
6397
|
slot: asHex(position)
|
|
5442
6398
|
});
|
|
@@ -5444,7 +6400,7 @@ var SafeProvider = class _SafeProvider {
|
|
|
5444
6400
|
return decodedContent[0];
|
|
5445
6401
|
}
|
|
5446
6402
|
async getTransaction(transactionHash) {
|
|
5447
|
-
return (0,
|
|
6403
|
+
return (0, import_actions9.getTransaction)(this.#externalProvider, {
|
|
5448
6404
|
hash: asHash(transactionHash)
|
|
5449
6405
|
});
|
|
5450
6406
|
}
|
|
@@ -5491,18 +6447,18 @@ var SafeProvider = class _SafeProvider {
|
|
|
5491
6447
|
}
|
|
5492
6448
|
async estimateGas(transaction) {
|
|
5493
6449
|
const converted = toEstimateGasParameters(transaction);
|
|
5494
|
-
return (await (0,
|
|
6450
|
+
return (await (0, import_actions9.estimateGas)(this.#externalProvider, converted)).toString();
|
|
5495
6451
|
}
|
|
5496
6452
|
async call(transaction, blockTag2) {
|
|
5497
6453
|
const converted = toTransactionRequest(transaction);
|
|
5498
|
-
const { data } = await (0,
|
|
6454
|
+
const { data } = await (0, import_actions9.call)(this.#externalProvider, {
|
|
5499
6455
|
...converted,
|
|
5500
6456
|
...asBlockId(blockTag2)
|
|
5501
6457
|
});
|
|
5502
6458
|
return data ?? "0x";
|
|
5503
6459
|
}
|
|
5504
6460
|
async readContract(args) {
|
|
5505
|
-
return (0,
|
|
6461
|
+
return (0, import_actions9.readContract)(this.#externalProvider, args);
|
|
5506
6462
|
}
|
|
5507
6463
|
// TODO: fix anys
|
|
5508
6464
|
encodeParameters(types, values) {
|
|
@@ -5785,7 +6741,7 @@ async function predictSafeAddress({
|
|
|
5785
6741
|
const salt = (0, import_viem13.keccak256)((0, import_viem13.concat)([initializerHash, encodedNonce]));
|
|
5786
6742
|
const input = safeProvider.encodeParameters("address", [safeContract.getAddress()]);
|
|
5787
6743
|
const from = safeProxyFactoryContract.getAddress();
|
|
5788
|
-
const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId);
|
|
6744
|
+
const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId) && (0, import_satisfies6.default)(safeVersion, "<=1.4.1");
|
|
5789
6745
|
if (isZkSyncChain) {
|
|
5790
6746
|
const proxyAddress2 = zkSyncCreate2Address(from, safeVersion, salt, asHex(input));
|
|
5791
6747
|
return safeProvider.getChecksummedAddress(proxyAddress2);
|
|
@@ -5850,7 +6806,7 @@ function toTxResult(runner, hash, options) {
|
|
|
5850
6806
|
hash,
|
|
5851
6807
|
options,
|
|
5852
6808
|
transactionResponse: {
|
|
5853
|
-
wait: async () => (0,
|
|
6809
|
+
wait: async () => (0, import_actions10.waitForTransactionReceipt)(runner, { hash })
|
|
5854
6810
|
}
|
|
5855
6811
|
};
|
|
5856
6812
|
}
|
|
@@ -5963,6 +6919,10 @@ var FallbackHandlerManager = class {
|
|
|
5963
6919
|
}
|
|
5964
6920
|
return this.#safeContract;
|
|
5965
6921
|
}
|
|
6922
|
+
encodeSetFallbackHandler(safeContract, handler) {
|
|
6923
|
+
const encode = safeContract.encode;
|
|
6924
|
+
return encode("setFallbackHandler", [asHex(handler)]);
|
|
6925
|
+
}
|
|
5966
6926
|
async getFallbackHandler() {
|
|
5967
6927
|
const safeContract = await this.isFallbackHandlerCompatible();
|
|
5968
6928
|
return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#slot);
|
|
@@ -5972,13 +6932,13 @@ var FallbackHandlerManager = class {
|
|
|
5972
6932
|
this.validateFallbackHandlerAddress(fallbackHandlerAddress);
|
|
5973
6933
|
const currentFallbackHandler = await this.getFallbackHandler();
|
|
5974
6934
|
this.validateFallbackHandlerIsNotEnabled(currentFallbackHandler, fallbackHandlerAddress);
|
|
5975
|
-
return
|
|
6935
|
+
return this.encodeSetFallbackHandler(safeContract, fallbackHandlerAddress);
|
|
5976
6936
|
}
|
|
5977
6937
|
async encodeDisableFallbackHandlerData() {
|
|
5978
6938
|
const safeContract = await this.isFallbackHandlerCompatible();
|
|
5979
6939
|
const currentFallbackHandler = await this.getFallbackHandler();
|
|
5980
6940
|
this.validateFallbackHandlerIsEnabled(currentFallbackHandler);
|
|
5981
|
-
return
|
|
6941
|
+
return this.encodeSetFallbackHandler(safeContract, ZERO_ADDRESS);
|
|
5982
6942
|
}
|
|
5983
6943
|
};
|
|
5984
6944
|
var fallbackHandlerManager_default = FallbackHandlerManager;
|
|
@@ -6045,6 +7005,8 @@ var guardManager_default = GuardManager;
|
|
|
6045
7005
|
var ModuleManager = class {
|
|
6046
7006
|
#safeProvider;
|
|
6047
7007
|
#safeContract;
|
|
7008
|
+
// keccak256("module_manager.module_guard.address")
|
|
7009
|
+
#moduleGuardSlot = "0xb104e0b93118902c651344349b610029d694cfdec91c589c91ebafbcd0289947";
|
|
6048
7010
|
constructor(safeProvider, safeContract) {
|
|
6049
7011
|
this.#safeProvider = safeProvider;
|
|
6050
7012
|
this.#safeContract = safeContract;
|
|
@@ -6110,6 +7072,49 @@ var ModuleManager = class {
|
|
|
6110
7072
|
const prevModuleAddress = moduleIndex === 0 ? SENTINEL_ADDRESS : modules[moduleIndex - 1];
|
|
6111
7073
|
return this.#safeContract.encode("disableModule", [prevModuleAddress, moduleAddress]);
|
|
6112
7074
|
}
|
|
7075
|
+
validateModuleGuardAddress(moduleGuardAddress) {
|
|
7076
|
+
const isValidAddress = this.#safeProvider.isAddress(moduleGuardAddress);
|
|
7077
|
+
if (!isValidAddress || isZeroAddress(moduleGuardAddress)) {
|
|
7078
|
+
throw new Error("Invalid module guard address provided");
|
|
7079
|
+
}
|
|
7080
|
+
}
|
|
7081
|
+
validateModuleGuardIsNotEnabled(currentModuleGuard, newModuleGuardAddress) {
|
|
7082
|
+
if (sameString(currentModuleGuard, newModuleGuardAddress)) {
|
|
7083
|
+
throw new Error("Module guard provided is already enabled");
|
|
7084
|
+
}
|
|
7085
|
+
}
|
|
7086
|
+
validateModuleGuardIsEnabled(moduleGuardAddress) {
|
|
7087
|
+
if (isZeroAddress(moduleGuardAddress)) {
|
|
7088
|
+
throw new Error("There is no module guard enabled yet");
|
|
7089
|
+
}
|
|
7090
|
+
}
|
|
7091
|
+
async isModuleGuardCompatible() {
|
|
7092
|
+
if (!this.#safeContract) {
|
|
7093
|
+
throw new Error("Safe is not deployed");
|
|
7094
|
+
}
|
|
7095
|
+
const safeVersion = this.#safeContract.safeVersion;
|
|
7096
|
+
if (!hasSafeFeature("SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */, safeVersion)) {
|
|
7097
|
+
throw new Error("Current version of the Safe does not support module guard functionality");
|
|
7098
|
+
}
|
|
7099
|
+
return this.#safeContract;
|
|
7100
|
+
}
|
|
7101
|
+
async getModuleGuard() {
|
|
7102
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7103
|
+
return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#moduleGuardSlot);
|
|
7104
|
+
}
|
|
7105
|
+
async encodeEnableModuleGuardData(moduleGuardAddress) {
|
|
7106
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7107
|
+
this.validateModuleGuardAddress(moduleGuardAddress);
|
|
7108
|
+
const currentModuleGuard = await this.getModuleGuard();
|
|
7109
|
+
this.validateModuleGuardIsNotEnabled(currentModuleGuard, moduleGuardAddress);
|
|
7110
|
+
return safeContract.encode("setModuleGuard", [asHex(moduleGuardAddress)]);
|
|
7111
|
+
}
|
|
7112
|
+
async encodeDisableModuleGuardData() {
|
|
7113
|
+
const safeContract = await this.isModuleGuardCompatible();
|
|
7114
|
+
const currentModuleGuard = await this.getModuleGuard();
|
|
7115
|
+
this.validateModuleGuardIsEnabled(currentModuleGuard);
|
|
7116
|
+
return safeContract.encode("setModuleGuard", [asHex(ZERO_ADDRESS)]);
|
|
7117
|
+
}
|
|
6113
7118
|
};
|
|
6114
7119
|
var moduleManager_default = ModuleManager;
|
|
6115
7120
|
|
|
@@ -6296,9 +7301,10 @@ function generateOnChainIdentifier({
|
|
|
6296
7301
|
var generateOnChainIdentifier_default = generateOnChainIdentifier;
|
|
6297
7302
|
|
|
6298
7303
|
// src/utils/getProtocolKitVersion.ts
|
|
6299
|
-
var getProtocolKitVersion = () => "
|
|
7304
|
+
var getProtocolKitVersion = () => "7.0.0";
|
|
6300
7305
|
|
|
6301
7306
|
// src/Safe.ts
|
|
7307
|
+
var EQ_OR_GT_1_5_0 = ">=1.5.0";
|
|
6302
7308
|
var EQ_OR_GT_1_4_1 = ">=1.4.1";
|
|
6303
7309
|
var EQ_OR_GT_1_3_03 = ">=1.3.0";
|
|
6304
7310
|
var Safe = class _Safe {
|
|
@@ -6334,31 +7340,27 @@ var Safe = class _Safe {
|
|
|
6334
7340
|
this.isValidSignature = async (messageHash, signature = "0x") => {
|
|
6335
7341
|
const safeAddress = await this.getAddress();
|
|
6336
7342
|
const fallbackHandler = await this.#getFallbackHandlerContract();
|
|
7343
|
+
const safeVersion = this.getContractVersion();
|
|
6337
7344
|
const signatureToCheck = signature && Array.isArray(signature) ? buildSignatureBytes(signature) : signature;
|
|
6338
7345
|
const bytes32Tuple = [
|
|
6339
7346
|
asHash(messageHash),
|
|
6340
7347
|
asHex(signatureToCheck)
|
|
6341
7348
|
];
|
|
6342
7349
|
const data = fallbackHandler.encode("isValidSignature", bytes32Tuple);
|
|
6343
|
-
const
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
7350
|
+
const callParams = { from: safeAddress, to: safeAddress };
|
|
7351
|
+
const calls = [this.#safeProvider.call({ ...callParams, data })];
|
|
7352
|
+
if (!(0, import_satisfies7.default)(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
7353
|
+
const bytesTuple = [
|
|
7354
|
+
asHash(messageHash),
|
|
7355
|
+
asHex(signatureToCheck)
|
|
7356
|
+
];
|
|
7357
|
+
const bytesData = fallbackHandler.encode("isValidSignature", bytesTuple);
|
|
7358
|
+
calls.push(this.#safeProvider.call({ ...callParams, data: bytesData }));
|
|
7359
|
+
}
|
|
6348
7360
|
try {
|
|
6349
|
-
const
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
to: safeAddress,
|
|
6353
|
-
data
|
|
6354
|
-
}),
|
|
6355
|
-
this.#safeProvider.call({
|
|
6356
|
-
from: safeAddress,
|
|
6357
|
-
to: safeAddress,
|
|
6358
|
-
data: bytesData
|
|
6359
|
-
})
|
|
6360
|
-
]);
|
|
6361
|
-
return !!isValidSignatureResponse.length && (isValidSignatureResponse[0].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE || isValidSignatureResponse[1].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE_BYTES);
|
|
7361
|
+
const responses = await Promise.all(calls);
|
|
7362
|
+
const magicValues = [this.#MAGIC_VALUE, this.#MAGIC_VALUE_BYTES];
|
|
7363
|
+
return responses.some((response, i) => response.slice(0, 10).toLowerCase() === magicValues[i]);
|
|
6362
7364
|
} catch (error) {
|
|
6363
7365
|
return false;
|
|
6364
7366
|
}
|
|
@@ -6717,6 +7719,15 @@ var Safe = class _Safe {
|
|
|
6717
7719
|
async isModuleEnabled(moduleAddress) {
|
|
6718
7720
|
return this.#moduleManager.isModuleEnabled(moduleAddress);
|
|
6719
7721
|
}
|
|
7722
|
+
/**
|
|
7723
|
+
* Returns the enabled Safe module guard or 0x address if no module guard is enabled.
|
|
7724
|
+
*
|
|
7725
|
+
* @returns The address of the enabled Safe module guard
|
|
7726
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
7727
|
+
*/
|
|
7728
|
+
async getModuleGuard() {
|
|
7729
|
+
return this.#moduleManager.getModuleGuard();
|
|
7730
|
+
}
|
|
6720
7731
|
/**
|
|
6721
7732
|
* Checks if a specific address is an owner of the current Safe.
|
|
6722
7733
|
*
|
|
@@ -6773,7 +7784,7 @@ var Safe = class _Safe {
|
|
|
6773
7784
|
to: multiSendContract.getAddress(),
|
|
6774
7785
|
value: "0",
|
|
6775
7786
|
data: multiSendContract.encode("multiSend", [asHex(multiSendData)]),
|
|
6776
|
-
operation:
|
|
7787
|
+
operation: import_types_kit37.OperationType.DelegateCall
|
|
6777
7788
|
};
|
|
6778
7789
|
newTransaction = multiSendTransaction;
|
|
6779
7790
|
} else {
|
|
@@ -6865,7 +7876,7 @@ var Safe = class _Safe {
|
|
|
6865
7876
|
const signerAddress = await this.#safeProvider.getSignerAddress();
|
|
6866
7877
|
if (isPasskeySigner && signerAddress) {
|
|
6867
7878
|
let signature2 = await this.#safeProvider.signMessage(hash);
|
|
6868
|
-
signature2 = await adjustVInSignature(
|
|
7879
|
+
signature2 = await adjustVInSignature(import_types_kit37.SigningMethod.ETH_SIGN, signature2, hash, signerAddress);
|
|
6869
7880
|
const safeSignature = new EthSafeSignature(signerAddress, signature2, true);
|
|
6870
7881
|
return safeSignature;
|
|
6871
7882
|
}
|
|
@@ -6892,7 +7903,7 @@ var Safe = class _Safe {
|
|
|
6892
7903
|
* https://github.com/safe-global/safe-contracts/blob/192c7dc67290940fcbc75165522bb86a37187069/test/core/Safe.Signatures.spec.ts#L229-L233
|
|
6893
7904
|
* @returns The signed Safe message
|
|
6894
7905
|
*/
|
|
6895
|
-
async signMessage(message, signingMethod =
|
|
7906
|
+
async signMessage(message, signingMethod = import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA_V4, preimageSafeAddress) {
|
|
6896
7907
|
const signerAddress = await this.#safeProvider.getSignerAddress();
|
|
6897
7908
|
if (!signerAddress) {
|
|
6898
7909
|
throw new Error("The protocol-kit requires a signer to use this method");
|
|
@@ -6902,15 +7913,15 @@ var Safe = class _Safe {
|
|
|
6902
7913
|
throw new Error("Messages can only be signed by Safe owners");
|
|
6903
7914
|
}
|
|
6904
7915
|
const safeVersion = this.getContractVersion();
|
|
6905
|
-
if (signingMethod ===
|
|
7916
|
+
if (signingMethod === import_types_kit37.SigningMethod.SAFE_SIGNATURE && (0, import_satisfies7.default)(safeVersion, EQ_OR_GT_1_4_1) && !preimageSafeAddress) {
|
|
6906
7917
|
throw new Error("The parent Safe account address is mandatory for contract signatures");
|
|
6907
7918
|
}
|
|
6908
7919
|
let signature;
|
|
6909
|
-
if (signingMethod ===
|
|
7920
|
+
if (signingMethod === import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA_V4) {
|
|
6910
7921
|
signature = await this.signTypedData(message, "v4");
|
|
6911
|
-
} else if (signingMethod ===
|
|
7922
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA_V3) {
|
|
6912
7923
|
signature = await this.signTypedData(message, "v3");
|
|
6913
|
-
} else if (signingMethod ===
|
|
7924
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA) {
|
|
6914
7925
|
signature = await this.signTypedData(message, void 0);
|
|
6915
7926
|
} else {
|
|
6916
7927
|
const chainId = await this.getChainId();
|
|
@@ -6918,7 +7929,15 @@ var Safe = class _Safe {
|
|
|
6918
7929
|
throw new Error("eth_sign is only supported by Safes >= v1.1.0");
|
|
6919
7930
|
}
|
|
6920
7931
|
let safeMessageHash;
|
|
6921
|
-
if (signingMethod ===
|
|
7932
|
+
if (signingMethod === import_types_kit37.SigningMethod.SAFE_SIGNATURE && preimageSafeAddress && (0, import_satisfies7.default)(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
7933
|
+
const parentSafeMessageHash = calculateSafeMessageHash(
|
|
7934
|
+
preimageSafeAddress,
|
|
7935
|
+
hashSafeMessage(message.data),
|
|
7936
|
+
safeVersion,
|
|
7937
|
+
chainId
|
|
7938
|
+
);
|
|
7939
|
+
safeMessageHash = await this.getSafeMessageHash(parentSafeMessageHash);
|
|
7940
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.SAFE_SIGNATURE && preimageSafeAddress && (0, import_satisfies7.default)(safeVersion, EQ_OR_GT_1_4_1)) {
|
|
6922
7941
|
const messageHashData = preimageSafeMessageHash(
|
|
6923
7942
|
preimageSafeAddress,
|
|
6924
7943
|
hashSafeMessage(message.data),
|
|
@@ -6966,7 +7985,7 @@ var Safe = class _Safe {
|
|
|
6966
7985
|
* @returns The signed Safe transaction
|
|
6967
7986
|
* @throws "Transactions can only be signed by Safe owners"
|
|
6968
7987
|
*/
|
|
6969
|
-
async signTransaction(safeTransaction, signingMethod =
|
|
7988
|
+
async signTransaction(safeTransaction, signingMethod = import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA_V4, preimageSafeAddress) {
|
|
6970
7989
|
const transaction = isSafeMultisigTransactionResponse(safeTransaction) ? await this.toSafeTransactionType(safeTransaction) : safeTransaction;
|
|
6971
7990
|
const signerAddress = await this.#safeProvider.getSignerAddress();
|
|
6972
7991
|
if (!signerAddress) {
|
|
@@ -6977,7 +7996,7 @@ var Safe = class _Safe {
|
|
|
6977
7996
|
throw new Error("Transactions can only be signed by Safe owners");
|
|
6978
7997
|
}
|
|
6979
7998
|
const safeVersion = this.getContractVersion();
|
|
6980
|
-
if (signingMethod ===
|
|
7999
|
+
if (signingMethod === import_types_kit37.SigningMethod.SAFE_SIGNATURE && (0, import_satisfies7.default)(safeVersion, EQ_OR_GT_1_3_03) && !preimageSafeAddress) {
|
|
6981
8000
|
throw new Error("The parent Safe account address is mandatory for contract signatures");
|
|
6982
8001
|
}
|
|
6983
8002
|
let signature;
|
|
@@ -6985,11 +8004,11 @@ var Safe = class _Safe {
|
|
|
6985
8004
|
if (isPasskeySigner) {
|
|
6986
8005
|
const txHash = await this.getTransactionHash(transaction);
|
|
6987
8006
|
signature = await this.signHash(txHash);
|
|
6988
|
-
} else if (signingMethod ===
|
|
8007
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA_V4) {
|
|
6989
8008
|
signature = await this.signTypedData(transaction, "v4");
|
|
6990
|
-
} else if (signingMethod ===
|
|
8009
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA_V3) {
|
|
6991
8010
|
signature = await this.signTypedData(transaction, "v3");
|
|
6992
|
-
} else if (signingMethod ===
|
|
8011
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.ETH_SIGN_TYPED_DATA) {
|
|
6993
8012
|
signature = await this.signTypedData(transaction, void 0);
|
|
6994
8013
|
} else {
|
|
6995
8014
|
const safeVersion2 = this.getContractVersion();
|
|
@@ -6998,7 +8017,15 @@ var Safe = class _Safe {
|
|
|
6998
8017
|
throw new Error("eth_sign is only supported by Safes >= v1.1.0");
|
|
6999
8018
|
}
|
|
7000
8019
|
let txHash;
|
|
7001
|
-
if (signingMethod ===
|
|
8020
|
+
if (signingMethod === import_types_kit37.SigningMethod.SAFE_SIGNATURE && (0, import_satisfies7.default)(safeVersion2, EQ_OR_GT_1_5_0) && preimageSafeAddress) {
|
|
8021
|
+
const txHashData = calculateSafeTransactionHash(
|
|
8022
|
+
preimageSafeAddress,
|
|
8023
|
+
transaction.data,
|
|
8024
|
+
safeVersion2,
|
|
8025
|
+
chainId
|
|
8026
|
+
);
|
|
8027
|
+
txHash = await this.getSafeMessageHash(txHashData);
|
|
8028
|
+
} else if (signingMethod === import_types_kit37.SigningMethod.SAFE_SIGNATURE && (0, import_satisfies7.default)(safeVersion2, EQ_OR_GT_1_3_03) && preimageSafeAddress) {
|
|
7002
8029
|
const txHashData = preimageSafeTransactionHash(
|
|
7003
8030
|
preimageSafeAddress,
|
|
7004
8031
|
safeTransaction.data,
|
|
@@ -7120,6 +8147,203 @@ var Safe = class _Safe {
|
|
|
7120
8147
|
});
|
|
7121
8148
|
return safeTransaction;
|
|
7122
8149
|
}
|
|
8150
|
+
// ---------------------------------------------------------------------------
|
|
8151
|
+
// ExtensibleFallbackHandler helpers
|
|
8152
|
+
// ---------------------------------------------------------------------------
|
|
8153
|
+
/**
|
|
8154
|
+
* Returns an instance of the ExtensibleFallbackHandler contract for the current chain.
|
|
8155
|
+
* Used internally to compose read queries and Safe transactions against the EFH.
|
|
8156
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8157
|
+
*/
|
|
8158
|
+
async #getExtensibleFallbackHandlerContract() {
|
|
8159
|
+
const safeVersion = this.getContractVersion();
|
|
8160
|
+
if (!(0, import_satisfies7.default)(safeVersion, EQ_OR_GT_1_5_0)) {
|
|
8161
|
+
throw new Error("ExtensibleFallbackHandler is only available for Safe >= v1.5.0");
|
|
8162
|
+
}
|
|
8163
|
+
const chainId = await this.getChainId();
|
|
8164
|
+
const customContracts = this.#contractManager.contractNetworks?.[chainId.toString()];
|
|
8165
|
+
return getExtensibleFallbackHandlerContract({
|
|
8166
|
+
safeProvider: this.#safeProvider,
|
|
8167
|
+
safeVersion,
|
|
8168
|
+
customContracts
|
|
8169
|
+
});
|
|
8170
|
+
}
|
|
8171
|
+
// ----- Read helpers -----
|
|
8172
|
+
/**
|
|
8173
|
+
* Returns the bytes32-encoded handler registered for the given 4-byte selector on
|
|
8174
|
+
* the ExtensibleFallbackHandler for this Safe.
|
|
8175
|
+
* Only available for Safe >= v1.5.0.
|
|
8176
|
+
*
|
|
8177
|
+
* @param selector - The 4-byte function selector (e.g. '0xaabbccdd')
|
|
8178
|
+
* @returns The bytes32 handler entry, or the zero bytes32 if unregistered
|
|
8179
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8180
|
+
*/
|
|
8181
|
+
async getSafeMethod(selector) {
|
|
8182
|
+
const safeAddress = await this.getAddress();
|
|
8183
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8184
|
+
const [method] = await efhContract.safeMethods([
|
|
8185
|
+
safeAddress,
|
|
8186
|
+
selector
|
|
8187
|
+
]);
|
|
8188
|
+
return method;
|
|
8189
|
+
}
|
|
8190
|
+
/**
|
|
8191
|
+
* Returns the ISafeSignatureVerifier address registered for the given domain separator
|
|
8192
|
+
* on the ExtensibleFallbackHandler for this Safe.
|
|
8193
|
+
* Only available for Safe >= v1.5.0.
|
|
8194
|
+
*
|
|
8195
|
+
* @param domainSeparator - 32-byte domain separator
|
|
8196
|
+
* @returns The verifier address, or the zero address if unregistered
|
|
8197
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8198
|
+
*/
|
|
8199
|
+
async getDomainVerifier(domainSeparator) {
|
|
8200
|
+
const safeAddress = await this.getAddress();
|
|
8201
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8202
|
+
const [verifier] = await efhContract.domainVerifiers([
|
|
8203
|
+
safeAddress,
|
|
8204
|
+
domainSeparator
|
|
8205
|
+
]);
|
|
8206
|
+
return verifier;
|
|
8207
|
+
}
|
|
8208
|
+
/**
|
|
8209
|
+
* Returns whether the given ERC-165 interface ID is marked as supported for this Safe
|
|
8210
|
+
* on the ExtensibleFallbackHandler.
|
|
8211
|
+
* Only available for Safe >= v1.5.0.
|
|
8212
|
+
*
|
|
8213
|
+
* @param interfaceId - 4-byte ERC-165 interface ID
|
|
8214
|
+
* @returns true if supported, false otherwise
|
|
8215
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8216
|
+
*/
|
|
8217
|
+
async isSafeInterfaceSupported(interfaceId) {
|
|
8218
|
+
const safeAddress = await this.getAddress();
|
|
8219
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8220
|
+
const [isSupported] = await efhContract.safeInterfaces([
|
|
8221
|
+
safeAddress,
|
|
8222
|
+
interfaceId
|
|
8223
|
+
]);
|
|
8224
|
+
return isSupported;
|
|
8225
|
+
}
|
|
8226
|
+
// ----- Write transaction builders -----
|
|
8227
|
+
/**
|
|
8228
|
+
* Returns a Safe transaction that calls setSafeMethod on the ExtensibleFallbackHandler.
|
|
8229
|
+
* Because the EFH uses msg.sender as the Safe address, this must be executed through
|
|
8230
|
+
* the Safe itself.
|
|
8231
|
+
* Only available for Safe >= v1.5.0.
|
|
8232
|
+
*
|
|
8233
|
+
* @param selector - The 4-byte function selector to handle
|
|
8234
|
+
* @param newMethod - bytes32-packed handler address (address right-aligned, 12 leading zero bytes)
|
|
8235
|
+
* @param options - Optional Safe transaction properties
|
|
8236
|
+
* @returns The Safe transaction ready to be signed
|
|
8237
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8238
|
+
*/
|
|
8239
|
+
async createSetSafeMethodTx(selector, newMethod, options) {
|
|
8240
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8241
|
+
const safeAddress = await this.getAddress();
|
|
8242
|
+
const data = efhContract.encode("setSafeMethod", [
|
|
8243
|
+
selector,
|
|
8244
|
+
newMethod
|
|
8245
|
+
]);
|
|
8246
|
+
return this.createTransaction({
|
|
8247
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8248
|
+
options
|
|
8249
|
+
});
|
|
8250
|
+
}
|
|
8251
|
+
/**
|
|
8252
|
+
* Returns a Safe transaction that calls setDomainVerifier on the ExtensibleFallbackHandler.
|
|
8253
|
+
* Registers an ISafeSignatureVerifier for EIP-712 domain-based signature validation.
|
|
8254
|
+
* Only available for Safe >= v1.5.0.
|
|
8255
|
+
*
|
|
8256
|
+
* @param domainSeparator - 32-byte EIP-712 domain separator
|
|
8257
|
+
* @param verifier - Address of the ISafeSignatureVerifier contract
|
|
8258
|
+
* @param options - Optional Safe transaction properties
|
|
8259
|
+
* @returns The Safe transaction ready to be signed
|
|
8260
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8261
|
+
*/
|
|
8262
|
+
async createSetDomainVerifierTx(domainSeparator, verifier, options) {
|
|
8263
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8264
|
+
const safeAddress = await this.getAddress();
|
|
8265
|
+
const data = efhContract.encode("setDomainVerifier", [
|
|
8266
|
+
domainSeparator,
|
|
8267
|
+
verifier
|
|
8268
|
+
]);
|
|
8269
|
+
return this.createTransaction({
|
|
8270
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8271
|
+
options
|
|
8272
|
+
});
|
|
8273
|
+
}
|
|
8274
|
+
/**
|
|
8275
|
+
* Returns a Safe transaction that calls setSupportedInterface on the ExtensibleFallbackHandler.
|
|
8276
|
+
* Marks (or un-marks) an ERC-165 interface as supported for this Safe.
|
|
8277
|
+
* Only available for Safe >= v1.5.0.
|
|
8278
|
+
*
|
|
8279
|
+
* @param interfaceId - 4-byte ERC-165 interface ID
|
|
8280
|
+
* @param supported - true to add support, false to remove it
|
|
8281
|
+
* @param options - Optional Safe transaction properties
|
|
8282
|
+
* @returns The Safe transaction ready to be signed
|
|
8283
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8284
|
+
*/
|
|
8285
|
+
async createSetSupportedInterfaceTx(interfaceId, supported, options) {
|
|
8286
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8287
|
+
const safeAddress = await this.getAddress();
|
|
8288
|
+
const data = efhContract.encode("setSupportedInterface", [
|
|
8289
|
+
interfaceId,
|
|
8290
|
+
supported
|
|
8291
|
+
]);
|
|
8292
|
+
return this.createTransaction({
|
|
8293
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8294
|
+
options
|
|
8295
|
+
});
|
|
8296
|
+
}
|
|
8297
|
+
/**
|
|
8298
|
+
* Returns a Safe transaction that calls addSupportedInterfaceBatch on the ExtensibleFallbackHandler.
|
|
8299
|
+
* Atomically registers an interface and multiple method handlers in a single call.
|
|
8300
|
+
* Only available for Safe >= v1.5.0.
|
|
8301
|
+
*
|
|
8302
|
+
* Each entry in handlerWithSelectors is a bytes32 value encoding both the handler address
|
|
8303
|
+
* and the 4-byte method selector: first 4 bytes = selector, next 8 bytes = zero padding,
|
|
8304
|
+
* last 20 bytes = handler address.
|
|
8305
|
+
*
|
|
8306
|
+
* @param interfaceId - 4-byte ERC-165 interface ID to mark as supported
|
|
8307
|
+
* @param handlerWithSelectors - Array of packed selector+handler bytes32 values
|
|
8308
|
+
* @param options - Optional Safe transaction properties
|
|
8309
|
+
* @returns The Safe transaction ready to be signed
|
|
8310
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8311
|
+
*/
|
|
8312
|
+
async createAddSupportedInterfaceBatchTx(interfaceId, handlerWithSelectors, options) {
|
|
8313
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8314
|
+
const safeAddress = await this.getAddress();
|
|
8315
|
+
const data = efhContract.encode("addSupportedInterfaceBatch", [
|
|
8316
|
+
interfaceId,
|
|
8317
|
+
handlerWithSelectors
|
|
8318
|
+
]);
|
|
8319
|
+
return this.createTransaction({
|
|
8320
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8321
|
+
options
|
|
8322
|
+
});
|
|
8323
|
+
}
|
|
8324
|
+
/**
|
|
8325
|
+
* Returns a Safe transaction that calls removeSupportedInterfaceBatch on the ExtensibleFallbackHandler.
|
|
8326
|
+
* Atomically un-registers an interface and removes the given method handlers in a single call.
|
|
8327
|
+
* Only available for Safe >= v1.5.0.
|
|
8328
|
+
*
|
|
8329
|
+
* @param interfaceId - 4-byte ERC-165 interface ID to remove
|
|
8330
|
+
* @param selectors - Array of 4-byte function selectors to un-register
|
|
8331
|
+
* @param options - Optional Safe transaction properties
|
|
8332
|
+
* @returns The Safe transaction ready to be signed
|
|
8333
|
+
* @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
|
|
8334
|
+
*/
|
|
8335
|
+
async createRemoveSupportedInterfaceBatchTx(interfaceId, selectors, options) {
|
|
8336
|
+
const efhContract = await this.#getExtensibleFallbackHandlerContract();
|
|
8337
|
+
const safeAddress = await this.getAddress();
|
|
8338
|
+
const data = efhContract.encode("removeSupportedInterfaceBatch", [
|
|
8339
|
+
interfaceId,
|
|
8340
|
+
selectors
|
|
8341
|
+
]);
|
|
8342
|
+
return this.createTransaction({
|
|
8343
|
+
transactions: [{ to: safeAddress, value: "0", data }],
|
|
8344
|
+
options
|
|
8345
|
+
});
|
|
8346
|
+
}
|
|
7123
8347
|
/**
|
|
7124
8348
|
* Returns the Safe transaction to enable a Safe guard.
|
|
7125
8349
|
*
|
|
@@ -7162,6 +8386,48 @@ var Safe = class _Safe {
|
|
|
7162
8386
|
});
|
|
7163
8387
|
return safeTransaction;
|
|
7164
8388
|
}
|
|
8389
|
+
/**
|
|
8390
|
+
* Returns the Safe transaction to enable a Safe module guard.
|
|
8391
|
+
*
|
|
8392
|
+
* @param moduleGuardAddress - The desired module guard address
|
|
8393
|
+
* @param options - The transaction optional properties
|
|
8394
|
+
* @returns The Safe transaction ready to be signed
|
|
8395
|
+
* @throws "Invalid module guard address provided"
|
|
8396
|
+
* @throws "Module guard provided is already enabled"
|
|
8397
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
8398
|
+
*/
|
|
8399
|
+
async createEnableModuleGuardTx(moduleGuardAddress, options) {
|
|
8400
|
+
const safeTransactionData = {
|
|
8401
|
+
to: await this.getAddress(),
|
|
8402
|
+
value: "0",
|
|
8403
|
+
data: await this.#moduleManager.encodeEnableModuleGuardData(moduleGuardAddress)
|
|
8404
|
+
};
|
|
8405
|
+
const safeTransaction = await this.createTransaction({
|
|
8406
|
+
transactions: [safeTransactionData],
|
|
8407
|
+
options
|
|
8408
|
+
});
|
|
8409
|
+
return safeTransaction;
|
|
8410
|
+
}
|
|
8411
|
+
/**
|
|
8412
|
+
* Returns the Safe transaction to disable a Safe module guard.
|
|
8413
|
+
*
|
|
8414
|
+
* @param options - The transaction optional properties
|
|
8415
|
+
* @returns The Safe transaction ready to be signed
|
|
8416
|
+
* @throws "There is no module guard enabled yet"
|
|
8417
|
+
* @throws "Current version of the Safe does not support module guard functionality"
|
|
8418
|
+
*/
|
|
8419
|
+
async createDisableModuleGuardTx(options) {
|
|
8420
|
+
const safeTransactionData = {
|
|
8421
|
+
to: await this.getAddress(),
|
|
8422
|
+
value: "0",
|
|
8423
|
+
data: await this.#moduleManager.encodeDisableModuleGuardData()
|
|
8424
|
+
};
|
|
8425
|
+
const safeTransaction = await this.createTransaction({
|
|
8426
|
+
transactions: [safeTransactionData],
|
|
8427
|
+
options
|
|
8428
|
+
});
|
|
8429
|
+
return safeTransaction;
|
|
8430
|
+
}
|
|
7165
8431
|
/**
|
|
7166
8432
|
* Returns the Safe transaction to enable a Safe module.
|
|
7167
8433
|
*
|
|
@@ -7541,13 +8807,13 @@ var Safe = class _Safe {
|
|
|
7541
8807
|
to: safeDeploymentTransaction.to,
|
|
7542
8808
|
value: safeDeploymentTransaction.value,
|
|
7543
8809
|
data: safeDeploymentTransaction.data,
|
|
7544
|
-
operation:
|
|
8810
|
+
operation: import_types_kit37.OperationType.Call
|
|
7545
8811
|
};
|
|
7546
8812
|
const safeBatchTransaction = {
|
|
7547
8813
|
to: await this.getAddress(),
|
|
7548
8814
|
value: "0",
|
|
7549
8815
|
data: await this.getEncodedTransaction(safeTransaction),
|
|
7550
|
-
operation:
|
|
8816
|
+
operation: import_types_kit37.OperationType.Call
|
|
7551
8817
|
};
|
|
7552
8818
|
const transactions = [safeDeploymentBatchTransaction, safeBatchTransaction];
|
|
7553
8819
|
const safeDeploymentBatch = await this.createTransactionBatch(
|
|
@@ -7674,7 +8940,7 @@ var Safe = class _Safe {
|
|
|
7674
8940
|
/**
|
|
7675
8941
|
* This method creates a signer to be used with the init method
|
|
7676
8942
|
* @param {Credential} credential - The credential to be used to create the signer. Can be generated in the web with navigator.credentials.create
|
|
7677
|
-
* @returns {
|
|
8943
|
+
* @returns {ExtractedPasskeyData} - The extracted passkey data. Combine with a verifierAddress to build a PasskeyArgType.
|
|
7678
8944
|
*/
|
|
7679
8945
|
this.createPasskeySigner = async (credential) => {
|
|
7680
8946
|
return extractPasskeyData(credential);
|