Skip to main content

ILockTypes

Asset Tokenization Studio Team

ILockTypes

Lock domain events and errors shared across the Lock facets.

Holds the LockedByPartition and LockByPartitionReleased events (emitted from both Lock and LockByPartition) and the LockExpirationNotReached / WrongLockId errors (reverted from modifiers and LockStorageWrapper, which both facets use). Both ILock and ILockByPartition inherit from this interface. Structs that are I/O of external methods on a single facet (e.g. LockData) live in that facet's interface instead.

Events​

LockByPartitionReleased​

event LockByPartitionReleased(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 lockId)

Emitted when a previously created lock is released back to its token holder.

Emitted by release, releaseByPartition and forceReleaseByPartition. The released amount is not part of the event because the underlying lock entry is removed atomically; consumers can correlate with the prior LockedByPartition via (partition, tokenHolder, lockId).

Parameters​

NameTypeDescription
operator indexedaddressThe caller that requested the release.
tokenHolder indexedaddressThe address the tokens are returned to.
partition indexedbytes32The partition the lock was held on.
lockIduint256The identifier of the lock that has been released.

LockExpirationUpdated​

event LockExpirationUpdated(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 lockId, uint256 oldExpirationTimestamp, uint256 newExpirationTimestamp)

Emitted when a lock's expiration timestamp is updated by a locker.

Emitted by both updateLockExpiration (default partition) and updateLockExpirationByPartition (any partition).

Parameters​

NameTypeDescription
operator indexedaddressThe caller that requested the update (must hold ROLE_LOCKER).
tokenHolder indexedaddressThe address whose lock expiration is being updated.
partition indexedbytes32The partition the lock lives on.
lockIduint256The identifier of the lock being updated.
oldExpirationTimestampuint256The expiration timestamp before the update.
newExpirationTimestampuint256The new expiration timestamp after the update.

LockedByPartition​

event LockedByPartition(address indexed operator, address indexed tokenHolder, bytes32 indexed partition, uint256 lockId, uint256 amount, uint256 expirationTimestamp)

Emitted when an amount of tokens is locked on a specific partition until an expiration timestamp.

Emitted by both lock (default partition) and lockByPartition (any partition) so consumers can monitor every lock creation through a single topic.

Parameters​

NameTypeDescription
operator indexedaddressThe caller that requested the lock (typically holds ROLE_LOCKER).
tokenHolder indexedaddressThe address whose tokens are locked.
partition indexedbytes32The partition the tokens are locked on.
lockIduint256The identifier assigned to the new lock for (partition, tokenHolder).
amountuint256The amount of tokens locked.
expirationTimestampuint256The Unix timestamp at which the lock becomes releasable.

Errors​

InvalidLockAmount​

error InvalidLockAmount()

Reverts when a lock creation is attempted with a zero amount.

Checked at the start of LockStorageWrapper.lockByPartition, which is the single entry point shared by both Lock.lock and LockByPartition.lockByPartition.

LockExpirationNotReached​

error LockExpirationNotReached()

Reverts when a release is attempted before the lock's expiration timestamp.

Used by the onlyWithLockedExpirationTimestamp modifier and by LockStorageWrapper.checkLockedExpirationTimestamp.

WrongLockId​

error WrongLockId()

Reverts when a lock identifier does not exist for the given (partition, tokenHolder) pair.

Used by the onlyWithValidLockId modifier and by LockStorageWrapper.checkValidLockId.