Are there examples how to set up a call filter in Substrate to allow only certain calls of a particular pallet to be executed?

2 Answers 2


The overarching Call enum has the following structure

enum Call {
    // ... and so on

The implementation of Contains<Call> for a call filter can do pattern-matching on the inner values as well. For example,

impl Contains<Call> for SomeFilter {
    fn contains(call: &Call) -> bool {
        match *call {
            Call::PalletOne(pallet_one::Call::CallA(_)) => true,
            _ => false,

Here's an example of how we were using a BaseCallFilter in the statemint parachain to filter out calls that we did not want enabled yet:


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.