← ClaudeAtlas

hts-system-contract-skilllisted

Hedera Token Service (HTS) smart contract development. Use when creating, managing, or interacting with Hedera-native tokens via Solidity contracts. Triggers include HTS tokens, Hedera token creation, HTS precompile, token minting/burning on Hedera, KYC/freeze/pause token controls, custom fee schedules, NFT collections on Hedera, or any token operations using the 0x167 precompile.
nickthelegend/xorv · ★ 0 · AI & Automation · score 67
Install: claude install-skill nickthelegend/xorv
# Hedera Token Service (HTS) System Contract HTS precompile at `0x167` enables Solidity contracts to create and manage Hedera-native tokens with built-in compliance controls (KYC, freeze, pause) and custom fees. ## Quick Reference **Imports:** ```solidity import {HederaTokenService} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-token-service/HederaTokenService.sol"; import {KeyHelper} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-token-service/KeyHelper.sol"; import {ExpiryHelper} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-token-service/ExpiryHelper.sol"; import {HederaResponseCodes} from "@hashgraph/smart-contracts/contracts/system-contracts/hedera-token-service/HederaResponseCodes.sol"; ``` **Safe variants** (auto-revert on failure): `SafeHTS.sol`, `SafeViewHTS.sol` ## Critical: HBAR Payment Required Token creation requires explicit HBAR value payment (not just gas): ```solidity // ❌ WRONG - fails with INSUFFICIENT_TX_FEE (int rc, address token) = createNonFungibleToken(token); // ✅ CORRECT (int rc, address token) = createNonFungibleToken{value: msg.value}(token); ``` Call from TypeScript: ```typescript await contract.createToken(name, symbol, { gasLimit: 350_000, value: ethers.parseEther("15"), // ~$1-2 USD of HBAR }); ``` ## Token Key System Seven key types control token operations (bit positions for `keyType` field): | Key | Bit | Value | Controls | | ------ | --- |