SettleMint
ArchitectureSecurityCompliance Modules

TimeLock

TimeLock module enforces minimum holding periods using FIFO batch tracking. Covers configuration, identity-based exemptions, and integration with regulatory templates like MAS Singapore.

Purpose: Reference for the TimeLock compliance module.


TimeLock

Enforces minimum holding periods — tokens received must be held for at least holdPeriod seconds before they can be transferred.

Interface (capabilities)

CapabilityWho can callInputsOn-chain effectEmitsNotes
setModuleParametersToken admin (via compliance)holdPeriod, allowExemptions, exemptionExpressionStores holding-period configexemptionExpression uses the same RPN system as identity verification
canTransferCompliance engineSender, recipient, amountWalks FIFO queue; checks if enough unlocked balance exists for the transfer amountExempted investors bypass the check entirely
recordAcquisitionCompliance engine (post-transfer hook)Investor identity, amount, timestampCreates a new FIFO batch entry with expiry = timestamp + holdPeriodAcquisitionRecordedCalled after every successful incoming transfer
unlockTokensToken holder (or agent)Investor identityReleases expired batches from the FIFO queueTokensUnlockedOptional — canTransfer also processes expired batches inline

How it works

TimeLock uses FIFO (First In, First Out) batch tracking. Each incoming transfer creates a batch with:

  • Amount received
  • Timestamp received
  • Expiry (received + holdPeriod)

On transfer, the module walks the FIFO queue and checks whether the oldest batches have cleared their holding period. If the requested transfer amount exceeds the unlocked balance, the transfer is blocked.

Example: An investor receives 100 tokens on day 1 and 50 tokens on day 90, with a 180-day hold. On day 185, they can transfer up to 100 tokens (day 1 batch unlocked). The day 90 batch unlocks on day 270.

Configuration

ParameterDescription
holdPeriodMinimum holding period in seconds (e.g., 15552000 = 180 days)
allowExemptionsIf true, investors matching the exemption expression bypass the lock
exemptionExpressionRPN expression identifying exempt investors

Identity-based exemptions

The exemption expression uses the same RPN system as SMARTIdentityVerification. Common exemption patterns:

ExemptionExpressionUse case
QII investors exempt[CONTRACT]Japan FSA: institutional investors skip lockup
Accredited investors exempt[ACCREDITED]Reg D: accredited investors can trade freely
No exemptionsEmptyMAS Singapore: all investors subject to hold period

Regulatory use cases

RegulationHold periodExemption
MAS Singapore — Capital Markets180 days (15,552,000 seconds)None
US Reg D 506(b) — typical1 year (31,536,000 seconds)[ACCREDITED]
EU MiCA — some asset typesVariesDepends on instrument type

Key invariants

  • TimeLock applies to received tokens, not the sender's full balance
  • Forced transfers (custodian) bypass the TimeLock check
  • Burns are not blocked by TimeLock — the FIFO queue walks batches oldest-first and skips lock checks for burn operations
  • The FIFO queue is maintained per investor identity (not per wallet address)

Operational signals

  • AcquisitionRecorded — emitted after each incoming transfer creates a new FIFO batch
  • TokensUnlocked — emitted when expired batches are released from the FIFO queue
  • Monitor for ComplianceCheckFailed revert errors in failed transactions when transfers exceed unlocked balance

Failure modes & edge cases

  • Hold period changed after tokens acquired — existing batches keep their original expiry; only new acquisitions use the updated period
  • Exemption expression changed — investors who previously bypassed the lock are now subject to it (and vice versa), but only for future transfers
  • Large number of FIFO batches from frequent small transfers — canTransfer gas cost increases linearly with batch count

See also

On this page