Skip to content

Latest commit

 

History

History
21 lines (12 loc) · 18.7 KB

hedera-token-service-system-contract.md

File metadata and controls

21 lines (12 loc) · 18.7 KB

Hedera Token Service System Contract

Hedera enables the native creation of fungible and non-fungible tokens through its SDKs, eliminating the need for smart contracts. This approach leverages Hedera's core features like high TPS, security, and low latency for an optimized user experience. Additionally, the Hedera Token Service provides a cost-effective method for tokenization. Smart contracts on Hedera can also interact with this service via the Hedera Token Service System contract, offering functionalities like token creation, burning, and minting through the EVM.

Some of the key functions defined in the Hedera Token Service System Contract include:

Function NameConsensus Node Release VersionHIPMethod Interface
allowance0.26HIP 514allowance(address token, address owner, address spender)
approve0.26HIP 514approve(address token, address to, uint256 tokenId)
approveNFT0.28HIP 514approveNFT(address token, address to, uint256 tokenId)
associate0.38HIP 719associate()
associateToken0.22HIP 206associateToken(address account, address token)
associateTokens0.22HIP 206associateTokens(address account, address[] memory tokens)
burnToken0.32HIP 206burnToken(address token, int64 amount, int64[] memory serialNumbers)
createFungibleToken0.32HIP 358createFungibleToken(HederaToken memory token, int64 initialTotalSupply, int32 decimals)
createFungibleTokenWithCustomFees0.30HIP 358createFungibleTokenWithCustomFees(HederaToken memory token, int64 initialTotalSupply, int32 decimals, FixedFee[] memory fixedFees, FractionalFee[] memory fractionalFees)
createNonFungibleToken0.25HIP 358createNonFungibleToken(HederaToken memory token)
createNonFungibleTokenWithCustomFees0.32HIP 358createNonFungibleTokenWithCustomFees(HederaToken memory token, FixedFee[] memory fixedFees, RoyaltyFee[] memory royaltyFees)
cryptoTransferUnreleasedHIP 206cryptoTransfer(TransferList memory transferList, TokenTransferList[] memory tokenTransfers) external returns (int64 responseCode)
deleteToken0.29HIP 514deleteToken(address token)
dissociate0.38HIP 719dissociate()
dissociateToken0.22HIP 206dissociateToken(address account, address token)
dissociateTokens0.22HIP 206dissociateTokens(address account, address[] memory tokens)
freezeToken0.29HIP 514freezeToken(address token, address account)
getApproved0.26HIP 376getApproved(address token, uint256 tokenId)
getFungibleTokenInfo0.29HIP 514getFungibleTokenInfo(address token)
getNonFungibleTokenInfo0.29HIP 514getNonFungibleTokenInfo(address token, int64 serialNumber)
getTokenCustomFees0.29HIP 514getTokenCustomFees(address token)
getTokenDefaultFreezeStatus0.29HIP 514getTokenDefaultFreezeStatus(address token)
getTokenDefaultKycStatus0.29HIP 514getTokenDefaultKycStatus(address token)
getTokenExpiryInfo0.30HIP 514getTokenExpiryInfo(address token)
getTokenInfo0.29HIP 514getTokenInfo(address token)
getTokenKey0.30HIP 514getTokenKey(address token, uint256 keyType)
getTokenType0.30HIP 514getTokenType(address token)
grantTokenKyc0.29HIP 514grantTokenKyc(address token, address account)
isAssociated0.53HIP 719isAssociated()
isApprovedForAll0.26HIP 376isApprovedForAll(address token, address owner, address operator)
isFrozen0.29HIP 514isFrozen(address token, address account)
isKyc0.29HIP 514isKyc(address token, address account)
isToken0.30HIP 514isToken(address token)
mintToken0.32HIP 206mintToken(address token, int64 amount, bytes[] memory metadata)
redirectForToken0.30HIP 218redirectForToken(address token, bytes memory data)
revokeTokenKyc0.29HIP 514revokeTokenKyc(address token, address account)
setApprovalForAll0.26HIP 376setApprovalForAll(address token, address operator, bool approved)
transferFrom0.26HIP 376transferFrom(address token, address from, address to, uint256 tokenId)
transferFromNFT0.26HIP 376transferFromNFT(address token, address from, address to, uint256 serialNumber)
transferNFT0.22HIP 206transferNFT(address token, address sender, address recipient, int64 serialNum)
transferNFTs0.22HIP 206transferNFTs(address token, address[] memory sender, address[] memory receiver, int64[] memory serialNumber)
transferToken0.22HIP 206transferToken(address token, address sender, address recipient, int64 amount)
transferTokens0.22HIP 206transferTokens(address token, address[] memory accountId, int64[] memory amount)
unfreezeToken0.29HIP 514unfreezeToken(address token, address account)
unpauseToken0.29HIP 514unpauseToken(address token)
updateTokenExpiryInfo0.32HIP 514updateTokenExpiryInfo(address token, Expiry expiry)
updateTokenInfo0.32HIP 514updateTokenInfo(address token, HederaToken hederaToken)
updateTokenKeys0.30HIP 514updateTokenKeys(address token, Expiry expiry)
wipeTokenAccount0.32HIP 514wipeTokenAccount(address token, address account, int64 amount)
wipeTokenAccountNFT0.29HIP 514wipeTokenAccountNFT(address token, address account, int64[] serialNumbers)

Given your HTS token address, you can invoke these functions:

Function NameConsensus Node Release VersionHIPMethod Interface
allowance0.26HIP 376allowance(address owner, address spender)
approve0.26HIP 376approve(address to, uint256 tokenId)
getApproved0.26HIP 376getApproved(uint256 tokenId)
isApprovedForAll0.26HIP 376isApprovedForAll(address token, address owner, address operator)
setApprovalForAll0.26HIP 376setApprovalForAll(address operator, bool approved)
transferFrom0.26HIP 376transferFrom(address from, address to, uint256 tokenId)

Example

{% content-ref url="../../../tutorials/smart-contracts/deploy-a-contract-using-the-hedera-token-service.md" %} deploy-a-contract-using-the-hedera-token-service.md {% endcontent-ref %}

Additional References

{% @github-files/github-code-block url="https://github.com/hashgraph/hedera-smart-contracts/tree/main/contracts/system-contracts/hedera-token-service" %}