Skip to content

Commit

Permalink
config sygma reserve account
Browse files Browse the repository at this point in the history
  • Loading branch information
tolak committed Oct 30, 2023
1 parent 60870d0 commit 48f1b59
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 12 deletions.
9 changes: 6 additions & 3 deletions runtime/khala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use sp_runtime::{
AccountId32, ApplyExtrinsicResult, DispatchError, FixedPointNumber, Perbill, Percent, Permill,
Perquintill,
};
use sp_std::{collections::btree_set::BTreeSet, prelude::*};
use sp_std::{collections::{btree_map::BTreeMap, btree_set::BTreeSet}, prelude::*};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down Expand Up @@ -98,7 +98,7 @@ use frame_system::{

use pallet_xcm::XcmPassthrough;
use polkadot_parachain_primitives::primitives::Sibling;
use xcm::latest::{prelude::*, Weight as XCMWeight};
use xcm::latest::{prelude::*, AssetId as XcmAssetId, Weight as XCMWeight};
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
Expand Down Expand Up @@ -1642,6 +1642,9 @@ parameter_types! {
// When relayers signing, this address will be included in the EIP712Domain
// As long as the relayer and pallet configured with the same address, EIP712Domain should be recognized properly.
pub DestVerifyingContractAddress: VerifyingContractAddress = primitive_types::H160::from_slice(hex::decode(DEST_VERIFYING_CONTRACT_ADDRESS).ok().unwrap().as_slice());
pub SygmaReserveAccounts: BTreeMap::<XcmAssetId, AccountId> = BTreeMap::from([
(PHALocation::get().into(), SygmaBridgeAccount::get().into())
]);
}

pub struct SygmaAdminMembers;
Expand Down Expand Up @@ -1683,7 +1686,7 @@ impl sygma_fee_handler_router::Config for Runtime {

impl sygma_bridge::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type TransferReserveAccounts = SygmaBridgeAccount;
type TransferReserveAccounts = SygmaReserveAccounts;
type FeeReserveAccount = SygmaBridgeFeeAccount;
type EIP712ChainID = EIP712ChainID;
type DestVerifyingContractAddress = DestVerifyingContractAddress;
Expand Down
9 changes: 6 additions & 3 deletions runtime/phala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use sp_runtime::{
AccountId32, ApplyExtrinsicResult, DispatchError, FixedPointNumber, Perbill, Percent, Permill,
Perquintill,
};
use sp_std::{collections::btree_set::BTreeSet, prelude::*};
use sp_std::{collections::{btree_map::BTreeMap, btree_set::BTreeSet}, prelude::*};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down Expand Up @@ -98,7 +98,7 @@ use frame_system::{

use pallet_xcm::XcmPassthrough;
use polkadot_parachain_primitives::primitives::Sibling;
use xcm::latest::{prelude::*, Weight as XCMWeight};
use xcm::latest::{prelude::*, AssetId as XcmAssetId, Weight as XCMWeight};
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
Expand Down Expand Up @@ -1600,6 +1600,9 @@ parameter_types! {
// When relayers signing, this address will be included in the EIP712Domain
// As long as the relayer and pallet configured with the same address, EIP712Domain should be recognized properly.
pub DestVerifyingContractAddress: VerifyingContractAddress = primitive_types::H160::from_slice(hex::decode(DEST_VERIFYING_CONTRACT_ADDRESS).ok().unwrap().as_slice());
pub SygmaReserveAccounts: BTreeMap::<XcmAssetId, AccountId> = BTreeMap::from([
(PHALocation::get().into(), SygmaBridgeAccount::get().into())
]);
}

pub struct SygmaAdminMembers;
Expand Down Expand Up @@ -1640,7 +1643,7 @@ impl sygma_fee_handler_router::Config for Runtime {

impl sygma_bridge::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type TransferReserveAccounts = SygmaBridgeAccount;
type TransferReserveAccounts = SygmaReserveAccounts;
type FeeReserveAccount = SygmaBridgeFeeAccount;
type EIP712ChainID = EIP712ChainID;
type DestVerifyingContractAddress = DestVerifyingContractAddress;
Expand Down
9 changes: 6 additions & 3 deletions runtime/rhala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ use sp_runtime::{
AccountId32, ApplyExtrinsicResult, DispatchError, FixedPointNumber, Perbill, Percent, Permill,
Perquintill,
};
use sp_std::{collections::btree_set::BTreeSet, prelude::*};
use sp_std::{collections::{btree_map::BTreeMap, btree_set::BTreeSet}, prelude::*};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down Expand Up @@ -98,7 +98,7 @@ use frame_system::{

use pallet_xcm::XcmPassthrough;
use polkadot_parachain_primitives::primitives::Sibling;
use xcm::latest::{prelude::*, Weight as XCMWeight};
use xcm::latest::{prelude::*, AssetId as XcmAssetId, Weight as XCMWeight};
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
Expand Down Expand Up @@ -1649,6 +1649,9 @@ parameter_types! {
// When relayers signing, this address will be included in the EIP712Domain
// As long as the relayer and pallet configured with the same address, EIP712Domain should be recognized properly.
pub DestVerifyingContractAddress: VerifyingContractAddress = primitive_types::H160::from_slice(hex::decode(DEST_VERIFYING_CONTRACT_ADDRESS).ok().unwrap().as_slice());
pub SygmaReserveAccounts: BTreeMap::<XcmAssetId, AccountId> = BTreeMap::from([
(PHALocation::get().into(), SygmaBridgeAccount::get().into())
]);
}

pub struct SygmaAdminMembers;
Expand Down Expand Up @@ -1689,7 +1692,7 @@ impl sygma_fee_handler_router::Config for Runtime {

impl sygma_bridge::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type TransferReserveAccounts = SygmaBridgeAccount;
type TransferReserveAccounts = SygmaReserveAccounts;
type FeeReserveAccount = SygmaBridgeFeeAccount;
type EIP712ChainID = EIP712ChainID;
type DestVerifyingContractAddress = DestVerifyingContractAddress;
Expand Down
9 changes: 6 additions & 3 deletions runtime/thala/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ use sp_runtime::{
AccountId32, ApplyExtrinsicResult, DispatchError, FixedPointNumber, Perbill, Percent, Permill,
Perquintill,
};
use sp_std::{collections::btree_set::BTreeSet, prelude::*};
use sp_std::{collections::{btree_map::BTreeMap, btree_set::BTreeSet}, prelude::*};
#[cfg(feature = "std")]
use sp_version::NativeVersion;
use sp_version::RuntimeVersion;
Expand Down Expand Up @@ -98,7 +98,7 @@ use frame_system::{

use pallet_xcm::XcmPassthrough;
use polkadot_parachain_primitives::primitives::Sibling;
use xcm::latest::{prelude::*, Weight as XCMWeight};
use xcm::latest::{prelude::*, AssetId as XcmAssetId, Weight as XCMWeight};
use xcm_builder::{
AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom,
AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin, FixedWeightBounds,
Expand Down Expand Up @@ -1643,6 +1643,9 @@ parameter_types! {
// SygmaBridgePalletId is the palletID
// this is used as the replacement of handler address in the ProposalExecution event
pub const SygmaBridgePalletId: PalletId = PalletId(*b"sygma/01");
pub SygmaReserveAccounts: BTreeMap::<XcmAssetId, AccountId> = BTreeMap::from([
(PHALocation::get().into(), SygmaBridgeAccount::get().into())
]);
}

impl sygma_access_segregator::Config for Runtime {
Expand Down Expand Up @@ -1679,7 +1682,7 @@ const DEST_VERIFYING_CONTRACT_ADDRESS: &str = "6CdE2Cd82a4F8B74693Ff5e194c19CA08

impl sygma_bridge::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type TransferReserveAccounts = SygmaBridgeAccount;
type TransferReserveAccounts = SygmaReserveAccounts;
type FeeReserveAccount = ThalaTreasuryAccount;
type EIP712ChainID = EIP712ChainID;
type DestVerifyingContractAddress = DestVerifyingContractAddress;
Expand Down

0 comments on commit 48f1b59

Please sign in to comment.