Questions tagged [balances]

A question that refers to the balances pallet, or anything to do with balance transfers.

Filter by
Sorted by
Tagged with
1 vote
0 answers
11 views

How to implement multi-currency staking?

I was wondering what would be the best way to achieve multi-currency staking given: It's on a solo chain Foreign assets are bridged (like Eth or BTC, pallet-asset can be used) No conversion from ...
Leouarz's user avatar
  • 199
0 votes
1 answer
16 views

Why do I need to call the upgrade_account in the balance pallet?

With the introduction of version 0.9.42, the logic of how balances work in Substrate changed. This version upgrade introduced a new extrinsic called upgrade_account. The fee_frozen attribute of the ...
Adel Golghalyani's user avatar
1 vote
0 answers
43 views

When doing transaction my total issuance got deducted

I am currently working on incorporating a transaction fee logic where the block reward for a validator is intended to be shared between the validator and its nominator. However, I am encountering an ...
Arunjot Singh's user avatar
0 votes
1 answer
20 views

How to read treasury pallet funds?

I am able to add funds in treasury pallet, now I want to get the total balance of treasury pool. How can this be done? Can someone provide some suggestions?
Ganesh11's user avatar
  • 1,208
1 vote
2 answers
67 views

How to fix the `FailedToTransactAsset("InsufficientBalance")` error?

I already read this post XCM cross-chain transfer error FailedToTransactAsset("InsufficientBalance")? , but nothing helped. I get the following XCM logs (originates from Parachain 2001): ...
Chralt's user avatar
  • 523
1 vote
1 answer
23 views

How to send fix amount of balance to contract address

I'm working on a smart contract where I need to send a balance from a user account to the contract address. The amount to be sent is fixed and hardcoded in the contract. I have tried to figure out ...
Ariful Islam's user avatar
1 vote
1 answer
37 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
24 views

can we do batch/multiple transfer in once?

I want to send the tokens to bulk/multiple accounts. Do we have any way to do it?
Pankaj's user avatar
  • 1,896
2 votes
1 answer
79 views

How can I check the balance of the account in ink smart contract

Let's say that I deploy erc20 contract in ink and transfer to Bob 100 tokens, now I want in my contract to see did Bob having any amount of tokens, just to be sure that he can use my contract? How to ...
jvn's user avatar
  • 55
0 votes
1 answer
30 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
1 vote
2 answers
168 views

system.ExtrinsicFailed Token.NotExpendable

I'm working on a project that involves setting up a shared pot account. Anyone can fund this account, and the owner has the ability to withdraw money from it. However, I'm encountering an error: ...
Deepak Chaudhary's user avatar
2 votes
1 answer
32 views

What's the difference between balances.account and system.account?

What's the difference between the balances reported by the balances.account and system.account storage queries? I would expect a balance query on a development chain for 'Alice' to show me a funded ...
Joe Caputo's user avatar
1 vote
2 answers
61 views

transfer balance subxt

I am using subxt library . I have downloaded metadata from chain using this url wss://rpc.polkadot.io:443 . I have also implemented default example from subxt documentation of transfer balance . i ...
Karanvir Singh's user avatar
3 votes
1 answer
79 views

Will we be able to use the BLS signature scheme to control funds?

After reading through the BLS related issues in the substrate repo, it isn't quite clear to me what type of support is planned for the BLS signature scheme. It seems like the primary goal is to ...
user2959071's user avatar
4 votes
0 answers
39 views

Polkadot JS units for currency

I am implementing a pallet which interacts with pallet_balances via Currency trait. For some reason, when I call any operation on currency trait (like Slash on screen below), it is not aligned to ...
Klapeyron's user avatar
  • 111
4 votes
1 answer
36 views

Listen to balance changes wrong after transfer token

I'm facing an issue. I used a query subscription to listen and update the free balance on UI. But I don't know why, when I log free in callback, they always return a balance of receiver and then a ...
Tung Le Xuan's user avatar
4 votes
2 answers
90 views

How to fetch all accounts in a pallet?

I need to change the balances of all the accounts in my custom pallet, For that first i need to fetch the accounts in the pallet. How to do this?
Deepak Chaudhary's user avatar
2 votes
1 answer
37 views

How does `Currency::pair(burn)` work?

