Questions tagged [frame]

Questions about Substrate's framework for developing custom runtime logic.

Filter by
Sorted by
Tagged with
6 votes
1 answer

Why is there no `Default` implementation for `T::AccountId`?

Starting with version 9.17 and greater I started getting these errors for the custom pallets I've made. Could I please get a pointer in resolving this issue? Example output from compiler: #[derive(...
Aaron Ely's user avatar
6 votes
2 answers

How do treasury accounts compare to end user accounts in FRAME?

I would like to understand how treasury accounts are created and used under the hood. How do they compare to end user accounts? Are they also just an AccountId to AccountInfo map in storage?
Sacha Lansky's user avatar
  • 2,610
16 votes
1 answer

When to use `BoundedVec` vs. `WeakBoundedVec` vs. `Vec`?

Are there any guiding principles that can be applied to decide whether to use Substrate's BoundedVec, WeakBoundedVec, or Vec in a runtime? Is it a general rule of thumb to use the bounded variant ...
cmichi's user avatar
  • 2,755
8 votes
1 answer

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
22 votes
3 answers

When should I build a Substrate FRAME Pallet versus a Smart Contract?

What are the differences between developing a Substrate FRAME Pallet and a Substrate Smart Contract (for example with the ink! language)? What are some examples of applications which are best written ...
Shawn Tabrizi's user avatar
  • 15.8k
12 votes
2 answers

How to fix `parity_scale_codec::MaxEncodedLen` is not implemented for `T`?

When building my pallet, I run into the error: error[E0277]: the trait bound `T: parity_scale_codec::MaxEncodedLen` is not satisfied --> pallets/template/src/ | 42 | #[pallet::...
Shawn Tabrizi's user avatar
  • 15.8k
5 votes
1 answer

adding an account

I just want to simply add an account in the development config but have no idea how to do it, i tried simply adding the seed in the development_config function but it dosent work, what can i do to add ...
Muhammed Rasheed's user avatar
6 votes
1 answer

How do I use storage and functions from one custom pallet in another?

Is there a way for one custom pallet to access the storage or functions from another custom pallet? For Example: Pallet 1 #[pallet::storage] pub(super) type MyValue<T: Config> = StorageValue<...
Shawn Tabrizi's user avatar
  • 15.8k
5 votes
2 answers

<T::Lookup as StaticLookup>::Source vs T::AccountId?

I noticed was recently resolved, replacing T::AccountId with <T::Lookup as StaticLookup>::Source. Substrate docs don't mention what is the ...
nazar-pc's user avatar
  • 539
4 votes
1 answer

How can I configure genesis state for my pallet's tests without hardcoding it?

I've been writing tests for pallet-kitties and have configured the genesis state inside my mock runtime by setting the storage items for two kitties (one Male and one Female) and their owners (with ...
Sacha Lansky's user avatar
  • 2,610
4 votes
1 answer

Whitelist a call subset of a pallet

Is there a way to whitelist a call subset of a pallet? And hide the rest from the end user. // something like Pallet { fn call_a(){} fn call_b(){} }; // Some Pallet ... construct_runtime!( pub ...
muharem's user avatar
  • 354
3 votes
1 answer

Problem running assert_last_event in

As the title suggests, I've been trying to call assert_last_event on the class without success. The problem first happened when developing the kitties tutorial and after several toolchain ...
frkmnt's user avatar
  • 55
2 votes
1 answer

Node that was not modified fails to build

I had a fully functioning node that was built about 4 day ago and I was using it. Today I've decided to rebuild it with cargo build -r and for some reason if failed to build with absolutely weird ...
CREESTL's user avatar
  • 474
1 vote
1 answer

How does the pay_tips parameter work for NFTs?

Who is it voluntary for? The buyer or the creator of the NFT? Does the tip get awarded to the creator after every transfer? Is it voluntary for the buyer each time or is it only voluntary during the ...
Jordan Greenberg's user avatar