Skip to main content

Questions tagged [lockable-currency]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
31 views

How to manage multiple balances for one account?

Here is my scenario: One account will maintain 3 balances of Token A, Token B, Token C. When Alice sends x Token A to Bob, it should deposit to Bob's balance for the same kind of token, means Token A. ...
MinhK's user avatar
  • 125
1 vote
1 answer
49 views

How to get Locked Balance of a particular account with a particular LockIdentifier in a pallet?

In a pallet I have used set_lock() with a own LockIdentifier for that pallet. Now I need to check the locked balance of an account with that LockIdentifier and not the global locked amount. how to do ...
Immanuel John's user avatar
0 votes
1 answer
36 views

After using set_lock() should we manually subtract free_balance()?

In a custom pallet, I have been using set_lock() for a staking purpose. But once the lock is done I thought the free_balance() will reduce in the account's balance but it stays the same and only the ...
Immanuel John's user avatar
4 votes
1 answer
84 views

What's the difference between calling T::Currency::transfer() and T::Currency::withdraw()

In the crowdfund pallet linked here: https://github.com/substrate-developer-hub/substrate-how-to-guides/blob/main/example-code/template-node/pallets/simple-crowdfund/src/lib.rs the withdraw function ...
Muhammed Rasheed's user avatar
0 votes
1 answer
62 views

Check if the funds are locked for LockableCurrency

I'm using fn set_lock inside LockableCurrency trait. It's possible to extend or remove lock, but no way to check if funds are in fact locked. Is this by design? and if so what is a good way to check ...
S. Iakovlev's user avatar
0 votes
1 answer
151 views

freeze(account, balance) for pallet-assets, how do I freeze X amount of a certain asset?

Does anyone know if there is a way to freeze (pallet-)asset's similar to how you can "lock"/freeze regular balance with T::Currency::freeze(AccountId, Balance)? seems like there is no easy ...
flipchan's user avatar
  • 369
4 votes
1 answer
62 views

extend_lock vs set_lock

Can someone explain the difference between set_lock and extend_lock? From my reading of the documentation on both, I figure that extend_lock should be called when we want to impose more locks on an ...
Purple_Turtle's user avatar
4 votes
1 answer
49 views

Should pallets that lock currency check for MaxLocks?

In the trait config for LockableCurrency there's a type MaxLocks. I am writing a pallet that uses set_lock and remove_lock from this trait. Should I implement checks to see if I am not exceeding ...
Purple_Turtle's user avatar
4 votes
1 answer
49 views

How to choose a Lock Identifier?

In my pallet, I am writing a function that checks if a user has some minimum amount of free balance, and if they do, proceed with the transaction by locking a DepositFee amount. I found that set_lock ...
Purple_Turtle's user avatar