{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://montrevane.com/schemas/op-transparency-project-manifest-0.1.schema.json",
  "title": "OP Treasury & Liquidity Transparency Hub project manifest",
  "description": "Strict static configuration for a read-only OP Mainnet transparency case. Live observations belong in snapshots, not manifests.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "manifestVersion",
    "projectId",
    "projectName",
    "manifestStatus",
    "chain",
    "rpcPolicy",
    "evidencePolicy",
    "sources",
    "assets",
    "treasurySafe",
    "uniswapV3",
    "documents",
    "freshness",
    "fallbackPolicy",
    "disclosures"
  ],
  "properties": {
    "$schema": {
      "const": "./project-manifest.schema.json"
    },
    "manifestVersion": {
      "const": "0.1"
    },
    "projectId": {
      "type": "string",
      "pattern": "^op-tlh:[a-z0-9]+(?:-[a-z0-9]+)*$"
    },
    "projectName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 80
    },
    "manifestStatus": {
      "enum": [
        "case_fixture",
        "active",
        "deprecated"
      ]
    },
    "chain": {
      "$ref": "#/$defs/chain"
    },
    "rpcPolicy": {
      "$ref": "#/$defs/rpcPolicy"
    },
    "evidencePolicy": {
      "$ref": "#/$defs/evidencePolicy"
    },
    "sources": {
      "type": "array",
      "minItems": 2,
      "maxItems": 12,
      "items": {
        "$ref": "#/$defs/source"
      }
    },
    "assets": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "projectToken",
        "wrappedNative"
      ],
      "properties": {
        "projectToken": {
          "$ref": "#/$defs/asset"
        },
        "wrappedNative": {
          "$ref": "#/$defs/asset"
        }
      }
    },
    "treasurySafe": {
      "$ref": "#/$defs/treasurySafe"
    },
    "uniswapV3": {
      "$ref": "#/$defs/uniswapV3"
    },
    "documents": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/document"
      }
    },
    "freshness": {
      "$ref": "#/$defs/freshness"
    },
    "fallbackPolicy": {
      "$ref": "#/$defs/fallbackPolicy"
    },
    "disclosures": {
      "$ref": "#/$defs/disclosures"
    }
  },
  "$defs": {
    "address": {
      "type": "string",
      "pattern": "^0x[0-9a-fA-F]{40}$"
    },
    "decimalString": {
      "type": "string",
      "pattern": "^(0|[1-9][0-9]*)$"
    },
    "sha256": {
      "type": "string",
      "pattern": "^[0-9a-f]{64}$"
    },
    "httpsUrl": {
      "type": "string",
      "format": "uri",
      "pattern": "^https://"
    },
    "chain": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "chainId",
        "network",
        "nativeCurrency",
        "explorerBaseUrl",
        "factBlockTag",
        "provisionalBlockTag"
      ],
      "properties": {
        "chainId": {
          "const": 10
        },
        "network": {
          "const": "OP Mainnet"
        },
        "nativeCurrency": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "name",
            "symbol",
            "decimals"
          ],
          "properties": {
            "name": {
              "const": "Ether"
            },
            "symbol": {
              "const": "ETH"
            },
            "decimals": {
              "const": 18
            }
          }
        },
        "explorerBaseUrl": {
          "$ref": "#/$defs/httpsUrl"
        },
        "factBlockTag": {
          "const": "finalized"
        },
        "provisionalBlockTag": {
          "const": "latest"
        }
      }
    },
    "rpcPolicy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "minimumIndependentProviders",
        "allowUserSuppliedRpc",
        "allowArbitraryMethods",
        "allowedMethods",
        "prohibitedMethods"
      ],
      "properties": {
        "minimumIndependentProviders": {
          "type": "integer",
          "minimum": 2,
          "maximum": 5
        },
        "allowUserSuppliedRpc": {
          "const": false
        },
        "allowArbitraryMethods": {
          "const": false
        },
        "allowedMethods": {
          "type": "array",
          "prefixItems": [
            { "const": "eth_chainId" },
            { "const": "eth_blockNumber" },
            { "const": "eth_getBlockByNumber" },
            { "const": "eth_getCode" },
            { "const": "eth_getBalance" },
            { "const": "eth_call" },
            { "const": "eth_getLogs" },
            { "const": "eth_getTransactionByHash" },
            { "const": "eth_getTransactionReceipt" }
          ],
          "items": false,
          "minItems": 9,
          "maxItems": 9
        },
        "prohibitedMethods": {
          "type": "array",
          "prefixItems": [
            { "const": "eth_accounts" },
            { "const": "eth_requestAccounts" },
            { "const": "eth_sendTransaction" },
            { "const": "eth_sendRawTransaction" },
            { "const": "eth_sign" },
            { "const": "eth_signTransaction" },
            { "const": "eth_signTypedData" },
            { "const": "eth_signTypedData_v1" },
            { "const": "eth_signTypedData_v3" },
            { "const": "eth_signTypedData_v4" },
            { "const": "personal_sign" },
            { "const": "wallet_addEthereumChain" },
            { "const": "wallet_switchEthereumChain" },
            { "const": "wallet_sendCalls" },
            { "const": "wallet_grantPermissions" }
          ],
          "items": false,
          "minItems": 15,
          "maxItems": 15
        }
      }
    },
    "tierDefinition": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "label",
        "description"
      ],
      "properties": {
        "label": {
          "enum": [
            "onchain_verified",
            "third_party_verified",
            "safe_service_indexed",
            "project_disclosed",
            "unverified_or_unavailable"
          ]
        },
        "description": {
          "type": "string",
          "minLength": 10,
          "maxLength": 400
        }
      }
    },
    "evidencePolicy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "tierOrder",
        "tiers",
        "conflictsReturnNull",
        "zeroRequiresSuccessfulRead",
        "manifestIsObservation"
      ],
      "properties": {
        "tierOrder": {
          "type": "array",
          "prefixItems": [
            { "const": "A" },
            { "const": "B" },
            { "const": "C" },
            { "const": "D" },
            { "const": "U" }
          ],
          "items": false,
          "minItems": 5,
          "maxItems": 5
        },
        "tiers": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "A",
            "B",
            "C",
            "D",
            "U"
          ],
          "properties": {
            "A": {
              "allOf": [
                { "$ref": "#/$defs/tierDefinition" },
                {
                  "properties": {
                    "label": { "const": "onchain_verified" }
                  }
                }
              ]
            },
            "B": {
              "allOf": [
                { "$ref": "#/$defs/tierDefinition" },
                {
                  "properties": {
                    "label": { "const": "third_party_verified" }
                  }
                }
              ]
            },
            "C": {
              "allOf": [
                { "$ref": "#/$defs/tierDefinition" },
                {
                  "properties": {
                    "label": { "const": "safe_service_indexed" }
                  }
                }
              ]
            },
            "D": {
              "allOf": [
                { "$ref": "#/$defs/tierDefinition" },
                {
                  "properties": {
                    "label": { "const": "project_disclosed" }
                  }
                }
              ]
            },
            "U": {
              "allOf": [
                { "$ref": "#/$defs/tierDefinition" },
                {
                  "properties": {
                    "label": { "const": "unverified_or_unavailable" }
                  }
                }
              ]
            }
          }
        },
        "conflictsReturnNull": {
          "const": true
        },
        "zeroRequiresSuccessfulRead": {
          "const": true
        },
        "manifestIsObservation": {
          "const": false
        }
      }
    },
    "source": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "sourceId",
        "kind",
        "evidenceTier",
        "endpointMode",
        "endpointUrl",
        "required",
        "mayOverrideOnchain"
      ],
      "properties": {
        "sourceId": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "kind": {
          "enum": [
            "rpc",
            "indexer",
            "explorer",
            "document"
          ]
        },
        "evidenceTier": {
          "enum": [
            "A",
            "B",
            "C",
            "D",
            "U"
          ]
        },
        "endpointMode": {
          "enum": [
            "server_configured",
            "fixed_public"
          ]
        },
        "endpointUrl": {
          "anyOf": [
            { "$ref": "#/$defs/httpsUrl" },
            { "type": "null" }
          ]
        },
        "required": {
          "type": "boolean"
        },
        "mayOverrideOnchain": {
          "const": false
        }
      }
    },
    "asset": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "role",
        "name",
        "symbol",
        "address",
        "decimals",
        "readFields",
        "expected"
      ],
      "properties": {
        "role": {
          "enum": [
            "project_token",
            "wrapped_native"
          ]
        },
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        "symbol": {
          "type": "string",
          "minLength": 1,
          "maxLength": 32
        },
        "address": {
          "$ref": "#/$defs/address"
        },
        "decimals": {
          "type": "integer",
          "minimum": 0,
          "maximum": 255
        },
        "readFields": {
          "type": "array",
          "minItems": 4,
          "maxItems": 7,
          "uniqueItems": true,
          "items": {
            "enum": [
              "code",
              "name",
              "symbol",
              "decimals",
              "totalSupply",
              "treasuryBalance",
              "poolBalance"
            ]
          }
        },
        "expected": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "totalSupplyRaw",
            "mintableAfterDeployment",
            "upgradeable"
          ],
          "properties": {
            "totalSupplyRaw": {
              "anyOf": [
                { "$ref": "#/$defs/decimalString" },
                { "type": "null" }
              ]
            },
            "mintableAfterDeployment": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "upgradeable": {
              "type": [
                "boolean",
                "null"
              ]
            }
          }
        }
      }
    },
    "treasurySafe": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "address",
        "expectedThreshold",
        "expectedOwners",
        "readFields",
        "moduleEnumeration"
      ],
      "properties": {
        "address": {
          "$ref": "#/$defs/address"
        },
        "expectedThreshold": {
          "type": "integer",
          "minimum": 1,
          "maximum": 50
        },
        "expectedOwners": {
          "type": "array",
          "minItems": 1,
          "maxItems": 50,
          "uniqueItems": true,
          "items": {
            "$ref": "#/$defs/address"
          }
        },
        "readFields": {
          "type": "array",
          "minItems": 10,
          "maxItems": 12,
          "uniqueItems": true,
          "items": {
            "enum": [
              "proxyCode",
              "singleton",
              "owners",
              "threshold",
              "nonce",
              "modules",
              "guard",
              "fallbackHandler",
              "nativeBalance",
              "projectTokenBalance",
              "wrappedNativeBalance",
              "executedTransactions"
            ]
          }
        },
        "moduleEnumeration": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "pageSize",
            "maxPages",
            "sentinel"
          ],
          "properties": {
            "pageSize": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "maxPages": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100
            },
            "sentinel": {
              "$ref": "#/$defs/address"
            }
          }
        }
      }
    },
    "uniswapV3": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "protocol",
        "factory",
        "positionManager",
        "pool",
        "position"
      ],
      "properties": {
        "protocol": {
          "const": "Uniswap V3"
        },
        "factory": {
          "$ref": "#/$defs/address"
        },
        "positionManager": {
          "$ref": "#/$defs/address"
        },
        "pool": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "address",
            "token0",
            "token1",
            "feeTier",
            "expectedTickSpacing",
            "readFields"
          ],
          "properties": {
            "address": {
              "$ref": "#/$defs/address"
            },
            "token0": {
              "$ref": "#/$defs/address"
            },
            "token1": {
              "$ref": "#/$defs/address"
            },
            "feeTier": {
              "type": "integer",
              "minimum": 1,
              "maximum": 1000000
            },
            "expectedTickSpacing": {
              "type": "integer",
              "minimum": 1,
              "maximum": 32767
            },
            "readFields": {
              "type": "array",
              "minItems": 10,
              "maxItems": 12,
              "uniqueItems": true,
              "items": {
                "enum": [
                  "code",
                  "factoryMapping",
                  "token0",
                  "token1",
                  "fee",
                  "tickSpacing",
                  "slot0.sqrtPriceX96",
                  "slot0.tick",
                  "slot0.unlocked",
                  "liquidity",
                  "token0Balance",
                  "token1Balance"
                ]
              }
            }
          }
        },
        "position": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "tokenId",
            "expectedOwner",
            "expectedFullRange",
            "expectedTickLower",
            "expectedTickUpper",
            "readFields"
          ],
          "properties": {
            "tokenId": {
              "$ref": "#/$defs/decimalString"
            },
            "expectedOwner": {
              "$ref": "#/$defs/address"
            },
            "expectedFullRange": {
              "type": "boolean"
            },
            "expectedTickLower": {
              "type": "integer",
              "minimum": -887272,
              "maximum": 887272
            },
            "expectedTickUpper": {
              "type": "integer",
              "minimum": -887272,
              "maximum": 887272
            },
            "readFields": {
              "type": "array",
              "minItems": 10,
              "maxItems": 11,
              "uniqueItems": true,
              "items": {
                "enum": [
                  "positionManagerCode",
                  "ownerOf",
                  "token0",
                  "token1",
                  "fee",
                  "tickLower",
                  "tickUpper",
                  "liquidity",
                  "feeGrowthInside0LastX128",
                  "feeGrowthInside1LastX128",
                  "tokensOwed"
                ]
              }
            }
          }
        }
      }
    },
    "document": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "documentId",
        "title",
        "language",
        "url",
        "version",
        "sha256",
        "evidenceTier"
      ],
      "properties": {
        "documentId": {
          "type": "string",
          "pattern": "^[a-z0-9]+(?:-[a-z0-9]+)*$"
        },
        "title": {
          "type": "string",
          "minLength": 1,
          "maxLength": 160
        },
        "language": {
          "type": "string",
          "pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"
        },
        "url": {
          "$ref": "#/$defs/httpsUrl"
        },
        "version": {
          "type": "string",
          "minLength": 1,
          "maxLength": 40
        },
        "sha256": {
          "$ref": "#/$defs/sha256"
        },
        "evidenceTier": {
          "const": "D"
        }
      }
    },
    "freshnessProfile": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "maxAgeSeconds",
        "maxStaleSeconds",
        "blockTag"
      ],
      "properties": {
        "maxAgeSeconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 31536000
        },
        "maxStaleSeconds": {
          "type": "integer",
          "minimum": 0,
          "maximum": 31536000
        },
        "blockTag": {
          "enum": [
            "finalized",
            "latest",
            "not_applicable"
          ]
        }
      }
    },
    "freshness": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "profiles",
        "assignments"
      ],
      "properties": {
        "profiles": {
          "type": "object",
          "additionalProperties": false,
          "required": [
            "chainCritical",
            "chainStatic",
            "indexerHistory",
            "projectDocument"
          ],
          "properties": {
            "chainCritical": {
              "$ref": "#/$defs/freshnessProfile"
            },
            "chainStatic": {
              "$ref": "#/$defs/freshnessProfile"
            },
            "indexerHistory": {
              "$ref": "#/$defs/freshnessProfile"
            },
            "projectDocument": {
              "$ref": "#/$defs/freshnessProfile"
            }
          }
        },
        "assignments": {
          "type": "array",
          "minItems": 1,
          "maxItems": 100,
          "items": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "path",
              "profile"
            ],
            "properties": {
              "path": {
                "type": "string",
                "pattern": "^[a-zA-Z0-9.*]+$"
              },
              "profile": {
                "enum": [
                  "chainCritical",
                  "chainStatic",
                  "indexerHistory",
                  "projectDocument"
                ]
              }
            }
          }
        }
      }
    },
    "fallbackPolicy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "criticalProviderQuorum",
        "requireSameBlockHash",
        "onSingleProviderSuccess",
        "onProviderMismatch",
        "onAllProvidersUnavailable",
        "indexersMayOverrideOnchain",
        "manifestMayOverrideSnapshot"
      ],
      "properties": {
        "criticalProviderQuorum": {
          "type": "integer",
          "minimum": 2,
          "maximum": 5
        },
        "requireSameBlockHash": {
          "const": true
        },
        "onSingleProviderSuccess": {
          "const": "provisional"
        },
        "onProviderMismatch": {
          "const": "conflict_with_null_value"
        },
        "onAllProvidersUnavailable": {
          "const": "last_good_stale_until_limit_then_unavailable"
        },
        "indexersMayOverrideOnchain": {
          "const": false
        },
        "manifestMayOverrideSnapshot": {
          "const": false
        }
      }
    },
    "disclosures": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "evidenceTier",
        "noPublicSale",
        "productUtilityEnabled",
        "independentAuditStatus",
        "liquidityRisk",
        "lpLockStatus",
        "notes"
      ],
      "properties": {
        "evidenceTier": {
          "const": "D"
        },
        "noPublicSale": {
          "type": "boolean"
        },
        "productUtilityEnabled": {
          "type": "boolean"
        },
        "independentAuditStatus": {
          "enum": [
            "not_completed",
            "completed"
          ]
        },
        "liquidityRisk": {
          "enum": [
            "extremely_low",
            "low",
            "moderate",
            "not_assessed"
          ]
        },
        "lpLockStatus": {
          "enum": [
            "not_locked",
            "locked_verified",
            "unverified"
          ]
        },
        "notes": {
          "type": "array",
          "minItems": 1,
          "maxItems": 20,
          "items": {
            "type": "string",
            "minLength": 1,
            "maxLength": 400
          }
        }
      }
    }
  }
}
