diff --git a/src/Nethereum.GnosisSafe/ContractDefinition/ExtendedContractDefinition.cs b/src/Nethereum.GnosisSafe/ContractDefinition/ExtendedContractDefinition.cs index 53d780d5c..3a760558b 100644 --- a/src/Nethereum.GnosisSafe/ContractDefinition/ExtendedContractDefinition.cs +++ b/src/Nethereum.GnosisSafe/ContractDefinition/ExtendedContractDefinition.cs @@ -18,7 +18,8 @@ public class EncodeTransactionDataFunctionBase : FunctionMessage [Parameter("address", "to", 1)] public virtual string To { get; set; } - [Parameter("uint256", "value", 2)] public virtual BigInteger Value { get; set; } = 0; + [Parameter("uint256", "value", 2)] + public virtual BigInteger Value { get; set; } = 0; [Parameter("bytes", "data", 3)] public virtual byte[] Data { get; set; } diff --git a/src/Nethereum.GnosisSafe/ContractDefinition/GnosisSafeDefinition.cs b/src/Nethereum.GnosisSafe/ContractDefinition/GnosisSafeDefinition.cs index 1bb9ee77c..653f68226 100644 --- a/src/Nethereum.GnosisSafe/ContractDefinition/GnosisSafeDefinition.cs +++ b/src/Nethereum.GnosisSafe/ContractDefinition/GnosisSafeDefinition.cs @@ -14,24 +14,10 @@ namespace Nethereum.GnosisSafe.ContractDefinition { - public partial class GnosisSafeDeployment : GnosisSafeDeploymentBase - { - public GnosisSafeDeployment() : base(BYTECODE) { } - public GnosisSafeDeployment(string byteCode) : base(byteCode) { } - } - - public class GnosisSafeDeploymentBase : ContractDeploymentMessage - { - public static string BYTECODE = "0x"; - public GnosisSafeDeploymentBase() : base(BYTECODE) { } - public GnosisSafeDeploymentBase(string byteCode) : base(byteCode) { } - - } - - public partial class VERSIONFunction : VERSIONFunctionBase { } + public partial class VersionFunction : VersionFunctionBase { } [Function("VERSION", "string")] - public class VERSIONFunctionBase : FunctionMessage + public class VersionFunctionBase : FunctionMessage { } @@ -104,7 +90,7 @@ public class EnableModuleFunctionBase : FunctionMessage public virtual string Module { get; set; } } - + public partial class ExecTransactionFunction : ExecTransactionFunctionBase { } @@ -369,7 +355,7 @@ public partial class AddedOwnerEventDTO : AddedOwnerEventDTOBase { } [Event("AddedOwner")] public class AddedOwnerEventDTOBase : IEventDTO { - [Parameter("address", "owner", 1, false )] + [Parameter("address", "owner", 1, false)] public virtual string Owner { get; set; } } @@ -378,9 +364,9 @@ public partial class ApproveHashEventDTO : ApproveHashEventDTOBase { } [Event("ApproveHash")] public class ApproveHashEventDTOBase : IEventDTO { - [Parameter("bytes32", "approvedHash", 1, true )] + [Parameter("bytes32", "approvedHash", 1, true)] public virtual byte[] ApprovedHash { get; set; } - [Parameter("address", "owner", 2, true )] + [Parameter("address", "owner", 2, true)] public virtual string Owner { get; set; } } @@ -389,7 +375,7 @@ public partial class ChangedFallbackHandlerEventDTO : ChangedFallbackHandlerEven [Event("ChangedFallbackHandler")] public class ChangedFallbackHandlerEventDTOBase : IEventDTO { - [Parameter("address", "handler", 1, false )] + [Parameter("address", "handler", 1, false)] public virtual string Handler { get; set; } } @@ -398,7 +384,7 @@ public partial class ChangedGuardEventDTO : ChangedGuardEventDTOBase { } [Event("ChangedGuard")] public class ChangedGuardEventDTOBase : IEventDTO { - [Parameter("address", "guard", 1, false )] + [Parameter("address", "guard", 1, false)] public virtual string Guard { get; set; } } @@ -407,7 +393,7 @@ public partial class ChangedThresholdEventDTO : ChangedThresholdEventDTOBase { } [Event("ChangedThreshold")] public class ChangedThresholdEventDTOBase : IEventDTO { - [Parameter("uint256", "threshold", 1, false )] + [Parameter("uint256", "threshold", 1, false)] public virtual BigInteger Threshold { get; set; } } @@ -416,7 +402,7 @@ public partial class DisabledModuleEventDTO : DisabledModuleEventDTOBase { } [Event("DisabledModule")] public class DisabledModuleEventDTOBase : IEventDTO { - [Parameter("address", "module", 1, false )] + [Parameter("address", "module", 1, false)] public virtual string Module { get; set; } } @@ -425,7 +411,7 @@ public partial class EnabledModuleEventDTO : EnabledModuleEventDTOBase { } [Event("EnabledModule")] public class EnabledModuleEventDTOBase : IEventDTO { - [Parameter("address", "module", 1, false )] + [Parameter("address", "module", 1, false)] public virtual string Module { get; set; } } @@ -434,9 +420,9 @@ public partial class ExecutionFailureEventDTO : ExecutionFailureEventDTOBase { } [Event("ExecutionFailure")] public class ExecutionFailureEventDTOBase : IEventDTO { - [Parameter("bytes32", "txHash", 1, false )] + [Parameter("bytes32", "txHash", 1, false)] public virtual byte[] TxHash { get; set; } - [Parameter("uint256", "payment", 2, false )] + [Parameter("uint256", "payment", 2, false)] public virtual BigInteger Payment { get; set; } } @@ -445,7 +431,7 @@ public partial class ExecutionFromModuleFailureEventDTO : ExecutionFromModuleFai [Event("ExecutionFromModuleFailure")] public class ExecutionFromModuleFailureEventDTOBase : IEventDTO { - [Parameter("address", "module", 1, true )] + [Parameter("address", "module", 1, true)] public virtual string Module { get; set; } } @@ -454,7 +440,7 @@ public partial class ExecutionFromModuleSuccessEventDTO : ExecutionFromModuleSuc [Event("ExecutionFromModuleSuccess")] public class ExecutionFromModuleSuccessEventDTOBase : IEventDTO { - [Parameter("address", "module", 1, true )] + [Parameter("address", "module", 1, true)] public virtual string Module { get; set; } } @@ -463,9 +449,9 @@ public partial class ExecutionSuccessEventDTO : ExecutionSuccessEventDTOBase { } [Event("ExecutionSuccess")] public class ExecutionSuccessEventDTOBase : IEventDTO { - [Parameter("bytes32", "txHash", 1, false )] + [Parameter("bytes32", "txHash", 1, false)] public virtual byte[] TxHash { get; set; } - [Parameter("uint256", "payment", 2, false )] + [Parameter("uint256", "payment", 2, false)] public virtual BigInteger Payment { get; set; } } @@ -474,7 +460,7 @@ public partial class RemovedOwnerEventDTO : RemovedOwnerEventDTOBase { } [Event("RemovedOwner")] public class RemovedOwnerEventDTOBase : IEventDTO { - [Parameter("address", "owner", 1, false )] + [Parameter("address", "owner", 1, false)] public virtual string Owner { get; set; } } @@ -483,9 +469,9 @@ public partial class SafeReceivedEventDTO : SafeReceivedEventDTOBase { } [Event("SafeReceived")] public class SafeReceivedEventDTOBase : IEventDTO { - [Parameter("address", "sender", 1, true )] + [Parameter("address", "sender", 1, true)] public virtual string Sender { get; set; } - [Parameter("uint256", "value", 2, false )] + [Parameter("uint256", "value", 2, false)] public virtual BigInteger Value { get; set; } } @@ -494,15 +480,15 @@ public partial class SafeSetupEventDTO : SafeSetupEventDTOBase { } [Event("SafeSetup")] public class SafeSetupEventDTOBase : IEventDTO { - [Parameter("address", "initiator", 1, true )] + [Parameter("address", "initiator", 1, true)] public virtual string Initiator { get; set; } - [Parameter("address[]", "owners", 2, false )] + [Parameter("address[]", "owners", 2, false)] public virtual List Owners { get; set; } - [Parameter("uint256", "threshold", 3, false )] + [Parameter("uint256", "threshold", 3, false)] public virtual BigInteger Threshold { get; set; } - [Parameter("address", "initializer", 4, false )] + [Parameter("address", "initializer", 4, false)] public virtual string Initializer { get; set; } - [Parameter("address", "fallbackHandler", 5, false )] + [Parameter("address", "fallbackHandler", 5, false)] public virtual string FallbackHandler { get; set; } } @@ -511,14 +497,14 @@ public partial class SignMsgEventDTO : SignMsgEventDTOBase { } [Event("SignMsg")] public class SignMsgEventDTOBase : IEventDTO { - [Parameter("bytes32", "msgHash", 1, true )] + [Parameter("bytes32", "msgHash", 1, true)] public virtual byte[] MsgHash { get; set; } } - public partial class VERSIONOutputDTO : VERSIONOutputDTOBase { } + public partial class VersionOutputDTO : VersionOutputDTOBase { } [FunctionOutput] - public class VERSIONOutputDTOBase : IFunctionOutputDTO + public class VersionOutputDTOBase : IFunctionOutputDTO { [Parameter("string", "", 1)] public virtual string ReturnValue1 { get; set; } @@ -531,7 +517,7 @@ public class VERSIONOutputDTOBase : IFunctionOutputDTO public partial class ApprovedHashesOutputDTO : ApprovedHashesOutputDTOBase { } [FunctionOutput] - public class ApprovedHashesOutputDTOBase : IFunctionOutputDTO + public class ApprovedHashesOutputDTOBase : IFunctionOutputDTO { [Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; } @@ -544,7 +530,7 @@ public class ApprovedHashesOutputDTOBase : IFunctionOutputDTO public partial class DomainSeparatorOutputDTO : DomainSeparatorOutputDTOBase { } [FunctionOutput] - public class DomainSeparatorOutputDTOBase : IFunctionOutputDTO + public class DomainSeparatorOutputDTOBase : IFunctionOutputDTO { [Parameter("bytes32", "", 1)] public virtual byte[] ReturnValue1 { get; set; } @@ -555,7 +541,7 @@ public class DomainSeparatorOutputDTOBase : IFunctionOutputDTO public partial class EncodeTransactionDataOutputDTO : EncodeTransactionDataOutputDTOBase { } [FunctionOutput] - public class EncodeTransactionDataOutputDTOBase : IFunctionOutputDTO + public class EncodeTransactionDataOutputDTOBase : IFunctionOutputDTO { [Parameter("bytes", "", 1)] public virtual byte[] ReturnValue1 { get; set; } @@ -568,7 +554,7 @@ public class EncodeTransactionDataOutputDTOBase : IFunctionOutputDTO public partial class ExecTransactionFromModuleReturnDataOutputDTO : ExecTransactionFromModuleReturnDataOutputDTOBase { } [FunctionOutput] - public class ExecTransactionFromModuleReturnDataOutputDTOBase : IFunctionOutputDTO + public class ExecTransactionFromModuleReturnDataOutputDTOBase : IFunctionOutputDTO { [Parameter("bool", "success", 1)] public virtual bool Success { get; set; } @@ -579,7 +565,7 @@ public class ExecTransactionFromModuleReturnDataOutputDTOBase : IFunctionOutputD public partial class GetChainIdOutputDTO : GetChainIdOutputDTOBase { } [FunctionOutput] - public class GetChainIdOutputDTOBase : IFunctionOutputDTO + public class GetChainIdOutputDTOBase : IFunctionOutputDTO { [Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; } @@ -588,7 +574,7 @@ public class GetChainIdOutputDTOBase : IFunctionOutputDTO public partial class GetModulesPaginatedOutputDTO : GetModulesPaginatedOutputDTOBase { } [FunctionOutput] - public class GetModulesPaginatedOutputDTOBase : IFunctionOutputDTO + public class GetModulesPaginatedOutputDTOBase : IFunctionOutputDTO { [Parameter("address[]", "array", 1)] public virtual List Array { get; set; } @@ -599,7 +585,7 @@ public class GetModulesPaginatedOutputDTOBase : IFunctionOutputDTO public partial class GetOwnersOutputDTO : GetOwnersOutputDTOBase { } [FunctionOutput] - public class GetOwnersOutputDTOBase : IFunctionOutputDTO + public class GetOwnersOutputDTOBase : IFunctionOutputDTO { [Parameter("address[]", "", 1)] public virtual List ReturnValue1 { get; set; } @@ -608,7 +594,7 @@ public class GetOwnersOutputDTOBase : IFunctionOutputDTO public partial class GetStorageAtOutputDTO : GetStorageAtOutputDTOBase { } [FunctionOutput] - public class GetStorageAtOutputDTOBase : IFunctionOutputDTO + public class GetStorageAtOutputDTOBase : IFunctionOutputDTO { [Parameter("bytes", "", 1)] public virtual byte[] ReturnValue1 { get; set; } @@ -617,7 +603,7 @@ public class GetStorageAtOutputDTOBase : IFunctionOutputDTO public partial class GetThresholdOutputDTO : GetThresholdOutputDTOBase { } [FunctionOutput] - public class GetThresholdOutputDTOBase : IFunctionOutputDTO + public class GetThresholdOutputDTOBase : IFunctionOutputDTO { [Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; } @@ -626,7 +612,7 @@ public class GetThresholdOutputDTOBase : IFunctionOutputDTO public partial class GetTransactionHashOutputDTO : GetTransactionHashOutputDTOBase { } [FunctionOutput] - public class GetTransactionHashOutputDTOBase : IFunctionOutputDTO + public class GetTransactionHashOutputDTOBase : IFunctionOutputDTO { [Parameter("bytes32", "", 1)] public virtual byte[] ReturnValue1 { get; set; } @@ -635,7 +621,7 @@ public class GetTransactionHashOutputDTOBase : IFunctionOutputDTO public partial class IsModuleEnabledOutputDTO : IsModuleEnabledOutputDTOBase { } [FunctionOutput] - public class IsModuleEnabledOutputDTOBase : IFunctionOutputDTO + public class IsModuleEnabledOutputDTOBase : IFunctionOutputDTO { [Parameter("bool", "", 1)] public virtual bool ReturnValue1 { get; set; } @@ -644,7 +630,7 @@ public class IsModuleEnabledOutputDTOBase : IFunctionOutputDTO public partial class IsOwnerOutputDTO : IsOwnerOutputDTOBase { } [FunctionOutput] - public class IsOwnerOutputDTOBase : IFunctionOutputDTO + public class IsOwnerOutputDTOBase : IFunctionOutputDTO { [Parameter("bool", "", 1)] public virtual bool ReturnValue1 { get; set; } @@ -653,7 +639,7 @@ public class IsOwnerOutputDTOBase : IFunctionOutputDTO public partial class NonceOutputDTO : NonceOutputDTOBase { } [FunctionOutput] - public class NonceOutputDTOBase : IFunctionOutputDTO + public class NonceOutputDTOBase : IFunctionOutputDTO { [Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; } @@ -661,24 +647,14 @@ public class NonceOutputDTOBase : IFunctionOutputDTO - - - - - - - - public partial class SignedMessagesOutputDTO : SignedMessagesOutputDTOBase { } [FunctionOutput] - public class SignedMessagesOutputDTOBase : IFunctionOutputDTO + public class SignedMessagesOutputDTOBase : IFunctionOutputDTO { [Parameter("uint256", "", 1)] public virtual BigInteger ReturnValue1 { get; set; } } - - } diff --git a/src/Nethereum.GnosisSafe/ExtendedGnosisSafeService.cs b/src/Nethereum.GnosisSafe/ExtendedGnosisSafeService.cs index b47f042ce..cd5532415 100644 --- a/src/Nethereum.GnosisSafe/ExtendedGnosisSafeService.cs +++ b/src/Nethereum.GnosisSafe/ExtendedGnosisSafeService.cs @@ -14,11 +14,12 @@ using Nethereum.Signer; using Nethereum.Signer.EIP712; using Nethereum.RLP; +using Nethereum.Web3; namespace Nethereum.GnosisSafe { - public partial class GnosisSafeService + public partial class GnosisSafeService:ContractWeb3ServiceBase { public class SafeSignature { @@ -26,16 +27,6 @@ public class SafeSignature public string Signature { get; set; } } - public Task VersionQueryAsync(VERSIONFunction versionFunction, BlockParameter blockParameter = null) - { - return ContractHandler.QueryAsync(versionFunction, blockParameter); - } - - public Task VersionQueryAsync(BlockParameter blockParameter = null) - { - return ContractHandler.QueryAsync(null, blockParameter); - } - public async Task BuildTransactionAsync( EncodeTransactionDataFunction transactionData, BigInteger chainId, diff --git a/src/Nethereum.GnosisSafe/GnosisSafeService.cs b/src/Nethereum.GnosisSafe/GnosisSafeService.cs index 2913d4be6..90415e134 100644 --- a/src/Nethereum.GnosisSafe/GnosisSafeService.cs +++ b/src/Nethereum.GnosisSafe/GnosisSafeService.cs @@ -5,76 +5,81 @@ using Nethereum.Contracts.ContractHandlers; using System.Threading; using Nethereum.GnosisSafe.ContractDefinition; +using System; +using Nethereum.Web3; namespace Nethereum.GnosisSafe { - public partial class GnosisSafeService + public partial class GnosisSafeService : ContractWeb3ServiceBase { - protected Nethereum.Web3.Web3 Web3{ get; } - - public ContractHandler ContractHandler { get; } + public GnosisSafeService(Nethereum.Web3.IWeb3 web3, string contractAddress) : base(web3, contractAddress) + { + } - public GnosisSafeService(Nethereum.Web3.Web3 web3, string contractAddress) + public Task VersionQueryAsync(VersionFunction versionFunction, BlockParameter blockParameter = null) { - Web3 = web3; - ContractHandler = web3.Eth.GetContractHandler(contractAddress); + return ContractHandler.QueryAsync(versionFunction, blockParameter); } - + + public Task VersionQueryAsync(BlockParameter blockParameter = null) + { + return ContractHandler.QueryAsync(null, blockParameter); + } public Task AddOwnerWithThresholdRequestAsync(AddOwnerWithThresholdFunction addOwnerWithThresholdFunction) { - return ContractHandler.SendRequestAsync(addOwnerWithThresholdFunction); + return ContractHandler.SendRequestAsync(addOwnerWithThresholdFunction); } public Task AddOwnerWithThresholdRequestAndWaitForReceiptAsync(AddOwnerWithThresholdFunction addOwnerWithThresholdFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(addOwnerWithThresholdFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(addOwnerWithThresholdFunction, cancellationToken); } public Task AddOwnerWithThresholdRequestAsync(string owner, BigInteger threshold) { var addOwnerWithThresholdFunction = new AddOwnerWithThresholdFunction(); - addOwnerWithThresholdFunction.Owner = owner; - addOwnerWithThresholdFunction.Threshold = threshold; - - return ContractHandler.SendRequestAsync(addOwnerWithThresholdFunction); + addOwnerWithThresholdFunction.Owner = owner; + addOwnerWithThresholdFunction.Threshold = threshold; + + return ContractHandler.SendRequestAsync(addOwnerWithThresholdFunction); } public Task AddOwnerWithThresholdRequestAndWaitForReceiptAsync(string owner, BigInteger threshold, CancellationTokenSource cancellationToken = null) { var addOwnerWithThresholdFunction = new AddOwnerWithThresholdFunction(); - addOwnerWithThresholdFunction.Owner = owner; - addOwnerWithThresholdFunction.Threshold = threshold; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(addOwnerWithThresholdFunction, cancellationToken); + addOwnerWithThresholdFunction.Owner = owner; + addOwnerWithThresholdFunction.Threshold = threshold; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(addOwnerWithThresholdFunction, cancellationToken); } public Task ApproveHashRequestAsync(ApproveHashFunction approveHashFunction) { - return ContractHandler.SendRequestAsync(approveHashFunction); + return ContractHandler.SendRequestAsync(approveHashFunction); } public Task ApproveHashRequestAndWaitForReceiptAsync(ApproveHashFunction approveHashFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(approveHashFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(approveHashFunction, cancellationToken); } public Task ApproveHashRequestAsync(byte[] hashToApprove) { var approveHashFunction = new ApproveHashFunction(); - approveHashFunction.HashToApprove = hashToApprove; - - return ContractHandler.SendRequestAsync(approveHashFunction); + approveHashFunction.HashToApprove = hashToApprove; + + return ContractHandler.SendRequestAsync(approveHashFunction); } public Task ApproveHashRequestAndWaitForReceiptAsync(byte[] hashToApprove, CancellationTokenSource cancellationToken = null) { var approveHashFunction = new ApproveHashFunction(); - approveHashFunction.HashToApprove = hashToApprove; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(approveHashFunction, cancellationToken); + approveHashFunction.HashToApprove = hashToApprove; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(approveHashFunction, cancellationToken); } public Task ApprovedHashesQueryAsync(ApprovedHashesFunction approvedHashesFunction, BlockParameter blockParameter = null) @@ -82,68 +87,68 @@ public Task ApprovedHashesQueryAsync(ApprovedHashesFunction approved return ContractHandler.QueryAsync(approvedHashesFunction, blockParameter); } - + public Task ApprovedHashesQueryAsync(string returnValue1, byte[] returnValue2, BlockParameter blockParameter = null) { var approvedHashesFunction = new ApprovedHashesFunction(); - approvedHashesFunction.ReturnValue1 = returnValue1; - approvedHashesFunction.ReturnValue2 = returnValue2; - + approvedHashesFunction.ReturnValue1 = returnValue1; + approvedHashesFunction.ReturnValue2 = returnValue2; + return ContractHandler.QueryAsync(approvedHashesFunction, blockParameter); } public Task ChangeThresholdRequestAsync(ChangeThresholdFunction changeThresholdFunction) { - return ContractHandler.SendRequestAsync(changeThresholdFunction); + return ContractHandler.SendRequestAsync(changeThresholdFunction); } public Task ChangeThresholdRequestAndWaitForReceiptAsync(ChangeThresholdFunction changeThresholdFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(changeThresholdFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(changeThresholdFunction, cancellationToken); } public Task ChangeThresholdRequestAsync(BigInteger threshold) { var changeThresholdFunction = new ChangeThresholdFunction(); - changeThresholdFunction.Threshold = threshold; - - return ContractHandler.SendRequestAsync(changeThresholdFunction); + changeThresholdFunction.Threshold = threshold; + + return ContractHandler.SendRequestAsync(changeThresholdFunction); } public Task ChangeThresholdRequestAndWaitForReceiptAsync(BigInteger threshold, CancellationTokenSource cancellationToken = null) { var changeThresholdFunction = new ChangeThresholdFunction(); - changeThresholdFunction.Threshold = threshold; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(changeThresholdFunction, cancellationToken); + changeThresholdFunction.Threshold = threshold; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(changeThresholdFunction, cancellationToken); } public Task DisableModuleRequestAsync(DisableModuleFunction disableModuleFunction) { - return ContractHandler.SendRequestAsync(disableModuleFunction); + return ContractHandler.SendRequestAsync(disableModuleFunction); } public Task DisableModuleRequestAndWaitForReceiptAsync(DisableModuleFunction disableModuleFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(disableModuleFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(disableModuleFunction, cancellationToken); } public Task DisableModuleRequestAsync(string prevModule, string module) { var disableModuleFunction = new DisableModuleFunction(); - disableModuleFunction.PrevModule = prevModule; - disableModuleFunction.Module = module; - - return ContractHandler.SendRequestAsync(disableModuleFunction); + disableModuleFunction.PrevModule = prevModule; + disableModuleFunction.Module = module; + + return ContractHandler.SendRequestAsync(disableModuleFunction); } public Task DisableModuleRequestAndWaitForReceiptAsync(string prevModule, string module, CancellationTokenSource cancellationToken = null) { var disableModuleFunction = new DisableModuleFunction(); - disableModuleFunction.PrevModule = prevModule; - disableModuleFunction.Module = module; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(disableModuleFunction, cancellationToken); + disableModuleFunction.PrevModule = prevModule; + disableModuleFunction.Module = module; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(disableModuleFunction, cancellationToken); } public Task DomainSeparatorQueryAsync(DomainSeparatorFunction domainSeparatorFunction, BlockParameter blockParameter = null) @@ -151,7 +156,7 @@ public Task DomainSeparatorQueryAsync(DomainSeparatorFunction domainSepa return ContractHandler.QueryAsync(domainSeparatorFunction, blockParameter); } - + public Task DomainSeparatorQueryAsync(BlockParameter blockParameter = null) { return ContractHandler.QueryAsync(null, blockParameter); @@ -159,28 +164,28 @@ public Task DomainSeparatorQueryAsync(BlockParameter blockParameter = nu public Task EnableModuleRequestAsync(EnableModuleFunction enableModuleFunction) { - return ContractHandler.SendRequestAsync(enableModuleFunction); + return ContractHandler.SendRequestAsync(enableModuleFunction); } public Task EnableModuleRequestAndWaitForReceiptAsync(EnableModuleFunction enableModuleFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(enableModuleFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(enableModuleFunction, cancellationToken); } public Task EnableModuleRequestAsync(string module) { var enableModuleFunction = new EnableModuleFunction(); - enableModuleFunction.Module = module; - - return ContractHandler.SendRequestAsync(enableModuleFunction); + enableModuleFunction.Module = module; + + return ContractHandler.SendRequestAsync(enableModuleFunction); } public Task EnableModuleRequestAndWaitForReceiptAsync(string module, CancellationTokenSource cancellationToken = null) { var enableModuleFunction = new EnableModuleFunction(); - enableModuleFunction.Module = module; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(enableModuleFunction, cancellationToken); + enableModuleFunction.Module = module; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(enableModuleFunction, cancellationToken); } public Task EncodeTransactionDataQueryAsync(EncodeTransactionDataFunction encodeTransactionDataFunction, BlockParameter blockParameter = null) @@ -188,130 +193,130 @@ public Task EncodeTransactionDataQueryAsync(EncodeTransactionDataFunctio return ContractHandler.QueryAsync(encodeTransactionDataFunction, blockParameter); } - + public Task EncodeTransactionDataQueryAsync(string to, BigInteger value, byte[] data, byte operation, BigInteger safeTxGas, BigInteger baseGas, BigInteger gasPrice, string gasToken, string refundReceiver, BigInteger nonce, BlockParameter blockParameter = null) { var encodeTransactionDataFunction = new EncodeTransactionDataFunction(); - encodeTransactionDataFunction.To = to; - encodeTransactionDataFunction.Value = value; - encodeTransactionDataFunction.Data = data; - encodeTransactionDataFunction.Operation = operation; - encodeTransactionDataFunction.SafeTxGas = safeTxGas; - encodeTransactionDataFunction.BaseGas = baseGas; - encodeTransactionDataFunction.GasPrice = gasPrice; - encodeTransactionDataFunction.GasToken = gasToken; - encodeTransactionDataFunction.RefundReceiver = refundReceiver; - encodeTransactionDataFunction.Nonce = nonce; - + encodeTransactionDataFunction.To = to; + encodeTransactionDataFunction.Value = value; + encodeTransactionDataFunction.Data = data; + encodeTransactionDataFunction.Operation = operation; + encodeTransactionDataFunction.SafeTxGas = safeTxGas; + encodeTransactionDataFunction.BaseGas = baseGas; + encodeTransactionDataFunction.SafeGasPrice = gasPrice; + encodeTransactionDataFunction.GasToken = gasToken; + encodeTransactionDataFunction.RefundReceiver = refundReceiver; + encodeTransactionDataFunction.SafeNonce = nonce; + return ContractHandler.QueryAsync(encodeTransactionDataFunction, blockParameter); } public Task ExecTransactionRequestAsync(ExecTransactionFunction execTransactionFunction) { - return ContractHandler.SendRequestAsync(execTransactionFunction); + return ContractHandler.SendRequestAsync(execTransactionFunction); } public Task ExecTransactionRequestAndWaitForReceiptAsync(ExecTransactionFunction execTransactionFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFunction, cancellationToken); } public Task ExecTransactionRequestAsync(string to, BigInteger value, byte[] data, byte operation, BigInteger safeTxGas, BigInteger baseGas, BigInteger gasPrice, string gasToken, string refundReceiver, byte[] signatures) { var execTransactionFunction = new ExecTransactionFunction(); - execTransactionFunction.To = to; - execTransactionFunction.Value = value; - execTransactionFunction.Data = data; - execTransactionFunction.Operation = operation; - execTransactionFunction.SafeTxGas = safeTxGas; - execTransactionFunction.BaseGas = baseGas; - execTransactionFunction.GasPrice = gasPrice; - execTransactionFunction.GasToken = gasToken; - execTransactionFunction.RefundReceiver = refundReceiver; - execTransactionFunction.Signatures = signatures; - - return ContractHandler.SendRequestAsync(execTransactionFunction); + execTransactionFunction.To = to; + execTransactionFunction.Value = value; + execTransactionFunction.Data = data; + execTransactionFunction.Operation = operation; + execTransactionFunction.SafeTxGas = safeTxGas; + execTransactionFunction.BaseGas = baseGas; + execTransactionFunction.SafeGasPrice = gasPrice; + execTransactionFunction.GasToken = gasToken; + execTransactionFunction.RefundReceiver = refundReceiver; + execTransactionFunction.Signatures = signatures; + + return ContractHandler.SendRequestAsync(execTransactionFunction); } public Task ExecTransactionRequestAndWaitForReceiptAsync(string to, BigInteger value, byte[] data, byte operation, BigInteger safeTxGas, BigInteger baseGas, BigInteger gasPrice, string gasToken, string refundReceiver, byte[] signatures, CancellationTokenSource cancellationToken = null) { var execTransactionFunction = new ExecTransactionFunction(); - execTransactionFunction.To = to; - execTransactionFunction.Value = value; - execTransactionFunction.Data = data; - execTransactionFunction.Operation = operation; - execTransactionFunction.SafeTxGas = safeTxGas; - execTransactionFunction.BaseGas = baseGas; - execTransactionFunction.GasPrice = gasPrice; - execTransactionFunction.GasToken = gasToken; - execTransactionFunction.RefundReceiver = refundReceiver; - execTransactionFunction.Signatures = signatures; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFunction, cancellationToken); + execTransactionFunction.To = to; + execTransactionFunction.Value = value; + execTransactionFunction.Data = data; + execTransactionFunction.Operation = operation; + execTransactionFunction.SafeTxGas = safeTxGas; + execTransactionFunction.BaseGas = baseGas; + execTransactionFunction.SafeGasPrice = gasPrice; + execTransactionFunction.GasToken = gasToken; + execTransactionFunction.RefundReceiver = refundReceiver; + execTransactionFunction.Signatures = signatures; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFunction, cancellationToken); } public Task ExecTransactionFromModuleRequestAsync(ExecTransactionFromModuleFunction execTransactionFromModuleFunction) { - return ContractHandler.SendRequestAsync(execTransactionFromModuleFunction); + return ContractHandler.SendRequestAsync(execTransactionFromModuleFunction); } public Task ExecTransactionFromModuleRequestAndWaitForReceiptAsync(ExecTransactionFromModuleFunction execTransactionFromModuleFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleFunction, cancellationToken); } public Task ExecTransactionFromModuleRequestAsync(string to, BigInteger value, byte[] data, byte operation) { var execTransactionFromModuleFunction = new ExecTransactionFromModuleFunction(); - execTransactionFromModuleFunction.To = to; - execTransactionFromModuleFunction.Value = value; - execTransactionFromModuleFunction.Data = data; - execTransactionFromModuleFunction.Operation = operation; - - return ContractHandler.SendRequestAsync(execTransactionFromModuleFunction); + execTransactionFromModuleFunction.To = to; + execTransactionFromModuleFunction.Value = value; + execTransactionFromModuleFunction.Data = data; + execTransactionFromModuleFunction.Operation = operation; + + return ContractHandler.SendRequestAsync(execTransactionFromModuleFunction); } public Task ExecTransactionFromModuleRequestAndWaitForReceiptAsync(string to, BigInteger value, byte[] data, byte operation, CancellationTokenSource cancellationToken = null) { var execTransactionFromModuleFunction = new ExecTransactionFromModuleFunction(); - execTransactionFromModuleFunction.To = to; - execTransactionFromModuleFunction.Value = value; - execTransactionFromModuleFunction.Data = data; - execTransactionFromModuleFunction.Operation = operation; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleFunction, cancellationToken); + execTransactionFromModuleFunction.To = to; + execTransactionFromModuleFunction.Value = value; + execTransactionFromModuleFunction.Data = data; + execTransactionFromModuleFunction.Operation = operation; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleFunction, cancellationToken); } public Task ExecTransactionFromModuleReturnDataRequestAsync(ExecTransactionFromModuleReturnDataFunction execTransactionFromModuleReturnDataFunction) { - return ContractHandler.SendRequestAsync(execTransactionFromModuleReturnDataFunction); + return ContractHandler.SendRequestAsync(execTransactionFromModuleReturnDataFunction); } public Task ExecTransactionFromModuleReturnDataRequestAndWaitForReceiptAsync(ExecTransactionFromModuleReturnDataFunction execTransactionFromModuleReturnDataFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleReturnDataFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleReturnDataFunction, cancellationToken); } public Task ExecTransactionFromModuleReturnDataRequestAsync(string to, BigInteger value, byte[] data, byte operation) { var execTransactionFromModuleReturnDataFunction = new ExecTransactionFromModuleReturnDataFunction(); - execTransactionFromModuleReturnDataFunction.To = to; - execTransactionFromModuleReturnDataFunction.Value = value; - execTransactionFromModuleReturnDataFunction.Data = data; - execTransactionFromModuleReturnDataFunction.Operation = operation; - - return ContractHandler.SendRequestAsync(execTransactionFromModuleReturnDataFunction); + execTransactionFromModuleReturnDataFunction.To = to; + execTransactionFromModuleReturnDataFunction.Value = value; + execTransactionFromModuleReturnDataFunction.Data = data; + execTransactionFromModuleReturnDataFunction.Operation = operation; + + return ContractHandler.SendRequestAsync(execTransactionFromModuleReturnDataFunction); } public Task ExecTransactionFromModuleReturnDataRequestAndWaitForReceiptAsync(string to, BigInteger value, byte[] data, byte operation, CancellationTokenSource cancellationToken = null) { var execTransactionFromModuleReturnDataFunction = new ExecTransactionFromModuleReturnDataFunction(); - execTransactionFromModuleReturnDataFunction.To = to; - execTransactionFromModuleReturnDataFunction.Value = value; - execTransactionFromModuleReturnDataFunction.Data = data; - execTransactionFromModuleReturnDataFunction.Operation = operation; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleReturnDataFunction, cancellationToken); + execTransactionFromModuleReturnDataFunction.To = to; + execTransactionFromModuleReturnDataFunction.Value = value; + execTransactionFromModuleReturnDataFunction.Data = data; + execTransactionFromModuleReturnDataFunction.Operation = operation; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(execTransactionFromModuleReturnDataFunction, cancellationToken); } public Task GetChainIdQueryAsync(GetChainIdFunction getChainIdFunction, BlockParameter blockParameter = null) @@ -319,7 +324,7 @@ public Task GetChainIdQueryAsync(GetChainIdFunction getChainIdFuncti return ContractHandler.QueryAsync(getChainIdFunction, blockParameter); } - + public Task GetChainIdQueryAsync(BlockParameter blockParameter = null) { return ContractHandler.QueryAsync(null, blockParameter); @@ -333,9 +338,9 @@ public Task GetModulesPaginatedQueryAsync(GetModul public Task GetModulesPaginatedQueryAsync(string start, BigInteger pageSize, BlockParameter blockParameter = null) { var getModulesPaginatedFunction = new GetModulesPaginatedFunction(); - getModulesPaginatedFunction.Start = start; - getModulesPaginatedFunction.PageSize = pageSize; - + getModulesPaginatedFunction.Start = start; + getModulesPaginatedFunction.PageSize = pageSize; + return ContractHandler.QueryDeserializingToObjectAsync(getModulesPaginatedFunction, blockParameter); } @@ -344,7 +349,7 @@ public Task> GetOwnersQueryAsync(GetOwnersFunction getOwnersFunctio return ContractHandler.QueryAsync>(getOwnersFunction, blockParameter); } - + public Task> GetOwnersQueryAsync(BlockParameter blockParameter = null) { return ContractHandler.QueryAsync>(null, blockParameter); @@ -355,13 +360,13 @@ public Task GetStorageAtQueryAsync(GetStorageAtFunction getStorageAtFunc return ContractHandler.QueryAsync(getStorageAtFunction, blockParameter); } - + public Task GetStorageAtQueryAsync(BigInteger offset, BigInteger length, BlockParameter blockParameter = null) { var getStorageAtFunction = new GetStorageAtFunction(); - getStorageAtFunction.Offset = offset; - getStorageAtFunction.Length = length; - + getStorageAtFunction.Offset = offset; + getStorageAtFunction.Length = length; + return ContractHandler.QueryAsync(getStorageAtFunction, blockParameter); } @@ -370,7 +375,7 @@ public Task GetThresholdQueryAsync(GetThresholdFunction getThreshold return ContractHandler.QueryAsync(getThresholdFunction, blockParameter); } - + public Task GetThresholdQueryAsync(BlockParameter blockParameter = null) { return ContractHandler.QueryAsync(null, blockParameter); @@ -381,21 +386,21 @@ public Task GetTransactionHashQueryAsync(GetTransactionHashFunction getT return ContractHandler.QueryAsync(getTransactionHashFunction, blockParameter); } - + public Task GetTransactionHashQueryAsync(string to, BigInteger value, byte[] data, byte operation, BigInteger safeTxGas, BigInteger baseGas, BigInteger gasPrice, string gasToken, string refundReceiver, BigInteger nonce, BlockParameter blockParameter = null) { var getTransactionHashFunction = new GetTransactionHashFunction(); - getTransactionHashFunction.To = to; - getTransactionHashFunction.Value = value; - getTransactionHashFunction.Data = data; - getTransactionHashFunction.Operation = operation; - getTransactionHashFunction.SafeTxGas = safeTxGas; - getTransactionHashFunction.BaseGas = baseGas; - getTransactionHashFunction.GasPrice = gasPrice; - getTransactionHashFunction.GasToken = gasToken; - getTransactionHashFunction.RefundReceiver = refundReceiver; - getTransactionHashFunction.Nonce = nonce; - + getTransactionHashFunction.To = to; + getTransactionHashFunction.Value = value; + getTransactionHashFunction.Data = data; + getTransactionHashFunction.Operation = operation; + getTransactionHashFunction.SafeTxGas = safeTxGas; + getTransactionHashFunction.BaseGas = baseGas; + getTransactionHashFunction.SafeGasPrice = gasPrice; + getTransactionHashFunction.GasToken = gasToken; + getTransactionHashFunction.RefundReceiver = refundReceiver; + getTransactionHashFunction.SafeNonce = nonce; + return ContractHandler.QueryAsync(getTransactionHashFunction, blockParameter); } @@ -404,12 +409,12 @@ public Task IsModuleEnabledQueryAsync(IsModuleEnabledFunction isModuleEnab return ContractHandler.QueryAsync(isModuleEnabledFunction, blockParameter); } - + public Task IsModuleEnabledQueryAsync(string module, BlockParameter blockParameter = null) { var isModuleEnabledFunction = new IsModuleEnabledFunction(); - isModuleEnabledFunction.Module = module; - + isModuleEnabledFunction.Module = module; + return ContractHandler.QueryAsync(isModuleEnabledFunction, blockParameter); } @@ -418,12 +423,12 @@ public Task IsOwnerQueryAsync(IsOwnerFunction isOwnerFunction, BlockParame return ContractHandler.QueryAsync(isOwnerFunction, blockParameter); } - + public Task IsOwnerQueryAsync(string owner, BlockParameter blockParameter = null) { var isOwnerFunction = new IsOwnerFunction(); - isOwnerFunction.Owner = owner; - + isOwnerFunction.Owner = owner; + return ContractHandler.QueryAsync(isOwnerFunction, blockParameter); } @@ -432,7 +437,7 @@ public Task NonceQueryAsync(NonceFunction nonceFunction, BlockParame return ContractHandler.QueryAsync(nonceFunction, blockParameter); } - + public Task NonceQueryAsync(BlockParameter blockParameter = null) { return ContractHandler.QueryAsync(null, blockParameter); @@ -440,156 +445,156 @@ public Task NonceQueryAsync(BlockParameter blockParameter = null) public Task RemoveOwnerRequestAsync(RemoveOwnerFunction removeOwnerFunction) { - return ContractHandler.SendRequestAsync(removeOwnerFunction); + return ContractHandler.SendRequestAsync(removeOwnerFunction); } public Task RemoveOwnerRequestAndWaitForReceiptAsync(RemoveOwnerFunction removeOwnerFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(removeOwnerFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(removeOwnerFunction, cancellationToken); } public Task RemoveOwnerRequestAsync(string prevOwner, string owner, BigInteger threshold) { var removeOwnerFunction = new RemoveOwnerFunction(); - removeOwnerFunction.PrevOwner = prevOwner; - removeOwnerFunction.Owner = owner; - removeOwnerFunction.Threshold = threshold; - - return ContractHandler.SendRequestAsync(removeOwnerFunction); + removeOwnerFunction.PrevOwner = prevOwner; + removeOwnerFunction.Owner = owner; + removeOwnerFunction.Threshold = threshold; + + return ContractHandler.SendRequestAsync(removeOwnerFunction); } public Task RemoveOwnerRequestAndWaitForReceiptAsync(string prevOwner, string owner, BigInteger threshold, CancellationTokenSource cancellationToken = null) { var removeOwnerFunction = new RemoveOwnerFunction(); - removeOwnerFunction.PrevOwner = prevOwner; - removeOwnerFunction.Owner = owner; - removeOwnerFunction.Threshold = threshold; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(removeOwnerFunction, cancellationToken); + removeOwnerFunction.PrevOwner = prevOwner; + removeOwnerFunction.Owner = owner; + removeOwnerFunction.Threshold = threshold; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(removeOwnerFunction, cancellationToken); } public Task RequiredTxGasRequestAsync(RequiredTxGasFunction requiredTxGasFunction) { - return ContractHandler.SendRequestAsync(requiredTxGasFunction); + return ContractHandler.SendRequestAsync(requiredTxGasFunction); } public Task RequiredTxGasRequestAndWaitForReceiptAsync(RequiredTxGasFunction requiredTxGasFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(requiredTxGasFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(requiredTxGasFunction, cancellationToken); } public Task RequiredTxGasRequestAsync(string to, BigInteger value, byte[] data, byte operation) { var requiredTxGasFunction = new RequiredTxGasFunction(); - requiredTxGasFunction.To = to; - requiredTxGasFunction.Value = value; - requiredTxGasFunction.Data = data; - requiredTxGasFunction.Operation = operation; - - return ContractHandler.SendRequestAsync(requiredTxGasFunction); + requiredTxGasFunction.To = to; + requiredTxGasFunction.Value = value; + requiredTxGasFunction.Data = data; + requiredTxGasFunction.Operation = operation; + + return ContractHandler.SendRequestAsync(requiredTxGasFunction); } public Task RequiredTxGasRequestAndWaitForReceiptAsync(string to, BigInteger value, byte[] data, byte operation, CancellationTokenSource cancellationToken = null) { var requiredTxGasFunction = new RequiredTxGasFunction(); - requiredTxGasFunction.To = to; - requiredTxGasFunction.Value = value; - requiredTxGasFunction.Data = data; - requiredTxGasFunction.Operation = operation; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(requiredTxGasFunction, cancellationToken); + requiredTxGasFunction.To = to; + requiredTxGasFunction.Value = value; + requiredTxGasFunction.Data = data; + requiredTxGasFunction.Operation = operation; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(requiredTxGasFunction, cancellationToken); } public Task SetFallbackHandlerRequestAsync(SetFallbackHandlerFunction setFallbackHandlerFunction) { - return ContractHandler.SendRequestAsync(setFallbackHandlerFunction); + return ContractHandler.SendRequestAsync(setFallbackHandlerFunction); } public Task SetFallbackHandlerRequestAndWaitForReceiptAsync(SetFallbackHandlerFunction setFallbackHandlerFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(setFallbackHandlerFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(setFallbackHandlerFunction, cancellationToken); } public Task SetFallbackHandlerRequestAsync(string handler) { var setFallbackHandlerFunction = new SetFallbackHandlerFunction(); - setFallbackHandlerFunction.Handler = handler; - - return ContractHandler.SendRequestAsync(setFallbackHandlerFunction); + setFallbackHandlerFunction.Handler = handler; + + return ContractHandler.SendRequestAsync(setFallbackHandlerFunction); } public Task SetFallbackHandlerRequestAndWaitForReceiptAsync(string handler, CancellationTokenSource cancellationToken = null) { var setFallbackHandlerFunction = new SetFallbackHandlerFunction(); - setFallbackHandlerFunction.Handler = handler; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(setFallbackHandlerFunction, cancellationToken); + setFallbackHandlerFunction.Handler = handler; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(setFallbackHandlerFunction, cancellationToken); } public Task SetGuardRequestAsync(SetGuardFunction setGuardFunction) { - return ContractHandler.SendRequestAsync(setGuardFunction); + return ContractHandler.SendRequestAsync(setGuardFunction); } public Task SetGuardRequestAndWaitForReceiptAsync(SetGuardFunction setGuardFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(setGuardFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(setGuardFunction, cancellationToken); } public Task SetGuardRequestAsync(string guard) { var setGuardFunction = new SetGuardFunction(); - setGuardFunction.Guard = guard; - - return ContractHandler.SendRequestAsync(setGuardFunction); + setGuardFunction.Guard = guard; + + return ContractHandler.SendRequestAsync(setGuardFunction); } public Task SetGuardRequestAndWaitForReceiptAsync(string guard, CancellationTokenSource cancellationToken = null) { var setGuardFunction = new SetGuardFunction(); - setGuardFunction.Guard = guard; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(setGuardFunction, cancellationToken); + setGuardFunction.Guard = guard; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(setGuardFunction, cancellationToken); } public Task SetupRequestAsync(SetupFunction setupFunction) { - return ContractHandler.SendRequestAsync(setupFunction); + return ContractHandler.SendRequestAsync(setupFunction); } public Task SetupRequestAndWaitForReceiptAsync(SetupFunction setupFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(setupFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(setupFunction, cancellationToken); } public Task SetupRequestAsync(List owners, BigInteger threshold, string to, byte[] data, string fallbackHandler, string paymentToken, BigInteger payment, string paymentReceiver) { var setupFunction = new SetupFunction(); - setupFunction.Owners = owners; - setupFunction.Threshold = threshold; - setupFunction.To = to; - setupFunction.Data = data; - setupFunction.FallbackHandler = fallbackHandler; - setupFunction.PaymentToken = paymentToken; - setupFunction.Payment = payment; - setupFunction.PaymentReceiver = paymentReceiver; - - return ContractHandler.SendRequestAsync(setupFunction); + setupFunction.Owners = owners; + setupFunction.Threshold = threshold; + setupFunction.To = to; + setupFunction.Data = data; + setupFunction.FallbackHandler = fallbackHandler; + setupFunction.PaymentToken = paymentToken; + setupFunction.Payment = payment; + setupFunction.PaymentReceiver = paymentReceiver; + + return ContractHandler.SendRequestAsync(setupFunction); } public Task SetupRequestAndWaitForReceiptAsync(List owners, BigInteger threshold, string to, byte[] data, string fallbackHandler, string paymentToken, BigInteger payment, string paymentReceiver, CancellationTokenSource cancellationToken = null) { var setupFunction = new SetupFunction(); - setupFunction.Owners = owners; - setupFunction.Threshold = threshold; - setupFunction.To = to; - setupFunction.Data = data; - setupFunction.FallbackHandler = fallbackHandler; - setupFunction.PaymentToken = paymentToken; - setupFunction.Payment = payment; - setupFunction.PaymentReceiver = paymentReceiver; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(setupFunction, cancellationToken); + setupFunction.Owners = owners; + setupFunction.Threshold = threshold; + setupFunction.To = to; + setupFunction.Data = data; + setupFunction.FallbackHandler = fallbackHandler; + setupFunction.PaymentToken = paymentToken; + setupFunction.Payment = payment; + setupFunction.PaymentReceiver = paymentReceiver; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(setupFunction, cancellationToken); } public Task SignedMessagesQueryAsync(SignedMessagesFunction signedMessagesFunction, BlockParameter blockParameter = null) @@ -597,71 +602,137 @@ public Task SignedMessagesQueryAsync(SignedMessagesFunction signedMe return ContractHandler.QueryAsync(signedMessagesFunction, blockParameter); } - + public Task SignedMessagesQueryAsync(byte[] returnValue1, BlockParameter blockParameter = null) { var signedMessagesFunction = new SignedMessagesFunction(); - signedMessagesFunction.ReturnValue1 = returnValue1; - + signedMessagesFunction.ReturnValue1 = returnValue1; + return ContractHandler.QueryAsync(signedMessagesFunction, blockParameter); } public Task SimulateAndRevertRequestAsync(SimulateAndRevertFunction simulateAndRevertFunction) { - return ContractHandler.SendRequestAsync(simulateAndRevertFunction); + return ContractHandler.SendRequestAsync(simulateAndRevertFunction); } public Task SimulateAndRevertRequestAndWaitForReceiptAsync(SimulateAndRevertFunction simulateAndRevertFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(simulateAndRevertFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(simulateAndRevertFunction, cancellationToken); } public Task SimulateAndRevertRequestAsync(string targetContract, byte[] calldataPayload) { var simulateAndRevertFunction = new SimulateAndRevertFunction(); - simulateAndRevertFunction.TargetContract = targetContract; - simulateAndRevertFunction.CalldataPayload = calldataPayload; - - return ContractHandler.SendRequestAsync(simulateAndRevertFunction); + simulateAndRevertFunction.TargetContract = targetContract; + simulateAndRevertFunction.CalldataPayload = calldataPayload; + + return ContractHandler.SendRequestAsync(simulateAndRevertFunction); } public Task SimulateAndRevertRequestAndWaitForReceiptAsync(string targetContract, byte[] calldataPayload, CancellationTokenSource cancellationToken = null) { var simulateAndRevertFunction = new SimulateAndRevertFunction(); - simulateAndRevertFunction.TargetContract = targetContract; - simulateAndRevertFunction.CalldataPayload = calldataPayload; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(simulateAndRevertFunction, cancellationToken); + simulateAndRevertFunction.TargetContract = targetContract; + simulateAndRevertFunction.CalldataPayload = calldataPayload; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(simulateAndRevertFunction, cancellationToken); } public Task SwapOwnerRequestAsync(SwapOwnerFunction swapOwnerFunction) { - return ContractHandler.SendRequestAsync(swapOwnerFunction); + return ContractHandler.SendRequestAsync(swapOwnerFunction); } public Task SwapOwnerRequestAndWaitForReceiptAsync(SwapOwnerFunction swapOwnerFunction, CancellationTokenSource cancellationToken = null) { - return ContractHandler.SendRequestAndWaitForReceiptAsync(swapOwnerFunction, cancellationToken); + return ContractHandler.SendRequestAndWaitForReceiptAsync(swapOwnerFunction, cancellationToken); } public Task SwapOwnerRequestAsync(string prevOwner, string oldOwner, string newOwner) { var swapOwnerFunction = new SwapOwnerFunction(); - swapOwnerFunction.PrevOwner = prevOwner; - swapOwnerFunction.OldOwner = oldOwner; - swapOwnerFunction.NewOwner = newOwner; - - return ContractHandler.SendRequestAsync(swapOwnerFunction); + swapOwnerFunction.PrevOwner = prevOwner; + swapOwnerFunction.OldOwner = oldOwner; + swapOwnerFunction.NewOwner = newOwner; + + return ContractHandler.SendRequestAsync(swapOwnerFunction); } public Task SwapOwnerRequestAndWaitForReceiptAsync(string prevOwner, string oldOwner, string newOwner, CancellationTokenSource cancellationToken = null) { var swapOwnerFunction = new SwapOwnerFunction(); - swapOwnerFunction.PrevOwner = prevOwner; - swapOwnerFunction.OldOwner = oldOwner; - swapOwnerFunction.NewOwner = newOwner; - - return ContractHandler.SendRequestAndWaitForReceiptAsync(swapOwnerFunction, cancellationToken); + swapOwnerFunction.PrevOwner = prevOwner; + swapOwnerFunction.OldOwner = oldOwner; + swapOwnerFunction.NewOwner = newOwner; + + return ContractHandler.SendRequestAndWaitForReceiptAsync(swapOwnerFunction, cancellationToken); + } + + public override List GetAllFunctionTypes() + { + return new List + { + typeof(VersionFunction), + typeof(AddOwnerWithThresholdFunction), + typeof(ApproveHashFunction), + typeof(ApprovedHashesFunction), + typeof(ChangeThresholdFunction), + typeof(DisableModuleFunction), + typeof(DomainSeparatorFunction), + typeof(EnableModuleFunction), + typeof(EncodeTransactionDataFunction), + typeof(ExecTransactionFunction), + typeof(ExecTransactionFromModuleFunction), + typeof(ExecTransactionFromModuleReturnDataFunction), + typeof(GetChainIdFunction), + typeof(GetModulesPaginatedFunction), + typeof(GetOwnersFunction), + typeof(GetStorageAtFunction), + typeof(GetThresholdFunction), + typeof(GetTransactionHashFunction), + typeof(IsModuleEnabledFunction), + typeof(IsOwnerFunction), + typeof(NonceFunction), + typeof(RemoveOwnerFunction), + typeof(RequiredTxGasFunction), + typeof(SetFallbackHandlerFunction), + typeof(SetGuardFunction), + typeof(SetupFunction), + typeof(SignedMessagesFunction), + typeof(SimulateAndRevertFunction), + typeof(SwapOwnerFunction) + }; + } + + public override List GetAllEventTypes() + { + return new List + { + typeof(AddedOwnerEventDTO), + typeof(ApproveHashEventDTO), + typeof(ChangedFallbackHandlerEventDTO), + typeof(ChangedGuardEventDTO), + typeof(ChangedThresholdEventDTO), + typeof(DisabledModuleEventDTO), + typeof(EnabledModuleEventDTO), + typeof(ExecutionFailureEventDTO), + typeof(ExecutionFromModuleFailureEventDTO), + typeof(ExecutionFromModuleSuccessEventDTO), + typeof(ExecutionSuccessEventDTO), + typeof(RemovedOwnerEventDTO), + typeof(SafeReceivedEventDTO), + typeof(SafeSetupEventDTO), + typeof(SignMsgEventDTO) + }; + } + + public override List GetAllErrorTypes() + { + return new List + { + + }; } } } diff --git a/src/Nethereum.GnosisSafe/SafeExecTransactionContractHandler.cs b/src/Nethereum.GnosisSafe/SafeExecTransactionContractHandler.cs new file mode 100644 index 000000000..1f3800b45 --- /dev/null +++ b/src/Nethereum.GnosisSafe/SafeExecTransactionContractHandler.cs @@ -0,0 +1,127 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Threading.Tasks; +using System.Threading; +using Nethereum.Contracts.ContractHandlers; +using Nethereum.Contracts.Services; +using Nethereum.Contracts; +using Nethereum.RPC.Eth.DTOs; +using Nethereum.Web3; +using System.Numerics; +using Nethereum.GnosisSafe.ContractDefinition; +using Nethereum.Model; +using Nethereum.Hex.HexTypes; + +namespace Nethereum.GnosisSafe +{ + + public static class SafeExecTransactionContractHandlerExtensions + { + public static void ChangeContractHandlerToSafeExecTransaction(this T service, string safeAddress, params string[] privateKeySigners) where T : ContractWeb3ServiceBase + { + service.ContractHandler = + SafeExecTransactionContractHandler.CreateFromExistingContractService(service, safeAddress, privateKeySigners); + } + } + + public class SafeExecTransactionContractHandler : ContractHandler + { + public static SafeExecTransactionContractHandler CreateFromExistingContractService(T service, string safeAddress, params string[] privateKeySigners) where T:ContractWeb3ServiceBase + { + var contractAddress = service.ContractAddress; + var ethApiContractService = service.Web3; + var handler = new SafeExecTransactionContractHandler(contractAddress, safeAddress, ethApiContractService, service.ContractHandler.AddressFrom, privateKeySigners); + return handler; + } + + public SafeExecTransactionContractHandler(string contractAddress, string safeAddress, IWeb3 web3, string addressFrom, params string[] privateKeySigners) : base(contractAddress, web3.Eth) + { + this.AddressFrom = addressFrom; + this._privateKeySigners = privateKeySigners; + SafeService = new GnosisSafeService(web3, safeAddress); + } + + private string[] _privateKeySigners; + public GnosisSafeService SafeService { get; protected set; } + +#if !DOTNET35 + + private BigInteger? _chainId; + private async Task GetChainIdAsync() + { + if(_chainId == null) + { + if(EthApiContractService.TransactionManager.ChainId == null) + { + _chainId = await EthApiContractService.ChainId.SendRequestAsync(); + } + else + { + _chainId = EthApiContractService.TransactionManager.ChainId; + } + } + return _chainId; + } + + public override async Task SendRequestAndWaitForReceiptAsync( + TEthereumContractFunctionMessage transactionMessage = null, CancellationTokenSource tokenSource = null) + { + + if (transactionMessage == null) transactionMessage = new TEthereumContractFunctionMessage(); + var execTransactionFunction = await CreateExecTransactionFunction(transactionMessage); + + return await SafeService.ExecTransactionRequestAndWaitForReceiptAsync(execTransactionFunction); + } + + + + public override async Task SendRequestAndWaitForReceiptAsync( + TEthereumContractFunctionMessage transactionMessage, CancellationToken cancellationToken) + + { + if (transactionMessage == null) transactionMessage = new TEthereumContractFunctionMessage(); + var execTransactionFunction = await CreateExecTransactionFunction(transactionMessage); + + return await SafeService.ExecTransactionRequestAndWaitForReceiptAsync(execTransactionFunction); + } + + private async Task CreateExecTransactionFunction(TEthereumContractFunctionMessage transactionMessage) where TEthereumContractFunctionMessage : FunctionMessage, new() + { + var chainId = await GetChainIdAsync(); + var execTransactionFunction = await SafeService.BuildTransactionAsync( + new EncodeTransactionDataFunction() { To = ContractAddress }, transactionMessage, (int)chainId, false, + _privateKeySigners); + return execTransactionFunction; + } + + public async override Task SendRequestAsync( + TEthereumContractFunctionMessage transactionMessage = null) + { + if (transactionMessage == null) transactionMessage = new TEthereumContractFunctionMessage(); + var execTransactionFunction = await CreateExecTransactionFunction(transactionMessage); + return await SafeService.ExecTransactionRequestAsync(execTransactionFunction); + } + + public override async Task SignTransactionAsync( + TEthereumContractFunctionMessage transactionMessage = null) + + { + if (transactionMessage == null) transactionMessage = new TEthereumContractFunctionMessage(); + var execTransactionFunction = await CreateExecTransactionFunction(transactionMessage); + return await SafeService.ContractHandler.SignTransactionAsync(execTransactionFunction); + } + + public override async Task EstimateGasAsync( + TEthereumContractFunctionMessage transactionMessage = null) + { + if (transactionMessage == null) transactionMessage = new TEthereumContractFunctionMessage(); + var execTransactionFunction = await CreateExecTransactionFunction(transactionMessage); + return await SafeService.ContractHandler.EstimateGasAsync(execTransactionFunction); + } +#endif + + } + + +} diff --git a/src/Nethereum.GnosisSafe/abi/GnosisSafe.abi b/src/Nethereum.GnosisSafe/abi/GnosisSafe.abi index 43da3424a..1482fc2cc 100644 --- a/src/Nethereum.GnosisSafe/abi/GnosisSafe.abi +++ b/src/Nethereum.GnosisSafe/abi/GnosisSafe.abi @@ -1,1033 +1,1033 @@ - [ - { - "inputs": [], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "AddedOwner", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "approvedHash", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "ApproveHash", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "handler", - "type": "address" - } - ], - "name": "ChangedFallbackHandler", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "guard", - "type": "address" - } - ], - "name": "ChangedGuard", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - } - ], - "name": "ChangedThreshold", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "DisabledModule", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "EnabledModule", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "payment", - "type": "uint256" - } - ], - "name": "ExecutionFailure", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "ExecutionFromModuleFailure", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "ExecutionFromModuleSuccess", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "payment", - "type": "uint256" - } - ], - "name": "ExecutionSuccess", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "RemovedOwner", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "SafeReceived", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "initiator", - "type": "address" - }, - { - "indexed": false, - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "initializer", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "fallbackHandler", - "type": "address" - } - ], - "name": "SafeSetup", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "msgHash", - "type": "bytes32" - } - ], - "name": "SignMsg", - "type": "event" - }, - { - "stateMutability": "nonpayable", - "type": "fallback" - }, - { - "inputs": [], - "name": "VERSION", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_threshold", - "type": "uint256" - } - ], - "name": "addOwnerWithThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "hashToApprove", - "type": "bytes32" - } - ], - "name": "approveHash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "approvedHashes", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "_threshold", - "type": "uint256" - } - ], - "name": "changeThreshold", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "requiredSignatures", - "type": "uint256" - } - ], - "name": "checkNSignatures", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "dataHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "checkSignatures", - "outputs": [], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "prevModule", - "type": "address" - }, - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "disableModule", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "domainSeparator", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "enableModule", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "safeTxGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "baseGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasPrice", - "type": "uint256" - }, - { - "internalType": "address", - "name": "gasToken", - "type": "address" - }, - { - "internalType": "address", - "name": "refundReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "encodeTransactionData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "safeTxGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "baseGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasPrice", - "type": "uint256" - }, - { - "internalType": "address", - "name": "gasToken", - "type": "address" - }, - { - "internalType": "address payable", - "name": "refundReceiver", - "type": "address" - }, - { - "internalType": "bytes", - "name": "signatures", - "type": "bytes" - } - ], - "name": "execTransaction", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - } - ], - "name": "execTransactionFromModule", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - } - ], - "name": "execTransactionFromModuleReturnData", - "outputs": [ - { - "internalType": "bool", - "name": "success", - "type": "bool" - }, - { - "internalType": "bytes", - "name": "returnData", - "type": "bytes" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getChainId", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "start", - "type": "address" - }, - { - "internalType": "uint256", - "name": "pageSize", - "type": "uint256" - } - ], - "name": "getModulesPaginated", - "outputs": [ - { - "internalType": "address[]", - "name": "array", - "type": "address[]" - }, - { - "internalType": "address", - "name": "next", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getOwners", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "offset", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "getStorageAt", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getThreshold", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "safeTxGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "baseGas", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "gasPrice", - "type": "uint256" - }, - { - "internalType": "address", - "name": "gasToken", - "type": "address" - }, - { - "internalType": "address", - "name": "refundReceiver", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_nonce", - "type": "uint256" - } - ], - "name": "getTransactionHash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "module", - "type": "address" - } - ], - "name": "isModuleEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "isOwner", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "nonce", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "prevOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256", - "name": "_threshold", - "type": "uint256" - } - ], - "name": "removeOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "enum Enum.Operation", - "name": "operation", - "type": "uint8" - } - ], - "name": "requiredTxGas", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "handler", - "type": "address" - } - ], - "name": "setFallbackHandler", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "guard", - "type": "address" - } - ], - "name": "setGuard", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "_owners", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "_threshold", - "type": "uint256" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - }, - { - "internalType": "address", - "name": "fallbackHandler", - "type": "address" - }, - { - "internalType": "address", - "name": "paymentToken", - "type": "address" - }, - { - "internalType": "uint256", - "name": "payment", - "type": "uint256" - }, - { - "internalType": "address payable", - "name": "paymentReceiver", - "type": "address" - } - ], - "name": "setup", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "name": "signedMessages", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "targetContract", - "type": "address" - }, - { - "internalType": "bytes", - "name": "calldataPayload", - "type": "bytes" - } - ], - "name": "simulateAndRevert", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "prevOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "oldOwner", - "type": "address" - }, - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "swapOwner", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] +[ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "AddedOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "approvedHash", + "type": "bytes32" + }, + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "ApproveHash", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "handler", + "type": "address" + } + ], + "name": "ChangedFallbackHandler", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "ChangedGuard", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + } + ], + "name": "ChangedThreshold", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "DisabledModule", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "EnabledModule", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "payment", + "type": "uint256" + } + ], + "name": "ExecutionFailure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "ExecutionFromModuleFailure", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "ExecutionFromModuleSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes32", + "name": "txHash", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "payment", + "type": "uint256" + } + ], + "name": "ExecutionSuccess", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "RemovedOwner", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "SafeReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "initiator", + "type": "address" + }, + { + "indexed": false, + "internalType": "address[]", + "name": "owners", + "type": "address[]" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "threshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "initializer", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "fallbackHandler", + "type": "address" + } + ], + "name": "SafeSetup", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "bytes32", + "name": "msgHash", + "type": "bytes32" + } + ], + "name": "SignMsg", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [], + "name": "VERSION", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "addOwnerWithThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "hashToApprove", + "type": "bytes32" + } + ], + "name": "approveHash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "approvedHashes", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "changeThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "requiredSignatures", + "type": "uint256" + } + ], + "name": "checkNSignatures", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "dataHash", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "checkSignatures", + "outputs": [], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevModule", + "type": "address" + }, + { + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "disableModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "domainSeparator", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "enableModule", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "safeTxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "gasToken", + "type": "address" + }, + { + "internalType": "address", + "name": "refundReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "encodeTransactionData", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "safeTxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "gasToken", + "type": "address" + }, + { + "internalType": "address payable", + "name": "refundReceiver", + "type": "address" + }, + { + "internalType": "bytes", + "name": "signatures", + "type": "bytes" + } + ], + "name": "execTransaction", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + } + ], + "name": "execTransactionFromModule", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + } + ], + "name": "execTransactionFromModuleReturnData", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + }, + { + "internalType": "bytes", + "name": "returnData", + "type": "bytes" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "getChainId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "start", + "type": "address" + }, + { + "internalType": "uint256", + "name": "pageSize", + "type": "uint256" + } + ], + "name": "getModulesPaginated", + "outputs": [ + { + "internalType": "address[]", + "name": "array", + "type": "address[]" + }, + { + "internalType": "address", + "name": "next", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getOwners", + "outputs": [ + { + "internalType": "address[]", + "name": "", + "type": "address[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "offset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "getStorageAt", + "outputs": [ + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "safeTxGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "baseGas", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "gasPrice", + "type": "uint256" + }, + { + "internalType": "address", + "name": "gasToken", + "type": "address" + }, + { + "internalType": "address", + "name": "refundReceiver", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_nonce", + "type": "uint256" + } + ], + "name": "getTransactionHash", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "module", + "type": "address" + } + ], + "name": "isModuleEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "isOwner", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nonce", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + } + ], + "name": "removeOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "enum Enum.Operation", + "name": "operation", + "type": "uint8" + } + ], + "name": "requiredTxGas", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "handler", + "type": "address" + } + ], + "name": "setFallbackHandler", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "guard", + "type": "address" + } + ], + "name": "setGuard", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "_owners", + "type": "address[]" + }, + { + "internalType": "uint256", + "name": "_threshold", + "type": "uint256" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }, + { + "internalType": "address", + "name": "fallbackHandler", + "type": "address" + }, + { + "internalType": "address", + "name": "paymentToken", + "type": "address" + }, + { + "internalType": "uint256", + "name": "payment", + "type": "uint256" + }, + { + "internalType": "address payable", + "name": "paymentReceiver", + "type": "address" + } + ], + "name": "setup", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "signedMessages", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "targetContract", + "type": "address" + }, + { + "internalType": "bytes", + "name": "calldataPayload", + "type": "bytes" + } + ], + "name": "simulateAndRevert", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "prevOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "oldOwner", + "type": "address" + }, + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "swapOwner", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file