Tokens Managed by Smart Contracts
A smart contract is a programmable, self-executing agreement designed to create, manage, or enforce the conditions of digital assets, also known as tokens. Tokens managed by smart contracts serve as digital representations of various asset types, such as artwork, cryptocurrency, and carbon credits on the blockchain. These tokens allow assets to be securely transferred between users or contracts and interact with others, adding functionality and interoperability within the blockchain ecosystem.
The ERC-20 and ERC-721 standards provide common interfaces for token contracts to standardize how tokens function across platforms. These interfaces enable tokens to be easily recognized by wallets, exchanges, and decentralized applications (dApps) in the Ethereum ecosystem. By conforming to these standards, tokens gain a predictable structure, simplifying integration for developers and ensuring users experience consistent functionality across compatible smart contract platforms.
"ERC" stands for Ethereum Request for Comments, a protocol developers can follow to propose improvements or introduce new guidelines to the Ethereum blockchain. Hedera smart contracts are compatible with several ERC standards, allowing developers to implement these standardized interfaces. This compatibility simplifies the token integration and provides a consistent user experience with token contracts across different platforms.
Hedera-Compatible ERC Token Standards
Explore some of the token standards supported and compatible with Hedera:
➡ ERC-721 Non-Fungible Tokens (NFTs)
➡ ERC-3643 Real World Assets (RWAs)
Token Associations
Before sending a token to a smart contract, you need to confirm whether you need to associate the token with the smart contract before transferring it. The transfer will fail if you transfer a token to a smart contract that was not associated with it first or does not have an open auto-association slot.
You can associate a smart contract with a token in the following ways:
Use the
TokenAssociationTransaction
in the supported Hedera SDKsUse the
associateToken()
orassociateTokens()
from HIP-206.
Note: Token association
is for HTS tokens only.
Synthetic Events
Smart contract tokens like ERC-20 and ERC-721 emit events, creating contract logs that developers can query or subscribe to. Hedera Token Service (HTS) tokens are not inherently equipped with such event logs. As a solution to this limitation, Hedera Mirror Nodes now generates synthetic event logs for HTS tokens. Learn more here.
FAQs
Last updated