12#![cfg_attr(not(feature = "std"), no_std)]34extern crate alloc;5use frame_support::sp_runtime::DispatchResult;6pub use pallet::*;7use pallet_evm_coder_substrate::{WithRecorder, SubstrateRecorder};89pub mod common;10pub mod erc;1112pub(crate) type SelfWeightOf<T> = <T as Config>::WeightInfo;131415pub struct NativeFungibleHandle<T: Config>(SubstrateRecorder<T>);16impl<T: Config> NativeFungibleHandle<T> {17 18 pub fn new() -> NativeFungibleHandle<T> {19 Self(SubstrateRecorder::new(u64::MAX))20 }2122 23 pub fn check_is_internal(&self) -> DispatchResult {24 Ok(())25 }26}2728impl<T: Config> WithRecorder<T> for NativeFungibleHandle<T> {29 fn recorder(&self) -> &pallet_evm_coder_substrate::SubstrateRecorder<T> {30 &self.031 }32 fn into_recorder(self) -> pallet_evm_coder_substrate::SubstrateRecorder<T> {33 self.034 }35}36#[frame_support::pallet]37pub mod pallet {38 use alloc::string::String;39 use frame_support::{traits::Get};40 use pallet_balances::WeightInfo;41 use sp_core::U256;4243 #[pallet::config]44 pub trait Config:45 frame_system::Config + pallet_evm_coder_substrate::Config + pallet_common::Config46 {47 48 type Currency: frame_support::traits::Currency<49 Self::AccountId,50 Balance = Self::CurrencyBalance,51 >;52 53 type CurrencyBalance: Into<U256> + TryFrom<U256> + PartialEq<u128> + From<u128> + Into<u128>;5455 56 type Decimals: Get<u8>;57 58 type Name: Get<String>;59 60 type Symbol: Get<String>;6162 63 type WeightInfo: WeightInfo;64 }65 #[pallet::pallet]66 pub struct Pallet<T>(_);67}