if !missed_any { // burn some proportion of the remaining budget if we run a surplus. let burn = (T::Burn::get() * budget_remaining).min(budget_remaining); budget_remaining -= burn; ...
Leo's user avatar
  • 67
2 votes
1 answer
69 views

Polkadot multisig - LiquidityRestrictions error to initiate a call from an account with < 20 DOT

The Polkadot account 1vSN9CPVLXJWsY3JbdRU9KjAFFAx88yvEVpU1ayjnhSephy is a proxy, controlled by a multisig (13oHAjv9gNbdVKFk6uosaiyRAm2ybC48VnJ47Ss8F8pY7NgR). All attempts to initiate an extrinsic with ...
bLd's user avatar
  • 182
7 votes
1 answer
68 views

Accidentally used ETH address to receive token from polkadot

I accidentally used my ETH address to receive token from Polkadot. Is there any way I can access my tokens with my private key? Thanks. For example: https://polkaholic.io/account/...
user avatar
3 votes
1 answer
56 views

`Currency::create_deposit` of `pallet_balance` fail on actual runtime but passes on mock rutime

The benchmark is written as: one_extrinsic { let caller: <T as frame_system::Config>::AccountId = make_account::<T>(1); assert_eq!( <T as crate::Config&...
Sudip Ghimire's user avatar
3 votes
1 answer
43 views

create a dev chainspec with specific test users

I'd like to use the Polkadot CLI to create a chainspec with specific user balances pre-seeded. I'd like to be able to do this for any of the dev runtimes. In the case of the polkadot dev runtime, I ...
Harry Solovay's user avatar
3 votes
1 answer
120 views

Getting `insufficient funds for gas * price + value` error when performing transaction with another account than Alice

I'd like to use Substrate Frontier as a private blockchain for my current project. I have set up a project using a frontier-template-node build and I am now trying to adjust its settings. I am ...
Olivier Hory's user avatar
2 votes
0 answers
99 views

Parsing Balance Transfer Data

I'm writing a client in Go that needs to scan balance transfers in Substrate chains - initially focused on Polkadot. My current objective is to determine all balance transfers in a given block, and to ...
csknk's user avatar
  • 227
0 votes
2 answers
34 views

Fund transferred to smart contract address not showing in balances

I deploy an ink smart contract through a properly configured pallet_contracts (4.0.0-dev from the Substrate branch polkadot-v0.9.29) on chain. Then I use the unique address of that smart contract and ...
Alex Sed's user avatar
  • 545
2 votes
1 answer
68 views

Benchmark extra macro

What does the #[extra] macro do in benchmarks? I was looking at how benchmarks are being implemented on the Balances pallet. I notice the following benchmarks: benchmarks_instance_pallet { transfer {...
Yatusabes's user avatar
  • 766
0 votes
2 answers
86 views

incorrect balance response

I've created test address in westend network. Topped up it using faucet. https://westend.subscan.io/account/5FpS4PkRzLmJZcwvJM6jxPU3N3481nbnTe6nzFwwQUVvu9LF?tab=transfer. In explorer I see 1WND ...
Andriy Vasyltsiv's user avatar
0 votes
1 answer
58 views

What is the Token Standard used by the balances pallet to issue the native token for the chain in the substrate kitchen sink node?

We are using the kitchen sink substrate node with the standard balances pallet. No changes. The chain mints native tokens using the usual processes. My question is: what token standard is used in the ...
KathrynColleen's user avatar
3 votes
1 answer
102 views

Is it possible to transfer balance from multiple accounts to the same receiver in a single Extrinsic?

I am working on a system that allows users to send and receive on the Polkadot network. The system tracks the amount of DOT controlled by a user, and this may be spread across multiple Polkadot ...
csknk's user avatar
  • 227
8 votes
1 answer
180 views

How are the costs of XCM messages designed?

after playing with the Substrate Cumulus Parachain Template and the ping-pallet to get an idea of how to use XCM, I built a local Rococo testnet connected to two parachains. In my code, at some point, ...
lucgerrits's user avatar
3 votes
1 answer
89 views

Division operation in `u128` results false value

In my node, Balance type is u128. I have following variable let per_block = 100_000_000_000_000_000_u128; let total = 50_000_000_000_000_000_000_000_u128; let ratio = per_block.checked_div(total); ...
Sudip Ghimire's user avatar
0 votes
2 answers
58 views

How do I mock `BalanceOf` for testing staking?

I'm trying to learn how to use the staking pallet in a game I'm building as a way to learn substrate, linked here, and I'd like to implement staking an amount when challenging another player. However, ...
stonecharioteer's user avatar
4 votes
1 answer
284 views

How to manage storage when a pallet is instantiated more than once?

I am working on an exercise involving liquid staking, where two different tokens are managed. It was suggested to me that I might try instantiating the Balances pallet twice, following the pattern of ...
psfblair's user avatar
2 votes
1 answer
145 views

Why is `reserve` restricted for locked balances?

I read the answer of Shawn about locked and reserved balances. What is the difference between Free Balance, Reserved Balance, Locked Balance, Vesting Balance, etc...? He pointed out, that locked funds ...
Chralt's user avatar
  • 523
6 votes
2 answers
491 views

How to pay transaction fees using the custom token created by using pallet_assets?

At the moment the transaction fee is payed as the native token in the substrate node template. When I create a new asset_id(say BAT) a fungible asset using pallet_assets, How can I now pay the ...
rusty loaki's user avatar
2 votes
1 answer
120 views

Using Polkadot-JS to have third party wallet pay for dot transaction fee

I am currently trying to use the polkadot-js sdk in order to transfer money between DOT wallets. I can successfully transfer money between two wallets using the api.tx.balances.transfer(destination, ...
cooper jones's user avatar
8 votes
1 answer
216 views

How does a Substrate chain set the max total supply?

How does a Substrate chain set the max total supply? Looking at the staking module, each era will increase the total_issuance through the issue. In the issue function, Self::Balance::max_value() is ...
Smith's user avatar
  • 131
4 votes
1 answer
99 views

Balance transfer fails when sending to the AccountIndex

I wanted to try out AccountIndex feature on Westend: https://wiki.polkadot.network/docs/learn-accounts#indices and claimed an index: https://westend.subscan.io/extrinsic/11590551-2 When I try to do ...
DrW3RK's user avatar
  • 956
3 votes
1 answer
142 views

Convert from asset balance to currency balance?

Context: I'm creating a pallet with a simple DEX (decentralised exchange) functionality. I need to perform some arithmetic operations on balances for liquidity pools. Problem: How can I convert from ...
Adam Wierzbicki's user avatar
0 votes
1 answer
70 views

Why does my multisig `approve_as_multi` extrinsic has failed with `InsufficientBalance` error?

In this link you can find my multisig approve_as_multi extrinsic and see the InsufficientBalance error. Does the balance error here refers to the sender (signatory) balance or the multisig address ...
dominique's user avatar
  • 1,633
3 votes
1 answer
101 views

Collator reward and inflation

What would be the recommended approach to introduce inflation for block production/collator reward? Is NegativeImbalance a good place for this, or implementing a separate pallet that schedules ...
Mo Elshami's user avatar
0 votes
1 answer
94 views

Error in currency transfer

I have currency configuration as follows use frame_support::traits::{Currency}; and in frame config type Currency: Currency<Self::AccountId>; Then in an extrincis function, I am trying to do a ...
not 0x12's user avatar
  • 343
0 votes
1 answer
96 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
  • 319
2 votes
1 answer
35 views

Does DOT and KSM have Currency AssetId?

I believed that Substrate-based tokens have its own assetId Question is, does relay chain tokens like "DOT" and "KSM" have their assetId too? I tried to find out where it is ...
coco_yoon's user avatar
  • 119
2 votes
0 answers
60 views

Access To Withdrawal Reason in Withdraw Event

I am developing a pallet that uses an off-chain worker to aggregate and store transaction fee data on a per-block basis. To do this, the most reasonable implementation looks to be using Withdraw ...
Brendan's user avatar
  • 65
3 votes
1 answer
237 views

How to calculate the reducible balance of a user?

I would like to ask question about free balance on Kusama when we execute the query await api.query.system.account('some address') then the output is this { nonce: 1 consumers: 0 providers: 1 ...
Michal Danco's user avatar
0 votes
1 answer
96 views

Locked Balance of an Account in Acala

Is it possible to retrieve the locked balance of an account from the account data queried from api.query.system.account? If not, what is the right way to do so? I'm looking for the stash locked in ...
user2395's user avatar
2 votes
1 answer
47 views

How to rebase tokens using balance pallet?

I want to reduce the balance of everyone say by 5% after say every 10 million blocks. It's not possible to loop over all balances, as that will be inefficient. AMPL solves it with using Gons tokens= ...
Amiya Behera's user avatar
1 vote
1 answer
203 views

How to get a percent portion of a balance?

I would like to divide a Balance into two parts. One is 10% of value and another part is 90% of the value. BalanceOf<T> is the Balance of a pallet. type Balance: AtLeast32BitUnsigned ...
Chralt's user avatar
  • 523
7 votes
1 answer
154 views

Influence of Existential Deposits on account assets

Statemint has an Existential Deposit threshold of 0.1 DOT. Say an account holds some amount of asset X, and transfers away all its DOT so that it goes below the ED. What happens to its holdings of ...
Bernardo Rodrigues's user avatar