ERC1363Utils
Library that provides common ERC-1363 utility functions. See https://eips.ethereum.org/EIPS/eip-1363[ERC-1363].
Functions
checkOnERC1363TransferReceived
*Performs a call to {IERC1363Receiver-onTransferReceived} on a target address. Requirements:
- The target has code (i.e. is a contract).
- The target
tomust implement the {IERC1363Receiver} interface. - The target must return the {IERC1363Receiver-onTransferReceived} selector to accept the transfer.*
function checkOnERC1363TransferReceived(address operator, address from, address to, uint256 value, bytes memory data)
internal;
checkOnERC1363ApprovalReceived
*Performs a call to {IERC1363Spender-onApprovalReceived} on a target address. Requirements:
- The target has code (i.e. is a contract).
- The target
spendermust implement the {IERC1363Spender} interface. - The target must return the {IERC1363Spender-onApprovalReceived} selector to accept the approval.*
function checkOnERC1363ApprovalReceived(address operator, address spender, uint256 value, bytes memory data) internal;
Errors
ERC1363InvalidReceiver
Indicates a failure with the token receiver. Used in transfers.
error ERC1363InvalidReceiver(address receiver);
Parameters
| Name | Type | Description |
|---|---|---|
receiver | address | Address to which tokens are being transferred. |
ERC1363InvalidSpender
Indicates a failure with the token spender. Used in approvals.
error ERC1363InvalidSpender(address spender);
Parameters
| Name | Type | Description |
|---|---|---|
spender | address | Address that may be allowed to operate on tokens without being their owner. |