Note: Hedera’s system contract functions do not natively support
ERC-1363 functionalities on HTS tokens. However, standard ERC-1363 functions can still be implemented within a smart contract and deployed on the network, similar to other EVM-compatible chains.Interface ERC-1363 Functions
transferAndCall
transferAndCall
approveAndCall
approveAndCall
Additional References
For a more in-depth understanding, please see the below links:1. Function Implementations and Interactions
- ERC-1363 Interface Specification:
Description: This section defines the
ERC1363interface, detailing functions liketransferAndCallandapproveAndCall, and explains how they interact with recipient contracts.
Link: ERC-1363 Interface Specification
2. Supporting Contracts
- IERC1363Receiver Interface:
Description: Defines the interface for contracts that want to handle incoming token transfers, specifying the
onTransferReceivedfunction.
Link: IERC1363Receiver Interface - IERC1363Spender Interface:
Description: Specifies the interface for contracts that intend to handle token approvals, detailing the
onApprovalReceivedfunction.
Link: IERC1363Spender Interface
3. Token Logic Examples
- ERC-1363 Reference Implementation:
Description: Provides a comprehensive implementation of the ERC-1363 standard, including how token transfers and approvals are handled with immediate contract interactions.
Link: ERC-1363 Reference Implementation
4. ERC-165 Compliance
- ERC-165 Standard Overview:
Description: Offers an understanding of the ERC-165 standard, which ERC-1363 utilizes to ensure recipient contracts implement the necessary interfaces. ERC-165 compliance is essential because it allows contracts to query whether a recipient implements required functions like
onTransferReceivedoronApprovalReceived, ensuring seamless interaction and preventing errors.
Link: ERC-165 Standard Overview
5. Practical Examples
- ERC1363Payable Contract Example:
Description: An example contract demonstrating how to accept ERC-1363 token transfers and approvals, including handling the
onTransferReceivedandonApprovalReceivedfunctions.
Link: ERC1363Payable Contract Example
Contributor: @sumanair