0

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 through pallet_balances, transfer some funds to that address. If I now go to the contracts panel in polkadot.js.org/apps (version 0.122.2), the transferred fund shows up for that contract instance. However if I check the chain state of the pallet_balances for that address, it is still 0 (both free and reserved). My question is why? Is it a feature or a bug?

2 Answers 2

1

There are two ways of storing balances in Substrate. One way is to store the balance in the pallet_balances where you were looking, and the other is to store the balance in the frame system.

When you implement the pallet_balances in the runtime you specify where you want to store it, for example in the template node.

If you take a look into the runtime of your node: runtime/src/lib.rs you will see it:

type AccountStore = System;

If you want more info about this topic check the Subtrate docs.

So to get the balance you have to check the chain state of the system for that address.

1

You can view the account balance info via chainstate->system->account(acountID). Not sure why balances pallet account data gives result with 0 values.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.