Skip to content

Commit

Permalink
Fix Erc20XcmBridge abstraction (#36)
Browse files Browse the repository at this point in the history
* fix new aprams

* more fixes
  • Loading branch information
KitHat authored Nov 4, 2024
1 parent ef65cb2 commit 92a8d33
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/evm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(<Erc20XcmBridge as frame_support::traits::PalletInfoAccess>::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<Self>;
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@ pub trait EvmConfig {
type PrecompilesType;
type PrecompilesValue;
type Erc20XcmBridgeTransferGasLimit;
type LocationToH160;
}

0 comments on commit 92a8d33

Please sign in to comment.