diff --git a/src/evm.rs b/src/evm.rs index e682115..38e5739 100644 --- a/src/evm.rs +++ b/src/evm.rs @@ -94,8 +94,20 @@ macro_rules! impl_openzeppelin_evm { type Threshold = BaseFeeThreshold; } + parameter_types! { + // This is the relative view of erc20 assets. + // Identified by this prefix + AccountKey20(contractAddress) + // We use the RELATIVE multilocation + pub Erc20XcmBridgePalletLocation: Location = Location { + parents:0, + interior: [ + PalletInstance(::index() as u8) + ].into() + }; + } + impl pallet_erc20_xcm_bridge::Config for Runtime { - type AccountIdConverter = LocationToH160; + type AccountIdConverter = <$t as EvmConfig>::LocationToH160; type Erc20MultilocationPrefix = Erc20XcmBridgePalletLocation; type Erc20TransferGasLimit = <$t as EvmConfig>::Erc20XcmBridgeTransferGasLimit; type EvmRunner = pallet_evm::runner::stack::Runner; diff --git a/src/lib.rs b/src/lib.rs index 07db762..79e77a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -132,4 +132,5 @@ pub trait EvmConfig { type PrecompilesType; type PrecompilesValue; type Erc20XcmBridgeTransferGasLimit; + type LocationToH160; }