К основному содержанию
скилл CX Codex

hss-system-contract — скилл для Claude Code: функции и установка

Помогает проектировать отложенные транзакции и вызовы смарт-контрактов в сети Hedera через системный контракт 0x16b. Пригодится при автоматизации DeFi-протоколов и DAO.

Установить в Claude Code · Через Skills CLI (Vercel) Все способы и платформы ↓
npx skills add hedera-dev/hedera-skills --skill hss-system-contract -a claude-code
Открыть на GitHub

Что делает hss-system-contract

Скилл даёт шаблоны и правила работы с системным контрактом Hedera Schedule Service (HSS) по адресу 0x16b. Он охватывает стандарты HIP-755, HIP-756 и HIP-1215. С их помощью Solidity-контракты создают отложенные транзакции, выпускают токены HTS и запускают вызовы других контрактов по расписанию.

Архитектура требует обязательного наследования абстрактного контракта HederaScheduleService. Сам интерфейс IHederaScheduleService пуст, а низкоуровневые вызовы вынесены во внутренние хелперы библиотеки @hashgraph/smart-contracts. Перед отправкой транзакции стоит проверять пропускную способность сети через hasScheduleCapacity, чтобы не получить ошибку SCHEDULE_EXPIRY_IS_BUSY.

Функции scheduleCall и scheduleCallWithPayer не выбрасывают revert при сбоях. Они возвращают нулевой адрес и код ошибки, поэтому контракт обязан вручную сверять статус с HederaResponseCodes.SUCCESS. Иначе сбойный вызов останется незамеченным.

Какие задачи решает

  • настроить отложенный вызов метода смарт-контракта через HIP-1215
  • запланировать создание токена HTS из Solidity по стандарту HIP-756
  • подписать расписание транзакции ключом контракта через authorizeSchedule
  • проверить пропускную способность сети Hedera вызовом hasScheduleCapacity

Примеры запросов агенту

  • Напиши контракт для отложенного вызова с проверкой hasScheduleCapacity
  • Покажи, как запланировать выпуск fungible-токена через scheduleNative
  • Добавь авторизацию расписания через authorizeSchedule для контракта 0x16b

Как установить hss-system-contract

1Через Skills CLI (Vercel)

npx skills add hedera-dev/hedera-skills --skill hss-system-contract -a claude-code

2Вручную: положить файлы

~/.claude/skills/hss-system-contract/SKILL.md

Папка скилла целиком; для одного проекта — .claude/skills/hss-system-contract/

По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов

Вопросы о hss-system-contract

Как установить hss-system-contract в Claude Code?

Выполните в терминале команду npx skills add hedera-dev/hedera-skills --skill hss-system-contract -a claude-code.

Что делает hss-system-contract?

Скилл содержит справочные шаблоны и правила для взаимодействия с системным контрактом Hedera Schedule Service по адресу 0x16b. Он помогает настраивать отложенные вызовы, минт токенов и подписание расписаний в Solidity.

Почему контракт должен наследовать HederaScheduleService?

Интерфейс IHederaScheduleService пуст. Рабочая логика низкоуровневых вызовов к 0x16b объявлена как внутренние хелперы в абстрактном контракте HederaScheduleService.

Исходный текст

SKILL.md · Apache-2.0
---
name: hss-system-contract
description: Hedera Schedule Service (HSS) smart contract development. Use when creating or interacting with scheduled transactions from Solidity via the Schedule Service system contract at 0x16b (e.g. scheduleNative for token creation, scheduleCall for generalized contract calls, authorizeSchedule, signSchedule, deleteSchedule, or querying scheduled token info).
---

# Hedera Schedule Service (HSS) System Contract

The Hedera Schedule Service system contract at **`0x16b`** exposes functions for creating and managing scheduled transactions from within Solidity. It supports:

- **HIP-755**: Authorizing and signing schedules from contracts
- **HIP-756**: Scheduling native HTS token creation (createFungibleToken, createNonFungibleToken, etc.)
- **HIP-1215**: Generalized scheduled contract calls — schedule arbitrary calls to any contract (or self) for DeFi automation, vesting, DAO operations

## Quick Reference

**Contract address:** `0x16b`

**Imports:**

```solidity
import {HederaScheduleService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/HederaScheduleService.sol";
import {IHRC1215ScheduleFacade} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/IHRC1215ScheduleFacade.sol";
```

`HederaScheduleService` is an abstract contract (like `HederaTokenService` for HTS). Inherit it to get `internal` helper functions that handle the low-level calls to `0x16b`. `HederaResponseCodes` is available transitively.

