Skip to main content

Questions tagged [balances]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
20 views

Error when building a substrate node template with multiple balances pallet instances configured

Im getting the following Substrate Error when configuring more than 1 balances note: multiple `impl`s satisfying `RuntimeCall: From<BalancesCall<_, _>>` found in the `my_node` crate: ...
Kalanamith's user avatar
1 vote
1 answer
28 views

Conceptually why can't I deposit balance < ED to an existing account?

I was experimenting with ED and ref counting of the account system, it seems counterintuitive that depositing a balance less than ED will have no effect even on a (long-)existing account, the account ...
Kailai's user avatar
  • 383
0 votes
0 answers
19 views

Error UnknownAsset when trying to increase AssetBalance

The error is shown in substrate-frontend Transaction Failed! system.ExtrinsicFailed::{"token":"UnknownAsset"} Score is an asset in pallet_template, in build function of ...
MinhK's user avatar
  • 125
0 votes
1 answer
61 views

How to define the connection between pallets?

In susbtrate, how to use a component of a pallet in other pallets, how to refer them? For example, How is the Balance in pallet-balances used in pallet-staking? Or in a custom pallet template? And ...
MinhK's user avatar
  • 125
1 vote
1 answer
30 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
0 answers
37 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
  • 353
1 vote
1 answer
44 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
50 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
26 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,241
1 vote
2 answers
93 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
  • 543
2 votes
1 answer
28 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
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
30 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
  • 2,021
2 votes
1 answer
127 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
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
1 vote
2 answers
725 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
44 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
104 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
108 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
48 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
  • 136
4 votes
1 answer
39 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
101 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
44 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
83 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
70 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
59 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
53 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
315 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
115 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
41 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
  • 590
2 votes
1 answer
77 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
95 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
68 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
111 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
197 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
105 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
61 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
292 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
182 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
  • 543
6 votes
2 answers
634 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
162 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
263 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
  • 141
4 votes
1 answer
100 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
175 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
94 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,683
3 votes
1 answer
113 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
113 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 ...
Kalanamith's user avatar
0 votes
1 answer
146 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
2 votes
1 answer
36 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