Skip to main content

Overview

The Hedera Schedule Service (HSS) system contract exposes functions that enable smart contracts to interact with Hedera’s native schedule service. The schedule service allows transactions to be scheduled for future execution, simplifies multi-sig coordination, and automates execution once all required signatures are collected. This eliminates the need for off-ledger signature coordination and reduces the complexity of multi-sig workflows in decentralized applications (dApps). Additionally, the HSS includes expiration handling, where scheduled transactions that fail to collect and verify all required signatures within the specified expiration window are automatically removed from the network. The IHederaScheduleService interface, introduced in HIP-755, allows accounts to interact with the schedule transaction service via smart contracts. With the introduction of HIP-1215, the HSS now supports generalized scheduled contract calls, allowing smart contracts to schedule arbitrary calls to other contracts (or themselves) directly from within the EVM. This powerful feature enables a wide range of decentralized automation use cases, such as:
  • DeFi Automation: Automatically rebalancing a portfolio or harvesting yield farming rewards.
  • Vesting Schedules: Creating token vesting contracts that automatically release tokens at specified intervals.
  • DAO Operations: Scheduling recurring governance tasks, such as distributing rewards or executing proposals.
Following system contract conventions, HSS is callable at the reserved 0x16b address and exposes the following functions callable within smart contracts.
Function NameFunction SelectorConsensus Node Release VersionHIPFunction Interface
authorizeSchedule0xf06379610.57HIP 755authorizeSchedule(address) external returns (int64 responseCode)
signSchedule0x358eeb030.59HIP 755signSchedule(address, bytes) external returns (int64 responseCode)
scheduleNative0xca8298110.59HIP 756scheduleNative(address, bytes, address) external returns (int64, address)
getScheduledCreateFungibleTokenInfo0xda2d5f8f0.59HIP 756getScheduledCreateFungibleTokenInfo(address) external returns (int64, FungibleTokenInfo)
getScheduledCreateNonFungibleTokenInfo0xd68c902c0.59HIP 756getScheduledCreateNonFungibleTokenInfo(address) external returns (int64, NonFungibleTokenInfo)
scheduleCall0x6f5bfde80.68HIP 1215scheduleCall(address, uint256, uint256, uint64, bytes) external returns (int64, address)
scheduleCallWithPayer0xe6599c180.68HIP 1215scheduleCallWithPayer(address, address, uint256, uint256, uint64, bytes) external returns (int64, address)
executeCallOnPayerSignature0x105772b20.68HIP 1215executeCallOnPayerSignature(address, address, uint256, uint256, uint64, bytes) external returns (int64, address)
deleteSchedule0x72d423940.68HIP 1215deleteSchedule(address) external returns (int64)
deleteSchedule0xc61dea850.68HIP 1215deleteSchedule() external returns (int64)
hasScheduleCapacity0xdfb4a9990.68HIP 1215hasScheduleCapacity(uint256, uint256) external view returns (bool)

authorizeSchedule(address)

  • Signs the schedule transaction identified by the pass-in parameter (address) with a ContractKey using the format 0.0.<ContractId of the calling contract>.
  • Allows contracts to sign schedule transactions using their own contract key.
  • Returns a responseCode indicating the success or failure of the authorization attempt.

signSchedule(address schedule, bytes memory signatureMap)

  • Allows for the signing of a schedule transaction given a protobuf encoded signature map.
  • The message signed by the keys is defined to be the concatenation of the shard, realm, and schedule transaction address.
  • Returns a responseCode indicating the success or failure of the signature addition attempt.

scheduleNative(address systemContractAddress, bytes memory callData, address payer)

  • Allows for the creation of a schedule transaction for a given system contract address, ABI-encoded call data, and payer address.
  • Currently supports the Hedera Token Service System Contract (0x167) for token-related functions.
  • Returns the scheduleAddress of the newly created scheduled transaction and a responseCode.

getScheduledCreateFungibleTokenInfo(address scheduleAddress)

  • Returns the token information for a scheduled fungible token create transaction.
  • scheduleAddress: The address of the scheduled fungible token create transaction.
  • Returns a responseCode and an IHederaTokenService.FungibleTokenInfo struct.

getScheduledCreateNonFungibleTokenInfo(address scheduleAddress)

  • Returns the token information for a scheduled non-fungible token create transaction.
  • scheduleAddress: The address of the scheduled non-fungible token create transaction.
  • Returns a responseCode and an IHederaTokenService.NonFungibleTokenInfo struct.

