Questions tagged [pallet]
Questions about Runtime Modules built with the FRAME developer SDK.
403
questions
0
votes
0
answers
17
views
How to interact between a smart contract written in Solidity from substrate pallet?
Can it be possible to interact solidity smart contract from substrate pallet?
1
vote
1
answer
16
views
BlockNumber and Balance Arithmetic
I am implementing subscriptions, paid for with balance, rated per block, and the duration measured in block numbers.
I am finding it very difficult, in general, to perform arithmetic that take both ...
1
vote
1
answer
16
views
Ensure that a call is dispatched from a specific pallet
So I want my instance of the pallet membership to be managed only by a specific pallet, and not even the Root origin.
Is there anyway to create an EnsureOrigin object that can verify that a specific ...
0
votes
1
answer
25
views
Weight consumed inside the on_idle hook?
The documentation of the on_idle hook states that "Any implementation should always respect _remaining_weight and never consume (and therefore return) more than this amount."
In the ...
2
votes
2
answers
76
views
Utility pallet: What are the key differences between batch batch_all and force_batch
In this question, and this answer the difference between batch and batch_all are discussed, but there is a third similar function in the utility pallet force_batch
What are the key differences between ...
3
votes
2
answers
35
views
How To Remove The Sudo Pallet Safely
We have the sudo pallet on a running live mainnet. It is almost time to remove it. What is the safest way to remove it in the code? We have made code upgrades before but removing a pallet (especially ...
1
vote
0
answers
17
views
Add a `StorageMap` to a pallet (metadata) from outside the pallet
my problem is the following:
There is a pallet which contains some storage, some extrinsics, and a type in its Config implementing trait CustomPalletHooks to which it delegates some logic.
Assuming ...
1
vote
1
answer
68
views
Contribute a pallet I've written to Polkadot Relay Chain
is there a submission procedure for contributing a pallet I've written to Polkadot, for the relay chain?
I would appreciate any help with this.
1
vote
0
answers
20
views
Run benchmark fail test in pallet-evm
test_benchmarks fail
Repo: https://github.com/paritytech/frontier
Command: cargo t -p pallet-evm --features runtime-benchmarks
Issue:
failures:
---- benchmarking::benchmark_tests::test_benchmarks ...
4
votes
1
answer
39
views
How we can get the current block author account id in POA solochain?
I am working on a solochain I want to pass the account of the block author in a pallet config in runtime of the chain. How can i get the the account is of the current block author?
2
votes
0
answers
17
views
How can I mint new token from ink smart contract calling pallet-balances function?
How can I mint a new native token (not a custom token) from the ink smart contract calling one of the functions from pallet-balances pallet?
0
votes
1
answer
39
views
Error: duplicate lang item in crate `sp_io` (which `sp_application_crypto` depends on): `panic_impl`
I am building a solo chain from Substrate node template, I have made some changes to switch from PoA to PoS just like this repo. Now, I am trying to add pallet-contracts on the runtime. I added the ...
1
vote
2
answers
52
views
How to add pallet contract for polkadot-v1.0.0?
How to add pallet contract for polkadot-v1.0.0? Do I only need to change the node/runtime folder or the runtime folder at root or both?
2
votes
1
answer
39
views
What is the use of Get trait here?
In the referenda pallet, type Tracks uses two trait, Get and TracksInfo
substrate/frame/referenda/src/lib.rs
/// Information concerning the different referendum tracks.
#[pallet::constant]
...
1
vote
1
answer
59
views
while building an application logic (use macros in a custom pallet)
[][in build an application logic im facing this error im new to substrate please help me fix this.]
2
votes
1
answer
26
views
What is the difference between the node folder and runtime folder in substrate node template?
In the Substrate node template there are two folder node and runtime. When I am building the chain I guess runtime folder is utilized. I am wondering what is the purpose of the two folders?
3
votes
1
answer
23
views
How to add pallet bounties on runtime?
I am building a solo chain from Substrate node template. I am trying to add pallet-bounties on top of the runtime. I can't seem to figure out a way.
0
votes
1
answer
19
views
How to add pallet collective on runtime? [closed]
I am trying to import pallet-collective on runtime. Can't seem to figure out a way.
3
votes
1
answer
41
views
Initial Token mint in Substrate Blockchain
I have downloaded the substrate node template and started working on a new project. For my project, I want to implement a native token. I've decided to use pallet balances to implement this native ...
1
vote
1
answer
42
views
How to Add and configure Democracy Pallet to Substrate Runtime
I've made an attempt to incorporate the "pallet-democracy" into my Substrate runtime. In the runtime/Cargo.toml file of my Substrate node template, I've added the following configuration:
...
2
votes
1
answer
58
views
Facing Issue in integration of POS
I'm integrating the POS in freshly node template. I'm facing this error:
This is the code repository: https://github.com/Aideepakchaudhary/POA-to-POS
Can anyone please help me to solve this issue?
...
3
votes
2
answers
52
views
How to use bounded_vec macro in benchmarking.rs
I was using substrate-node-template, and created some benchmarking functions.
I was able to use bounded_vec macro in tests.rs but, can't able to use it in the benchmarking.rs file
my code
#![cfg(...
1
vote
1
answer
32
views
Call the extrensic of a pallet from the ink smart contract
I am using a DEX Pallet and it has multiple extrinsic functions, But I am thinking of developing a smart contract in Ink that will be calling the extrinsic functions of the pallet and the people who ...
3
votes
1
answer
66
views
How to reset a pallet
I'm planning to reset a pallet. To do this, I've developed a migration process aimed at clearing all storage associated with the MyPallet key. Additionally, I've followed up by renaming the pallet. I'...
1
vote
1
answer
41
views
Grandpa AuthorityWeights
There's code in Grandpa to have different "Authority Weights" assigned to each validator. It doesn't appear to be accessible beyond in a genesis block. Does someone know the intended purpose ...
2
votes
1
answer
90
views
Are users only allowed to own 16 assets with pallet-assets?
Every new token a user holds in pallet_assets increases the consumer count for that user +1. And most chains set the MaxConsumers of frame_system to 16.
Both mint_into and transfer call at some point ...
2
votes
1
answer
19
views
Pallate for Native Blockchain Currency
In my Blockchain app, I want to add my own native currency. For extended Features of my application Users will be rewarded and they will receive coin for that. The users will receive the reward in ...
1
vote
1
answer
29
views
Node template with POS Babe consensus: Removal of Unnecessary Extra Pallets
Here is the node template with Babe:
https://github.com/paritytech/substrate/blob/6a946fc36d68b89599d7ca1ab03803d10c78468c/bin/node/runtime/src/lib.rs#L1583
The above template is functioning smoothly ...
2
votes
1
answer
27
views
Appropriate Substrate Pallets for voting proposal
In my custom blockchain, i want to offer a feature where i will provide some proposals to my users. The users can vote on to the proposal they find considerate. To accept the proposal, there will be a ...
5
votes
1
answer
122
views
How to solve this error: associated type `BlockNumber` not found for `T`?
I have substrate node template with babe and i want to integrate orml-currencies.
I'm using this in cargo.toml:
orml-currencies = { default-features = false, git = "https://github.com/open-web3-...
1
vote
2
answers
30
views
#[frame_support::pallet(dev_mode)] versus #[frame_support::pallet]
I see that most of the pallets are annotated as #[frame_support::pallet], but some of them are #[frame_support::pallet(dev_mode)] and my question is what exactly means dev-mode in the context of the ...
0
votes
0
answers
48
views
Converting a H256/bytes32 into a generic AccountId for EVM precompiles
Overview
We are building out a precompile for pallet-staking and have run into the tricky challenge of converting H256 types into generic AccountIds so that we can implement functions like nominate ...
0
votes
1
answer
42
views
how to resolve could not find `__private` in `frame_support?
I am following following tutorial to write collectibles pallet:
https://docs.substrate.io/tutorials/collectibles-workshop/.
My source code is available here:
https://github.com/sayyedkamran/substrate-...
1
vote
1
answer
38
views
In what scenarios should we use a pallet to call an ink! smart contract?
For example,
pallet
They use pallet-dapps-staking to call ink! smart contract
https://github.com/AstarNetwork/Astar/tree/master/pallets/dapps-staking
Runtime
https://github.com/AstarNetwork/Astar/...
1
vote
1
answer
29
views
Trait bond Clone not satisfied by pallet constant
Trying to implement boundedVecs for an struct, but the compiler is telling me that I can´t Clone the struct because the StringLimit Constant doesn´t comply with the Clone Trait.
This is the definition ...
2
votes
2
answers
30
views
Emitting errors from hooks like on_initialize()
A similar question exists here : Emit Events from hooks like on_initialize()
If we are performing fallible operations on pallet hooks like on_initialize and let's say we want to notify the frontend (e....
2
votes
1
answer
133
views
associated type `BlockNumber` not found for `T`
I am following following tutorial to write a custom pallet.
https://docs.substrate.io/tutorials/build-application-logic/use-macros-in-a-custom-pallet/
When I compile the node, I get following error:
...
0
votes
1
answer
32
views
AssetConversionApi (asset_conversion_pallet) - How to encode function input parameters in price and reserves RPC calls?
I'm trying to use asset_conversion pallet to call quote prices, and get reserved rpc endpoints (defined here)
In pallets official docs there is small section about calling that endpoint, but it doesn'...
0
votes
1
answer
41
views
Verifying storage changes made during block hooks
I am having trouble understanding the verification process for storage changes that are applied during the on_initialize hooks of a pallet. From what I understand, imported blocks do not re-run any ...
1
vote
1
answer
107
views
how to call smart contract function in custom pallet?
Is there any way to call ink! smart contract function in substrate custom pallet?
We've found this answer where bare_call function is based on older version of contract_pallet.
// This ends up calling ...
1
vote
1
answer
30
views
How to entirely clear a pallet storage on a living chain?
Would it be possible to clear a pallet storage with a call on a live chain ?
Precisely I would like to remove all contracts and code hash existing on my chain (as sudo).
2
votes
3
answers
57
views
Best Practices: Setting Non-configurable Types in a Substrate Pallet
I'm currently working on a custom Substrate pallet and am trying to understand the best practices surrounding the Config trait. I've come across a design decision and would appreciate some guidance.
...
2
votes
1
answer
62
views
Incompatibility between subxt_signer and subxt
https://github.com/paritytech/subxt/blob/master/subxt/examples/tx_basic.rs
I want to call a function in my substrate pallet. I am using the
substrate-node-template
subxt
subxt_signer
use subxt::{...
0
votes
1
answer
27
views
How to hold nft price until all nft are sold?
We have created nft-marketplace in substrate, 1 collection has 100 NFT. We only need to send all the amount of nft only after all nft are sold and until we wan't to hold the amount somewhere. How to ...
5
votes
1
answer
37
views
pallet scheduler with timestamp instead of blocknumber?
Is it possible to schedule a call using timestamp from timestamp pallet instead of blocknumber?
The docs of scheduler pallet states the following:
"This Pallet exposes capabilities for scheduling ...
2
votes
1
answer
34
views
Benchmarking in a cusom pallet requires a storage put operation in Staking pallet
Let's say I have a pallet_x. In this pallet i have an extrinsic where I get the active_era using the below code :
Staking::<T>::active_era()
.map(|e| e....
0
votes
2
answers
35
views
A blockchain to read events from another blockchain
I'm working on an idea where I would want my substrate-based blockchain (let's name it Blockchain A) to read events from another substrate-based blockchain (let's call it Blockchain B) and perform ...
2
votes
1
answer
22
views
Weight syntax on pallet_balances
In pallet_balances I found this syntax for annotating weight and it confused me a bit :
#[pallet::call(weight(<T as Config<I>>::WeightInfo))]
impl<T: Config<I>, I: 'static> ...
3
votes
1
answer
31
views
Why can't I use structs with data on my pallet error?
I have this code that will not compile :
#[pallet::error]
pub enum Error<T> {
SomeErr{ account : T::AccountId }
}
This will not compile with the error :
AccountId associated type not found.
...
0
votes
1
answer
39
views
Uncaught (in promise) Error: Cannot convert 'InBlock' via asFinalized
I am trying to sign and send some transactions using the batch function.
Here are some code snippets for reproduction.
const nftMinting = async (item) => {
try {
let collection = 1
...