{
  "schemaVersion": "1.0",
  "item": {
    "slug": "tezos",
    "name": "Tezos Skill",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/efekucuk/tezos",
    "canonicalUrl": "https://clawhub.ai/efekucuk/tezos",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/tezos",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tezos",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "README.md",
      "SKILL.md"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "Download the package from Yavira.",
        "Extract it into a folder your agent can access.",
        "Paste one of the prompts below and point your agent at the extracted folder."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
        },
        {
          "label": "Upgrade existing",
          "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
        }
      ]
    },
    "sourceHealth": {
      "source": "tencent",
      "slug": "tezos",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-09T22:40:31.589Z",
      "expiresAt": "2026-05-16T22:40:31.589Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tezos",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=tezos",
        "contentDisposition": "attachment; filename=\"tezos-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "tezos"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/tezos"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/tezos",
    "agentPageUrl": "https://openagent3.xyz/skills/tezos/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tezos/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tezos/agent.md"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "Download the package from Yavira.",
      "Extract it into a folder your agent can access.",
      "Paste one of the prompts below and point your agent at the extracted folder."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete."
      },
      {
        "label": "Upgrade existing",
        "body": "I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "Tezos Smart Contract Development Expert",
        "body": "You are an expert Tezos blockchain developer with deep knowledge of smart contract security, gas optimization, and production deployment. When working with Tezos:"
      },
      {
        "title": "Core Development Philosophy",
        "body": "Security First: Every contract must pass security validation before considering functionality complete. Always validate inputs, check authorization, and prevent reentrancy.\n\nGas Conscious: Every operation has a cost. Default to efficient patterns - use big_map over map, views for reads, batch operations over loops.\n\nTest Thoroughly: Never deploy to mainnet without comprehensive testing on Shadownet. Simulate all operations before execution."
      },
      {
        "title": "LIGO (Recommended for Most Projects)",
        "body": "Use LIGO as the default choice for production contracts. It provides type safety, readability, and compiles to efficient Michelson.\n\nCameLIGO - Functional style, OCaml-like syntax:\n\ntype storage = {\n  owner: address;\n  balance: nat;\n  paused: bool;\n}\n\ntype action =\n| Transfer of address * nat\n| SetOwner of address\n| Pause\n\nlet is_owner (addr, storage : address * storage) : bool =\n  addr = storage.owner\n\n[@entry]\nlet transfer (dest, amount : address * nat) (storage : storage) : operation list * storage =\n  let () = if storage.paused then failwith \"CONTRACT_PAUSED\" else () in\n  let () = if amount > storage.balance then failwith \"INSUFFICIENT_BALANCE\" else () in\n  let contract = match Tezos.get_contract_opt dest with\n    | None -> failwith \"INVALID_ADDRESS\"\n    | Some c -> c\n  in\n  let op = Tezos.transaction () (amount * 1mutez) contract in\n  [op], {storage with balance = storage.balance - amount}\n\nJsLIGO - Imperative style, JavaScript-like syntax:\n\ntype storage = {\n  owner: address,\n  counter: nat\n};\n\n@entry\nconst increment = (delta: nat, storage: storage): [list<operation>, storage] => {\n  if (Tezos.get_sender() != storage.owner) {\n    return failwith(\"NOT_OWNER\");\n  }\n  return [list([]), {...storage, counter: storage.counter + delta}];\n};"
      },
      {
        "title": "Michelson (For Gas-Critical Paths)",
        "body": "Use Michelson only when:\n\nMaximum gas optimization is required\nYou need direct protocol feature access\nWorking on core infrastructure\n\nMichelson is stack-based and harder to audit. Prefer LIGO unless you have a specific reason."
      },
      {
        "title": "SmartPy (For Rapid Prototyping)",
        "body": "Use SmartPy for:\n\nQuick proof of concepts\nPython developers\nTeaching/learning\n\nNot recommended for production without thorough review."
      },
      {
        "title": "1. Reentrancy Protection",
        "body": "ALWAYS update state before external calls:\n\n// ❌ VULNERABLE - state updated after external call\n[@entry]\nlet withdraw (amount : tez) (storage : storage) : operation list * storage =\n  let contract = Tezos.get_contract_opt(Tezos.get_sender()) in\n  let op = Tezos.transaction () amount contract in\n  [op], {storage with withdrawn = true}\n\n// ✅ SECURE - state updated first\n[@entry]\nlet withdraw (amount : tez) (storage : storage) : operation list * storage =\n  let () = if storage.withdrawn then failwith \"ALREADY_WITHDRAWN\" else () in\n  let storage = {storage with withdrawn = true} in\n  let contract = match Tezos.get_contract_opt(Tezos.get_sender()) with\n    | None -> failwith \"INVALID_ADDRESS\"\n    | Some c -> c\n  in\n  let op = Tezos.transaction () amount contract in\n  [op], storage"
      },
      {
        "title": "2. Access Control",
        "body": "Always verify sender authorization:\n\ntype storage = {\n  admin: address;\n  data: big_map(address, nat);\n}\n\nlet require_admin (storage : storage) : unit =\n  if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\"\n  else ()\n\n[@entry]\nlet update_admin (new_admin : address) (storage : storage) : operation list * storage =\n  let () = require_admin(storage) in\n  [], {storage with admin = new_admin}"
      },
      {
        "title": "3. Input Validation",
        "body": "Validate all parameters at entry boundaries:\n\n[@entry]\nlet transfer (dest, amount : address * nat) (storage : storage) : operation list * storage =\n  // Validate destination\n  let () = match Tezos.get_contract_opt(dest) with\n    | None -> failwith \"INVALID_DESTINATION\"\n    | Some _ -> ()\n  in\n  // Validate amount\n  let () = if amount = 0n then failwith \"ZERO_AMOUNT\" else () in\n  let () = if amount > storage.balance then failwith \"INSUFFICIENT_BALANCE\" else () in\n  // ... proceed with transfer"
      },
      {
        "title": "4. Integer Overflow Prevention",
        "body": "Use nat for non-negative values, validate bounds:\n\n[@entry]\nlet add_tokens (amount : nat) (storage : storage) : operation list * storage =\n  // Validate reasonable bounds\n  let max_amount = 1_000_000_000n in\n  let () = if amount > max_amount then failwith \"AMOUNT_TOO_LARGE\" else () in\n  // Safe addition with nat\n  let new_balance = storage.balance + amount in\n  [], {storage with balance = new_balance}"
      },
      {
        "title": "5. Timestamp Usage",
        "body": "Use Tezos.get_now(), never system time:\n\n[@entry]\nlet check_deadline (storage : storage) : operation list * storage =\n  let now = Tezos.get_now() in\n  let () = if now > storage.deadline then\n    failwith \"DEADLINE_PASSED\"\n  else () in\n  [], storage"
      },
      {
        "title": "FA2 Token Standard (TZIP-12)",
        "body": "FA2 is the multi-token standard supporting fungible tokens, NFTs, and hybrid contracts."
      },
      {
        "title": "Required Entry Points",
        "body": "type transfer_destination = {\n  to_: address;\n  token_id: nat;\n  amount: nat;\n}\n\ntype transfer = {\n  from_: address;\n  txs: transfer_destination list;\n}\n\n// Entry point: transfer\n[@entry]\nlet transfer (transfers : transfer list) (storage : storage) : operation list * storage =\n  let sender = Tezos.get_sender() in\n\n  let process_transfer (storage, xfer : storage * transfer) : storage =\n    // Verify sender is authorized (owner or operator)\n    let () = if xfer.from_ <> sender then\n      let key = (xfer.from_, sender) in\n      if not Big_map.mem key storage.operators then\n        failwith \"FA2_NOT_OPERATOR\"\n      else ()\n    else () in\n\n    // Process each transfer destination\n    List.fold_left\n      (fun (storage, tx) ->\n        // Get current balance\n        let from_balance = get_balance(xfer.from_, tx.token_id, storage) in\n\n        // Check sufficient balance\n        let () = if from_balance < tx.amount then\n          failwith \"FA2_INSUFFICIENT_BALANCE\"\n        else () in\n\n        // Update balances\n        let storage = set_balance(xfer.from_, tx.token_id,\n          abs(from_balance - tx.amount), storage) in\n        let to_balance = get_balance(tx.to_, tx.token_id, storage) in\n        set_balance(tx.to_, tx.token_id, to_balance + tx.amount, storage))\n      storage\n      xfer.txs\n  in\n\n  let storage = List.fold_left process_transfer storage transfers in\n  [], storage\n\n// Entry point: balance_of (callback pattern)\ntype balance_of_request = {\n  owner: address;\n  token_id: nat;\n}\n\ntype balance_of_response = {\n  request: balance_of_request;\n  balance: nat;\n}\n\n[@entry]\nlet balance_of\n  (requests : balance_of_request list)\n  (callback : balance_of_response list contract)\n  (storage : storage)\n  : operation list * storage =\n\n  let responses = List.map\n    (fun (req : balance_of_request) ->\n      let balance = get_balance(req.owner, req.token_id, storage) in\n      {request = req; balance = balance})\n    requests\n  in\n  let op = Tezos.transaction responses 0mutez callback in\n  [op], storage\n\n// Entry point: update_operators\ntype operator_update =\n| Add_operator of address * address * nat\n| Remove_operator of address * address * nat\n\n[@entry]\nlet update_operators (updates : operator_update list) (storage : storage) : operation list * storage =\n  let sender = Tezos.get_sender() in\n\n  let process_update (storage, update : storage * operator_update) : storage =\n    match update with\n    | Add_operator (owner, operator, token_id) ->\n        let () = if sender <> owner then failwith \"FA2_NOT_OWNER\" else () in\n        {storage with operators = Big_map.add (owner, operator) () storage.operators}\n    | Remove_operator (owner, operator, token_id) ->\n        let () = if sender <> owner then failwith \"FA2_NOT_OWNER\" else () in\n        {storage with operators = Big_map.remove (owner, operator) storage.operators}\n  in\n\n  let storage = List.fold_left process_update storage updates in\n  [], storage"
      },
      {
        "title": "FA2 NFT Pattern",
        "body": "For NFTs, enforce amount = 1 per token_id:\n\nlet validate_nft_transfer (amount : nat) : unit =\n  if amount <> 1n then failwith \"FA2_INVALID_AMOUNT\" else ()"
      },
      {
        "title": "FA2 with Metadata (TZIP-16)",
        "body": "type token_metadata = {\n  token_id: nat;\n  token_info: (string, bytes) map;\n}\n\ntype storage = {\n  // ... other fields\n  token_metadata: (nat, token_metadata) big_map;\n  metadata: (string, bytes) big_map;\n}\n\n// Off-chain view for token metadata\n[@view]\nlet token_metadata (token_id : nat) (storage : storage) : token_metadata =\n  match Big_map.find_opt token_id storage.token_metadata with\n  | None -> failwith \"FA2_TOKEN_UNDEFINED\"\n  | Some meta -> meta"
      },
      {
        "title": "1. Use big_map for Large Collections",
        "body": "// ❌ Expensive - entire map in context\ntype storage = {\n  balances: (address, nat) map;\n}\n\n// ✅ Efficient - only accessed entries in context\ntype storage = {\n  balances: (address, nat) big_map;\n}"
      },
      {
        "title": "2. Use Views for Read-Only Operations",
        "body": "Views have no gas cost when called off-chain:\n\n[@view]\nlet get_balance (owner : address) (storage : storage) : nat =\n  match Big_map.find_opt owner storage.balances with\n  | None -> 0n\n  | Some balance -> balance"
      },
      {
        "title": "3. Batch Operations",
        "body": "// ❌ Expensive - multiple transactions\ntransfer(alice, 100n);\ntransfer(bob, 200n);\ntransfer(charlie, 300n);\n\n// ✅ Efficient - single batched operation\ntype batch_transfer = {\n  recipients: (address * nat) list;\n}\n\n[@entry]\nlet batch_transfer (batch : batch_transfer) (storage : storage) : operation list * storage =\n  List.fold_left\n    (fun (storage, (recipient, amount)) ->\n      process_single_transfer(recipient, amount, storage))\n    storage\n    batch.recipients"
      },
      {
        "title": "4. Cache Storage Reads",
        "body": "// ❌ Multiple reads of same value\n[@entry]\nlet process (storage : storage) : operation list * storage =\n  if storage.config.enabled then\n    if storage.config.rate > 0n then\n      let result = storage.config.rate * storage.config.multiplier in\n      // ... storage.config read 4 times\n\n// ✅ Single read, cached locally\n[@entry]\nlet process (storage : storage) : operation list * storage =\n  let config = storage.config in\n  if config.enabled then\n    if config.rate > 0n then\n      let result = config.rate * config.multiplier in\n      // ... config accessed from local variable"
      },
      {
        "title": "5. Optimize Data Packing",
        "body": "// Store complex data efficiently\n[@entry]\nlet store_data (data : complex_type) (storage : storage) : operation list * storage =\n  let packed = Bytes.pack data in\n  {storage with packed_data = Big_map.add key packed storage.packed_data}\n\n[@view]\nlet retrieve_data (key : string) (storage : storage) : complex_type =\n  match Big_map.find_opt key storage.packed_data with\n  | None -> failwith \"NOT_FOUND\"\n  | Some packed ->\n      match Bytes.unpack packed with\n      | None -> failwith \"UNPACK_FAILED\"\n      | Some data -> data"
      },
      {
        "title": "Admin Pattern with Transfer",
        "body": "type storage = {\n  admin: address;\n  pending_admin: address option;\n  // ... other fields\n}\n\n[@entry]\nlet propose_admin (new_admin : address) (storage : storage) : operation list * storage =\n  let () = if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\" else () in\n  [], {storage with pending_admin = Some new_admin}\n\n[@entry]\nlet accept_admin (storage : storage) : operation list * storage =\n  match storage.pending_admin with\n  | None -> failwith \"NO_PENDING_ADMIN\", storage\n  | Some pending ->\n      let () = if Tezos.get_sender() <> pending then\n        failwith \"NOT_PENDING_ADMIN\" else () in\n      [], {storage with admin = pending; pending_admin = None}"
      },
      {
        "title": "Pausable Pattern",
        "body": "type storage = {\n  paused: bool;\n  admin: address;\n  // ... other fields\n}\n\nlet require_not_paused (storage : storage) : unit =\n  if storage.paused then failwith \"CONTRACT_PAUSED\" else ()\n\n[@entry]\nlet pause (storage : storage) : operation list * storage =\n  let () = if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\" else () in\n  [], {storage with paused = true}\n\n[@entry]\nlet unpause (storage : storage) : operation list * storage =\n  let () = if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\" else () in\n  [], {storage with paused = false}"
      },
      {
        "title": "Rate Limiting Pattern",
        "body": "type storage = {\n  last_action: (address, timestamp) big_map;\n  cooldown_period: int;\n  // ... other fields\n}\n\nlet check_rate_limit (sender : address) (storage : storage) : unit =\n  match Big_map.find_opt sender storage.last_action with\n  | None -> ()\n  | Some last_time ->\n      let now = Tezos.get_now() in\n      let elapsed = now - last_time in\n      if elapsed < storage.cooldown_period then\n        failwith \"RATE_LIMIT_EXCEEDED\"\n      else ()\n\n[@entry]\nlet rate_limited_action (storage : storage) : operation list * storage =\n  let sender = Tezos.get_sender() in\n  let () = check_rate_limit(sender, storage) in\n  let storage = {storage with\n    last_action = Big_map.update sender (Some (Tezos.get_now())) storage.last_action\n  } in\n  // ... perform action\n  [], storage"
      },
      {
        "title": "1. Write Tests First",
        "body": "Before implementing, write test cases:\n\n# tests/contract_test.mligo\nlet test_transfer_success =\n  let initial_storage = {\n    balances = Big_map.literal [(alice, 1000n); (bob, 0n)];\n    admin = admin_address;\n  } in\n  let (ops, storage) = transfer(bob, 100n, initial_storage) in\n  assert (Big_map.find alice storage.balances = 900n);\n  assert (Big_map.find bob storage.balances = 100n)\n\nlet test_transfer_insufficient_balance =\n  let initial_storage = {\n    balances = Big_map.literal [(alice, 50n)];\n    admin = admin_address;\n  } in\n  // Should fail with INSUFFICIENT_BALANCE\n  Test.expect_failure (fun () -> transfer(bob, 100n, initial_storage))"
      },
      {
        "title": "2. Test Security Boundaries",
        "body": "# Test unauthorized access\nlet test_admin_only_fails =\n  Test.set_source(non_admin);\n  Test.expect_failure (fun () -> pause(storage))\n\n# Test reentrancy protection\nlet test_double_withdrawal_fails =\n  withdraw(amount, storage);\n  Test.expect_failure (fun () -> withdraw(amount, storage))\n\n# Test overflow conditions\nlet test_max_amount =\n  let max_nat = 1000000000n in\n  Test.expect_failure (fun () -> add_tokens(max_nat + 1n, storage))"
      },
      {
        "title": "3. Simulate on Shadownet",
        "body": "Always simulate before real transactions:\n\noctez-client \\\n  --endpoint https://rpc.shadownet.teztnets.com \\\n  transfer 0 from alice to my_contract \\\n  --entrypoint transfer \\\n  --arg '{\"dest\": \"tz1...\", \"amount\": 100}' \\\n  --dry-run \\\n  --gas-limit 100000"
      },
      {
        "title": "Step 1: Compile and Verify",
        "body": "# Compile contract\nligo compile contract contract.mligo > contract.tz\n\n# Compile initial storage\nligo compile storage contract.mligo '{\n  admin = (\"tz1...\" : address);\n  balance = 0n;\n  paused = false;\n}' > storage.tz\n\n# Verify Michelson output\ncat contract.tz"
      },
      {
        "title": "Step 2: Deploy to Shadownet",
        "body": "# Originate on testnet\noctez-client \\\n  --endpoint https://rpc.shadownet.teztnets.com \\\n  originate contract my_contract \\\n  transferring 0 from alice \\\n  running contract.tz \\\n  --init \"$(cat storage.tz)\" \\\n  --burn-cap 10.0 \\\n  --force\n\n# Note the KT1... address"
      },
      {
        "title": "Step 3: Integration Testing",
        "body": "# Test all entry points\noctez-client transfer 0 from alice to my_contract \\\n  --entrypoint transfer \\\n  --arg '{\"dest\": \"tz1...\", \"amount\": 100}'\n\n# Verify storage state\noctez-client get contract storage for my_contract\n\n# Check operations\ncurl https://api.shadownet.tzkt.io/v1/contracts/KT1.../operations"
      },
      {
        "title": "Step 4: Security Review",
        "body": "Before mainnet deployment:\n\nAll entry points tested\n Access control verified\n Reentrancy protection confirmed\n Input validation complete\n Gas optimization reviewed\n Professional audit (for high-value contracts)\n Bug bounty considered"
      },
      {
        "title": "Step 5: Mainnet Deployment",
        "body": "# Deploy to mainnet (after thorough testing!)\noctez-client \\\n  --endpoint https://mainnet.api.tez.ie \\\n  originate contract my_contract \\\n  transferring 0 from deployer \\\n  running contract.tz \\\n  --init \"$(cat storage.tz)\" \\\n  --burn-cap 10.0\n\n# Verify on explorer\nopen https://tzkt.io/KT1..."
      },
      {
        "title": "Mainnet (Production)",
        "body": "RPC: https://mainnet.api.tez.ie\nExplorer: https://tzkt.io\nUse for: Production deployments only\nCost: Real XTZ"
      },
      {
        "title": "Shadownet (Primary Testnet - Recommended)",
        "body": "RPC: https://rpc.shadownet.teztnets.com\nFaucet: https://faucet.shadownet.teztnets.com\nExplorer: https://shadownet.tzkt.io\nUse for: All development and testing\nStatus: Long-running, similar to mainnet"
      },
      {
        "title": "Ghostnet (Legacy - Deprecated)",
        "body": "RPC: https://rpc.ghostnet.teztnets.com\nStatus: Being phased out\nAction: Migrate projects to Shadownet\n\nAlways test thoroughly on Shadownet before deploying to mainnet."
      },
      {
        "title": "When to Invoke This Skill",
        "body": "Use this skill when:\n\nBuilding Tezos smart contracts\nImplementing FA1.2 or FA2 token standards\nOptimizing gas usage\nDebugging contract issues\nPlanning production deployment\nReviewing contract security"
      },
      {
        "title": "Resources",
        "body": "Tezos Docs: https://docs.tezos.com\nLIGO: https://ligolang.org\nOpenTezos: https://opentezos.com\nTzKT Explorer: https://tzkt.io\nToken Standards: https://gitlab.com/tezos/tzip\nTestnet Registry: https://teztnets.com\n\nRemember: Security first, test thoroughly, deploy confidently."
      }
    ],
    "body": "Tezos Smart Contract Development Expert\n\nYou are an expert Tezos blockchain developer with deep knowledge of smart contract security, gas optimization, and production deployment. When working with Tezos:\n\nCore Development Philosophy\n\nSecurity First: Every contract must pass security validation before considering functionality complete. Always validate inputs, check authorization, and prevent reentrancy.\n\nGas Conscious: Every operation has a cost. Default to efficient patterns - use big_map over map, views for reads, batch operations over loops.\n\nTest Thoroughly: Never deploy to mainnet without comprehensive testing on Shadownet. Simulate all operations before execution.\n\nSmart Contract Language Selection\nLIGO (Recommended for Most Projects)\n\nUse LIGO as the default choice for production contracts. It provides type safety, readability, and compiles to efficient Michelson.\n\nCameLIGO - Functional style, OCaml-like syntax:\n\ntype storage = {\n  owner: address;\n  balance: nat;\n  paused: bool;\n}\n\ntype action =\n| Transfer of address * nat\n| SetOwner of address\n| Pause\n\nlet is_owner (addr, storage : address * storage) : bool =\n  addr = storage.owner\n\n[@entry]\nlet transfer (dest, amount : address * nat) (storage : storage) : operation list * storage =\n  let () = if storage.paused then failwith \"CONTRACT_PAUSED\" else () in\n  let () = if amount > storage.balance then failwith \"INSUFFICIENT_BALANCE\" else () in\n  let contract = match Tezos.get_contract_opt dest with\n    | None -> failwith \"INVALID_ADDRESS\"\n    | Some c -> c\n  in\n  let op = Tezos.transaction () (amount * 1mutez) contract in\n  [op], {storage with balance = storage.balance - amount}\n\n\nJsLIGO - Imperative style, JavaScript-like syntax:\n\ntype storage = {\n  owner: address,\n  counter: nat\n};\n\n@entry\nconst increment = (delta: nat, storage: storage): [list<operation>, storage] => {\n  if (Tezos.get_sender() != storage.owner) {\n    return failwith(\"NOT_OWNER\");\n  }\n  return [list([]), {...storage, counter: storage.counter + delta}];\n};\n\nMichelson (For Gas-Critical Paths)\n\nUse Michelson only when:\n\nMaximum gas optimization is required\nYou need direct protocol feature access\nWorking on core infrastructure\n\nMichelson is stack-based and harder to audit. Prefer LIGO unless you have a specific reason.\n\nSmartPy (For Rapid Prototyping)\n\nUse SmartPy for:\n\nQuick proof of concepts\nPython developers\nTeaching/learning\n\nNot recommended for production without thorough review.\n\nCritical Security Patterns\n1. Reentrancy Protection\n\nALWAYS update state before external calls:\n\n// ❌ VULNERABLE - state updated after external call\n[@entry]\nlet withdraw (amount : tez) (storage : storage) : operation list * storage =\n  let contract = Tezos.get_contract_opt(Tezos.get_sender()) in\n  let op = Tezos.transaction () amount contract in\n  [op], {storage with withdrawn = true}\n\n// ✅ SECURE - state updated first\n[@entry]\nlet withdraw (amount : tez) (storage : storage) : operation list * storage =\n  let () = if storage.withdrawn then failwith \"ALREADY_WITHDRAWN\" else () in\n  let storage = {storage with withdrawn = true} in\n  let contract = match Tezos.get_contract_opt(Tezos.get_sender()) with\n    | None -> failwith \"INVALID_ADDRESS\"\n    | Some c -> c\n  in\n  let op = Tezos.transaction () amount contract in\n  [op], storage\n\n2. Access Control\n\nAlways verify sender authorization:\n\ntype storage = {\n  admin: address;\n  data: big_map(address, nat);\n}\n\nlet require_admin (storage : storage) : unit =\n  if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\"\n  else ()\n\n[@entry]\nlet update_admin (new_admin : address) (storage : storage) : operation list * storage =\n  let () = require_admin(storage) in\n  [], {storage with admin = new_admin}\n\n3. Input Validation\n\nValidate all parameters at entry boundaries:\n\n[@entry]\nlet transfer (dest, amount : address * nat) (storage : storage) : operation list * storage =\n  // Validate destination\n  let () = match Tezos.get_contract_opt(dest) with\n    | None -> failwith \"INVALID_DESTINATION\"\n    | Some _ -> ()\n  in\n  // Validate amount\n  let () = if amount = 0n then failwith \"ZERO_AMOUNT\" else () in\n  let () = if amount > storage.balance then failwith \"INSUFFICIENT_BALANCE\" else () in\n  // ... proceed with transfer\n\n4. Integer Overflow Prevention\n\nUse nat for non-negative values, validate bounds:\n\n[@entry]\nlet add_tokens (amount : nat) (storage : storage) : operation list * storage =\n  // Validate reasonable bounds\n  let max_amount = 1_000_000_000n in\n  let () = if amount > max_amount then failwith \"AMOUNT_TOO_LARGE\" else () in\n  // Safe addition with nat\n  let new_balance = storage.balance + amount in\n  [], {storage with balance = new_balance}\n\n5. Timestamp Usage\n\nUse Tezos.get_now(), never system time:\n\n[@entry]\nlet check_deadline (storage : storage) : operation list * storage =\n  let now = Tezos.get_now() in\n  let () = if now > storage.deadline then\n    failwith \"DEADLINE_PASSED\"\n  else () in\n  [], storage\n\nFA2 Token Standard (TZIP-12)\n\nFA2 is the multi-token standard supporting fungible tokens, NFTs, and hybrid contracts.\n\nRequired Entry Points\ntype transfer_destination = {\n  to_: address;\n  token_id: nat;\n  amount: nat;\n}\n\ntype transfer = {\n  from_: address;\n  txs: transfer_destination list;\n}\n\n// Entry point: transfer\n[@entry]\nlet transfer (transfers : transfer list) (storage : storage) : operation list * storage =\n  let sender = Tezos.get_sender() in\n\n  let process_transfer (storage, xfer : storage * transfer) : storage =\n    // Verify sender is authorized (owner or operator)\n    let () = if xfer.from_ <> sender then\n      let key = (xfer.from_, sender) in\n      if not Big_map.mem key storage.operators then\n        failwith \"FA2_NOT_OPERATOR\"\n      else ()\n    else () in\n\n    // Process each transfer destination\n    List.fold_left\n      (fun (storage, tx) ->\n        // Get current balance\n        let from_balance = get_balance(xfer.from_, tx.token_id, storage) in\n\n        // Check sufficient balance\n        let () = if from_balance < tx.amount then\n          failwith \"FA2_INSUFFICIENT_BALANCE\"\n        else () in\n\n        // Update balances\n        let storage = set_balance(xfer.from_, tx.token_id,\n          abs(from_balance - tx.amount), storage) in\n        let to_balance = get_balance(tx.to_, tx.token_id, storage) in\n        set_balance(tx.to_, tx.token_id, to_balance + tx.amount, storage))\n      storage\n      xfer.txs\n  in\n\n  let storage = List.fold_left process_transfer storage transfers in\n  [], storage\n\n// Entry point: balance_of (callback pattern)\ntype balance_of_request = {\n  owner: address;\n  token_id: nat;\n}\n\ntype balance_of_response = {\n  request: balance_of_request;\n  balance: nat;\n}\n\n[@entry]\nlet balance_of\n  (requests : balance_of_request list)\n  (callback : balance_of_response list contract)\n  (storage : storage)\n  : operation list * storage =\n\n  let responses = List.map\n    (fun (req : balance_of_request) ->\n      let balance = get_balance(req.owner, req.token_id, storage) in\n      {request = req; balance = balance})\n    requests\n  in\n  let op = Tezos.transaction responses 0mutez callback in\n  [op], storage\n\n// Entry point: update_operators\ntype operator_update =\n| Add_operator of address * address * nat\n| Remove_operator of address * address * nat\n\n[@entry]\nlet update_operators (updates : operator_update list) (storage : storage) : operation list * storage =\n  let sender = Tezos.get_sender() in\n\n  let process_update (storage, update : storage * operator_update) : storage =\n    match update with\n    | Add_operator (owner, operator, token_id) ->\n        let () = if sender <> owner then failwith \"FA2_NOT_OWNER\" else () in\n        {storage with operators = Big_map.add (owner, operator) () storage.operators}\n    | Remove_operator (owner, operator, token_id) ->\n        let () = if sender <> owner then failwith \"FA2_NOT_OWNER\" else () in\n        {storage with operators = Big_map.remove (owner, operator) storage.operators}\n  in\n\n  let storage = List.fold_left process_update storage updates in\n  [], storage\n\nFA2 NFT Pattern\n\nFor NFTs, enforce amount = 1 per token_id:\n\nlet validate_nft_transfer (amount : nat) : unit =\n  if amount <> 1n then failwith \"FA2_INVALID_AMOUNT\" else ()\n\nFA2 with Metadata (TZIP-16)\ntype token_metadata = {\n  token_id: nat;\n  token_info: (string, bytes) map;\n}\n\ntype storage = {\n  // ... other fields\n  token_metadata: (nat, token_metadata) big_map;\n  metadata: (string, bytes) big_map;\n}\n\n// Off-chain view for token metadata\n[@view]\nlet token_metadata (token_id : nat) (storage : storage) : token_metadata =\n  match Big_map.find_opt token_id storage.token_metadata with\n  | None -> failwith \"FA2_TOKEN_UNDEFINED\"\n  | Some meta -> meta\n\nGas Optimization Patterns\n1. Use big_map for Large Collections\n// ❌ Expensive - entire map in context\ntype storage = {\n  balances: (address, nat) map;\n}\n\n// ✅ Efficient - only accessed entries in context\ntype storage = {\n  balances: (address, nat) big_map;\n}\n\n2. Use Views for Read-Only Operations\n\nViews have no gas cost when called off-chain:\n\n[@view]\nlet get_balance (owner : address) (storage : storage) : nat =\n  match Big_map.find_opt owner storage.balances with\n  | None -> 0n\n  | Some balance -> balance\n\n3. Batch Operations\n// ❌ Expensive - multiple transactions\ntransfer(alice, 100n);\ntransfer(bob, 200n);\ntransfer(charlie, 300n);\n\n// ✅ Efficient - single batched operation\ntype batch_transfer = {\n  recipients: (address * nat) list;\n}\n\n[@entry]\nlet batch_transfer (batch : batch_transfer) (storage : storage) : operation list * storage =\n  List.fold_left\n    (fun (storage, (recipient, amount)) ->\n      process_single_transfer(recipient, amount, storage))\n    storage\n    batch.recipients\n\n4. Cache Storage Reads\n// ❌ Multiple reads of same value\n[@entry]\nlet process (storage : storage) : operation list * storage =\n  if storage.config.enabled then\n    if storage.config.rate > 0n then\n      let result = storage.config.rate * storage.config.multiplier in\n      // ... storage.config read 4 times\n\n// ✅ Single read, cached locally\n[@entry]\nlet process (storage : storage) : operation list * storage =\n  let config = storage.config in\n  if config.enabled then\n    if config.rate > 0n then\n      let result = config.rate * config.multiplier in\n      // ... config accessed from local variable\n\n5. Optimize Data Packing\n// Store complex data efficiently\n[@entry]\nlet store_data (data : complex_type) (storage : storage) : operation list * storage =\n  let packed = Bytes.pack data in\n  {storage with packed_data = Big_map.add key packed storage.packed_data}\n\n[@view]\nlet retrieve_data (key : string) (storage : storage) : complex_type =\n  match Big_map.find_opt key storage.packed_data with\n  | None -> failwith \"NOT_FOUND\"\n  | Some packed ->\n      match Bytes.unpack packed with\n      | None -> failwith \"UNPACK_FAILED\"\n      | Some data -> data\n\nCommon Production Patterns\nAdmin Pattern with Transfer\ntype storage = {\n  admin: address;\n  pending_admin: address option;\n  // ... other fields\n}\n\n[@entry]\nlet propose_admin (new_admin : address) (storage : storage) : operation list * storage =\n  let () = if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\" else () in\n  [], {storage with pending_admin = Some new_admin}\n\n[@entry]\nlet accept_admin (storage : storage) : operation list * storage =\n  match storage.pending_admin with\n  | None -> failwith \"NO_PENDING_ADMIN\", storage\n  | Some pending ->\n      let () = if Tezos.get_sender() <> pending then\n        failwith \"NOT_PENDING_ADMIN\" else () in\n      [], {storage with admin = pending; pending_admin = None}\n\nPausable Pattern\ntype storage = {\n  paused: bool;\n  admin: address;\n  // ... other fields\n}\n\nlet require_not_paused (storage : storage) : unit =\n  if storage.paused then failwith \"CONTRACT_PAUSED\" else ()\n\n[@entry]\nlet pause (storage : storage) : operation list * storage =\n  let () = if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\" else () in\n  [], {storage with paused = true}\n\n[@entry]\nlet unpause (storage : storage) : operation list * storage =\n  let () = if Tezos.get_sender() <> storage.admin then\n    failwith \"NOT_ADMIN\" else () in\n  [], {storage with paused = false}\n\nRate Limiting Pattern\ntype storage = {\n  last_action: (address, timestamp) big_map;\n  cooldown_period: int;\n  // ... other fields\n}\n\nlet check_rate_limit (sender : address) (storage : storage) : unit =\n  match Big_map.find_opt sender storage.last_action with\n  | None -> ()\n  | Some last_time ->\n      let now = Tezos.get_now() in\n      let elapsed = now - last_time in\n      if elapsed < storage.cooldown_period then\n        failwith \"RATE_LIMIT_EXCEEDED\"\n      else ()\n\n[@entry]\nlet rate_limited_action (storage : storage) : operation list * storage =\n  let sender = Tezos.get_sender() in\n  let () = check_rate_limit(sender, storage) in\n  let storage = {storage with\n    last_action = Big_map.update sender (Some (Tezos.get_now())) storage.last_action\n  } in\n  // ... perform action\n  [], storage\n\nTesting Strategy\n1. Write Tests First\n\nBefore implementing, write test cases:\n\n# tests/contract_test.mligo\nlet test_transfer_success =\n  let initial_storage = {\n    balances = Big_map.literal [(alice, 1000n); (bob, 0n)];\n    admin = admin_address;\n  } in\n  let (ops, storage) = transfer(bob, 100n, initial_storage) in\n  assert (Big_map.find alice storage.balances = 900n);\n  assert (Big_map.find bob storage.balances = 100n)\n\nlet test_transfer_insufficient_balance =\n  let initial_storage = {\n    balances = Big_map.literal [(alice, 50n)];\n    admin = admin_address;\n  } in\n  // Should fail with INSUFFICIENT_BALANCE\n  Test.expect_failure (fun () -> transfer(bob, 100n, initial_storage))\n\n2. Test Security Boundaries\n# Test unauthorized access\nlet test_admin_only_fails =\n  Test.set_source(non_admin);\n  Test.expect_failure (fun () -> pause(storage))\n\n# Test reentrancy protection\nlet test_double_withdrawal_fails =\n  withdraw(amount, storage);\n  Test.expect_failure (fun () -> withdraw(amount, storage))\n\n# Test overflow conditions\nlet test_max_amount =\n  let max_nat = 1000000000n in\n  Test.expect_failure (fun () -> add_tokens(max_nat + 1n, storage))\n\n3. Simulate on Shadownet\n\nAlways simulate before real transactions:\n\noctez-client \\\n  --endpoint https://rpc.shadownet.teztnets.com \\\n  transfer 0 from alice to my_contract \\\n  --entrypoint transfer \\\n  --arg '{\"dest\": \"tz1...\", \"amount\": 100}' \\\n  --dry-run \\\n  --gas-limit 100000\n\nDeployment Workflow\nStep 1: Compile and Verify\n# Compile contract\nligo compile contract contract.mligo > contract.tz\n\n# Compile initial storage\nligo compile storage contract.mligo '{\n  admin = (\"tz1...\" : address);\n  balance = 0n;\n  paused = false;\n}' > storage.tz\n\n# Verify Michelson output\ncat contract.tz\n\nStep 2: Deploy to Shadownet\n# Originate on testnet\noctez-client \\\n  --endpoint https://rpc.shadownet.teztnets.com \\\n  originate contract my_contract \\\n  transferring 0 from alice \\\n  running contract.tz \\\n  --init \"$(cat storage.tz)\" \\\n  --burn-cap 10.0 \\\n  --force\n\n# Note the KT1... address\n\nStep 3: Integration Testing\n# Test all entry points\noctez-client transfer 0 from alice to my_contract \\\n  --entrypoint transfer \\\n  --arg '{\"dest\": \"tz1...\", \"amount\": 100}'\n\n# Verify storage state\noctez-client get contract storage for my_contract\n\n# Check operations\ncurl https://api.shadownet.tzkt.io/v1/contracts/KT1.../operations\n\nStep 4: Security Review\n\nBefore mainnet deployment:\n\n All entry points tested\n Access control verified\n Reentrancy protection confirmed\n Input validation complete\n Gas optimization reviewed\n Professional audit (for high-value contracts)\n Bug bounty considered\nStep 5: Mainnet Deployment\n# Deploy to mainnet (after thorough testing!)\noctez-client \\\n  --endpoint https://mainnet.api.tez.ie \\\n  originate contract my_contract \\\n  transferring 0 from deployer \\\n  running contract.tz \\\n  --init \"$(cat storage.tz)\" \\\n  --burn-cap 10.0\n\n# Verify on explorer\nopen https://tzkt.io/KT1...\n\nNetworks\nMainnet (Production)\nRPC: https://mainnet.api.tez.ie\nExplorer: https://tzkt.io\nUse for: Production deployments only\nCost: Real XTZ\nShadownet (Primary Testnet - Recommended)\nRPC: https://rpc.shadownet.teztnets.com\nFaucet: https://faucet.shadownet.teztnets.com\nExplorer: https://shadownet.tzkt.io\nUse for: All development and testing\nStatus: Long-running, similar to mainnet\nGhostnet (Legacy - Deprecated)\nRPC: https://rpc.ghostnet.teztnets.com\nStatus: Being phased out\nAction: Migrate projects to Shadownet\n\nAlways test thoroughly on Shadownet before deploying to mainnet.\n\nWhen to Invoke This Skill\n\nUse this skill when:\n\nBuilding Tezos smart contracts\nImplementing FA1.2 or FA2 token standards\nOptimizing gas usage\nDebugging contract issues\nPlanning production deployment\nReviewing contract security\nResources\nTezos Docs: https://docs.tezos.com\nLIGO: https://ligolang.org\nOpenTezos: https://opentezos.com\nTzKT Explorer: https://tzkt.io\nToken Standards: https://gitlab.com/tezos/tzip\nTestnet Registry: https://teztnets.com\n\nRemember: Security first, test thoroughly, deploy confidently."
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/efekucuk/tezos",
    "publisherUrl": "https://clawhub.ai/efekucuk/tezos",
    "owner": "efekucuk",
    "version": "1.0.1",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/tezos",
    "downloadUrl": "https://openagent3.xyz/downloads/tezos",
    "agentUrl": "https://openagent3.xyz/skills/tezos/agent",
    "manifestUrl": "https://openagent3.xyz/skills/tezos/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/tezos/agent.md"
  }
}