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).
From system-contractsnpx claudepluginhub hedera-dev/hedera-skills --plugin system-contractsThis skill uses the workspace's default tool permissions.
references/api.mdGuides Next.js Cache Components and Partial Prerendering (PPR) with cacheComponents enabled. Implements 'use cache', cacheLife(), cacheTag(), revalidateTag(), static/dynamic optimization, and cache debugging.
Migrates code, prompts, and API calls from Claude Sonnet 4.0/4.5 or Opus 4.1 to Opus 4.5, updating model strings on Anthropic, AWS, GCP, Azure platforms.
Configures VPN and dedicated connections like Direct Connect, ExpressRoute, Interconnect for secure on-premises to AWS, Azure, GCP, OCI hybrid networking.
The Hedera Schedule Service system contract at 0x16b exposes functions for creating and managing scheduled transactions from within Solidity. It supports:
Contract address: 0x16b
Imports:
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 for full function list and Hedera response codes.
IHederaScheduleService is an empty interface. Functions are defined in IHRC755, IHRC756, IHRC1215 and wrapped as internal helpers in HederaScheduleService. Your contract must inherit HederaScheduleService:
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();
}
}
The scheduleCall, scheduleCallWithPayer, and executeCallOnPayerSignature functions do not revert. On failure they return (responseCode, address(0)). Always check:
error ScheduleFailed();
(int64 rc, address scheduleAddr) = scheduleCall(target, expiry, gasLimit, 0, data);
if (rc != HederaResponseCodes.SUCCESS || scheduleAddr == address(0)) {
revert ScheduleFailed();
}
Scheduled calls are throttled per second. Use hasScheduleCapacity(expirySecond, gasLimit) before scheduling to avoid SCHEDULE_EXPIRY_IS_BUSY:
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
}
scheduleCall, the calling contract is the payer. With scheduleCallWithPayer / executeCallOnPayerSignature, a separate payer can be specified.0.0.<ContractId>).expirySecond are automatically removed from the network.Note: The payer must have sufficient HBAR when the schedule executes (for the token creation fee).
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();
}
}
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);
}
}
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();
}
}
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();
}
}
}