scheduleCall(address to, uint256 expirySecond, uint256 gasLimit, uint64 value, bytes memory callData)

  • Schedules a contract call with the calling contract acting as the payer.
  • to: The address of the contract to call.
  • expirySecond: The epoch second at which the transaction should expire.
  • gasLimit: The maximum amount of gas to use for the call.
  • value: The amount of HBAR (in tinybars) to send with the call.
  • callData: The ABI-encoded data for the function call.
  • Returns a responseCode indicating success or failure (22 for SUCCESS) and the scheduleAddress of the newly created scheduled transaction.

scheduleCallWithPayer(address to, address payer, uint256 expirySecond, uint256 gasLimit, uint64 value, bytes memory callData)

  • Schedules a contract call with a specified payer address. This method collects the required signatures but only executes the transaction at the expirySecond timestamp, even if all signatures are gathered earlier. The payer must provide signatures before the transaction can execute.
  • to: The address of the contract to call.
  • payer: The address of the account that will pay for the transaction.
  • expirySecond: The epoch second at which the transaction should expire.
  • gasLimit: The maximum amount of gas to use for the call.
  • value: The amount of HBAR (in tinybars) to send with the call.
  • callData: The ABI-encoded data for the function call.
  • Returns a responseCode indicating success or failure (22 for SUCCESS) and the scheduleAddress of the newly created scheduled transaction.

executeCallOnPayerSignature(address to, address payer, uint256 expirySecond, uint256 gasLimit, uint64 value, bytes memory callData)

  • Schedules and executes a contract call immediately upon receiving the payer’s signature. This method also collects signatures, but executes the transaction immediately once all required signatures are present, without waiting for the expirySecond timestamp, unless the consensus time has already passed the expirySecond.
  • to: The address of the contract to call.
  • payer: The address of the account that will pay for the transaction.
  • expirySecond: The epoch second at which the transaction should expire.
  • gasLimit: The maximum amount of gas to use for the call.
  • value: The amount of HBAR (in tinybars) to send with the call.
  • callData: The ABI-encoded data for the function call.
  • Returns a responseCode indicating success or failure (22 for SUCCESS) and the scheduleAddress of the newly created scheduled transaction.

deleteSchedule(address scheduleAddress)

  • Deletes a previously scheduled transaction.
  • scheduleAddress: The address of the scheduled transaction to delete.
  • Returns a responseCode indicating success or failure (22 for SUCCESS).

deleteSchedule()

  • Deletes a scheduled transaction by calling this parameter-less redirect function directly on the schedule’s address.
  • This provides a convenient alternative for contracts or Externally Owned Accounts (EOAs) to the main deleteSchedule(address) function.
  • Returns a responseCode indicating success or failure (22 for SUCCESS).

hasScheduleCapacity(uint256 expirySecond, uint256 gasLimit)

  • A view function that checks if there is enough capacity on the network to schedule a contract call at a given time with a specified gas limit.
  • expirySecond: The epoch second to check for capacity.
  • gasLimit: The gas limit of the call to check for capacity.
  • Returns true if there is capacity, false otherwise.
  • For a reliable retry pattern, consider implementing a method similar to findAvailableSecond() as described in HIP-1215.

Behavior and Costs

Behavior

  • Scheduled transactions must collect all required signatures before they can be executed. These signatures can be added asynchronously using the signSchedule function.
  • If all required signatures are not received within the specified expiration window, the transaction expires and is removed from the network.
  • The execution of a schedule transaction occurs automatically when the final required signature is submitted.
  • Throttling and Capacity: The main design concern for scheduled contract calls is managing network capacity. The hasScheduleCapacity() view function allows contracts to check if a given second has capacity to schedule a contract call with a specified gas limit. This enables contracts to find an acceptable second for execution with an affordable gas budget.
  • Return Values: The new scheduleCall functions do not revert. On success, they return the address of the newly created scheduled transaction and a SUCCESS (22) response code. On failure, they return a zero address and a failure response code from the ResponseCodeEnum.

Costs

  • Schedule transaction fees are the same as a HAPI sign schedule transaction, with a 20% markup for using system contracts.
  • Fees include gas costs for EVM execution, storage costs, and network fees for consensus.
  • Expired transactions cost no additional fees beyond the initial scheduling and signature costs.

Gas and Fees | Hedera

Gas fee schedule and calculation

Reference