hts-system-contract-skilllisted
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 |
| ------ | --- |