0

I have an extrinsic, which can be executed only by sudo. I want it to be executed only by MultiSig user.

I couldn't find way to do this.

I can replace ensure_root(origin) with ensure_signed(origin) and then it can be executed by both normal user and multisig user as well. I don't want normal user to execute this extrinsic.

Can someone please help me to provide the solution?

1 Answer 1

1

You could ask the user to provide the multisig data.

https://github.com/paritytech/substrate/blob/3bc3742d5c0c5269353d7809d9f8f91104a93273/frame/multisig/src/lib.rs#L525

let account_id = ensure_signed(origin);
let multisig_account_id = multi_account_id(&signatories, threshold);

ensure!(account_id == multisig_account_id, <Error<T>>::NotMultisigAccount);

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.