@safe-global/protocol-kit 4.1.0 → 5.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/src/Safe.d.ts +12 -17
- package/dist/src/Safe.js +159 -112
- package/dist/src/Safe.js.map +1 -1
- package/dist/src/SafeProvider.d.ts +11 -20
- package/dist/src/SafeProvider.js +141 -90
- package/dist/src/SafeProvider.js.map +1 -1
- package/dist/src/contracts/BaseContract.d.ts +26 -6
- package/dist/src/contracts/BaseContract.js +101 -14
- package/dist/src/contracts/BaseContract.js.map +1 -1
- package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.d.ts +5 -4
- package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.js +3 -2
- package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.js.map +1 -1
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.d.ts +4 -3
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.js +5 -5
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.3.0/CompatibilityFallbackHandlerContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.d.ts +4 -3
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.js +5 -5
- package/dist/src/contracts/CompatibilityFallbackHandler/v1.4.1/CompatibilityFallbackHandlerContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/CreateCall/CreateCallBaseContract.d.ts +5 -4
- package/dist/src/contracts/CreateCall/CreateCallBaseContract.js +3 -2
- package/dist/src/contracts/CreateCall/CreateCallBaseContract.js.map +1 -1
- package/dist/src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.d.ts +4 -3
- package/dist/src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.js +7 -9
- package/dist/src/contracts/CreateCall/v1.3.0/CreateCallContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/CreateCall/v1.4.1/CreateCallContract_v1_4_1.d.ts +4 -3
- package/dist/src/contracts/CreateCall/v1.4.1/CreateCallContract_v1_4_1.js +7 -9
- package/dist/src/contracts/CreateCall/v1.4.1/CreateCallContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/MultiSend/MultiSendBaseContract.d.ts +5 -4
- package/dist/src/contracts/MultiSend/MultiSendBaseContract.js +3 -2
- package/dist/src/contracts/MultiSend/MultiSendBaseContract.js.map +1 -1
- package/dist/src/contracts/MultiSend/MultiSendCallOnlyBaseContract.d.ts +5 -4
- package/dist/src/contracts/MultiSend/MultiSendCallOnlyBaseContract.js +3 -2
- package/dist/src/contracts/MultiSend/MultiSendCallOnlyBaseContract.js.map +1 -1
- package/dist/src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.d.ts +4 -3
- package/dist/src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.js +5 -5
- package/dist/src/contracts/MultiSend/v1.1.1/MultiSendContract_v1_1_1.js.map +1 -1
- package/dist/src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.d.ts +4 -3
- package/dist/src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.js +5 -5
- package/dist/src/contracts/MultiSend/v1.3.0/MultiSendCallOnlyContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.d.ts +4 -3
- package/dist/src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.js +5 -5
- package/dist/src/contracts/MultiSend/v1.3.0/MultiSendContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.d.ts +4 -3
- package/dist/src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.js +5 -5
- package/dist/src/contracts/MultiSend/v1.4.1/MultiSendCallOnlyContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.d.ts +4 -3
- package/dist/src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.js +5 -5
- package/dist/src/contracts/MultiSend/v1.4.1/MultiSendContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/Safe/SafeBaseContract.d.ts +5 -4
- package/dist/src/contracts/Safe/SafeBaseContract.js +3 -2
- package/dist/src/contracts/Safe/SafeBaseContract.js.map +1 -1
- package/dist/src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.d.ts +7 -11
- package/dist/src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.js +64 -42
- package/dist/src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.js.map +1 -1
- package/dist/src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.d.ts +4 -9
- package/dist/src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.js +61 -39
- package/dist/src/contracts/Safe/v1.1.1/SafeContract_v1_1_1.js.map +1 -1
- package/dist/src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.d.ts +5 -10
- package/dist/src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.js +63 -41
- package/dist/src/contracts/Safe/v1.2.0/SafeContract_v1_2_0.js.map +1 -1
- package/dist/src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.d.ts +5 -10
- package/dist/src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.js +63 -41
- package/dist/src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.d.ts +5 -10
- package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.js +63 -41
- package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.d.ts +5 -7
- package/dist/src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.js +3 -2
- package/dist/src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.js.map +1 -1
- package/dist/src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.d.ts +5 -11
- package/dist/src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.js +9 -38
- package/dist/src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.js.map +1 -1
- package/dist/src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.d.ts +6 -12
- package/dist/src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.js +12 -41
- package/dist/src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.js.map +1 -1
- package/dist/src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.d.ts +5 -11
- package/dist/src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.js +11 -40
- package/dist/src/contracts/SafeProxyFactory/v1.3.0/SafeProxyFactoryContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.d.ts +5 -11
- package/dist/src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.js +10 -39
- package/dist/src/contracts/SafeProxyFactory/v1.4.1/SafeProxyFactoryContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.d.ts +5 -7
- package/dist/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.js +3 -2
- package/dist/src/contracts/SafeWebAuthnSharedSigner/SafeWebAuthnSharedSignerBaseContract.js.map +1 -1
- package/dist/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.d.ts +4 -3
- package/dist/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.js +9 -9
- package/dist/src/contracts/SafeWebAuthnSharedSigner/v0.2.1/SafeWebAuthnSharedSignerContract_v0_2_1.js.map +1 -1
- package/dist/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.d.ts +5 -7
- package/dist/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.js +3 -2
- package/dist/src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.js.map +1 -1
- package/dist/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.d.ts +4 -3
- package/dist/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.js +8 -8
- package/dist/src/contracts/SafeWebAuthnSignerFactory/v0.2.1/SafeWebAuthnSignerFactoryContract_v0_2_1.js.map +1 -1
- package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.d.ts +5 -4
- package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.js +3 -2
- package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.js.map +1 -1
- package/dist/src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.d.ts +4 -3
- package/dist/src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.js +7 -8
- package/dist/src/contracts/SignMessageLib/v1.3.0/SignMessageLibContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.d.ts +4 -3
- package/dist/src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.js +7 -8
- package/dist/src/contracts/SignMessageLib/v1.4.1/SignMessageLibContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.d.ts +5 -4
- package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.js +3 -2
- package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.js.map +1 -1
- package/dist/src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.d.ts +4 -3
- package/dist/src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.js +9 -7
- package/dist/src/contracts/SimulateTxAccessor/v1.3.0/SimulateTxAccessorContract_v1_3_0.js.map +1 -1
- package/dist/src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.d.ts +4 -3
- package/dist/src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.js +9 -7
- package/dist/src/contracts/SimulateTxAccessor/v1.4.1/SimulateTxAccessorContract_v1_4_1.js.map +1 -1
- package/dist/src/contracts/config.d.ts +8 -1
- package/dist/src/contracts/config.js +47 -16
- package/dist/src/contracts/config.js.map +1 -1
- package/dist/src/contracts/constants.d.ts +4 -3
- package/dist/src/contracts/constants.js +2 -1
- package/dist/src/contracts/constants.js.map +1 -1
- package/dist/src/contracts/contractInstances.d.ts +13 -12
- package/dist/src/contracts/contractInstances.js +34 -34
- package/dist/src/contracts/contractInstances.js.map +1 -1
- package/dist/src/contracts/safeDeploymentContracts.d.ts +6 -5
- package/dist/src/contracts/safeDeploymentContracts.js +26 -66
- package/dist/src/contracts/safeDeploymentContracts.js.map +1 -1
- package/dist/src/contracts/utils.d.ts +35 -13
- package/dist/src/contracts/utils.js +136 -55
- package/dist/src/contracts/utils.js.map +1 -1
- package/dist/src/index.d.ts +10 -6
- package/dist/src/index.js +7 -9
- package/dist/src/index.js.map +1 -1
- package/dist/src/managers/contractManager.js +12 -17
- package/dist/src/managers/contractManager.js.map +1 -1
- package/dist/src/managers/fallbackHandlerManager.js +5 -4
- package/dist/src/managers/fallbackHandlerManager.js.map +1 -1
- package/dist/src/managers/guardManager.js +5 -4
- package/dist/src/managers/guardManager.js.map +1 -1
- package/dist/src/types/contracts.d.ts +13 -13
- package/dist/src/types/index.d.ts +0 -1
- package/dist/src/types/index.js +0 -1
- package/dist/src/types/index.js.map +1 -1
- package/dist/src/types/safeConfig.d.ts +3 -1
- package/dist/src/types/safeProvider.d.ts +33 -5
- package/dist/src/types/transactions.d.ts +1 -1
- package/dist/src/utils/address.d.ts +1 -1
- package/dist/src/utils/address.js +1 -1
- package/dist/src/utils/address.js.map +1 -1
- package/dist/src/utils/block.d.ts +6 -0
- package/dist/src/utils/block.js +14 -0
- package/dist/src/utils/block.js.map +1 -0
- package/dist/src/utils/constants.d.ts +4 -3
- package/dist/src/utils/constants.js +2 -1
- package/dist/src/utils/constants.js.map +1 -1
- package/dist/src/utils/eip-3770/config.js +32 -1
- package/dist/src/utils/eip-3770/config.js.map +1 -1
- package/dist/src/utils/eip-3770/index.d.ts +1 -1
- package/dist/src/utils/eip-3770/index.js +2 -3
- package/dist/src/utils/eip-3770/index.js.map +1 -1
- package/dist/src/utils/eip-712/encode.d.ts +3 -0
- package/dist/src/utils/eip-712/encode.js +127 -0
- package/dist/src/utils/eip-712/encode.js.map +1 -0
- package/dist/src/utils/eip-712/index.d.ts +1 -1
- package/dist/src/utils/eip-712/index.js +5 -7
- package/dist/src/utils/eip-712/index.js.map +1 -1
- package/dist/src/utils/erc-20/index.d.ts +1 -1
- package/dist/src/utils/erc-20/index.js +12 -5
- package/dist/src/utils/erc-20/index.js.map +1 -1
- package/dist/src/utils/messages/SafeMessage.d.ts +1 -1
- package/dist/src/utils/passkeys/PasskeyClient.d.ts +5 -0
- package/dist/src/utils/passkeys/PasskeyClient.js +156 -0
- package/dist/src/utils/passkeys/PasskeyClient.js.map +1 -0
- package/dist/src/utils/passkeys/createPasskeyDeploymentTransaction.d.ts +2 -1
- package/dist/src/utils/passkeys/createPasskeyDeploymentTransaction.js +12 -12
- package/dist/src/utils/passkeys/createPasskeyDeploymentTransaction.js.map +1 -1
- package/dist/src/utils/passkeys/extractPasskeyData.d.ts +1 -2
- package/dist/src/utils/passkeys/extractPasskeyData.js +8 -15
- package/dist/src/utils/passkeys/extractPasskeyData.js.map +1 -1
- package/dist/src/utils/passkeys/getPasskeyOwnerAddress.js +10 -3
- package/dist/src/utils/passkeys/getPasskeyOwnerAddress.js.map +1 -1
- package/dist/src/utils/passkeys/index.d.ts +1 -1
- package/dist/src/utils/passkeys/index.js +1 -1
- package/dist/src/utils/passkeys/isSharedSigner.d.ts +2 -3
- package/dist/src/utils/passkeys/isSharedSigner.js +6 -5
- package/dist/src/utils/passkeys/isSharedSigner.js.map +1 -1
- package/dist/src/utils/provider.d.ts +3 -0
- package/dist/src/utils/provider.js +12 -0
- package/dist/src/utils/provider.js.map +1 -0
- package/dist/src/utils/safeVersions.js +2 -2
- package/dist/src/utils/safeVersions.js.map +1 -1
- package/dist/src/utils/signatures/SafeSignature.d.ts +1 -1
- package/dist/src/utils/signatures/utils.d.ts +4 -4
- package/dist/src/utils/signatures/utils.js +34 -20
- package/dist/src/utils/signatures/utils.js.map +1 -1
- package/dist/src/utils/transactions/SafeTransaction.d.ts +1 -1
- package/dist/src/utils/transactions/SafeTransaction.js.map +1 -1
- package/dist/src/utils/transactions/gas.d.ts +1 -1
- package/dist/src/utils/transactions/gas.js +37 -64
- package/dist/src/utils/transactions/gas.js.map +1 -1
- package/dist/src/utils/transactions/types.d.ts +17 -1
- package/dist/src/utils/transactions/utils.d.ts +11 -2
- package/dist/src/utils/transactions/utils.js +117 -27
- package/dist/src/utils/transactions/utils.js.map +1 -1
- package/dist/src/utils/types.d.ts +4 -0
- package/dist/src/utils/types.js +59 -1
- package/dist/src/utils/types.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +26 -35
- package/dist/src/SafeFactory.d.ts +0 -15
- package/dist/src/SafeFactory.js +0 -136
- package/dist/src/SafeFactory.js.map +0 -1
- package/dist/src/types/safeFactory.d.ts +0 -31
- package/dist/src/types/safeFactory.js +0 -3
- package/dist/src/types/safeFactory.js.map +0 -1
- package/dist/src/utils/passkeys/PasskeySigner.d.ts +0 -63
- package/dist/src/utils/passkeys/PasskeySigner.js +0 -163
- package/dist/src/utils/passkeys/PasskeySigner.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeContract_v1_3_0.js","sourceRoot":"","sources":["../../../../../src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.ts"],"names":[],"mappings":";;;;;AAAA,iHAAwF;AAExF,qEAAsE;AACtE,yEAA4E;
|
|
1
|
+
{"version":3,"file":"SafeContract_v1_3_0.js","sourceRoot":"","sources":["../../../../../src/contracts/Safe/v1.3.0/SafeContract_v1_3_0.ts"],"names":[],"mappings":";;;;;AAAA,0CAA+C;AAC/C,iHAAwF;AAExF,qEAAsE;AACtE,yEAA4E;AAE5E,sDAQ+B;AAC/B,iEAAqE;AAGrE;;;;;;;GAOG;AACH,MAAM,mBACJ,SAAQ,0BAAyC;IAGjD;;;;;;;;;OASG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,iBAAiB,GAAG,KAAK,EACzB,qBAA8B,EAC9B,iBAA2C,EAC3C,cAA+B;QAE/B,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,wCAA4B,CAAC,GAAG,CAAA;QAEnD,KAAK,CACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAGH;;WAEG;QACH,YAAO,GAA4C,KAAK,IAAI,EAAE;YAC5D,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;QACrC,CAAC,CAAA;QAED;;;WAGG;QACH,mBAAc,GAAmD,KAAK,EAAE,IAAI,EAAE,EAAE;YAC9E,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAA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CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAClC,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,kBAAe,mBAAmB,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import SafeBaseContract from '../../../contracts/Safe/SafeBaseContract';
|
|
2
2
|
import SafeProvider from '../../../SafeProvider';
|
|
3
|
-
import {
|
|
3
|
+
import { DeploymentType } from '../../../types';
|
|
4
|
+
import { SafeContract_v1_4_1_Abi, SafeContract_v1_4_1_Contract, SafeContract_v1_4_1_Function, SafeTransaction, TransactionOptions, TransactionResult } from '@safe-global/types-kit';
|
|
4
5
|
/**
|
|
5
6
|
* SafeContract_v1_4_1 is the implementation specific to the Safe contract version 1.4.1.
|
|
6
7
|
*
|
|
@@ -10,7 +11,6 @@ import { SafeVersion, SafeContract_v1_4_1_Abi, SafeContract_v1_4_1_Contract, Saf
|
|
|
10
11
|
* @implements SafeContract_v1_4_1_Contract - Implements the interface specific to Safe contract version 1.4.1.
|
|
11
12
|
*/
|
|
12
13
|
declare class SafeContract_v1_4_1 extends SafeBaseContract<SafeContract_v1_4_1_Abi> implements SafeContract_v1_4_1_Contract {
|
|
13
|
-
safeVersion: SafeVersion;
|
|
14
14
|
/**
|
|
15
15
|
* Constructs an instance of SafeContract_v1_4_1
|
|
16
16
|
*
|
|
@@ -19,8 +19,9 @@ declare class SafeContract_v1_4_1 extends SafeBaseContract<SafeContract_v1_4_1_A
|
|
|
19
19
|
* @param isL1SafeSingleton - A flag indicating if the contract is a L1 Safe Singleton.
|
|
20
20
|
* @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.
|
|
21
21
|
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.4.1 is used.
|
|
22
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
22
23
|
*/
|
|
23
|
-
constructor(chainId: bigint, safeProvider: SafeProvider, isL1SafeSingleton?: boolean, customContractAddress?: string, customContractAbi?: SafeContract_v1_4_1_Abi);
|
|
24
|
+
constructor(chainId: bigint, safeProvider: SafeProvider, isL1SafeSingleton?: boolean, customContractAddress?: string, customContractAbi?: SafeContract_v1_4_1_Abi, deploymentType?: DeploymentType);
|
|
24
25
|
/**
|
|
25
26
|
* @returns Array[safeContractVersion]
|
|
26
27
|
*/
|
|
@@ -109,7 +110,7 @@ declare class SafeContract_v1_4_1 extends SafeBaseContract<SafeContract_v1_4_1_A
|
|
|
109
110
|
* @param options - Optional transaction options.
|
|
110
111
|
* @returns True, if the given transactions is valid.
|
|
111
112
|
*/
|
|
112
|
-
isValidTransaction(safeTransaction: SafeTransaction, options?: TransactionOptions): Promise<
|
|
113
|
+
isValidTransaction(safeTransaction: SafeTransaction, options?: TransactionOptions): Promise<boolean>;
|
|
113
114
|
/**
|
|
114
115
|
* Executes a transaction.
|
|
115
116
|
* @param safeTransaction - The Safe transaction to execute.
|
|
@@ -134,12 +135,6 @@ declare class SafeContract_v1_4_1 extends SafeBaseContract<SafeContract_v1_4_1_A
|
|
|
134
135
|
* @returns Array[chainId]
|
|
135
136
|
*/
|
|
136
137
|
getChainId(): Promise<[bigint]>;
|
|
137
|
-
/**
|
|
138
|
-
* returns the version of the Safe contract.
|
|
139
|
-
*
|
|
140
|
-
* @returns {Promise<SafeVersion>} A promise that resolves to the version of the Safe contract as string.
|
|
141
|
-
*/
|
|
142
|
-
getVersion(): Promise<SafeVersion>;
|
|
143
138
|
/**
|
|
144
139
|
* returns the nonce of the Safe contract.
|
|
145
140
|
*
|
|
@@ -3,10 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const actions_1 = require("viem/actions");
|
|
6
7
|
const SafeBaseContract_1 = __importDefault(require("../../../contracts/Safe/SafeBaseContract"));
|
|
7
8
|
const utils_1 = require("../../../contracts/utils");
|
|
8
9
|
const constants_1 = require("../../../utils/constants");
|
|
9
|
-
const
|
|
10
|
+
const types_kit_1 = require("@safe-global/types-kit");
|
|
11
|
+
const types_1 = require("../../../utils/types");
|
|
10
12
|
/**
|
|
11
13
|
* SafeContract_v1_4_1 is the implementation specific to the Safe contract version 1.4.1.
|
|
12
14
|
*
|
|
@@ -24,23 +26,24 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
24
26
|
* @param isL1SafeSingleton - A flag indicating if the contract is a L1 Safe Singleton.
|
|
25
27
|
* @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.
|
|
26
28
|
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.4.1 is used.
|
|
29
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
27
30
|
*/
|
|
28
|
-
constructor(chainId, safeProvider, isL1SafeSingleton = false, customContractAddress, customContractAbi) {
|
|
31
|
+
constructor(chainId, safeProvider, isL1SafeSingleton = false, customContractAddress, customContractAbi, deploymentType) {
|
|
29
32
|
const safeVersion = '1.4.1';
|
|
30
|
-
const defaultAbi =
|
|
31
|
-
super(chainId, safeProvider, defaultAbi, safeVersion, isL1SafeSingleton, customContractAddress, customContractAbi);
|
|
33
|
+
const defaultAbi = types_kit_1.safe_1_4_1_ContractArtifacts.abi;
|
|
34
|
+
super(chainId, safeProvider, defaultAbi, safeVersion, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType);
|
|
32
35
|
/**
|
|
33
36
|
* @returns Array[safeContractVersion]
|
|
34
37
|
*/
|
|
35
38
|
this.VERSION = async () => {
|
|
36
|
-
return [await this.
|
|
39
|
+
return [await this.read('VERSION')];
|
|
37
40
|
};
|
|
38
41
|
/**
|
|
39
42
|
* @param args - Array[owner, txHash]
|
|
40
43
|
* @returns Array[approvedHashes]
|
|
41
44
|
*/
|
|
42
45
|
this.approvedHashes = async (args) => {
|
|
43
|
-
return [await this.
|
|
46
|
+
return [await this.read('approvedHashes', args)];
|
|
44
47
|
};
|
|
45
48
|
/**
|
|
46
49
|
* Checks whether the signature provided is valid for the provided data, hash and number of required signatures.
|
|
@@ -49,7 +52,7 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
49
52
|
* @returns Empty array
|
|
50
53
|
*/
|
|
51
54
|
this.checkNSignatures = async (args) => {
|
|
52
|
-
await this.
|
|
55
|
+
await this.read('checkNSignatures', args);
|
|
53
56
|
return [];
|
|
54
57
|
};
|
|
55
58
|
/**
|
|
@@ -58,14 +61,14 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
58
61
|
* @returns Empty array
|
|
59
62
|
*/
|
|
60
63
|
this.checkSignatures = async (args) => {
|
|
61
|
-
await this.
|
|
64
|
+
await this.read('checkSignatures', args);
|
|
62
65
|
return [];
|
|
63
66
|
};
|
|
64
67
|
/**
|
|
65
68
|
* @returns Array[domainSeparator]
|
|
66
69
|
*/
|
|
67
70
|
this.domainSeparator = async () => {
|
|
68
|
-
return [await this.
|
|
71
|
+
return [await this.read('domainSeparator')];
|
|
69
72
|
};
|
|
70
73
|
/**
|
|
71
74
|
* Encodes the data for a transaction to the Safe contract.
|
|
@@ -73,7 +76,7 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
73
76
|
* @returns Array[encodedData]
|
|
74
77
|
*/
|
|
75
78
|
this.encodeTransactionData = async (args) => {
|
|
76
|
-
return [await this.
|
|
79
|
+
return [await this.read('encodeTransactionData', args)];
|
|
77
80
|
};
|
|
78
81
|
/**
|
|
79
82
|
* Returns array of modules.
|
|
@@ -81,15 +84,15 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
81
84
|
* @returns Array[Array[modules], next]
|
|
82
85
|
*/
|
|
83
86
|
this.getModulesPaginated = async (args) => {
|
|
84
|
-
const
|
|
85
|
-
return [
|
|
87
|
+
const [array, next] = await this.read('getModulesPaginated', args);
|
|
88
|
+
return [array, next];
|
|
86
89
|
};
|
|
87
90
|
/**
|
|
88
91
|
* Returns the list of Safe owner accounts.
|
|
89
92
|
* @returns Array[Array[owners]]
|
|
90
93
|
*/
|
|
91
94
|
this.getOwners = async () => {
|
|
92
|
-
return [await this.
|
|
95
|
+
return [await this.read('getOwners')];
|
|
93
96
|
};
|
|
94
97
|
/**
|
|
95
98
|
* Reads `length` bytes of storage in the currents contract
|
|
@@ -97,14 +100,14 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
97
100
|
* @returns Array[storage]
|
|
98
101
|
*/
|
|
99
102
|
this.getStorageAt = async (args) => {
|
|
100
|
-
return [await this.
|
|
103
|
+
return [await this.read('getStorageAt', args)];
|
|
101
104
|
};
|
|
102
105
|
/**
|
|
103
106
|
* Returns the Safe threshold.
|
|
104
107
|
* @returns Array[threshold]
|
|
105
108
|
*/
|
|
106
109
|
this.getThreshold = async () => {
|
|
107
|
-
return [await this.
|
|
110
|
+
return [await this.read('getThreshold')];
|
|
108
111
|
};
|
|
109
112
|
/**
|
|
110
113
|
* Returns hash to be signed by owners.
|
|
@@ -112,7 +115,7 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
112
115
|
* @returns Array[transactionHash]
|
|
113
116
|
*/
|
|
114
117
|
this.getTransactionHash = async (args) => {
|
|
115
|
-
return [await this.
|
|
118
|
+
return [await this.read('getTransactionHash', args)];
|
|
116
119
|
};
|
|
117
120
|
/**
|
|
118
121
|
* Checks if a specific Safe module is enabled for the current Safe.
|
|
@@ -120,7 +123,7 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
120
123
|
* @returns Array[isEnabled]
|
|
121
124
|
*/
|
|
122
125
|
this.isModuleEnabled = async (args) => {
|
|
123
|
-
return [await this.
|
|
126
|
+
return [await this.read('isModuleEnabled', args)];
|
|
124
127
|
};
|
|
125
128
|
/**
|
|
126
129
|
* Checks if a specific address is an owner of the current Safe.
|
|
@@ -128,23 +131,22 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
128
131
|
* @returns Array[isOwner]
|
|
129
132
|
*/
|
|
130
133
|
this.isOwner = async (args) => {
|
|
131
|
-
return [await this.
|
|
134
|
+
return [await this.read('isOwner', args)];
|
|
132
135
|
};
|
|
133
136
|
/**
|
|
134
137
|
* Returns the Safe nonce.
|
|
135
138
|
* @returns Array[nonce]
|
|
136
139
|
*/
|
|
137
140
|
this.nonce = async () => {
|
|
138
|
-
return [await this.
|
|
141
|
+
return [await this.read('nonce')];
|
|
139
142
|
};
|
|
140
143
|
/**
|
|
141
144
|
* @param args - Array[messageHash]
|
|
142
145
|
* @returns Array[signedMessages]
|
|
143
146
|
*/
|
|
144
147
|
this.signedMessages = async (args) => {
|
|
145
|
-
return [await this.
|
|
148
|
+
return [await this.read('signedMessages', args)];
|
|
146
149
|
};
|
|
147
|
-
this.safeVersion = safeVersion;
|
|
148
150
|
}
|
|
149
151
|
/**
|
|
150
152
|
* Checks whether a given Safe transaction can be executed successfully with no errors.
|
|
@@ -158,16 +160,35 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
158
160
|
(await this.estimateGas('execTransaction', [
|
|
159
161
|
safeTransaction.data.to,
|
|
160
162
|
BigInt(safeTransaction.data.value),
|
|
161
|
-
safeTransaction.data.data,
|
|
163
|
+
(0, types_1.asHex)(safeTransaction.data.data),
|
|
162
164
|
safeTransaction.data.operation,
|
|
163
165
|
BigInt(safeTransaction.data.safeTxGas),
|
|
164
166
|
BigInt(safeTransaction.data.baseGas),
|
|
165
167
|
BigInt(safeTransaction.data.gasPrice),
|
|
166
168
|
safeTransaction.data.gasToken,
|
|
167
169
|
safeTransaction.data.refundReceiver,
|
|
168
|
-
safeTransaction.encodedSignatures()
|
|
170
|
+
(0, types_1.asHex)(safeTransaction.encodedSignatures())
|
|
169
171
|
], options));
|
|
170
|
-
|
|
172
|
+
const converted = this.convertOptions({ ...options, gasLimit });
|
|
173
|
+
const txResult = await (0, actions_1.simulateContract)(this.runner, {
|
|
174
|
+
address: this.contractAddress,
|
|
175
|
+
functionName: 'execTransaction',
|
|
176
|
+
abi: this.contractAbi,
|
|
177
|
+
args: [
|
|
178
|
+
safeTransaction.data.to,
|
|
179
|
+
BigInt(safeTransaction.data.value),
|
|
180
|
+
(0, types_1.asHex)(safeTransaction.data.data),
|
|
181
|
+
safeTransaction.data.operation,
|
|
182
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
183
|
+
BigInt(safeTransaction.data.baseGas),
|
|
184
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
185
|
+
safeTransaction.data.gasToken,
|
|
186
|
+
safeTransaction.data.refundReceiver,
|
|
187
|
+
(0, types_1.asHex)(safeTransaction.encodedSignatures())
|
|
188
|
+
],
|
|
189
|
+
...converted
|
|
190
|
+
});
|
|
191
|
+
return txResult.result;
|
|
171
192
|
}
|
|
172
193
|
catch (error) {
|
|
173
194
|
return false;
|
|
@@ -184,17 +205,28 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
184
205
|
(await this.estimateGas('execTransaction', [
|
|
185
206
|
safeTransaction.data.to,
|
|
186
207
|
BigInt(safeTransaction.data.value),
|
|
187
|
-
safeTransaction.data.data,
|
|
208
|
+
(0, types_1.asHex)(safeTransaction.data.data),
|
|
188
209
|
safeTransaction.data.operation,
|
|
189
210
|
BigInt(safeTransaction.data.safeTxGas),
|
|
190
211
|
BigInt(safeTransaction.data.baseGas),
|
|
191
212
|
BigInt(safeTransaction.data.gasPrice),
|
|
192
213
|
safeTransaction.data.gasToken,
|
|
193
214
|
safeTransaction.data.refundReceiver,
|
|
194
|
-
safeTransaction.encodedSignatures()
|
|
215
|
+
(0, types_1.asHex)(safeTransaction.encodedSignatures())
|
|
195
216
|
], options));
|
|
196
|
-
const
|
|
197
|
-
|
|
217
|
+
const args = [
|
|
218
|
+
safeTransaction.data.to,
|
|
219
|
+
BigInt(safeTransaction.data.value),
|
|
220
|
+
(0, types_1.asHex)(safeTransaction.data.data),
|
|
221
|
+
safeTransaction.data.operation,
|
|
222
|
+
BigInt(safeTransaction.data.safeTxGas),
|
|
223
|
+
BigInt(safeTransaction.data.baseGas),
|
|
224
|
+
BigInt(safeTransaction.data.gasPrice),
|
|
225
|
+
safeTransaction.data.gasToken,
|
|
226
|
+
safeTransaction.data.refundReceiver,
|
|
227
|
+
(0, types_1.asHex)(safeTransaction.encodedSignatures())
|
|
228
|
+
];
|
|
229
|
+
return (0, utils_1.toTxResult)(this.runner, await this.write('execTransaction', args, { ...options, gasLimit }), options);
|
|
198
230
|
}
|
|
199
231
|
/**
|
|
200
232
|
* Returns array of first 10 modules.
|
|
@@ -211,25 +243,15 @@ class SafeContract_v1_4_1 extends SafeBaseContract_1.default {
|
|
|
211
243
|
* @returns Transaction result.
|
|
212
244
|
*/
|
|
213
245
|
async approveHash(hash, options) {
|
|
214
|
-
const gasLimit = options?.gasLimit || (await this.estimateGas('approveHash', [hash], options));
|
|
215
|
-
|
|
216
|
-
return (0, utils_1.toTxResult)(txResponse, options);
|
|
246
|
+
const gasLimit = options?.gasLimit || (await this.estimateGas('approveHash', [(0, types_1.asHash)(hash)], options));
|
|
247
|
+
return (0, utils_1.toTxResult)(this.runner, await this.write('approveHash', [(0, types_1.asHash)(hash)], { ...options, gasLimit }), options);
|
|
217
248
|
}
|
|
218
249
|
/**
|
|
219
250
|
* Returns the chain id of the Safe contract. (Custom method - not defined in the Safe Contract)
|
|
220
251
|
* @returns Array[chainId]
|
|
221
252
|
*/
|
|
222
253
|
async getChainId() {
|
|
223
|
-
return [await this.
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* returns the version of the Safe contract.
|
|
227
|
-
*
|
|
228
|
-
* @returns {Promise<SafeVersion>} A promise that resolves to the version of the Safe contract as string.
|
|
229
|
-
*/
|
|
230
|
-
async getVersion() {
|
|
231
|
-
const [safeVersion] = await this.VERSION();
|
|
232
|
-
return safeVersion;
|
|
254
|
+
return [await Promise.resolve(this.chainId)];
|
|
233
255
|
}
|
|
234
256
|
/**
|
|
235
257
|
* returns the nonce of the Safe contract.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeContract_v1_4_1.js","sourceRoot":"","sources":["../../../../../src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.ts"],"names":[],"mappings":";;;;;AAAA,iHAAwF;AAExF,qEAAsE;AACtE,yEAA4E;
|
|
1
|
+
{"version":3,"file":"SafeContract_v1_4_1.js","sourceRoot":"","sources":["../../../../../src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.ts"],"names":[],"mappings":";;;;;AAAA,0CAA+C;AAC/C,iHAAwF;AAExF,qEAAsE;AACtE,yEAA4E;AAE5E,sDAQ+B;AAC/B,iEAAqE;AAGrE;;;;;;;GAOG;AACH,MAAM,mBACJ,SAAQ,0BAAyC;IAGjD;;;;;;;;;OASG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,iBAAiB,GAAG,KAAK,EACzB,qBAA8B,EAC9B,iBAA2C,EAC3C,cAA+B;QAE/B,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,wCAA4B,CAAC,GAAG,CAAA;QAEnD,KAAK,CACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,iBAAiB,EACjB,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAGH;;WAEG;QACH,YAAO,GAA4C,KAAK,IAAI,EAAE;YAC5D,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAA;QACrC,CAAC,CAAA;QAED;;;WAGG;QACH,mBAAc,GAAmD,KAAK,EAAE,IAAI,EAAE,EAAE;YAC9E,OAAO,CAAC,MAAM,IAA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,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ;QACZ,MAAM,CAAC,KAAK,CAAC,GAAG,MAAM,IAAI,CAAC,KAAK,EAAE,CAAA;QAClC,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAED,kBAAe,mBAAmB,CAAA"}
|
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { Abi } from 'abitype';
|
|
2
|
-
import { ContractRunner, InterfaceAbi } from 'ethers';
|
|
3
2
|
import SafeProvider from '../../SafeProvider';
|
|
4
3
|
import BaseContract from '../../contracts/BaseContract';
|
|
5
|
-
import { SafeVersion
|
|
4
|
+
import { SafeVersion } from '@safe-global/types-kit';
|
|
5
|
+
import { DeploymentType } from '../../types';
|
|
6
6
|
import { contractName } from '../../contracts/config';
|
|
7
|
-
export interface CreateProxyProps extends CreateProxyPropsGeneral {
|
|
8
|
-
options?: TransactionOptions;
|
|
9
|
-
}
|
|
10
7
|
/**
|
|
11
8
|
* Abstract class SafeProxyFactoryBaseContract extends BaseContract to specifically integrate with the SafeProxyFactory contract.
|
|
12
9
|
* It is designed to be instantiated for different versions of the Safe contract.
|
|
@@ -23,7 +20,7 @@ export interface CreateProxyProps extends CreateProxyPropsGeneral {
|
|
|
23
20
|
* - SafeProxyFactoryContract_v1_1_1 extends SafeProxyFactoryBaseContract<SafeProxyFactoryContract_v1_1_1_Abi>
|
|
24
21
|
* - SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContract<SafeProxyFactoryContract_v1_0_0_Abi>
|
|
25
22
|
*/
|
|
26
|
-
declare abstract class SafeProxyFactoryBaseContract<SafeProxyFactoryContractAbiType extends
|
|
23
|
+
declare abstract class SafeProxyFactoryBaseContract<SafeProxyFactoryContractAbiType extends Abi> extends BaseContract<SafeProxyFactoryContractAbiType> {
|
|
27
24
|
contractName: contractName;
|
|
28
25
|
/**
|
|
29
26
|
* @constructor
|
|
@@ -35,7 +32,8 @@ declare abstract class SafeProxyFactoryBaseContract<SafeProxyFactoryContractAbiT
|
|
|
35
32
|
* @param safeVersion - The version of the Safe contract.
|
|
36
33
|
* @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.
|
|
37
34
|
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
35
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
38
36
|
*/
|
|
39
|
-
constructor(chainId: bigint, safeProvider: SafeProvider, defaultAbi: SafeProxyFactoryContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: SafeProxyFactoryContractAbiType,
|
|
37
|
+
constructor(chainId: bigint, safeProvider: SafeProvider, defaultAbi: SafeProxyFactoryContractAbiType, safeVersion: SafeVersion, customContractAddress?: string, customContractAbi?: SafeProxyFactoryContractAbiType, deploymentType?: DeploymentType);
|
|
40
38
|
}
|
|
41
39
|
export default SafeProxyFactoryBaseContract;
|
|
@@ -31,10 +31,11 @@ class SafeProxyFactoryBaseContract extends BaseContract_1.default {
|
|
|
31
31
|
* @param safeVersion - The version of the Safe contract.
|
|
32
32
|
* @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.
|
|
33
33
|
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
|
|
34
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
34
35
|
*/
|
|
35
|
-
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi,
|
|
36
|
+
constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
|
|
36
37
|
const contractName = 'safeProxyFactoryVersion';
|
|
37
|
-
super(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi,
|
|
38
|
+
super(contractName, chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
|
|
38
39
|
this.contractName = contractName;
|
|
39
40
|
}
|
|
40
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeProxyFactoryBaseContract.js","sourceRoot":"","sources":["../../../../src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"SafeProxyFactoryBaseContract.js","sourceRoot":"","sources":["../../../../src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts"],"names":[],"mappings":";;;;;AAEA,oGAA2E;AAK3E;;;;;;;;;;;;;;;GAeG;AACH,MAAe,4BAEb,SAAQ,sBAA6C;IAGrD;;;;;;;;;;;OAWG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,UAA2C,EAC3C,WAAwB,EACxB,qBAA8B,EAC9B,iBAAmD,EACnD,cAA+B;QAE/B,MAAM,YAAY,GAAG,yBAAyB,CAAA;QAE9C,KAAK,CACH,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAED,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;CACF;AAED,kBAAe,4BAA4B,CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import SafeProxyFactoryBaseContract, { CreateProxyProps } from '../../../contracts/SafeProxyFactory/SafeProxyFactoryBaseContract';
|
|
1
|
+
import SafeProxyFactoryBaseContract from '../../../contracts/SafeProxyFactory/SafeProxyFactoryBaseContract';
|
|
3
2
|
import SafeProvider from '../../../SafeProvider';
|
|
4
|
-
import {
|
|
3
|
+
import { DeploymentType } from '../../../types';
|
|
4
|
+
import { SafeProxyFactoryContract_v1_0_0_Abi, SafeProxyFactoryContract_v1_0_0_Contract, SafeProxyFactoryContract_v1_0_0_Function } from '@safe-global/types-kit';
|
|
5
5
|
/**
|
|
6
6
|
* SafeProxyFactoryContract_v1_0_0 is the implementation specific to the Safe Proxy Factory contract version 1.0.0.
|
|
7
7
|
*
|
|
@@ -11,7 +11,6 @@ import { SafeVersion, SafeProxyFactoryContract_v1_0_0_Abi, SafeProxyFactoryContr
|
|
|
11
11
|
* @implements SafeProxyFactoryContract_v1_0_0_Contract - Implements the interface specific to Safe Proxy Factory contract version 1.0.0.
|
|
12
12
|
*/
|
|
13
13
|
declare class SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContract<SafeProxyFactoryContract_v1_0_0_Abi> implements SafeProxyFactoryContract_v1_0_0_Contract {
|
|
14
|
-
safeVersion: SafeVersion;
|
|
15
14
|
/**
|
|
16
15
|
* Constructs an instance of SafeProxyFactoryContract_v1_0_0
|
|
17
16
|
*
|
|
@@ -19,8 +18,9 @@ declare class SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContra
|
|
|
19
18
|
* @param safeProvider - An instance of SafeProvider.
|
|
20
19
|
* @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.
|
|
21
20
|
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
|
|
21
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
22
22
|
*/
|
|
23
|
-
constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: SafeProxyFactoryContract_v1_0_0_Abi,
|
|
23
|
+
constructor(chainId: bigint, safeProvider: SafeProvider, customContractAddress?: string, customContractAbi?: SafeProxyFactoryContract_v1_0_0_Abi, deploymentType?: DeploymentType);
|
|
24
24
|
/**
|
|
25
25
|
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
26
26
|
* @returns Array[creationCode]
|
|
@@ -43,11 +43,5 @@ declare class SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContra
|
|
|
43
43
|
* @returns Array[proxyAddress]
|
|
44
44
|
*/
|
|
45
45
|
createProxyWithNonce: SafeProxyFactoryContract_v1_0_0_Function<'createProxyWithNonce'>;
|
|
46
|
-
/**
|
|
47
|
-
* Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
|
|
48
|
-
* @param {CreateProxyProps} props - Properties for the new proxy contract.
|
|
49
|
-
* @returns The address of the new proxy contract.
|
|
50
|
-
*/
|
|
51
|
-
createProxyWithOptions({ safeSingletonAddress, initializer, saltNonce, options, callback }: CreateProxyProps): Promise<string>;
|
|
52
46
|
}
|
|
53
47
|
export default SafeProxyFactoryContract_v1_0_0;
|
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const SafeProxyFactoryBaseContract_1 = __importDefault(require("../../../contracts/SafeProxyFactory/SafeProxyFactoryBaseContract"));
|
|
7
|
-
const
|
|
7
|
+
const types_kit_1 = require("@safe-global/types-kit");
|
|
8
8
|
/**
|
|
9
9
|
* SafeProxyFactoryContract_v1_0_0 is the implementation specific to the Safe Proxy Factory contract version 1.0.0.
|
|
10
10
|
*
|
|
@@ -21,24 +21,25 @@ class SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContract_1.def
|
|
|
21
21
|
* @param safeProvider - An instance of SafeProvider.
|
|
22
22
|
* @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.
|
|
23
23
|
* @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
|
|
24
|
+
* @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
|
|
24
25
|
*/
|
|
25
|
-
constructor(chainId, safeProvider, customContractAddress, customContractAbi,
|
|
26
|
+
constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
|
|
26
27
|
const safeVersion = '1.0.0';
|
|
27
|
-
const defaultAbi =
|
|
28
|
-
super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi,
|
|
28
|
+
const defaultAbi = types_kit_1.safeProxyFactory_1_0_0_ContractArtifacts.abi;
|
|
29
|
+
super(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType);
|
|
29
30
|
/**
|
|
30
31
|
* Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
|
|
31
32
|
* @returns Array[creationCode]
|
|
32
33
|
*/
|
|
33
34
|
this.proxyCreationCode = async () => {
|
|
34
|
-
return [await this.
|
|
35
|
+
return [await this.read('proxyCreationCode')];
|
|
35
36
|
};
|
|
36
37
|
/**
|
|
37
38
|
* Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
|
|
38
39
|
* @returns Array[runtimeCode]
|
|
39
40
|
*/
|
|
40
41
|
this.proxyRuntimeCode = async () => {
|
|
41
|
-
return [await this.
|
|
42
|
+
return [await this.read('proxyRuntimeCode')];
|
|
42
43
|
};
|
|
43
44
|
/**
|
|
44
45
|
* Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
|
|
@@ -46,7 +47,7 @@ class SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContract_1.def
|
|
|
46
47
|
* @returns Array[proxyAddress]
|
|
47
48
|
*/
|
|
48
49
|
this.createProxy = async (args) => {
|
|
49
|
-
return [await this.
|
|
50
|
+
return [await this.write('createProxy', args)];
|
|
50
51
|
};
|
|
51
52
|
/**
|
|
52
53
|
* Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
|
|
@@ -54,38 +55,8 @@ class SafeProxyFactoryContract_v1_0_0 extends SafeProxyFactoryBaseContract_1.def
|
|
|
54
55
|
* @returns Array[proxyAddress]
|
|
55
56
|
*/
|
|
56
57
|
this.createProxyWithNonce = async (args) => {
|
|
57
|
-
return [await this.
|
|
58
|
+
return [await this.write('createProxyWithNonce', args)];
|
|
58
59
|
};
|
|
59
|
-
this.safeVersion = safeVersion;
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
|
|
63
|
-
* @param {CreateProxyProps} props - Properties for the new proxy contract.
|
|
64
|
-
* @returns The address of the new proxy contract.
|
|
65
|
-
*/
|
|
66
|
-
async createProxyWithOptions({ safeSingletonAddress, initializer, saltNonce, options, callback }) {
|
|
67
|
-
const saltNonceBigInt = BigInt(saltNonce);
|
|
68
|
-
if (saltNonceBigInt < 0)
|
|
69
|
-
throw new Error('saltNonce must be greater than or equal to 0');
|
|
70
|
-
if (options && !options.gasLimit) {
|
|
71
|
-
options.gasLimit = (await this.estimateGas('createProxyWithNonce', [safeSingletonAddress, initializer, saltNonceBigInt], { ...options })).toString();
|
|
72
|
-
}
|
|
73
|
-
const proxyAddress = this.contract
|
|
74
|
-
.createProxyWithNonce(safeSingletonAddress, initializer, saltNonce, { ...options })
|
|
75
|
-
.then(async (txResponse) => {
|
|
76
|
-
if (callback) {
|
|
77
|
-
callback(txResponse.hash);
|
|
78
|
-
}
|
|
79
|
-
const txReceipt = await txResponse.wait();
|
|
80
|
-
const events = txReceipt?.logs;
|
|
81
|
-
const proxyCreationEvent = events.find((event) => event?.eventName === 'ProxyCreation');
|
|
82
|
-
if (!proxyCreationEvent || !proxyCreationEvent.args) {
|
|
83
|
-
throw new Error('SafeProxy was not deployed correctly');
|
|
84
|
-
}
|
|
85
|
-
const proxyAddress = proxyCreationEvent.args[0];
|
|
86
|
-
return proxyAddress;
|
|
87
|
-
});
|
|
88
|
-
return proxyAddress;
|
|
89
60
|
}
|
|
90
61
|
}
|
|
91
62
|
exports.default = SafeProxyFactoryContract_v1_0_0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SafeProxyFactoryContract_v1_0_0.js","sourceRoot":"","sources":["../../../../../src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"SafeProxyFactoryContract_v1_0_0.js","sourceRoot":"","sources":["../../../../../src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts"],"names":[],"mappings":";;;;;AAAA,qJAA4H;AAG5H,sDAK+B;AAE/B;;;;;;;GAOG;AACH,MAAM,+BACJ,SAAQ,sCAAiE;IAGzE;;;;;;;;OAQG;IACH,YACE,OAAe,EACf,YAA0B,EAC1B,qBAA8B,EAC9B,iBAAuD,EACvD,cAA+B;QAE/B,MAAM,WAAW,GAAG,OAAO,CAAA;QAC3B,MAAM,UAAU,GAAG,oDAAwC,CAAC,GAAG,CAAA;QAE/D,KAAK,CACH,OAAO,EACP,YAAY,EACZ,UAAU,EACV,WAAW,EACX,qBAAqB,EACrB,iBAAiB,EACjB,cAAc,CACf,CAAA;QAGH;;;WAGG;QACH,sBAAiB,GAAkE,KAAK,IAAI,EAAE;YAC5F,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,CAAA;QAC/C,CAAC,CAAA;QAED;;;WAGG;QACH,qBAAgB,GAAiE,KAAK,IAAI,EAAE;YAC1F,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,CAAA;QAC9C,CAAC,CAAA;QAED;;;;WAIG;QACH,gBAAW,GAA4D,KAAK,EAAE,IAAI,EAAE,EAAE;YACpF,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC,CAAA;QAChD,CAAC,CAAA;QAED;;;;WAIG;QACH,yBAAoB,GAAqE,KAAK,EAC5F,IAAI,EACJ,EAAE;YACF,OAAO,CAAC,MAAM,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC,CAAA;QACzD,CAAC,CAAA;IApCD,CAAC;CAqCF;AAED,kBAAe,+BAA+B,CAAA"}
|