[
  {
    "type": "constructor",
    "inputs": [
      {
        "name": "treasury_",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "FEE_BPS",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MAX_ITEMS",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MAX_KEY_LENGTH",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MAX_NAME_LENGTH",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MAX_UNITS",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MAX_URL_LENGTH",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MIN_HANDLE_LENGTH",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "MONTH",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "PURCHASE",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "RENEWAL",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "UPGRADE",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint8",
        "internalType": "uint8"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "acceptMerchant",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "allMerchants",
    "inputs": [
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "allProducts",
    "inputs": [
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "buyLifetime",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "beneficiary",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "expectedPrice",
        "type": "uint96",
        "internalType": "uint96"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "buyPack",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "packId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "quantity",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "beneficiary",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "expectedPrice",
        "type": "uint96",
        "internalType": "uint96"
      },
      {
        "name": "expectedCredits",
        "type": "uint96",
        "internalType": "uint96"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "credits",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "createProduct",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "key",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "name",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "items",
        "type": "tuple[]",
        "internalType": "struct Sub3Checkout.ItemInput[]",
        "components": [
          {
            "name": "kind",
            "type": "uint8",
            "internalType": "enum Sub3Checkout.Kind"
          },
          {
            "name": "level",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "price",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "credits",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "active",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "key",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          }
        ]
      }
    ],
    "outputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "customers",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "address[]",
        "internalType": "address[]"
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "feeFlat",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getItem",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Item",
        "components": [
          {
            "name": "kind",
            "type": "uint8",
            "internalType": "enum Sub3Checkout.Kind"
          },
          {
            "name": "active",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "index",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "level",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "price",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "credits",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "key",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getMerchant",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Merchant",
        "components": [
          {
            "name": "owner",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "registeredAt",
            "type": "uint48",
            "internalType": "uint48"
          },
          {
            "name": "pendingOwner",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "payTo",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "handle",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "url",
            "type": "string",
            "internalType": "string"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "getProduct",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Product",
        "components": [
          {
            "name": "merchantId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "createdAt",
            "type": "uint48",
            "internalType": "uint48"
          },
          {
            "name": "key",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "globalStats",
    "inputs": [],
    "outputs": [
      {
        "name": "merchants",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "products",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "totals",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Stats",
        "components": [
          {
            "name": "revenue",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "fees",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "payments",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "customers",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "initialize",
    "inputs": [
      {
        "name": "token_",
        "type": "address",
        "internalType": "contract IERC20"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "itemIdOf",
    "inputs": [
      {
        "name": "key",
        "type": "string",
        "internalType": "string"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "itemIdsOf",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "itemStats",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Stats",
        "components": [
          {
            "name": "revenue",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "fees",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "payments",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "customers",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "membershipOf",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "m",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Membership",
        "components": [
          {
            "name": "tierId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "start",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "end",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "generation",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "revision",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      },
      {
        "name": "active",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "merchantFee",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "merchantIdOf",
    "inputs": [
      {
        "name": "handle",
        "type": "string",
        "internalType": "string"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "merchantStats",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Stats",
        "components": [
          {
            "name": "revenue",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "fees",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "payments",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "customers",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "merchantsOf",
    "inputs": [
      {
        "name": "owner",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "minPrice",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "orderOf",
    "inputs": [
      {
        "name": "payer",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Order",
        "components": [
          {
            "name": "productId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "itemId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "beneficiary",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "kind",
            "type": "uint8",
            "internalType": "enum Sub3Checkout.Kind"
          },
          {
            "name": "action",
            "type": "uint8",
            "internalType": "uint8"
          },
          {
            "name": "units",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "paidAt",
            "type": "uint48",
            "internalType": "uint48"
          },
          {
            "name": "amount",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "credits",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "blockNumber",
            "type": "uint64",
            "internalType": "uint64"
          },
          {
            "name": "generation",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "revision",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "ordersOf",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "tuple[]",
        "internalType": "struct Sub3Checkout.Receipt[]",
        "components": [
          {
            "name": "payer",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "orderId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "order",
            "type": "tuple",
            "internalType": "struct Sub3Checkout.Order",
            "components": [
              {
                "name": "productId",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "itemId",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "beneficiary",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "kind",
                "type": "uint8",
                "internalType": "enum Sub3Checkout.Kind"
              },
              {
                "name": "action",
                "type": "uint8",
                "internalType": "uint8"
              },
              {
                "name": "units",
                "type": "uint16",
                "internalType": "uint16"
              },
              {
                "name": "paidAt",
                "type": "uint48",
                "internalType": "uint48"
              },
              {
                "name": "amount",
                "type": "uint96",
                "internalType": "uint96"
              },
              {
                "name": "credits",
                "type": "uint96",
                "internalType": "uint96"
              },
              {
                "name": "blockNumber",
                "type": "uint64",
                "internalType": "uint64"
              },
              {
                "name": "generation",
                "type": "uint32",
                "internalType": "uint32"
              },
              {
                "name": "revision",
                "type": "uint32",
                "internalType": "uint32"
              }
            ]
          }
        ]
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "ownsLifetime",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bool",
        "internalType": "bool"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "payments",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "tuple[]",
        "internalType": "struct Sub3Checkout.Receipt[]",
        "components": [
          {
            "name": "payer",
            "type": "address",
            "internalType": "address"
          },
          {
            "name": "orderId",
            "type": "bytes32",
            "internalType": "bytes32"
          },
          {
            "name": "order",
            "type": "tuple",
            "internalType": "struct Sub3Checkout.Order",
            "components": [
              {
                "name": "productId",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "itemId",
                "type": "bytes32",
                "internalType": "bytes32"
              },
              {
                "name": "beneficiary",
                "type": "address",
                "internalType": "address"
              },
              {
                "name": "kind",
                "type": "uint8",
                "internalType": "enum Sub3Checkout.Kind"
              },
              {
                "name": "action",
                "type": "uint8",
                "internalType": "uint8"
              },
              {
                "name": "units",
                "type": "uint16",
                "internalType": "uint16"
              },
              {
                "name": "paidAt",
                "type": "uint48",
                "internalType": "uint48"
              },
              {
                "name": "amount",
                "type": "uint96",
                "internalType": "uint96"
              },
              {
                "name": "credits",
                "type": "uint96",
                "internalType": "uint96"
              },
              {
                "name": "blockNumber",
                "type": "uint64",
                "internalType": "uint64"
              },
              {
                "name": "generation",
                "type": "uint32",
                "internalType": "uint32"
              },
              {
                "name": "revision",
                "type": "uint32",
                "internalType": "uint32"
              }
            ]
          }
        ]
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "productIdOf",
    "inputs": [
      {
        "name": "handle",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "key",
        "type": "string",
        "internalType": "string"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "pure"
  },
  {
    "type": "function",
    "name": "productStats",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.Stats",
        "components": [
          {
            "name": "revenue",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "fees",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "payments",
            "type": "uint32",
            "internalType": "uint32"
          },
          {
            "name": "customers",
            "type": "uint32",
            "internalType": "uint32"
          }
        ]
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "productsBoughtBy",
    "inputs": [
      {
        "name": "user",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "productsOf",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "offset",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "limit",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "outputs": [
      {
        "name": "page",
        "type": "bytes32[]",
        "internalType": "bytes32[]"
      },
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "quote",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "units",
        "type": "uint16",
        "internalType": "uint16"
      }
    ],
    "outputs": [
      {
        "name": "total",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "fee",
        "type": "uint256",
        "internalType": "uint256"
      },
      {
        "name": "net",
        "type": "uint256",
        "internalType": "uint256"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "registerMerchant",
    "inputs": [
      {
        "name": "handle",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "url",
        "type": "string",
        "internalType": "string"
      },
      {
        "name": "payTo",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setItem",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "item",
        "type": "tuple",
        "internalType": "struct Sub3Checkout.ItemInput",
        "components": [
          {
            "name": "kind",
            "type": "uint8",
            "internalType": "enum Sub3Checkout.Kind"
          },
          {
            "name": "level",
            "type": "uint16",
            "internalType": "uint16"
          },
          {
            "name": "price",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "credits",
            "type": "uint96",
            "internalType": "uint96"
          },
          {
            "name": "active",
            "type": "bool",
            "internalType": "bool"
          },
          {
            "name": "key",
            "type": "string",
            "internalType": "string"
          },
          {
            "name": "name",
            "type": "string",
            "internalType": "string"
          }
        ]
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setMerchant",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "payTo",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "url",
        "type": "string",
        "internalType": "string"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "setProduct",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "name",
        "type": "string",
        "internalType": "string"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "subscribe",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "tierId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "months",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "beneficiary",
        "type": "address",
        "internalType": "address"
      },
      {
        "name": "expectedPrice",
        "type": "uint96",
        "internalType": "uint96"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "start",
        "type": "uint64",
        "internalType": "uint64"
      },
      {
        "name": "end",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "token",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "contract IERC20"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "transferMerchant",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "newOwner",
        "type": "address",
        "internalType": "address"
      }
    ],
    "outputs": [],
    "stateMutability": "nonpayable"
  },
  {
    "type": "function",
    "name": "treasury",
    "inputs": [],
    "outputs": [
      {
        "name": "",
        "type": "address",
        "internalType": "address"
      }
    ],
    "stateMutability": "view"
  },
  {
    "type": "function",
    "name": "upgrade",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "tierId",
        "type": "bytes32",
        "internalType": "bytes32"
      },
      {
        "name": "months",
        "type": "uint16",
        "internalType": "uint16"
      },
      {
        "name": "expectedRevision",
        "type": "uint32",
        "internalType": "uint32"
      },
      {
        "name": "expectedPrice",
        "type": "uint96",
        "internalType": "uint96"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "internalType": "bytes32"
      }
    ],
    "outputs": [
      {
        "name": "start",
        "type": "uint64",
        "internalType": "uint64"
      },
      {
        "name": "end",
        "type": "uint64",
        "internalType": "uint64"
      }
    ],
    "stateMutability": "nonpayable"
  },
  {
    "type": "event",
    "name": "Initialized",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "decimals",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ItemSet",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "kind",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum Sub3Checkout.Kind"
      },
      {
        "name": "level",
        "type": "uint16",
        "indexed": false,
        "internalType": "uint16"
      },
      {
        "name": "price",
        "type": "uint96",
        "indexed": false,
        "internalType": "uint96"
      },
      {
        "name": "credits",
        "type": "uint96",
        "indexed": false,
        "internalType": "uint96"
      },
      {
        "name": "active",
        "type": "bool",
        "indexed": false,
        "internalType": "bool"
      },
      {
        "name": "key",
        "type": "string",
        "indexed": false,
        "internalType": "string"
      },
      {
        "name": "name",
        "type": "string",
        "indexed": false,
        "internalType": "string"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "MembershipChanged",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "user",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "tierId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "action",
        "type": "uint8",
        "indexed": false,
        "internalType": "uint8"
      },
      {
        "name": "generation",
        "type": "uint32",
        "indexed": false,
        "internalType": "uint32"
      },
      {
        "name": "revision",
        "type": "uint32",
        "indexed": false,
        "internalType": "uint32"
      },
      {
        "name": "start",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "end",
        "type": "uint64",
        "indexed": false,
        "internalType": "uint64"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "MerchantRegistered",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "owner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "handle",
        "type": "string",
        "indexed": false,
        "internalType": "string"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "MerchantTransferStarted",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "owner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "MerchantTransferred",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "previousOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "newOwner",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "MerchantUpdated",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "payTo",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "url",
        "type": "string",
        "indexed": false,
        "internalType": "string"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "Paid",
    "inputs": [
      {
        "name": "merchantId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "productId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "beneficiary",
        "type": "address",
        "indexed": true,
        "internalType": "address"
      },
      {
        "name": "payer",
        "type": "address",
        "indexed": false,
        "internalType": "address"
      },
      {
        "name": "kind",
        "type": "uint8",
        "indexed": false,
        "internalType": "enum Sub3Checkout.Kind"
      },
      {
        "name": "itemId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      },
      {
        "name": "units",
        "type": "uint16",
        "indexed": false,
        "internalType": "uint16"
      },
      {
        "name": "amount",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "fee",
        "type": "uint256",
        "indexed": false,
        "internalType": "uint256"
      },
      {
        "name": "orderId",
        "type": "bytes32",
        "indexed": false,
        "internalType": "bytes32"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ProductCreated",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "merchantId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "key",
        "type": "string",
        "indexed": false,
        "internalType": "string"
      }
    ],
    "anonymous": false
  },
  {
    "type": "event",
    "name": "ProductUpdated",
    "inputs": [
      {
        "name": "productId",
        "type": "bytes32",
        "indexed": true,
        "internalType": "bytes32"
      },
      {
        "name": "name",
        "type": "string",
        "indexed": false,
        "internalType": "string"
      }
    ],
    "anonymous": false
  },
  {
    "type": "error",
    "name": "AlreadyInitialized",
    "inputs": []
  },
  {
    "type": "error",
    "name": "AlreadyOwned",
    "inputs": []
  },
  {
    "type": "error",
    "name": "DuplicateItem",
    "inputs": []
  },
  {
    "type": "error",
    "name": "HandleTaken",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidItem",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidKey",
    "inputs": []
  },
  {
    "type": "error",
    "name": "InvalidUnits",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ItemInactive",
    "inputs": []
  },
  {
    "type": "error",
    "name": "MembershipChangedSinceQuote",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NameTooLong",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NoActiveMembership",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotAnUpgrade",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotInitialized",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotMerchantOwner",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotPendingOwner",
    "inputs": []
  },
  {
    "type": "error",
    "name": "NotTreasury",
    "inputs": []
  },
  {
    "type": "error",
    "name": "OrderUsed",
    "inputs": []
  },
  {
    "type": "error",
    "name": "PaymentOverflow",
    "inputs": []
  },
  {
    "type": "error",
    "name": "PriceTooLow",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ProductExists",
    "inputs": []
  },
  {
    "type": "error",
    "name": "SafeERC20FailedOperation",
    "inputs": [
      {
        "name": "token",
        "type": "address",
        "internalType": "address"
      }
    ]
  },
  {
    "type": "error",
    "name": "TermsChanged",
    "inputs": []
  },
  {
    "type": "error",
    "name": "TierMismatch",
    "inputs": []
  },
  {
    "type": "error",
    "name": "TooManyItems",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UnknownItem",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UnknownMerchant",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UnknownProduct",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UnsupportedDecimals",
    "inputs": []
  },
  {
    "type": "error",
    "name": "UrlTooLong",
    "inputs": []
  },
  {
    "type": "error",
    "name": "WrongKind",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ZeroAddress",
    "inputs": []
  },
  {
    "type": "error",
    "name": "ZeroOrderId",
    "inputs": []
  }
]
