lock_asset

function lock_asset(type: text, account: account, asset: asset, amount: big_integer)(source)

Transfers an asset to the lock account, rendering it inaccessible to the user.

Can only be called from an operation.

Throws if the required assets cannot be moved. Common cases include:

  • the amount to transfer is not in the accepted range (0, 2^256) (exclusive)

  • some conditions added in development through transfer extensions (before_transfer or after_transfer) aren't met

  • the account's balance is lower than amount

Parameters

type

the type of lock account to use to lock the asset

account

the account that has the asset to lock

asset

the asset to lock

amount

how much of the specified asset to lock

See also

ACCOUNT_TYPE_LOCK

for more information on lock accounts