12#![cfg_attr(not(feature = "std"), no_std)]34extern crate alloc;5use core::ops::Deref;67use frame_support::sp_runtime::DispatchResult;8pub use pallet::*;9use pallet_evm_coder_substrate::{WithRecorder, SubstrateRecorder};1011pub mod common;12pub mod erc;1314pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;151617pub struct NativeFungibleHandle<T: Config>(SubstrateRecorder<T>);18impl<T: Config> NativeFungibleHandle<T> {19 20 pub fn new() -> NativeFungibleHandle<T> {21 Self(SubstrateRecorder::new(u64::MAX))22 }2324 25 pub fn check_is_internal(&self) -> DispatchResult {26 Ok(())27 }28}2930impl<T: Config> WithRecorder<T> for NativeFungibleHandle<T> {31 fn recorder(&self) -> &pallet_evm_coder_substrate::SubstrateRecorder<T> {32 &self.033 }34 fn into_recorder(self) -> pallet_evm_coder_substrate::SubstrateRecorder<T> {35 self.036 }37}3839impl<T: Config> Deref for NativeFungibleHandle<T> {40 type Target = SubstrateRecorder<T>;4142 fn deref(&self) -> &Self::Target {43 &self.044 }45}46#[frame_support::pallet]47pub mod pallet {48 use alloc::string::String;49 use frame_support::{traits::Get};50 use pallet_balances::WeightInfo;51 use sp_core::U256;5253 #[pallet::config]54 pub trait Config:55 frame_system::Config + pallet_evm_coder_substrate::Config + pallet_common::Config56 {57 58 type Currency: frame_support::traits::Currency<59 Self::AccountId,60 Balance = Self::CurrencyBalance,61 >;62 63 type CurrencyBalance: Into<U256> + TryFrom<U256> + PartialEq<u128> + From<u128> + Into<u128>;6465 66 type Decimals: Get<u8>;67 68 type Name: Get<String>;69 70 type Symbol: Get<String>;7172 73 type WeightInfo: WeightInfo;74 }75 #[pallet::pallet]76 pub struct Pallet<T>(_);77}