From 5d377bcd55039c8bd336cc5b544f54e30a3c321a Mon Sep 17 00:00:00 2001 From: Alistair Singh Date: Thu, 15 Jun 2023 00:14:56 +0200 Subject: [PATCH 1/2] added config --- .../assets/asset-hub-kusama/src/xcm_config.rs | 30 ++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs index 016e08d9deb..a1f60d370da 100644 --- a/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs @@ -530,6 +530,9 @@ pub mod bridging { pub storage AssetHubPolkadotMaxFee: Option = Some((MultiLocation::parent(), 1_000_000).into()); pub DotLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(PolkadotNetwork::get()))); + pub EthereumNetwork: NetworkId = NetworkId::Ethereum { chain_id: 15 }; + pub EthereumLocation: MultiLocation = MultiLocation::new(2, X1(GlobalConsensus(EthereumNetwork::get()))); // TODO: Maybe registry address belongs here + // Setup bridges configuration // (hard-coded version - on-chain configuration will come later as separate feature) pub Bridges: BridgesConfig = BridgesConfigBuilder::default() @@ -555,6 +558,23 @@ pub mod bridging { )) ) ) + .add_or_panic( + EthereumNetwork::get(), + BridgeConfig.new( + MaybePaidLocation { + location: BridgeHubKusama::get(), + maybe_fee: None, + } + ).add_target_location( + MaybePaidLocation { + location: EthereumLocation::get(), + maybe_fee: None, // No fees supported for ethereum + }, + Some(AssetFilter::ByMultiLocation({ + MultiLocationFilter::default() + .add_starts_with(EthereumLocation::get()) // TODO: Change to registry contract address. For now accept any ethereum address? + })), + )) .build(); // Setup trusted bridged reserve locations @@ -567,13 +587,21 @@ pub mod bridging { // allow receive DOT .add_equals(DotLocation::get()) ) + ), + ( + EthereumLocation::get(), + AssetFilter::ByMultiLocation( + MultiLocationFilter::default() + .add_starts_with(EthereumLocation::get()) + ) // Any mutli location that is from ethereum global consensus. ) ]; /// Universal aliases pub BridgedUniversalAliases: BTreeSet<(MultiLocation, Junction)> = BTreeSet::from_iter( sp_std::vec![ - (BridgeHubKusama::get(), GlobalConsensus(PolkadotNetwork::get())) + (BridgeHubKusama::get(), GlobalConsensus(PolkadotNetwork::get())), + (BridgeHubKusama::get(), GlobalConsensus(EthereumNetwork::get())), ] ); } From e1447373693e99e1e95dfb8db0d843cf0e807b5b Mon Sep 17 00:00:00 2001 From: Alistair Singh Date: Thu, 15 Jun 2023 00:31:17 +0200 Subject: [PATCH 2/2] update comments --- parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs index a1f60d370da..724b3231b51 100644 --- a/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs +++ b/parachains/runtimes/assets/asset-hub-kusama/src/xcm_config.rs @@ -572,7 +572,7 @@ pub mod bridging { }, Some(AssetFilter::ByMultiLocation({ MultiLocationFilter::default() - .add_starts_with(EthereumLocation::get()) // TODO: Change to registry contract address. For now accept any ethereum address? + .add_starts_with(EthereumLocation::get()) })), )) .build(); @@ -593,7 +593,7 @@ pub mod bridging { AssetFilter::ByMultiLocation( MultiLocationFilter::default() .add_starts_with(EthereumLocation::get()) - ) // Any mutli location that is from ethereum global consensus. + ) // TODO: Change to registry contract address. For now accept any ethereum address. ) ];