Skip to main content

ITransfer

Asset Tokenization Studio Team

ITransferFacet

Interface grouping all standard token transfer operations: ERC-20 style and ERC-1594 data-bearing style. Also owns the Transfer event and the InsufficientBalance error that were previously declared in IERC20.

Methods​

initializeTransfer​

function initializeTransfer() external nonpayable

Initialises the transfer capability on the token.

Callable once; subsequent calls revert with FacetAlreadyRegistered. Requires DEFAULT_ADMIN_ROLE. Called by the factory during deployment.

transfer​

function transfer(address _to, uint256 _amount) external nonpayable returns (bool)

Moves amount tokens from the caller to to.

Parameters​

NameTypeDescription
_toaddressRecipient address.
_amountuint256Number of tokens to transfer.

Returns​

NameTypeDescription
_0boolTrue if the transfer succeeded.

transferFrom​

function transferFrom(address _from, address _to, uint256 _amount) external nonpayable returns (bool)

Moves amount tokens from from to to using the caller's allowance.

Parameters​

NameTypeDescription
_fromaddressSource address.
_toaddressDestination address.
_amountuint256Number of tokens to transfer.

Returns​

NameTypeDescription
_0boolTrue if the transfer succeeded.

transferFromWithData​

function transferFromWithData(address _from, address _to, uint256 _value, bytes _data) external nonpayable

Transfers tokens from _from to _to with additional _data attached.

Caller must have a sufficient allowance set by _from. Only available in single-partition mode.

Parameters​

NameTypeDescription
_fromaddressSource address.
_toaddressDestination address.
_valueuint256Amount of tokens to transfer.
_databytesArbitrary data attached to the transfer.

transferWithData​

function transferWithData(address _to, uint256 _value, bytes _data) external nonpayable

Transfers tokens to _to with additional _data attached.

Only available in single-partition mode.

Parameters​

NameTypeDescription
_toaddressRecipient address.
_valueuint256Amount of tokens to transfer.
_databytesArbitrary data attached to the transfer.

Events​

Transfer​

event Transfer(address indexed from, address indexed to, uint256 value)

Emitted whenever tokens move between accounts, are minted, or are burned.

Parameters​

NameTypeDescription
from indexedaddressSource account (zero address on mint).
to indexedaddressDestination account (zero address on burn).
valueuint256Amount of tokens transferred.

TransferFromWithData​

event TransferFromWithData(address indexed sender, address indexed from, address indexed to, uint256 amount, bytes data)

Emitted when tokens are transferred via an allowance with an attached data payload.

Parameters​

NameTypeDescription
sender indexedaddressAccount that executed the transfer (typically msg.sender).
from indexedaddressAddress from which tokens were debited.
to indexedaddressRecipient of the transferred tokens.
amountuint256Amount of tokens transferred, denominated in base units.
databytesArbitrary payload supplied by the caller for off-chain interpretation.

TransferInitialized​

event TransferInitialized()

Emitted once when the transfer capability is initialised on a token.

Fires exclusively from initializeTransfer.

TransferWithData​

event TransferWithData(address indexed sender, address indexed to, uint256 amount, bytes data)

Emitted when tokens are transferred with an attached data payload.

Parameters​

NameTypeDescription
sender indexedaddressAccount that executed the transfer (typically msg.sender).
to indexedaddressRecipient of the transferred tokens.
amountuint256Amount of tokens transferred, denominated in base units.
databytesArbitrary payload supplied by the caller for off-chain interpretation.

Errors​

InsufficientBalance​

error InsufficientBalance(address account, uint256 balance, uint256 value, bytes32 partition)

Thrown when a transfer or redemption is attempted with insufficient partition balance.

Parameters​

NameTypeDescription
accountaddressThe account whose balance was checked.
balanceuint256The actual balance available.
valueuint256The amount that was requested.
partitionbytes32The partition that was checked.