Introduction
Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.
I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.
I also build and publish a variety of tools, libraries, and open-source projects.
ERC-1363 extends ERC-20 with methods that invoke a function on the receiving or approved contract after transferring tokens or setting an allowance.
This article translates, summarizes, and expands on the following proposal. The original article also used ChatGPT to assist with its explanation.
The extension defines an interface for executing additional code after a token transfer or approval, within the same transaction.

The proposal introduces the following methods.
transferAndCall and transferFromAndCall
These methods invoke the receiving contract's onTransferReceived callback after transferring tokens, allowing the recipient to execute additional operations.

approveAndCall
This method invokes the approved contract's onApprovalReceived callback after setting its allowance.

A spender is an address authorized to transfer tokens on behalf of their owner, subject to its allowance. The original illustrations retain their existing labels.
Motivation
Ordinary ERC-20 transfer and approve do not define a standardized recipient or spender callback. A user may therefore need to submit another transaction and pay additional transaction fees to execute subsequent operations, unless an application provides another mechanism for combining those operations.
ERC-1363 aims to simplify token payments and related contract interactions without relying on a separate event listener to initiate the follow-up action.
Potential applications include the following.
ICOs
An initial coin offering (ICO) is a fundraising arrangement in which newly issued tokens are sold to investors or other purchasers.
Using ERC-1363, a crowdsale contract could receive payment tokens through a transfer callback and distribute its own tokens to the purchaser according to the amount received.
Service delivery
A service provider could use a transfer callback to record payment and initiate the corresponding service. The service delivered could depend on the amount of tokens received.
Invoice payments
An invoice contract could use a callback to record payment and update the invoice's status according to the amount received.
Subscriptions
A subscription contract could activate a subscription after receiving tokens and extend access when subsequent payments arrive. It could also handle failed payments or insufficient funds through additional application logic.
ERC-1363 itself does not schedule recurring transactions or automatically collect future payments. Those capabilities require separate authorization and execution mechanisms.
The proposal draws inspiration from ERC-721's onERC721Received callback and its token receiver interface.
Specification
ERC1363
pragma solidity ^0.8.0;
interface ERC1363 /* is ERC20, ERC165 */ {
function transferAndCall(address to, uint256 value) external returns (bool);
function transferAndCall(address to, uint256 value, bytes memory data) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value) external returns (bool);
function transferFromAndCall(address from, address to, uint256 value, bytes memory data) external returns (bool);
function approveAndCall(address spender, uint256 value) external returns (bool);
function approveAndCall(address spender, uint256 value, bytes memory data) external returns (bool);
}
interface ERC20 {
function totalSupply() external view returns (uint256);
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
}
interface ERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}transferAndCall
Transfers tokens to a recipient and then invokes the recipient contract's onTransferReceived function. An overload allows arbitrary additional data to be supplied to the recipient.
transferFromAndCall
Transfers tokens from an authorized source account and then invokes onTransferReceived on the recipient contract. An overload accepts additional data.
approveAndCall
Sets an allowance for a spender and invokes the spender contract's onApprovalReceived function. An overload allows additional data to be supplied.
For ERC-20, see the following article.
For ERC-165, see the following article.
ERC-165: Checking whether a contract supports a particular interface
ERC1363Receiver
interface ERC1363Receiver {
function onTransferReceived(address operator, address from, uint256 value, bytes memory data) external returns (bytes4);
}The ERC1363Receiver interface identifier is 0x88a7ca5c.
onTransferReceived
Called by the ERC-1363 token contract after a transfer performed through transferAndCall or transferFromAndCall. The recipient implements this function to execute its own logic upon receiving tokens.
The function must return bytes4(keccak256("onTransferReceived(address,address,uint256,bytes)")). Returning a different value causes the operation to revert.
operator- The account that called
transferAndCallortransferFromAndCall. It may differ from the account supplying the tokens.
- The account that called
from- The account from which tokens were transferred.
value- The amount of tokens transferred.
data- Additional bytes whose format is determined by the application.
ERC1363Spender
interface ERC1363Spender {
function onApprovalReceived(address owner, uint256 value, bytes memory data) external returns (bytes4);
}The ERC1363Spender interface identifier is 0x7b04a2d0.
onApprovalReceived
Called by the ERC-1363 token contract after an allowance is set through approveAndCall. The spender can execute additional logic in response to the approval.
The function must return bytes4(keccak256("onApprovalReceived(address,uint256,bytes)")). Returning a different value causes the operation to revert.
owner- The token owner who called
approveAndCall.
- The token owner who called
value- The approved allowance amount.
data- Additional application-defined bytes.
Rationale
The names transferAndCall, transferFromAndCall, and approveAndCall derive from the corresponding ERC-20 operations. They extend those operations with callbacks to the recipient or spender.
A callback is a function invoked by another component as part of a defined operation or event. Here, the callback executes synchronously within the transaction.
The extension therefore allows recipient or spender contracts to perform additional operations after a transfer or approval.
Compatibility
The proposal draws inspiration from ERC-223 and ERC-677 while retaining the ERC-20 interface. It adds separate methods rather than changing the behavior of ordinary transfer and transferFrom.
Existing ERC-20 integrations can continue using the original methods. However, an already deployed token that does not implement ERC-1363 cannot automatically gain these new methods.
Security considerations
approveAndCall and transferFromAndCall can be affected by allowance-related issues associated with the corresponding ERC-20 operations.
When an existing allowance is replaced with a new nonzero value, transaction ordering may allow the spender to consume the old allowance before the new one takes effect. One mitigation is to set the allowance to zero first and then set the intended value, accounting for the ordering and confirmation of both operations.
Callbacks also introduce external contract calls. Implementations should account for reentrancy, verify the calling token where appropriate, and avoid treating an arbitrary callback as proof of a legitimate payment.
Code
The original example uses the following implementation:
My example repository is available here:
Tests
The associated test code is available here:
Discussion
Executing additional logic after a token transfer or approval within the same transaction is useful and opens up a range of application designs, although implementing the callbacks securely requires care.
The callback destination must be a compatible contract, so checking that the destination supports the required behavior is important.
Subscription applications are particularly interesting. They could use these callbacks to activate or extend access when a payment arrives.
Citation
Vittorio Minacori (@vittominacori), "ERC-1363: Payable Token," Ethereum Improvement Proposals, no. 1363, January 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-1363.
Conclusion
ERC-1363 extends ERC-20 with transfer and approval methods that invoke recipient or spender callbacks within the same transaction.
Questions are welcome via Twitter @cardene777.

