lock_coin.move

make_lock_coin (public func)

// func parameter
recipient [address]: recipient wallet address
lock_ts[u64]: coin lock timestamp (UTC / ms)
unlock_ts[u64]: coin unlock timestamp (UTC / ms)
balance [Balance<T>]: information of the coins to be locked
ctx[TxContext]: transaction information (auto-filled)

This function wraps the coin in a LockedCoinobject, locking it and then transferring it to a specified wallet, preventing any unlocking until the unlock_tstimestamp.

unlock_wrapper (public func)

// func parameter
locked_coin[LockedCoin<T>]: lock object created by the make_lock_coinfunction
cur_lock[Clock]: object containing the current time (fixed at 0x6)
ctx[TxContext]: transaction information (auto-filled)

Unwraps the owned LockedCoinobject to unlock it, allowing the user to use it as their own coin.

Last updated