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
| Name | Type | Description |
|---|---|---|
operator indexed | address | The caller that requested the release. |
tokenHolder indexed | address | The address the tokens are returned to. |
partition indexed | bytes32 | The partition the lock was held on. |
| lockId | uint256 | The 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
| Name | Type | Description |
|---|---|---|
operator indexed | address | The caller that requested the update (must hold ROLE_LOCKER). |
tokenHolder indexed | address | The address whose lock expiration is being updated. |
partition indexed | bytes32 | The partition the lock lives on. |
| lockId | uint256 | The identifier of the lock being updated. |
| oldExpirationTimestamp | uint256 | The expiration timestamp before the update. |
| newExpirationTimestamp | uint256 | The 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
| Name | Type | Description |
|---|---|---|
operator indexed | address | The caller that requested the lock (typically holds ROLE_LOCKER). |
tokenHolder indexed | address | The address whose tokens are locked. |
partition indexed | bytes32 | The partition the tokens are locked on. |
| lockId | uint256 | The identifier assigned to the new lock for (partition, tokenHolder). |
| amount | uint256 | The amount of tokens locked. |
| expirationTimestamp | uint256 | The 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.