Skip to main content

ITransferAndLock

Asset Tokenization Studio Team

ITransferAndLock

Interface for transferring tokens to a recipient and immediately locking them until a specified expiration timestamp using the default partition.

Methods​

initializeTransferAndLock​

function initializeTransferAndLock() external nonpayable

Initialises the transfer-and-lock capability on the token.

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

transferAndLock​

function transferAndLock(address _to, uint256 _amount, bytes _data, uint256 _expirationTimestamp) external nonpayable returns (uint256 lockId_)

Transfers tokens to a specified address and locks them until the expiration timestamp using the default partition.

Parameters​

NameTypeDescription
_toaddressThe address to which tokens will be transferred and locked.
_amountuint256The amount of tokens to be transferred and locked.
_databytesAdditional data with no specified format, sent in the call to _to.
_expirationTimestampuint256The timestamp until which the tokens will be locked.

Returns​

NameTypeDescription
lockId_uint256The identifier assigned to the new hold created for the locked tokens.

Events​

PartitionTransferredAndLocked​

event PartitionTransferredAndLocked(bytes32 indexed partition, address indexed from, address to, uint256 value, bytes data, uint256 expirationTimestamp, uint256 lockId)

Emitted when tokens are transferred to a recipient on a partition and locked until a future timestamp.

Parameters​

NameTypeDescription
partition indexedbytes32The partition on which the transfer and lock occurred.
from indexedaddressThe address from which tokens were transferred.
toaddressThe address to which tokens were transferred and locked.
valueuint256The amount of tokens transferred and locked.
databytesAdditional data provided by the caller.
expirationTimestampuint256Unix timestamp at which the lock expires.
lockIduint256Identifier assigned to the resulting lock.

TransferAndLockInitialized​

event TransferAndLockInitialized()

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

Fires exclusively from initializeTransferAndLock.