supersub
Version:
Supersub JS Sdk
1,691 lines • 98.1 kB
JSON
{
"_format": "hh-sol-artifact-1",
"contractName": "SubscriptionPlugin",
"sourceName": "contracts/SubscriptionPlugin.sol",
"abi": [
{
"inputs": [
{
"internalType": "uint256",
"name": "chainId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_bridge",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [],
"name": "AlreadyInitialized",
"type": "error"
},
{
"inputs": [],
"name": "InvalidAction",
"type": "error"
},
{
"inputs": [
{
"internalType": "address",
"name": "caller",
"type": "address"
}
],
"name": "NotContractCaller",
"type": "error"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "selector",
"type": "bytes4"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
}
],
"name": "NotImplemented",
"type": "error"
},
{
"inputs": [],
"name": "NotInitialized",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "productId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "planId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "price",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "chargeInterval",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"name": "PlanCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "planId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"name": "PlanUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "productId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "address",
"name": "provider",
"type": "address"
},
{
"indexed": false,
"internalType": "bytes32",
"name": "name",
"type": "bytes32"
},
{
"indexed": false,
"internalType": "string",
"name": "description",
"type": "string"
},
{
"indexed": false,
"internalType": "string",
"name": "logoUrl",
"type": "string"
},
{
"indexed": false,
"internalType": "enum SubscriptionPlugin.ProductType",
"name": "productType",
"type": "uint8"
},
{
"indexed": false,
"internalType": "address",
"name": "chargeToken",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "receivingAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "destinationChain",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"name": "ProductCreated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "uint256",
"name": "productId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "address",
"name": "receivingAddress",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "destinationChain",
"type": "uint256"
},
{
"indexed": false,
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"name": "ProductUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "subscriber",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "provider",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "product",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "plan",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
}
],
"name": "Subscribed",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "subscriber",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "recipient",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "planId",
"type": "uint256"
},
{
"indexed": true,
"internalType": "uint256",
"name": "productId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "amount",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "timestamp",
"type": "uint256"
}
],
"name": "SubscriptionCharged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "subscriber",
"type": "address"
},
{
"indexed": true,
"internalType": "uint256",
"name": "id",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
}
],
"name": "SubscriptionEndTimeUpdated",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "planId",
"type": "uint256"
}
],
"name": "SubscriptionPlanChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "user",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
}
],
"name": "UnSubscribed",
"type": "event"
},
{
"inputs": [],
"name": "AUTHOR",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "NAME",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "VERSION",
"outputs": [
{
"internalType": "string",
"name": "",
"type": "string"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_chainId",
"type": "uint256"
},
{
"internalType": "uint64",
"name": "_selector",
"type": "uint64"
}
],
"name": "addChainSelector",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "ccipChainSelectors",
"outputs": [
{
"internalType": "uint64",
"name": "",
"type": "uint64"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
}
],
"name": "changeSubscriptionEndTime",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "changeSubscriptionPlan",
"outputs": [],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "subscriber",
"type": "address"
},
{
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
}
],
"name": "charge",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_productId",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "_chargeInterval",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "_price",
"type": "uint256"
}
],
"name": "createPlan",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_name",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
},
{
"internalType": "string",
"name": "_logoUrl",
"type": "string"
},
{
"internalType": "enum SubscriptionPlugin.ProductType",
"name": "_type",
"type": "uint8"
},
{
"internalType": "address",
"name": "_chargeToken",
"type": "address"
},
{
"internalType": "address",
"name": "_receivingAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "_destinationChain",
"type": "uint256"
}
],
"name": "createProduct",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_name",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
},
{
"internalType": "string",
"name": "_logoUrl",
"type": "string"
},
{
"internalType": "enum SubscriptionPlugin.ProductType",
"name": "_type",
"type": "uint8"
},
{
"internalType": "address",
"name": "_chargeToken",
"type": "address"
},
{
"internalType": "address",
"name": "_receivingAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "_destinationChain",
"type": "uint256"
},
{
"components": [
{
"internalType": "uint256",
"name": "price",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "chargeInterval",
"type": "uint32"
}
],
"internalType": "struct SubscriptionPlugin.InitPlanParam[]",
"name": "_plans",
"type": "tuple[]"
}
],
"name": "createProductWithPlans",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes32",
"name": "_name",
"type": "bytes32"
},
{
"internalType": "string",
"name": "_description",
"type": "string"
},
{
"internalType": "string",
"name": "_logoUrl",
"type": "string"
},
{
"internalType": "address",
"name": "_chargeToken",
"type": "address"
},
{
"internalType": "address",
"name": "_receivingAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "_destinationChain",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "_chargeInterval",
"type": "uint32"
},
{
"internalType": "uint256",
"name": "_endTime",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "_price",
"type": "uint256"
}
],
"name": "createRecurringPayment",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "currentChainId",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "getManifestHash",
"outputs": [
{
"internalType": "bytes32",
"name": "",
"type": "bytes32"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"name": "onInstall",
"outputs": [],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"name": "onUninstall",
"outputs": [],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "addr",
"type": "address"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
}
],
"name": "pack",
"outputs": [
{
"internalType": "FunctionReference",
"name": "",
"type": "bytes21"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "planNonce",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "plans",
"outputs": [
{
"internalType": "uint256",
"name": "productId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "planId",
"type": "uint256"
},
{
"internalType": "address",
"name": "provider",
"type": "address"
},
{
"internalType": "uint256",
"name": "price",
"type": "uint256"
},
{
"internalType": "uint32",
"name": "chargeInterval",
"type": "uint32"
},
{
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "pluginManifest",
"outputs": [
{
"components": [
{
"internalType": "bytes4[]",
"name": "interfaceIds",
"type": "bytes4[]"
},
{
"internalType": "bytes4[]",
"name": "dependencyInterfaceIds",
"type": "bytes4[]"
},
{
"internalType": "bytes4[]",
"name": "executionFunctions",
"type": "bytes4[]"
},
{
"internalType": "bytes4[]",
"name": "permittedExecutionSelectors",
"type": "bytes4[]"
},
{
"internalType": "bool",
"name": "permitAnyExternalAddress",
"type": "bool"
},
{
"internalType": "bool",
"name": "canSpendNativeToken",
"type": "bool"
},
{
"components": [
{
"internalType": "address",
"name": "externalAddress",
"type": "address"
},
{
"internalType": "bool",
"name": "permitAnySelector",
"type": "bool"
},
{
"internalType": "bytes4[]",
"name": "selectors",
"type": "bytes4[]"
}
],
"internalType": "struct ManifestExternalCallPermission[]",
"name": "permittedExternalCalls",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "bytes4",
"name": "executionSelector",
"type": "bytes4"
},
{
"components": [
{
"internalType": "enum ManifestAssociatedFunctionType",
"name": "functionType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "dependencyIndex",
"type": "uint256"
}
],
"internalType": "struct ManifestFunction",
"name": "associatedFunction",
"type": "tuple"
}
],
"internalType": "struct ManifestAssociatedFunction[]",
"name": "userOpValidationFunctions",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "bytes4",
"name": "executionSelector",
"type": "bytes4"
},
{
"components": [
{
"internalType": "enum ManifestAssociatedFunctionType",
"name": "functionType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "dependencyIndex",
"type": "uint256"
}
],
"internalType": "struct ManifestFunction",
"name": "associatedFunction",
"type": "tuple"
}
],
"internalType": "struct ManifestAssociatedFunction[]",
"name": "runtimeValidationFunctions",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "bytes4",
"name": "executionSelector",
"type": "bytes4"
},
{
"components": [
{
"internalType": "enum ManifestAssociatedFunctionType",
"name": "functionType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "dependencyIndex",
"type": "uint256"
}
],
"internalType": "struct ManifestFunction",
"name": "associatedFunction",
"type": "tuple"
}
],
"internalType": "struct ManifestAssociatedFunction[]",
"name": "preUserOpValidationHooks",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "bytes4",
"name": "executionSelector",
"type": "bytes4"
},
{
"components": [
{
"internalType": "enum ManifestAssociatedFunctionType",
"name": "functionType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "dependencyIndex",
"type": "uint256"
}
],
"internalType": "struct ManifestFunction",
"name": "associatedFunction",
"type": "tuple"
}
],
"internalType": "struct ManifestAssociatedFunction[]",
"name": "preRuntimeValidationHooks",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "bytes4",
"name": "executionSelector",
"type": "bytes4"
},
{
"components": [
{
"internalType": "enum ManifestAssociatedFunctionType",
"name": "functionType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "dependencyIndex",
"type": "uint256"
}
],
"internalType": "struct ManifestFunction",
"name": "preExecHook",
"type": "tuple"
},
{
"components": [
{
"internalType": "enum ManifestAssociatedFunctionType",
"name": "functionType",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "uint256",
"name": "dependencyIndex",
"type": "uint256"
}
],
"internalType": "struct ManifestFunction",
"name": "postExecHook",
"type": "tuple"
}
],
"internalType": "struct ManifestExecutionHook[]",
"name": "executionHooks",
"type": "tuple[]"
}
],
"internalType": "struct PluginManifest",
"name": "",
"type": "tuple"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [],
"name": "pluginMetadata",
"outputs": [
{
"components": [
{
"internalType": "string",
"name": "name",
"type": "string"
},
{
"internalType": "string",
"name": "version",
"type": "string"
},
{
"internalType": "string",
"name": "author",
"type": "string"
},
{
"components": [
{
"internalType": "bytes4",
"name": "functionSelector",
"type": "bytes4"
},
{
"internalType": "string",
"name": "permissionDescription",
"type": "string"
}
],
"internalType": "struct SelectorPermission[]",
"name": "permissionDescriptors",
"type": "tuple[]"
}
],
"internalType": "struct PluginMetadata",
"name": "",
"type": "tuple"
}
],
"stateMutability": "pure",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "bytes",
"name": "preExecHookData",
"type": "bytes"
}
],
"name": "postExecutionHook",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "preExecutionHook",
"outputs": [
{
"internalType": "bytes",
"name": "",
"type": "bytes"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "preRuntimeValidationHook",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"components": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "initCode",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "callGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "verificationGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "preVerificationGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxFeePerGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxPriorityFeePerGas",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "paymasterAndData",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct UserOperation",
"name": "userOp",
"type": "tuple"
},
{
"internalType": "bytes32",
"name": "userOpHash",
"type": "bytes32"
}
],
"name": "preUserOpValidationHook",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "productNonce",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "products",
"outputs": [
{
"internalType": "uint256",
"name": "productId",
"type": "uint256"
},
{
"internalType": "enum SubscriptionPlugin.ProductType",
"name": "productType",
"type": "uint8"
},
{
"internalType": "address",
"name": "provider",
"type": "address"
},
{
"internalType": "address",
"name": "chargeToken",
"type": "address"
},
{
"internalType": "address",
"name": "receivingAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "destinationChain",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "value",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "runtimeValidationFunction",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "_bridgeAddr",
"type": "address"
}
],
"name": "setTokenBridge",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "planId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
}
],
"name": "subscribe",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "subscribedToProduct",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"name": "subscriptionNonces",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "bytes4",
"name": "interfaceId",
"type": "bytes4"
}
],
"name": "supportsInterface",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "tokenBridge",
"outputs": [
{
"internalType": "contract ITokenBridge",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
}
],
"name": "unSubscribe",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_planId",
"type": "uint256"
},
{
"internalType": "bool",
"name": "_isActive",
"type": "bool"
}
],
"name": "updatePlan",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "_productId",
"type": "uint256"
},
{
"internalType": "address",
"name": "_receivingAddr",
"type": "address"
},
{
"internalType": "uint256",
"name": "_destChain",
"type": "uint256"
},
{
"internalType": "bool",
"name": "_isActive",
"type": "bool"
}
],
"name": "updateProduct",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "uint8",
"name": "functionId",
"type": "uint8"
},
{
"components": [
{
"internalType": "address",
"name": "sender",
"type": "address"
},
{
"internalType": "uint256",
"name": "nonce",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "initCode",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "callData",
"type": "bytes"
},
{
"internalType": "uint256",
"name": "callGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "verificationGasLimit",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "preVerificationGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxFeePerGas",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "maxPriorityFeePerGas",
"type": "uint256"
},
{
"internalType": "bytes",
"name": "paymasterAndData",
"type": "bytes"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"internalType": "struct UserOperation",
"name": "userOp",
"type": "tuple"
},
{
"internalType": "bytes32",
"name": "userOpHash",
"type": "bytes32"
}
],
"name": "userOpValidationFunction",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"name": "userSubscriptions",
"outputs": [
{
"internalType": "uint256",
"name": "subscriptionId",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "product",
"type": "uint256"
},
{
"internalType": "address",
"name": "provider",
"type": "address"
},
{
"internalType": "uint256",
"name": "plan",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "lastChargeDate",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "endTime",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isActive",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"bytecode": "0x60806040523480156200001157600080fd5b50604051620038423803806200384283398101604081905262000034916200005a565b600180546001600160a01b03191633178155600091909155600281905560035562000074565b6000602082840312156200006d57600080fd5b5051919050565b6137be80620000846000396000f3fe608060405234801561001057600080fd5b50600436106102325760003560e01c806388e18ce411610130578063c6328a46116100b8578063e9f338081161007c578063e9f33808146106ae578063f7fc32a2146106dc578063f851a440146106ef578063ffa1ad7414610702578063ffc95ae21461072657600080fd5b8063c6328a4614610572578063c77631301461059d578063c95d6edc146105b2578063cd61587e1461065a578063dfc2f42e1461069b57600080fd5b8063a7be85c6116100ff578063a7be85c6146104a1578063af87348314610449578063b1620616146104cf578063bfa15c751461056a578063bfd151c11461027457600080fd5b806388e18ce4146104495780638a91b0e3146103a1578063a3f4df7e1461045c578063a3ffa9cd1461048e57600080fd5b80632796b030116101be5780636cbadbfa116101825780636cbadbfa146103985780636d61fe70146103a15780637acc0b20146103b35780637f5f66be14610423578063843708131461043657600080fd5b80632796b030146103025780632a73740c146103155780632e6ca5881461034557806339d048601461036557806346d60eb21461037857600080fd5b8063118a538911610205578063118a53891461029a578063151d2677146102af578063157f7123146102c65780631b7c82ec146102d95780631feea06a146102e257600080fd5b806301ffc9a7146102375780630c497af31461025f5780630c7ecd84146102745780631128186d14610287575b600080fd5b61024a61024536600461262c565b610739565b60405190151581526020015b60405180910390f35b61027261026d366004612650565b610770565b005b6102726102823660046126fd565b6109b0565b61027261029536600461276f565b6109d9565b6102a2610a02565b6040516102569190612813565b6102b860035481565b604051908152602001610256565b6102726102d43660046128fa565b610ad2565b6102b860025481565b6102b86102f036600461292a565b60086020526000908152604090205481565b610272610310366004612947565b610bc7565b610272610323366004612960565b3360009081526009602090815260408083209483529390529190912060050155565b61035861035336600461292a565b610c20565b6040516102569190612982565b61027261037336600461292a565b610d9e565b61038b6103863660046126fd565b610dd7565b6040516102569190612a0f565b6102b860005481565b6102726103af366004612a22565b5050565b6104106103c1366004612947565b600660205260009081526040902080546001820154600283015460038401546004850154600590950154939460ff808516956101009095046001600160a01b0390811695948116949316921687565b6040516102569796959493929190612a8d565b610272610431366004612ad9565b610e02565b610272610444366004612960565b61103a565b6102b8610457366004612b97565b6114d2565b61038b6040518060400160405280601381526020017229bab139b1b934b83a34b7b71028363ab3b4b760691b81525081565b61027261049c366004612be5565b6114fc565b61038b6040518060400160405280600f81526020016e5465652d70792026204a617962656560881b81525081565b6105286104dd366004612947565b60076020526000908152604090208054600182015460028301546003840154600490940154929391926001600160a01b03909116919063ffffffff811690600160201b900460ff1686565b6040805196875260208701959095526001600160a01b0390931693850193909352606084015263ffffffff9091166080830152151560a082015260c001610256565b6102b8611862565b600454610585906001600160a01b031681565b6040516001600160a01b039091168152602001610256565b6105a56118f5565b6040516102569190612db9565b6106156105c0366004612be5565b60096020908152600092835260408084209091529082529020805460018201546002830154600384015460048501546005860154600690960154949593946001600160a01b0390931693919290919060ff1687565b6040805197885260208801969096526001600160a01b03909416948601949094526060850191909152608084015260a0830191909152151560c082015260e001610256565b610683610668366004612947565b6005602052600090815260409020546001600160401b031681565b6040516001600160401b039091168152602001610256565b6102726106a9366004612f13565b611eaa565b61024a6106bc366004612be5565b600a60209081526000928352604080842090915290825290205460ff1681565b6102726106ea366004612f44565b611ef0565b600154610585906001600160a01b031681565b61038b604051806040016040528060058152602001640312e302e360dc1b81525081565b610272610734366004612f8e565b61208d565b60006001600160e01b0319821663f23b1ed760e01b148061076a57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000838152600660205260408120548491036107c75760405162461bcd60e51b8152602060048201526011602482015270141c9bd91d58dd08139bdd08119bdd5b99607a1b60448201526064015b60405180910390fd5b600084815260066020526040902060010154849061010090046001600160a01b031633146108075760405162461bcd60e51b81526004016107be90612fba565b600060066000878152602001908152602001600020905060006040518060c0016040528088815260200160035481526020018360010160019054906101000a90046001600160a01b03166001600160a01b031681526020018681526020018763ffffffff168152602001600115158152509050806007600083602001518152602001908152602001600020600082015181600001556020820151816001015560408201518160020160006101000a8154816001600160a01b0302191690836001600160a01b031602179055506060820151816003015560808201518160040160006101000a81548163ffffffff021916908363ffffffff16021790555060a08201518160040160046101000a81548160ff02191690831515021790555090505060016003600082825461093a9190612ff1565b925050819055508060200151877fefcd7034bb3bc315795fdab1fdca7520ce3650a588e5f33fc58163c79e9b737e836060015184608001518560a0015160405161099f9392919092835263ffffffff9190911660208301521515604082015260600190565b60405180910390a350505050505050565b6000356001600160e01b031916856040516384b9b37960e01b81526004016107be929190613012565b6000356001600160e01b031916836040516384b9b37960e01b81526004016107be929190613012565b610a2d6040518060800160405280606081526020016060815260200160608152602001606081525090565b610a586040518060800160405280606081526020016060815260200160608152602001606081525090565b604080518082018252601381527229bab139b1b934b83a34b7b71028363ab3b4b760691b6020808301919091529083528151808301835260058152640312e302e360dc1b818301528382015281518083018352600f81526e5465652d70792026204a617962656560881b9181019190915290820152919050565b600082815260076020526040812060010154839103610b245760405162461bcd60e51b815260206004820152600e60248201526d141b185b88139bdd08119bdd5b9960921b60448201526064016107be565b600083815260076020526040902060028101546001600160a01b03163314610b5e5760405162461bcd60e51b81526004016107be90612fba565b600481018054841515600160201b90810264ff0000000019909216919091179182905560018301546040519190920460ff16151581527fe8898c20571732660341e9bd58210cbce79a036302e465085395645040fd1cc29060200160405180910390a250505050565b336000818152600960209081526040808320858452825291829020600601805460ff1916905590518381527f3ce0ad9e088ae3e7555f42cc73d57bf59207a30deef3eea8654a27e86650a4a9910160405180910390a250565b6001600160a01b038116600090815260086020526040902054606090806001600160401b03811115610c5457610c5461302f565b604051908082528060200260200182016040528015610cd057816020015b610cbd6040518060e00160405280600081526020016000815260200160006001600160a01b031681526020016000815260200160008152602001600081526020016000151581525090565b815260200190600190039081610c725790505b50915060005b6001600160a01b038416600090815260086020526040902054811015610d97576001600160a01b038085166000908152600960209081526040808320858452825291829020825160e081018452815481526001820154928101929092526002810154909316918101919091526003820154606082015260048201546080820152600582015460a082015260069091015460ff16151560c08201528351849083908110610d8457610d84613045565b6020908102919091010152600101610cd6565b5050919050565b6001546001600160a01b03163314610db557600080fd5b600480546001600160a01b0319166001600160a01b0392909216919091179055565b60606000356001600160e01b031916866040516384b9b37960e01b81526004016107be929190613012565b6000548114610e71576000818152600560205260408120546001600160401b03169003610e715760405162461bcd60e51b815260206004820152601f60248201527f64657374696e6174696f6e20636861696e206e6f7420737570706f727465640060448201526064016107be565b60006040518060e001604052806002548152602001866001811115610e9857610e98612a63565b8152602001336001600160a01b03168152602001856001600160a01b03168152602001846001600160a01b031681526020018381526020016001151581525090508060066000836000015181526020019081526020016000206000820151816000015560208201518160010160006101000a81548160ff02191690836001811115610f2557610f25612a63565b0217905550604082015160018281018054610100600160a81b0319166101006001600160a01b03948516021790556060840151600280850180546001600160a01b03199081169386169390931790556080860151600386018054909316941693909317905560a0840151600484015560c0909301516005909201805460ff1916921515929092179091558054600090610fbf908490612ff1565b92505081905550336001600160a01b031681600001517ff9815db369a250e4360ba847cf51ab4c7702b42b361aac1288caeed4404cc0ad8c8c8c8c8c8c89606001518a608001518b60a001518c60c001516040516110269a99989796959493929190613084565b60405180910390a350505050505050505050565b6000828152600760205260409020600401548290600160201b900460ff166110745760405162461bcd60e51b81526004016107be906130fa565b333b6000036110d35760405162461bcd60e51b815260206004820152602560248201527f4163636f756e74206973206e6f74206f6620736d61727420636f6e7472616374604482015264207479706560d81b60648201526084016107be565b6000838152600760209081526040808320815160c08101835281548082526001808401548387015260028401546001600160a01b0316838601526003840154606084015260049093015463ffffffff8116608084015260ff600160201b9091048116151560a084015290865260068552838620845160e0810190955280548552808401549296959093908501929091169081111561117357611173612a63565b600181111561118457611184612a63565b815260018201546001600160a01b0361010090910481166020830152600283015481166040830152600383015416606082015260048