Skip to content

[SC-13] Implement lock_tokens and unlock_tokens functions #653

@yusuftomilola

Description

@yusuftomilola

Overview

Implement lock_tokens and unlock_tokens functions to restrict token transferability inside contracts/contrib/.

Location

All work must be inside contracts/contrib/src/tokenization.rs.

Acceptance Criteria

  • lock_tokens(env, asset_id, owner, amount) — admin or token owner only; moves amount from transferable to locked_balance in OwnershipRecord; panics if insufficient transferable balance
  • unlock_tokens(env, asset_id, owner, amount) — admin or token owner only; moves amount from locked_balance back to transferable; panics if insufficient locked balance
  • get_locked_balance(env, asset_id, owner) -> i128 — returns locked amount
  • Emits lock/unlock events with asset_id, owner, amount

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions