ERC-1363 (Payable Tokens)
The ERC-1363 standard, also known as the payable token standard, is an upgrade to ERC-20 tokens. While ERC-20 tokens can only be sent from one person to another, ERC-1363 tokens can trigger actions in a smart contract immediately after being sent or approved for spending.
For example, if you use one of these tokens to pay for a subscription, the contract can instantly recognize the payment and activate your subscription with no extra steps. This makes the standard useful for quick transactions like buying services, paying invoices, or managing subscriptions, all in one easy step.
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
ERC-1363
FunctionsAdditional References
The original EIP can be found here
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
ERC1363
interface, detailing functions liketransferAndCall
andapproveAndCall
, 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
onTransferReceived
function. Link: IERC1363Receiver InterfaceIERC1363Spender Interface: Description: Specifies the interface for contracts that intend to handle token approvals, detailing the
onApprovalReceived
function. 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
onTransferReceived
oronApprovalReceived
, 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
onTransferReceived
andonApprovalReceived
functions. Link: ERC1363Payable Contract Example
Contributor: @sumanair
Last updated
Was this helpful?