**Response codes:** SUCCESS = 22 (`HederaResponseCodes.SUCCESS`). See [references/api.md](references/api.md) for full function list and [Hedera response codes](https://github.com/hashgraph/hedera-protobufs/blob/main/services/response_code.proto).

## Critical: Inheritance Pattern

**`IHederaScheduleService` is an empty interface.** Functions are defined in `IHRC755`, `IHRC756`, `IHRC1215` and wrapped as `internal` helpers in `HederaScheduleService`. Your contract must **inherit** `HederaScheduleService`:

```solidity
contract MyScheduler is HederaScheduleService {
    error ScheduleFailed();

    function doSchedule() external {
        (int64 rc, address scheduleAddr) = scheduleCall(target, expiry, gasLimit, 0, data);
        if (rc != HederaResponseCodes.SUCCESS) revert ScheduleFailed();
    }
}
```

## Critical: Non-Reverting Behavior (HIP-1215)

The `scheduleCall`, `scheduleCallWithPayer`, and `executeCallOnPayerSignature` functions **do not revert**. On failure they return `(responseCode, address(0))`. Always check:

```solidity
error ScheduleFailed();

(int64 rc, address scheduleAddr) = scheduleCall(target, expiry, gasLimit, 0, data);
if (rc != HederaResponseCodes.SUCCESS || scheduleAddr == address(0)) {
    revert ScheduleFailed();
}
```

## Capacity and Throttling (HIP-1215)

Scheduled calls are throttled per second. Use `hasScheduleCapacity(expirySecond, gasLimit)` before scheduling to avoid `SCHEDULE_EXPIRY_IS_BUSY`:

```solidity
bool capacity = hasScheduleCapacity(expirySecond, gasLimit);
if (!capacity) {
    // Retry with a later expiry or different gas limit
    // See HIP-1215 findAvailableSecond() pattern for exponential backoff + jitter
}
```

## Common Concepts

- **Scheduled transaction**: Wraps a Hedera transaction (native HTS call or EVM contract call) for deferred execution when signature thresholds are met.
- **Payer**: Account responsible for paying fees. With `scheduleCall`, the calling contract is the payer. With `scheduleCallWithPayer` / `executeCallOnPayerSignature`, a separate payer can be specified.
- **authorizeSchedule**: Signs the schedule with the calling contract's key (ContractKey format `0.0.<ContractId>`).
- **signSchedule**: Adds protobuf-encoded signatures from EOAs or other keys.
- **Expiration**: Schedules that fail to collect all required signatures before `expirySecond` are automatically removed from the network.

## Usage Patterns

### Schedule Native Token Creation (HIP-756)

> **Note:** The payer must have sufficient HBAR when the schedule executes (for the token creation fee).

```solidity
import {HederaScheduleService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/HederaScheduleService.sol";
import {IHederaTokenService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-token-service/IHederaTokenService.sol";

contract ScheduledTokenCreator is HederaScheduleService {
    error FailToSchedule();

    function scheduleTokenCreate(
        IHederaTokenService.HederaToken memory token,
        int64 initialSupply,
        int32 decimals,
        address payer
    ) external returns (address scheduleAddr) {
        bytes memory callData = abi.encodeCall(
            IHederaTokenService.createFungibleToken,
            (token, initialSupply, decimals)
        );
        int64 rc;
        (rc, scheduleAddr) = scheduleNative(
            address(0x167), callData, payer
        );
        if (rc != HederaResponseCodes.SUCCESS) revert FailToSchedule();
    }
}
```

### Schedule Arbitrary Contract Call (HIP-1215)

```solidity
import {HederaScheduleService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/HederaScheduleService.sol";

contract Scheduler is HederaScheduleService {
    error FailToSchedule();
    event ScheduleCreated(address);

    function scheduleFutureCall(
        address target,
        uint256 expirySecond,
        uint256 gasLimit,
        bytes memory callData
    ) external returns (address scheduleAddr) {
        if (!hasScheduleCapacity(expirySecond, gasLimit)) revert FailToSchedule();

        int64 rc;
        (rc, scheduleAddr) = scheduleCall(
            target,
            expirySecond > 0 ? expirySecond : block.timestamp + 5,
            gasLimit,
            0,
            callData
        );
        if (rc != HederaResponseCodes.SUCCESS) {
            revert FailToSchedule();
        }
        emit ScheduleCreated(scheduleAddr);
    }
}
```

### Contract Signs Schedule (HIP-755)

```solidity
import {HederaScheduleService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/HederaScheduleService.sol";

contract ScheduleSigner is HederaScheduleService {
    error FailToAuthorize();
    error FailToSign();

    function signAsContract(address scheduleAddr) external {
        int64 rc = authorizeSchedule(scheduleAddr);
        if (rc != HederaResponseCodes.SUCCESS) revert FailToAuthorize();
    }

    function signWithSignatureMap(address scheduleAddr, bytes memory sigMap) external {
        int64 rc = signSchedule(scheduleAddr, sigMap);
        if (rc != HederaResponseCodes.SUCCESS) revert FailToSign();
    }
}
```

### Delete Schedule

```solidity
import {HederaScheduleService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/HederaScheduleService.sol";
import {IHRC1215ScheduleFacade} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-schedule-service/IHRC1215ScheduleFacade.sol";

contract ScheduleManager is HederaScheduleService {
    error FailToDeleteSchedule();

    // Option 1: Internal helper (inheriting HederaScheduleService)
    function deleteScheduleExample(address scheduleAddr) external {
        int64 rc = deleteSchedule(scheduleAddr);
        if (rc != HederaResponseCodes.SUCCESS) {
            revert FailToDeleteSchedule();
        }
    }

    // Option 2: Redirect — call deleteSchedule() on the schedule's address
    // (works for contracts and EOAs)
    function deleteScheduleProxy(address scheduleAddr) external {
        int64 rc = IHRC1215ScheduleFacade(scheduleAddr).deleteSchedule();
        if (rc != HederaResponseCodes.SUCCESS) {
            revert FailToDeleteSchedule();
        }
    }
}
```

## Costs

- Schedule transaction fees match HAPI ScheduleCreate, with a **20% markup** for system contract usage.
- Includes gas, storage, and consensus fees. Expired transactions incur no extra fees beyond initial scheduling/signature costs.

## References

- **API Reference**: [references/api.md](references/api.md) — Full function signatures, selectors, and usage notes
- **HIP-755**: [Schedule Service System Contract](https://hips.hedera.com/hip/hip-755)
- **HIP-756**: [Contract Scheduled Token Create](https://hips.hedera.com/hip/hip-756)
- **HIP-1215**: [Generalized Scheduled Contract Calls](https://hips.hedera.com/hip/hip-1215)
- **Source**: [hedera-smart-contracts/hedera-schedule-service](https://github.com/hashgraph/hedera-smart-contracts/tree/main/contracts/system-contracts/hedera-schedule-service)

© hedera-dev · Apache-2.0 · hedera-dev/hedera-skills

Похожие скиллы

Все скиллы по теме «Бэкенд и API» →
mcp-builder официальный anthropics Скилл проводит через создание MCP-сервера на TypeScript или Python: от изучения протокола до тестов и оценки качества. 130 949установок claude-api официальный anthropics Справочник по Anthropic SDK и API Claude для генерации кода без устаревших параметров и выдуманных методов. 74 198установок lark-im larksuite Скилл подключает Lark IM к агенту: он отправляет сообщения, ищет историю, управляет чатами и файлами. Подойдёт для задач вокруг командных коммуникаций. CX Codex +1 472 900установок lark-event larksuite Слушает события Lark/Feishu и отдаёт их потоком NDJSON. Подходит для ботов, обработчиков сообщений и долгих подписчиков. CX Codex +1 466 800установок caveman-discover JuliusBrussee Находит точки вызова LLM в репозитории и размечает их воркфлоу для Caveman Cloud, чтобы расходы на токены не сливались в одну общую кучу. CX Codex +1 104 400установок migration JuliusBrussee Скилл задаёт правила безопасных миграций схем, данных и API с обязательным откатом. Пригодится при изменениях, где нельзя терять данные или ломать совместимость. CX Codex +1 103 900установок

Из того же набора24

Hedera Agent Kit v4 Migration Ведёт проект с [email protected] на v4: меняет пакеты, импорты и переписывает кастомные инструменты на BaseTool. CX Codex +1 484установок Hedera Hook Creation Скилл помогает создавать ненаблюдаемые и неизменяющие поток выполнения хуки для Hedera Agent Kit. Пригодится при настройке аудита вызовов, сборе метрик или сохранении состояния сессии. CX Codex +1 479установок hts-system-contract Скилл помогает создавать и настраивать нативные токены Hedera через смарт-контракты Solidity с вызовом прекомпайла 0x167. Пригодится при выпуске NFT, настройке комиссий и правил KYC. CX Codex +1 463установок agent-kit-plugin Скилл помогает создавать плагины и инструменты для Hedera Agent Kit. Он пригодится при добавлении операций с токенами, аккаунтами и другими сервисами Hedera. CX Codex +1 463установок create-harness-spec Превращает идею фичи Hedera в готовый рецепт для hedera-harness: PRD, spec.yaml, валидаторы. Пригодится, когда нужно перейти от замысла к запускаемой спецификации. CX Codex +1 465установок hiero-cli Учит ИИ-агента работать с блокчейном Hedera через утилиту hcli. Помогает выпускать токены, переводить HBAR, развёртывать смарт-контракты и оплачивать вызовы по протоколу x402. CX Codex +1 460установок harness-spec-anatomy Описывает, из чего состоит рецепт hedera-harness: файлы, значения по умолчанию v3, стадии прогона и правило слепой проверки. Нужен тем, кто пишет или проверяет такие рецепты. CX Codex +1 464установок review-harness-spec Проверяет рецепт .harness/spec.yaml перед запуском тестов и генератора. Находит ошибки связей и пробелы в чеклисте оценок. CX Codex +1 459установок

Спонсоры проекта

Компании, которые помогают держать аналитику открытой