1#![cfg_attr(not(feature = "std"), no_std)]23use frame_support::sp_runtime::AccountId32;4use sp_core::H160;567891011pub trait EvmBackwardsAddressMapping<AccountId> {12 fn from_account_id(account_id: AccountId) -> H160;13}141516pub struct MapBackwardsAddressTruncated;17impl EvmBackwardsAddressMapping<AccountId32> for MapBackwardsAddressTruncated {18 fn from_account_id(account_id: AccountId32) -> H160 {19 let mut out = [0; 20];20 out.copy_from_slice(&(account_id.as_ref() as &[u8])[0..20]);21 H160(out)22 }23}