Skip to content

Commit

Permalink
change inDEX pallet admin to a multisig account
Browse files Browse the repository at this point in the history
  • Loading branch information
tolak committed Sep 5, 2023
1 parent 8c82660 commit 477fab3
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion runtime/khala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1839,9 +1839,22 @@ impl phala_pallets::PhalaConfig for Runtime {
// type Currency = Balances;
// }

parameter_types! {
// IndexAdminAccount Address: 44vK3U1qdk1dbYEuECTme5LqKxSUaiz52jkLAgNtMgvCaEEZ
pub IndexAdminAccountPubKey: [u8; 32] = hex_literal::hex!("be4e106a4ef31469ef10df4e07b37a57f39820a5e5ca2f864006902731c84f6b");
pub IndexAdminAccount: AccountId = IndexAdminAccountPubKey::get().into();
}

pub struct IndexAdminMembers;
impl SortedMembers<AccountId> for IndexAdminMembers {
fn sorted_members() -> Vec<AccountId> {
[IndexAdminAccount::get()].to_vec()
}
}

impl pallet_index::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type CommitteeOrigin = EnsureRootOrHalfCouncil;
type CommitteeOrigin = EnsureSignedBy<IndexAdminMembers, AccountId>;
type AssetTransactor = (CurrencyTransactor, FungiblesTransactor);
type AssetsRegistry = AssetsRegistry;
}
Expand Down
15 changes: 14 additions & 1 deletion runtime/phala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1798,9 +1798,22 @@ impl pallet_phat_tokenomic::Config for Runtime {
type Currency = Balances;
}

parameter_types! {
// IndexAdminAccount Address: 44vK3U1qdk1dbYEuECTme5LqKxSUaiz52jkLAgNtMgvCaEEZ
pub IndexAdminAccountPubKey: [u8; 32] = hex_literal::hex!("be4e106a4ef31469ef10df4e07b37a57f39820a5e5ca2f864006902731c84f6b");
pub IndexAdminAccount: AccountId = IndexAdminAccountPubKey::get().into();
}

pub struct IndexAdminMembers;
impl SortedMembers<AccountId> for IndexAdminMembers {
fn sorted_members() -> Vec<AccountId> {
[IndexAdminAccount::get()].to_vec()
}
}

impl pallet_index::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type CommitteeOrigin = EnsureRootOrHalfCouncil;
type CommitteeOrigin = EnsureSignedBy<IndexAdminMembers, AccountId>;
type AssetTransactor = (CurrencyTransactor, FungiblesTransactor);
type AssetsRegistry = AssetsRegistry;
}
Expand Down

0 comments on commit 477fab3

Please sign in to comment.